feat(epic3): deliver the accepted Epic 3 scope through Story 3.17
CI / Rust Checks (pull_request) Failing after 13m41s
CI / UI Checks (pull_request) Skipped
CI / Frontend E2E (pull_request) Skipped
CI / Community Image Smoke (pull_request) Skipped
CI / Deploy (pull_request) Skipped
Community Release / release (push) Failing after 13m33s
CI / Rust Checks (pull_request) Failing after 13m41s
CI / UI Checks (pull_request) Skipped
CI / Frontend E2E (pull_request) Skipped
CI / Community Image Smoke (pull_request) Skipped
CI / Deploy (pull_request) Skipped
Community Release / release (push) Failing after 13m33s
Recovery delivery of the accumulated, TL-accepted Epic 3 work that had never been
committed to Git (stories 3.6-3.17, see the crank board). Story 3.18 is not accepted
yet and is deliberately excluded: its logging surface, its capability registration,
its oracle projections and its tests are not part of this tree.
Accepted scope
- 3.6 typed static Resource Drafts; 3.7 publication and exact binding of static
Resource Versions; 3.8 MCP discovery/read and revocation of static Resources;
- 3.9 Resource import/export in API and UI plus TLS dependency maintenance;
3.10 REST-backed Resource templates; 3.11 shared REST read runtime and the MCP
revision/capability foundation;
- 3.12 parameterised Prompt Drafts with preview; 3.13 Prompt publication and exact
version binding to Agents; 3.14 MCP prompts; 3.15 Prompt import/export;
- 3.16 composite Prompts with published Resources (dependency content scan plus
dynamic read through the accepted 3.11 runtime, admin preview and MCP prompts/get);
- 3.17 bounded MCP completion suggestions from typed published schemas and the
resources/list admission fix for bound template publications.
Accepted evidence being reused (unchanged code paths)
- 3.16 candidate: core 7, admin-api 22, registry 4, mcp-server 4, UI 6; one final
`just verify` run 1651 passed / 0 failed / 2 ignored.
- 3.17 candidate: full run 1672 passed / 0 failed / 2 ignored, QA targeted reruns and
a real MCP Inspector 2.12.0 client smoke.
Delivery engineering in this commit
- CI: one event per change (feature branches are gated by their pull request, push
runs only on main), story events run the changed packages, the full workspace suite
stays the feature/release gate; no cache/sharding without a measured runner check.
- Release: the packaged archives, checksums and SBOM are now uploaded to the Gitea
release entry of the tag instead of dying with the runner workspace.
Not included on purpose: Story 3.18 work, build caches, runtime databases, local
credentials and scratch evidence.
Refs: crank kanban t_e39d7263; baseline 1b6db09bd1.
This commit is contained in:
1 parent
1b6db09bd1
commit
54ce770682
357 files changed
+117394
-5115
No files matched your search
+12
-3
@@ -14,11 +14,15 @@
|
||||
return /\/api\/auth\/(?:login|bootstrap\/complete|session\/csrf)$/.test(path);
|
||||
}
|
||||
|
||||
function attachCsrf(path, method, requestOptions) {
|
||||
function mutationNeedsCsrf(path, method) {
|
||||
if (method === 'GET' || method === 'HEAD' || method === 'OPTIONS' || csrfExempt(path)) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (!(path.indexOf('/api/auth/') === 0 || path.indexOf('/api/admin/') === 0)) {
|
||||
return path.indexOf('/api/auth/') === 0 || path.indexOf('/api/admin/') === 0;
|
||||
}
|
||||
|
||||
function attachCsrf(path, method, requestOptions) {
|
||||
if (!mutationNeedsCsrf(path, method)) {
|
||||
return;
|
||||
}
|
||||
var token = window.CrankAuth && typeof window.CrankAuth.getCsrfToken === 'function'
|
||||
@@ -92,6 +96,11 @@
|
||||
headers: headers(),
|
||||
}, options || {});
|
||||
var method = (requestOptions.method || 'GET').toUpperCase();
|
||||
if (mutationNeedsCsrf(path, method)
|
||||
&& window.CrankAuth
|
||||
&& typeof window.CrankAuth.ensureCsrf === 'function') {
|
||||
await window.CrankAuth.ensureCsrf();
|
||||
}
|
||||
attachCsrf(path, method, requestOptions);
|
||||
var mutationResource = operationMutationResource(path, method);
|
||||
var agentMutation = agentMutationResource(path, method);
|
||||
|
||||
+84
-11
@@ -2,6 +2,9 @@
|
||||
var STORAGE_KEY = 'crank_user';
|
||||
var sessionCache = null;
|
||||
var sessionPromise = null;
|
||||
var csrfRefreshPromise = null;
|
||||
var csrfTokenFallback = '';
|
||||
var sessionEpoch = 0;
|
||||
function tKey(key) {
|
||||
return typeof t === 'function' ? t(key) : key;
|
||||
}
|
||||
@@ -44,6 +47,9 @@
|
||||
}
|
||||
|
||||
function clearUserMirror() {
|
||||
sessionEpoch += 1;
|
||||
csrfRefreshPromise = null;
|
||||
csrfTokenFallback = '';
|
||||
sessionCache = null;
|
||||
sessionPromise = null;
|
||||
try {
|
||||
@@ -159,6 +165,11 @@
|
||||
}
|
||||
|
||||
function replaceSession(session) {
|
||||
if (session && session.csrf_token) {
|
||||
// Keep the fallback in sync: sessions rotated by the server (profile update,
|
||||
// workspace switch) must not be replaced later by an older token.
|
||||
csrfTokenFallback = session.csrf_token;
|
||||
}
|
||||
sessionCache = session;
|
||||
persistUserMirror(session);
|
||||
renderShellIdentity(session);
|
||||
@@ -166,6 +177,62 @@
|
||||
return session;
|
||||
}
|
||||
|
||||
function getCsrfToken() {
|
||||
return sessionCache && sessionCache.csrf_token ? sessionCache.csrf_token : '';
|
||||
}
|
||||
|
||||
function storeCsrfToken(token, epoch) {
|
||||
if (!token || epoch !== sessionEpoch) {
|
||||
return '';
|
||||
}
|
||||
csrfTokenFallback = token;
|
||||
if (sessionCache) {
|
||||
replaceSession(Object.assign({}, sessionCache, { csrf_token: token }));
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
// Single-flight rotation: parallel page loads, guards and mutations share one
|
||||
// POST /api/auth/session/csrf and its token is always written back to the
|
||||
// session cache, so the client can never keep a token the server already
|
||||
// replaced with a later rotation.
|
||||
function refreshCsrf() {
|
||||
if (csrfRefreshPromise) {
|
||||
return csrfRefreshPromise;
|
||||
}
|
||||
if (!(window.CrankApi && typeof window.CrankApi.refreshSessionCsrf === 'function')) {
|
||||
return Promise.resolve('');
|
||||
}
|
||||
var epoch = sessionEpoch;
|
||||
csrfRefreshPromise = window.CrankApi.refreshSessionCsrf()
|
||||
.then(function(csrf) {
|
||||
return storeCsrfToken(csrf && csrf.csrf_token ? csrf.csrf_token : '', epoch);
|
||||
})
|
||||
.finally(function() {
|
||||
csrfRefreshPromise = null;
|
||||
});
|
||||
return csrfRefreshPromise;
|
||||
}
|
||||
|
||||
// Token for a protected mutation: join a rotation that is already in flight,
|
||||
// reuse the cached token, or rotate once.
|
||||
function ensureCsrf() {
|
||||
if (csrfRefreshPromise) {
|
||||
return csrfRefreshPromise.then(getCsrfToken);
|
||||
}
|
||||
var token = getCsrfToken();
|
||||
if (token) {
|
||||
return Promise.resolve(token);
|
||||
}
|
||||
if (sessionPromise) {
|
||||
return sessionPromise.then(ensureCsrf, function() { return ''; });
|
||||
}
|
||||
if (sessionCache) {
|
||||
return refreshCsrf();
|
||||
}
|
||||
return Promise.resolve('');
|
||||
}
|
||||
|
||||
async function fetchSession(force) {
|
||||
if (!force && sessionCache) {
|
||||
return sessionCache;
|
||||
@@ -174,21 +241,27 @@
|
||||
return sessionPromise;
|
||||
}
|
||||
|
||||
var epoch = sessionEpoch;
|
||||
sessionPromise = window.CrankApi.getSession()
|
||||
.then(function(session) {
|
||||
if (session && !session.csrf_token && window.CrankApi && typeof window.CrankApi.refreshSessionCsrf === 'function') {
|
||||
return window.CrankApi.refreshSessionCsrf().then(function(csrf) {
|
||||
session.csrf_token = csrf && csrf.csrf_token ? csrf.csrf_token : '';
|
||||
return session;
|
||||
if (epoch !== sessionEpoch) {
|
||||
return sessionCache;
|
||||
}
|
||||
if (session && !session.csrf_token && csrfTokenFallback) {
|
||||
session.csrf_token = csrfTokenFallback;
|
||||
}
|
||||
replaceSession(session);
|
||||
if (session && !session.csrf_token) {
|
||||
return refreshCsrf().then(function() {
|
||||
return sessionCache || session;
|
||||
});
|
||||
}
|
||||
return session;
|
||||
})
|
||||
.then(function(session) {
|
||||
return replaceSession(session);
|
||||
})
|
||||
.catch(function(error) {
|
||||
clearUserMirror();
|
||||
if (epoch === sessionEpoch) {
|
||||
clearUserMirror();
|
||||
}
|
||||
throw error;
|
||||
})
|
||||
.finally(function() {
|
||||
@@ -261,9 +334,9 @@
|
||||
fetchSession: fetchSession,
|
||||
replaceSession: replaceSession,
|
||||
getCachedSession: function() { return sessionCache; },
|
||||
getCsrfToken: function() {
|
||||
return sessionCache && sessionCache.csrf_token ? sessionCache.csrf_token : '';
|
||||
},
|
||||
getCsrfToken: getCsrfToken,
|
||||
ensureCsrf: ensureCsrf,
|
||||
refreshCsrf: refreshCsrf,
|
||||
renderShellIdentity: function() {
|
||||
renderShellIdentity(sessionCache);
|
||||
},
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
home: '/',
|
||||
login: '/login',
|
||||
agents: '/agents',
|
||||
resources: '/resources',
|
||||
apiKeys: '/api-keys',
|
||||
secrets: '/secrets',
|
||||
logs: '/logs',
|
||||
|
||||
@@ -8,6 +8,95 @@ var TRANSLATIONS = {
|
||||
// Nav
|
||||
'nav.operations': 'Operations',
|
||||
'nav.agents': 'Agents',
|
||||
'nav.resources': 'Resources',
|
||||
'nav.prompts': 'Prompts',
|
||||
'prompts.title': 'Prompt templates',
|
||||
'prompts.subtitle': 'Create parameterized Drafts and check rendered messages before any publication.',
|
||||
'prompts.list': 'Drafts',
|
||||
'prompts.create': 'New Draft',
|
||||
'prompts.empty': 'No Prompt Drafts yet.',
|
||||
'prompts.name': 'Name',
|
||||
'prompts.description': 'Description',
|
||||
'prompts.sensitivity': 'Sensitivity',
|
||||
'prompts.arguments': 'Arguments (JSON)',
|
||||
'prompts.messages': 'Messages (JSON)',
|
||||
'prompts.dependencies': 'Dependencies (JSON)',
|
||||
'prompts.effective_sensitivity': 'Effective sensitivity',
|
||||
'prompts.sensitivity.public': 'public',
|
||||
'prompts.sensitivity.internal': 'internal',
|
||||
'prompts.sensitivity.secret': 'secret',
|
||||
'prompts.dependency.untrusted': 'Untrusted content - no sanitisation promise',
|
||||
'prompts.composition.error': 'Composed preview failed',
|
||||
'prompts.preview.arguments': 'Preview arguments (JSON)',
|
||||
'prompts.save': 'Save Draft',
|
||||
'prompts.preview': 'Preview',
|
||||
'prompts.draft': 'Draft',
|
||||
'prompts.not_published': 'This Draft has not been published.',
|
||||
'prompts.loading': 'Loading…',
|
||||
'prompts.saving': 'Saving Draft…',
|
||||
'prompts.saved': 'Draft saved.',
|
||||
'prompts.previewing': 'Rendering preview…',
|
||||
'prompts.preview_done': 'Preview ready; Draft remains unpublished.',
|
||||
'prompts.error.load': 'Prompts could not be loaded.',
|
||||
'prompts.error.save': 'Draft could not be saved.',
|
||||
'prompts.error.preview': 'Preview failed; no messages were returned.',
|
||||
'prompts.error.invalid_json': 'Enter valid JSON for this field.',
|
||||
'prompts.confirm.create': 'Create this Prompt Draft?',
|
||||
'prompts.confirm.update': 'Save a new Draft revision?',
|
||||
'prompts.confirm.cancel': 'Cancel',
|
||||
'prompts.stale': 'This Draft changed elsewhere. Reload it before editing.',
|
||||
'prompts.reload': 'Reload Draft',
|
||||
'prompts.preview.requires_save': 'Save the Draft before previewing unsaved edits.',
|
||||
'prompts.preview.stale': 'This Draft changed elsewhere. Reload it before previewing.',
|
||||
'prompts.publish': 'Publish this Draft',
|
||||
'prompts.archive': 'Archive Prompt',
|
||||
'prompts.published_state': 'Published',
|
||||
'prompts.archived_state': 'Archived',
|
||||
'prompts.published_version': 'Published version',
|
||||
'prompts.immutable': 'immutable snapshot',
|
||||
'prompts.archived_detail': 'This Prompt is archived; published versions stay immutable.',
|
||||
'prompts.view_published': 'View published version',
|
||||
'prompts.loading_published': 'Loading published version…',
|
||||
'prompts.published_loaded': 'Published version loaded.',
|
||||
'prompts.error.published': 'Published version could not be loaded.',
|
||||
'prompts.confirm.publish': 'Publish the current Draft as an immutable version?',
|
||||
'prompts.confirm.archive': 'Archive this Prompt? Published versions remain immutable.',
|
||||
'prompts.publishing': 'Publishing…',
|
||||
'prompts.published_saved': 'Published version pinned.',
|
||||
'prompts.archiving': 'Archiving…',
|
||||
'prompts.archived_saved': 'Prompt archived.',
|
||||
'prompts.error.action': 'The lifecycle action failed.',
|
||||
'prompts.bind': 'Bind published version',
|
||||
'prompts.bind_agent': 'Agent',
|
||||
'prompts.confirm.bind': 'Bind the exact published version to this Agent?',
|
||||
'prompts.binding': 'Binding the published version…',
|
||||
'prompts.bound': 'Published version bound to the Agent.',
|
||||
'prompts.error.bind': 'The published version could not be bound.',
|
||||
'prompts.bind.stale': 'The Agent changed elsewhere. Reload and bind again.',
|
||||
'prompts.bind.not_found': 'The published version is not available for binding.',
|
||||
'prompts.error.agents': 'Agents could not be loaded.',
|
||||
'prompts.no_agents': 'No Agents available.',
|
||||
'prompts.export': 'Export',
|
||||
'prompts.export.published': 'Export this version',
|
||||
'prompts.export.pending': 'Preparing the export…',
|
||||
'prompts.export.error': 'The Prompt could not be exported.',
|
||||
'prompts.import.title': 'Import a Prompt file',
|
||||
'prompts.import.description': 'Load a .crank-prompt.json file: a new Draft is created in this workspace and nothing is published.',
|
||||
'prompts.import.file': 'Portability file',
|
||||
'prompts.import.submit': 'Preview import',
|
||||
'prompts.import.pending': 'Importing…',
|
||||
'prompts.import.select': 'Choose a portability file first.',
|
||||
'prompts.import.preview.sensitivity': 'Sensitivity',
|
||||
'prompts.import.preview.arguments': 'Arguments',
|
||||
'prompts.import.preview.messages': 'Messages',
|
||||
'prompts.import.preview.draft': 'A new Draft will be created in this workspace; nothing will be published.',
|
||||
'prompts.import.confirm.accept': 'Create the Draft',
|
||||
'prompts.import.cancel': 'Cancel',
|
||||
'prompts.import.done': 'Import created a new Draft.',
|
||||
'prompts.import.error.invalid': 'The file is not a valid Crank Prompt portability file.',
|
||||
'prompts.import.error.definition': 'The template definition is invalid; nothing was created.',
|
||||
'prompts.import.error.generic': 'The Prompt could not be imported.',
|
||||
'prompts.portability.stale': 'The previous selection changed: this portability response was not applied.',
|
||||
'nav.apikeys': 'API Keys',
|
||||
'nav.secrets': 'Secrets',
|
||||
'nav.logs': 'Logs',
|
||||
@@ -20,6 +109,166 @@ var TRANSLATIONS = {
|
||||
'nav.user_fallback': 'Crank',
|
||||
'nav.workspace_fallback': 'workspace',
|
||||
|
||||
// Resources (Story 3.6)
|
||||
'resources.title': 'Resources',
|
||||
'resources.subtitle': 'Typed static drafts stored by this workspace.',
|
||||
'resources.callout.title': 'Drafts are shown inert.',
|
||||
'resources.callout.body': 'Content is displayed as plain text and downloads as an attachment, so markup never runs in this origin.',
|
||||
'resources.preview.title': 'Draft preview',
|
||||
'resources.meta.uri': 'URI',
|
||||
'resources.meta.name': 'Name',
|
||||
'resources.meta.kind': 'Kind',
|
||||
'resources.meta.mime': 'MIME type',
|
||||
'resources.meta.size': 'Size (bytes)',
|
||||
'resources.meta.digest': 'Digest',
|
||||
'resources.meta.version': 'Version',
|
||||
'resources.meta.description': 'Description',
|
||||
'resources.meta.sensitivity': 'Sensitivity',
|
||||
'resources.download': 'Download content',
|
||||
// Story 3.9: перенос Resource между установками.
|
||||
'resources.export': 'Export',
|
||||
'resources.export.published': 'Export this version',
|
||||
'resources.export.pending': 'Preparing the export…',
|
||||
'resources.export.error': 'The Resource could not be exported.',
|
||||
'resources.import.title': 'Import a Resource',
|
||||
'resources.import.subtitle': 'Load a portability file exported from another installation. The import always creates a new Draft; nothing is published.',
|
||||
'resources.import.file': 'Portability file (JSON)',
|
||||
'resources.import.submit': 'Import',
|
||||
'resources.import.pending': 'Importing…',
|
||||
'resources.import.reading': 'Reading the file…',
|
||||
'resources.import.done': 'The import created a new Draft.',
|
||||
'resources.import.select': 'Choose a portability file first.',
|
||||
'resources.import.confirm.draft': 'A new Draft will be created in this workspace; nothing will be published.',
|
||||
'resources.import.confirm.accept': 'Create the Draft',
|
||||
'resources.import.error.invalid': 'The file is not a valid Crank Resource portability file.',
|
||||
'resources.import.error.too_large': 'The content is too large for this Resource: it exceeds the size limit.',
|
||||
'resources.import.error.integrity': 'The file is damaged: its declared size or checksum does not match the content.',
|
||||
'resources.import.error.uri_duplicate': 'This workspace already has a Resource with the same URI.',
|
||||
'resources.import.error.name_duplicate': 'This workspace already has a Resource with the same name.',
|
||||
'resources.import.error.generic': 'The Resource could not be imported.',
|
||||
'resources.portability.stale': 'The previous selection changed: this portability response was not applied.',
|
||||
'resources.loading': 'Loading resource…',
|
||||
'resources.empty': 'No Resource selected.',
|
||||
'resources.error': 'The Resource could not be loaded.',
|
||||
'resources.create.title': 'Create a draft',
|
||||
'resources.create.subtitle': 'URI and name are stable identifiers: they cannot be changed later.',
|
||||
'resources.create.pending': 'Creating the draft…',
|
||||
'resources.create.done': 'The draft was created.',
|
||||
'resources.create.error': 'The draft could not be created.',
|
||||
'resources.form.uri.placeholder': 'crank://team/payload',
|
||||
'resources.form.name.placeholder': 'payload',
|
||||
'resources.form.content': 'Content (text and JSON)',
|
||||
'resources.form.file': 'Content (binary file upload)',
|
||||
'resources.form.submit': 'Create draft',
|
||||
'resources.list.title': 'Drafts in this workspace',
|
||||
'resources.list.loading': 'Loading drafts…',
|
||||
'resources.list.empty': 'No drafts yet.',
|
||||
'resources.list.hint': 'Select a draft to preview or edit it.',
|
||||
'resources.list.error': 'The drafts could not be loaded.',
|
||||
'resources.preview.error': 'The preview could not be shown.',
|
||||
'resources.edit.title': 'Edit the selected draft',
|
||||
'resources.edit.subtitle': 'URI, name and kind stay immutable; an accepted edit creates the next version.',
|
||||
'resources.edit.submit': 'Save new version',
|
||||
'resources.edit.pending': 'Saving the new version…',
|
||||
'resources.edit.done': 'The new version was saved.',
|
||||
'resources.edit.error': 'The draft could not be updated.',
|
||||
'resources.edit.select': 'Select a draft first.',
|
||||
'resources.edit.file': 'Choose the replacement file for the selected draft first.',
|
||||
'resources.lifecycle.title': 'Publication and lifecycle',
|
||||
'resources.lifecycle.subtitle': 'Publish the reviewed Draft, read the exact Published Version, bind it to an Agent or archive the Resource.',
|
||||
'resources.lifecycle.archived_hint': 'This Resource is archived: publication, edits, binding and archiving are disabled. Published history stays readable.',
|
||||
'resources.status.label': 'Status',
|
||||
'resources.status.draft': 'Draft',
|
||||
'resources.status.published': 'Published',
|
||||
'resources.status.archived': 'Archived',
|
||||
'resources.findings.title': 'Publication checks',
|
||||
'resources.findings.empty': 'No findings.',
|
||||
'resources.publish.action': 'Publish',
|
||||
'resources.publish.confirm': 'Confirm publication?',
|
||||
'resources.publish.pending': 'Publishing…',
|
||||
'resources.publish.done': 'The Resource was published.',
|
||||
'resources.publish.error': 'The Resource could not be published.',
|
||||
'resources.publish.secret': 'Publication refused: the content contains secret material or an access-bypassing reference.',
|
||||
'resources.publish.stale': 'The Resource changed since it was loaded. Reload and try again.',
|
||||
'resources.archive.action': 'Archive',
|
||||
'resources.archive.confirm': 'Confirm archiving?',
|
||||
'resources.archive.pending': 'Archiving…',
|
||||
'resources.archive.done': 'The Resource was archived.',
|
||||
'resources.archive.error': 'The Resource could not be archived.',
|
||||
'resources.confirm.accept': 'Confirm',
|
||||
'resources.confirm.cancel': 'Cancel',
|
||||
'resources.published.title': 'Exact Published Version',
|
||||
'resources.published.version': 'Version',
|
||||
'resources.published.mime': 'MIME type',
|
||||
'resources.published.size': 'Size (bytes)',
|
||||
'resources.published.sensitivity': 'Sensitivity',
|
||||
'resources.published.digest': 'Digest',
|
||||
'resources.published.download': 'Download published version',
|
||||
'resources.published.error': 'The exact Published Version could not be loaded. Reload and try again.',
|
||||
// Story 3.10: REST-backed Resource template.
|
||||
'resources.source.mode': 'Source',
|
||||
'resources.source.mode.static': 'Uploaded file',
|
||||
'resources.source.mode.rest': 'Published REST operation',
|
||||
'resources.source.loading': 'Loading published operations…',
|
||||
'resources.source.empty': 'No published operation in this workspace yet. Publish a read-safe operation first.',
|
||||
'resources.source.operation': 'Published operation',
|
||||
'resources.source.version': 'Published version',
|
||||
'resources.source.uri_template': 'Resource URI template',
|
||||
'resources.source.bind': 'Pin this version',
|
||||
'resources.source.preview': 'Validate and create draft',
|
||||
'resources.source.pinned': 'Pinned operation',
|
||||
'resources.source.pinned_done': 'Pinned operation',
|
||||
'resources.source.required': 'required',
|
||||
'resources.source.optional': 'optional',
|
||||
'resources.source.safety': 'Read safety',
|
||||
'resources.source.access': 'Access',
|
||||
'resources.source.read_safe': 'read-safe',
|
||||
'resources.source.not_read_safe': 'not read-safe',
|
||||
'resources.source.pending': 'Creating the template draft…',
|
||||
'resources.source.done': 'The template draft was created.',
|
||||
'resources.source.error': 'The published operations could not be loaded. Try again.',
|
||||
'resources.source.bind_error': 'The selected version could not be pinned. Try again.',
|
||||
'resources.source.preview_error': 'The template draft could not be created.',
|
||||
'resources.source.finding.resource_source_not_read_safe': 'Only read-safe GET or HEAD operations can be published.',
|
||||
'resources.source.finding.resource_source_parameter_unknown': 'A parameter is not used by the URI template.',
|
||||
'resources.source.finding.resource_source_parameter_unmapped': 'A URI placeholder has no parameter mapped to the pinned operation input.',
|
||||
'resources.source.finding.resource_source_parameter_duplicate': 'A parameter, placeholder or input field is declared more than once.',
|
||||
'resources.source.finding.resource_source_parameter_type_mismatch': 'A parameter type, format or enum does not match the pinned operation input.',
|
||||
'resources.source.finding.resource_source_parameter_default_invalid': 'A parameter default value does not match its type or enum.',
|
||||
'resources.source.finding.resource_source_parameter_optional_without_default': 'An optional parameter needs a default value to render the URI.',
|
||||
'resources.source.finding.resource_source_cache_ttl_invalid': 'The cache TTL must be greater than zero and within the allowed bound.',
|
||||
'resources.source.finding.resource_source_cache_size_invalid': 'The cache size must be greater than zero and within the allowed bound.',
|
||||
'resources.source.finding.resource_source_vary_unknown': 'The cache varies on a name that is not a template parameter.',
|
||||
'resources.source.finding.resource_source_vary_duplicate': 'The cache vary list repeats a name.',
|
||||
'resources.source.finding.resource_source_vary_incomplete': 'Every template parameter must be part of the cache vary list.',
|
||||
'resources.source.finding.generic': 'This definition needs attention before publication.',
|
||||
'resources.bind.title': 'Bind the exact Published Version',
|
||||
'resources.bind.agent': 'Agent',
|
||||
'resources.bind.version': 'Published version',
|
||||
'resources.bind.agent_version': 'Agent draft version',
|
||||
'resources.bind.action': 'Bind exact version',
|
||||
'resources.bind.pending': 'Binding…',
|
||||
'resources.bind.done': 'The binding was saved.',
|
||||
'resources.bind.select': 'Select an Agent first.',
|
||||
'resources.bind.error': 'The Resource could not be bound.',
|
||||
'resources.bind.stale': 'The Agent revision changed: reload the form and bind again.',
|
||||
'resources.bind.reload': 'Reload Agent',
|
||||
'resources.bind.empty': 'No Agents in this workspace yet.',
|
||||
'resources.test.title': 'Test administrative read',
|
||||
'resources.test.subtitle': 'Runs the pinned published operation as an administrator, not as an Agent.',
|
||||
'resources.test.start': 'Test read',
|
||||
'resources.test.confirm': 'This makes a live request to the pinned operation.',
|
||||
'resources.test.accept': 'Run test',
|
||||
'resources.test.loading': 'Reading from the pinned operation…',
|
||||
'resources.test.done': 'Test read completed.',
|
||||
'resources.test.empty': 'The read returned no content.',
|
||||
'resources.test.error': 'The test read failed safely. Check the pinned operation and authorization.',
|
||||
'resources.test.stale': 'The Resource or parameters changed; this result was not applied. Run the test again.',
|
||||
'resources.test.parameters': 'Required parameter',
|
||||
|
||||
'resources.stale.message': 'The Resource changed since it was loaded. Reload and try again.',
|
||||
'resources.stale.reload': 'Reload',
|
||||
|
||||
'onboarding.title': 'Getting Started',
|
||||
'onboarding.subtitle': 'A resumable path to your first real MCP tool call.',
|
||||
'onboarding.loading': 'Checking authoritative progress…',
|
||||
@@ -1074,6 +1323,95 @@ var TRANSLATIONS = {
|
||||
// Nav
|
||||
'nav.operations': 'Операции',
|
||||
'nav.agents': 'Агенты',
|
||||
'nav.resources': 'Ресурсы',
|
||||
'nav.prompts': 'Шаблоны запросов',
|
||||
'prompts.title': 'Шаблоны запросов',
|
||||
'prompts.subtitle': 'Создавайте черновики с параметрами и проверяйте итоговые сообщения до публикации.',
|
||||
'prompts.list': 'Черновики',
|
||||
'prompts.create': 'Новый черновик',
|
||||
'prompts.empty': 'Черновиков запросов пока нет.',
|
||||
'prompts.name': 'Название',
|
||||
'prompts.description': 'Описание',
|
||||
'prompts.sensitivity': 'Чувствительность',
|
||||
'prompts.arguments': 'Параметры (JSON)',
|
||||
'prompts.messages': 'Сообщения (JSON)',
|
||||
'prompts.dependencies': 'Зависимости (JSON)',
|
||||
'prompts.effective_sensitivity': 'Действительная чувствительность',
|
||||
'prompts.sensitivity.public': 'публичная',
|
||||
'prompts.sensitivity.internal': 'внутренняя',
|
||||
'prompts.sensitivity.secret': 'секретная',
|
||||
'prompts.dependency.untrusted': 'Недоверенное содержимое — без обещания очистки',
|
||||
'prompts.composition.error': 'Не удалось собрать предпросмотр',
|
||||
'prompts.preview.arguments': 'Параметры предпросмотра (JSON)',
|
||||
'prompts.save': 'Сохранить черновик',
|
||||
'prompts.preview': 'Предпросмотр',
|
||||
'prompts.draft': 'Черновик',
|
||||
'prompts.not_published': 'Этот черновик ещё не опубликован.',
|
||||
'prompts.loading': 'Загрузка…',
|
||||
'prompts.saving': 'Сохраняем черновик…',
|
||||
'prompts.saved': 'Черновик сохранён.',
|
||||
'prompts.previewing': 'Формируем предпросмотр…',
|
||||
'prompts.preview_done': 'Предпросмотр готов; черновик не опубликован.',
|
||||
'prompts.error.load': 'Не удалось загрузить запросы.',
|
||||
'prompts.error.save': 'Не удалось сохранить черновик.',
|
||||
'prompts.error.preview': 'Предпросмотр не выполнен; сообщения не возвращены.',
|
||||
'prompts.error.invalid_json': 'Введите корректный JSON в это поле.',
|
||||
'prompts.confirm.create': 'Создать этот черновик запроса?',
|
||||
'prompts.confirm.update': 'Сохранить новую версию черновика?',
|
||||
'prompts.confirm.cancel': 'Отмена',
|
||||
'prompts.stale': 'Черновик изменён в другом окне. Перезагрузите его перед редактированием.',
|
||||
'prompts.reload': 'Перезагрузить черновик',
|
||||
'prompts.preview.requires_save': 'Сохраните черновик, чтобы увидеть предпросмотр изменений.',
|
||||
'prompts.preview.stale': 'Черновик изменён в другом окне. Перезагрузите его перед предпросмотром.',
|
||||
'prompts.publish': 'Опубликовать этот черновик',
|
||||
'prompts.archive': 'Архивировать запрос',
|
||||
'prompts.published_state': 'Опубликовано',
|
||||
'prompts.archived_state': 'В архиве',
|
||||
'prompts.published_version': 'Опубликованная версия',
|
||||
'prompts.immutable': 'неизменяемый снимок',
|
||||
'prompts.archived_detail': 'Запрос в архиве; опубликованные версии остаются неизменяемыми.',
|
||||
'prompts.view_published': 'Открыть опубликованную версию',
|
||||
'prompts.loading_published': 'Загружаем опубликованную версию…',
|
||||
'prompts.published_loaded': 'Опубликованная версия загружена.',
|
||||
'prompts.error.published': 'Не удалось загрузить опубликованную версию.',
|
||||
'prompts.confirm.publish': 'Опубликовать текущий черновик как неизменяемую версию?',
|
||||
'prompts.confirm.archive': 'Архивировать запрос? Опубликованные версии останутся неизменяемыми.',
|
||||
'prompts.publishing': 'Публикуем…',
|
||||
'prompts.published_saved': 'Опубликованная версия закреплена.',
|
||||
'prompts.archiving': 'Архивируем…',
|
||||
'prompts.archived_saved': 'Запрос архивирован.',
|
||||
'prompts.error.action': 'Не удалось выполнить действие жизненного цикла.',
|
||||
'prompts.bind': 'Привязать опубликованную версию',
|
||||
'prompts.bind_agent': 'Агент',
|
||||
'prompts.confirm.bind': 'Привязать точную опубликованную версию к этому агенту?',
|
||||
'prompts.binding': 'Привязываем опубликованную версию…',
|
||||
'prompts.bound': 'Опубликованная версия привязана к агенту.',
|
||||
'prompts.error.bind': 'Не удалось привязать опубликованную версию.',
|
||||
'prompts.bind.stale': 'Агент изменён в другом окне. Перезагрузите и привяжите снова.',
|
||||
'prompts.bind.not_found': 'Опубликованная версия недоступна для привязки.',
|
||||
'prompts.error.agents': 'Не удалось загрузить агентов.',
|
||||
'prompts.no_agents': 'Агентов пока нет.',
|
||||
'prompts.export': 'Экспорт',
|
||||
'prompts.export.published': 'Экспорт этой версии',
|
||||
'prompts.export.pending': 'Готовим экспорт…',
|
||||
'prompts.export.error': 'Не удалось экспортировать шаблон.',
|
||||
'prompts.import.title': 'Импорт шаблона из файла',
|
||||
'prompts.import.description': 'Загрузите файл .crank-prompt.json: в этом workspace будет создан новый черновик, публикации не будет.',
|
||||
'prompts.import.file': 'Файл переноса',
|
||||
'prompts.import.submit': 'Проверить импорт',
|
||||
'prompts.import.pending': 'Импортируем…',
|
||||
'prompts.import.select': 'Сначала выберите файл переноса.',
|
||||
'prompts.import.preview.sensitivity': 'Чувствительность',
|
||||
'prompts.import.preview.arguments': 'Параметры',
|
||||
'prompts.import.preview.messages': 'Сообщения',
|
||||
'prompts.import.preview.draft': 'Будет создан новый черновик в этом workspace; публикации не будет.',
|
||||
'prompts.import.confirm.accept': 'Создать черновик',
|
||||
'prompts.import.cancel': 'Отмена',
|
||||
'prompts.import.done': 'Импорт создал новый черновик.',
|
||||
'prompts.import.error.invalid': 'Файл не является корректным файлом переноса шаблона Crank.',
|
||||
'prompts.import.error.definition': 'Определение шаблона некорректно; ничего не создано.',
|
||||
'prompts.import.error.generic': 'Не удалось импортировать шаблон.',
|
||||
'prompts.portability.stale': 'Прежний выбор изменился: этот ответ переноса не применён.',
|
||||
'nav.apikeys': 'API Ключи',
|
||||
'nav.secrets': 'Секреты',
|
||||
'nav.logs': 'Логи',
|
||||
@@ -1086,6 +1424,166 @@ var TRANSLATIONS = {
|
||||
'nav.user_fallback': 'Crank',
|
||||
'nav.workspace_fallback': 'workspace',
|
||||
|
||||
// Resources (Story 3.6)
|
||||
'resources.title': 'Ресурсы',
|
||||
'resources.subtitle': 'Типизированные статические черновики этого воркспейса.',
|
||||
'resources.callout.title': 'Черновики показываются инертно.',
|
||||
'resources.callout.body': 'Содержимое выводится как обычный текст, а скачивается как вложение, поэтому разметка никогда не исполняется в этом origin.',
|
||||
'resources.preview.title': 'Просмотр черновика',
|
||||
'resources.meta.uri': 'URI',
|
||||
'resources.meta.name': 'Имя',
|
||||
'resources.meta.kind': 'Тип',
|
||||
'resources.meta.mime': 'MIME-тип',
|
||||
'resources.meta.size': 'Размер (байт)',
|
||||
'resources.meta.digest': 'Дайджест',
|
||||
'resources.meta.version': 'Версия',
|
||||
'resources.meta.description': 'Описание',
|
||||
'resources.meta.sensitivity': 'Чувствительность',
|
||||
'resources.download': 'Скачать содержимое',
|
||||
// Story 3.9: перенос Resource между установками.
|
||||
'resources.export': 'Экспорт',
|
||||
'resources.export.published': 'Экспорт этой версии',
|
||||
'resources.export.pending': 'Готовим экспорт…',
|
||||
'resources.export.error': 'Не удалось экспортировать ресурс.',
|
||||
'resources.import.title': 'Импорт Resource',
|
||||
'resources.import.subtitle': 'Загрузите файл переноса, выгруженный из другой установки. Импорт всегда создаёт новый черновик; публикации не будет.',
|
||||
'resources.import.file': 'Файл переноса (JSON)',
|
||||
'resources.import.submit': 'Импортировать',
|
||||
'resources.import.pending': 'Импортируем…',
|
||||
'resources.import.reading': 'Читаем файл…',
|
||||
'resources.import.done': 'Импорт завершён: создан новый черновик.',
|
||||
'resources.import.select': 'Сначала выберите файл переноса.',
|
||||
'resources.import.confirm.draft': 'Будет создан новый черновик в этом воркспейсе; публикации не будет.',
|
||||
'resources.import.confirm.accept': 'Создать черновик',
|
||||
'resources.import.error.invalid': 'Файл не является корректным файлом переноса Resource Crank.',
|
||||
'resources.import.error.too_large': 'Содержимое превышает допустимый размер для этого ресурса.',
|
||||
'resources.import.error.integrity': 'Файл повреждён: заявленный размер или контрольная сумма не совпадает с содержимым.',
|
||||
'resources.import.error.uri_duplicate': 'В этом воркспейсе уже есть ресурс с таким URI.',
|
||||
'resources.import.error.name_duplicate': 'В этом воркспейсе уже есть ресурс с таким именем.',
|
||||
'resources.import.error.generic': 'Не удалось импортировать ресурс.',
|
||||
'resources.portability.stale': 'Выбор изменился: ответ на прежний запрос переноса не применён.',
|
||||
'resources.loading': 'Загружаем ресурс…',
|
||||
'resources.empty': 'Ресурс не выбран.',
|
||||
'resources.error': 'Не удалось загрузить ресурс.',
|
||||
'resources.create.title': 'Создать черновик',
|
||||
'resources.create.subtitle': 'URI и имя — стабильные идентификаторы: изменить их позже нельзя.',
|
||||
'resources.create.pending': 'Создаём черновик…',
|
||||
'resources.create.done': 'Черновик создан.',
|
||||
'resources.create.error': 'Не удалось создать черновик.',
|
||||
'resources.form.uri.placeholder': 'crank://team/payload',
|
||||
'resources.form.name.placeholder': 'payload',
|
||||
'resources.form.content': 'Содержимое (текст и JSON)',
|
||||
'resources.form.file': 'Содержимое (файл для binary)',
|
||||
'resources.form.submit': 'Создать черновик',
|
||||
'resources.list.title': 'Черновики этого воркспейса',
|
||||
'resources.list.loading': 'Загружаем черновики…',
|
||||
'resources.list.empty': 'Черновиков пока нет.',
|
||||
'resources.list.hint': 'Выберите черновик для просмотра или редактирования.',
|
||||
'resources.list.error': 'Не удалось загрузить черновики.',
|
||||
'resources.preview.error': 'Не удалось показать предпросмотр.',
|
||||
'resources.edit.title': 'Редактировать выбранный черновик',
|
||||
'resources.edit.subtitle': 'URI, имя и тип неизменяемы; принятое изменение создаёт следующую версию.',
|
||||
'resources.edit.submit': 'Сохранить новую версию',
|
||||
'resources.edit.pending': 'Сохраняем новую версию…',
|
||||
'resources.edit.done': 'Новая версия сохранена.',
|
||||
'resources.edit.error': 'Не удалось обновить черновик.',
|
||||
'resources.edit.select': 'Сначала выберите черновик.',
|
||||
'resources.edit.file': 'Сначала выберите файл замены для выбранного черновика.',
|
||||
'resources.lifecycle.title': 'Публикация и жизненный цикл',
|
||||
'resources.lifecycle.subtitle': 'Опубликуйте проверенный черновик, посмотрите точную опубликованную версию, привяжите её к Agent или отправьте ресурс в архив.',
|
||||
'resources.lifecycle.archived_hint': 'Ресурс в архиве: публикация, правка, привязка и архивация недоступны. История публикаций остаётся читаемой.',
|
||||
'resources.status.label': 'Статус',
|
||||
'resources.status.draft': 'Черновик',
|
||||
'resources.status.published': 'Опубликован',
|
||||
'resources.status.archived': 'В архиве',
|
||||
'resources.findings.title': 'Проверки публикации',
|
||||
'resources.findings.empty': 'Нарушений не найдено.',
|
||||
'resources.publish.action': 'Опубликовать',
|
||||
'resources.publish.confirm': 'Подтвердить публикацию?',
|
||||
'resources.publish.pending': 'Публикуем…',
|
||||
'resources.publish.done': 'Ресурс опубликован.',
|
||||
'resources.publish.error': 'Не удалось опубликовать ресурс.',
|
||||
'resources.publish.secret': 'Публикация отклонена: содержимое содержит секретные данные или ссылку в обход доступа.',
|
||||
'resources.publish.stale': 'Ресурс изменился после загрузки. Обновите данные и повторите.',
|
||||
'resources.archive.action': 'В архив',
|
||||
'resources.archive.confirm': 'Подтвердить отправку в архив?',
|
||||
'resources.archive.pending': 'Отправляем в архив…',
|
||||
'resources.archive.done': 'Ресурс отправлен в архив.',
|
||||
'resources.archive.error': 'Не удалось отправить ресурс в архив.',
|
||||
'resources.confirm.accept': 'Подтвердить',
|
||||
'resources.confirm.cancel': 'Отмена',
|
||||
'resources.published.title': 'Точная опубликованная версия',
|
||||
'resources.published.version': 'Версия',
|
||||
'resources.published.mime': 'MIME-тип',
|
||||
'resources.published.size': 'Размер (байт)',
|
||||
'resources.published.sensitivity': 'Чувствительность',
|
||||
'resources.published.digest': 'Дайджест',
|
||||
'resources.published.download': 'Скачать опубликованную версию',
|
||||
'resources.published.error': 'Не удалось загрузить точную опубликованную версию. Обновите страницу и повторите.',
|
||||
// Story 3.10: REST-backed Resource template.
|
||||
'resources.source.mode': 'Источник',
|
||||
'resources.source.mode.static': 'Загруженный файл',
|
||||
'resources.source.mode.rest': 'Опубликованная REST-операция',
|
||||
'resources.source.loading': 'Загрузка опубликованных операций…',
|
||||
'resources.source.empty': 'В рабочем пространстве ещё нет опубликованных операций. Сначала опубликуйте безопасную операцию.',
|
||||
'resources.source.operation': 'Опубликованная операция',
|
||||
'resources.source.version': 'Опубликованная версия',
|
||||
'resources.source.uri_template': 'URI-шаблон ресурса',
|
||||
'resources.source.bind': 'Зафиксировать версию',
|
||||
'resources.source.preview': 'Проверить и создать черновик',
|
||||
'resources.source.pinned': 'Зафиксированная операция',
|
||||
'resources.source.pinned_done': 'Зафиксированная операция',
|
||||
'resources.source.required': 'обязательный',
|
||||
'resources.source.optional': 'необязательный',
|
||||
'resources.source.safety': 'Безопасность чтения',
|
||||
'resources.source.access': 'Доступ',
|
||||
'resources.source.read_safe': 'только чтение',
|
||||
'resources.source.not_read_safe': 'небезопасно для чтения',
|
||||
'resources.source.pending': 'Создание черновика шаблона…',
|
||||
'resources.source.done': 'Черновик шаблона создан.',
|
||||
'resources.source.error': 'Не удалось загрузить опубликованные операции. Повторите попытку.',
|
||||
'resources.source.bind_error': 'Не удалось зафиксировать выбранную версию. Повторите попытку.',
|
||||
'resources.source.preview_error': 'Не удалось создать черновик шаблона.',
|
||||
'resources.source.finding.resource_source_not_read_safe': 'Публиковать можно только безопасные операции чтения GET или HEAD.',
|
||||
'resources.source.finding.resource_source_parameter_unknown': 'Параметр не используется в URI-шаблоне.',
|
||||
'resources.source.finding.resource_source_parameter_unmapped': 'Для заполнителя URI нет параметра, связанного с полем входа зафиксированной операции.',
|
||||
'resources.source.finding.resource_source_parameter_duplicate': 'Параметр, заполнитель или поле входа объявлены более одного раза.',
|
||||
'resources.source.finding.resource_source_parameter_type_mismatch': 'Тип, формат или перечисление параметра не совпадают с полем входа зафиксированной операции.',
|
||||
'resources.source.finding.resource_source_parameter_default_invalid': 'Значение по умолчанию не соответствует типу или перечислению параметра.',
|
||||
'resources.source.finding.resource_source_parameter_optional_without_default': 'Необязательному параметру нужно значение по умолчанию, иначе URI не построить.',
|
||||
'resources.source.finding.resource_source_cache_ttl_invalid': 'Время кэширования должно быть больше нуля и в допустимых пределах.',
|
||||
'resources.source.finding.resource_source_cache_size_invalid': 'Размер кэша должен быть больше нуля и в допустимых пределах.',
|
||||
'resources.source.finding.resource_source_vary_unknown': 'Кэш зависит от имени, которого нет среди параметров шаблона.',
|
||||
'resources.source.finding.resource_source_vary_duplicate': 'Список зависимостей кэша повторяет одно и то же имя.',
|
||||
'resources.source.finding.resource_source_vary_incomplete': 'Каждый параметр шаблона должен входить в список зависимостей кэша.',
|
||||
'resources.source.finding.generic': 'Это определение нужно исправить до публикации.',
|
||||
'resources.bind.title': 'Привязать точную опубликованную версию',
|
||||
'resources.bind.agent': 'Agent',
|
||||
'resources.bind.version': 'Опубликованная версия',
|
||||
'resources.bind.agent_version': 'Черновая версия Agent',
|
||||
'resources.bind.action': 'Привязать точную версию',
|
||||
'resources.bind.pending': 'Привязываем…',
|
||||
'resources.bind.done': 'Привязка сохранена.',
|
||||
'resources.bind.select': 'Сначала выберите Agent.',
|
||||
'resources.bind.error': 'Не удалось привязать ресурс.',
|
||||
'resources.bind.stale': 'Версия Agent изменилась: обновите форму и повторите привязку.',
|
||||
'resources.bind.reload': 'Обновить Agent',
|
||||
'resources.bind.empty': 'В этом воркспейсе пока нет Agent.',
|
||||
'resources.test.title': 'Проверить административное чтение',
|
||||
'resources.test.subtitle': 'Запускает закреплённую опубликованную операцию от администратора, а не от имени агента.',
|
||||
'resources.test.start': 'Проверить чтение',
|
||||
'resources.test.confirm': 'Будет выполнен реальный запрос к закреплённой операции.',
|
||||
'resources.test.accept': 'Запустить проверку',
|
||||
'resources.test.loading': 'Читаем данные через закреплённую операцию…',
|
||||
'resources.test.done': 'Проверка чтения завершена.',
|
||||
'resources.test.empty': 'Чтение не вернуло содержимое.',
|
||||
'resources.test.error': 'Не удалось безопасно выполнить чтение. Проверьте операцию и авторизацию.',
|
||||
'resources.test.stale': 'Ресурс или параметры изменились; результат не применён. Запустите проверку ещё раз.',
|
||||
'resources.test.parameters': 'Обязательный параметр',
|
||||
|
||||
'resources.stale.message': 'Ресурс изменился после загрузки. Обновите данные и повторите.',
|
||||
'resources.stale.reload': 'Обновить',
|
||||
|
||||
'onboarding.title': 'Начало работы',
|
||||
'onboarding.subtitle': 'Возобновляемый путь к первому реальному вызову MCP-инструмента.',
|
||||
'onboarding.loading': 'Проверяем подтверждённый прогресс…',
|
||||
|
||||
@@ -2112,11 +2112,15 @@
|
||||
async function submitApply(request) {
|
||||
if (state.applyInFlight) return;
|
||||
|
||||
// Claim the attempt — including the controller used by the cancel path —
|
||||
// before the first await. A second click cannot start a parallel replay
|
||||
// with a different idempotency key, and Escape/close or a workspace or
|
||||
// language change during the session wait aborts this attempt instead of
|
||||
// letting it install itself and POST afterwards.
|
||||
var controller = new AbortController();
|
||||
var revision = state.revision;
|
||||
var workspaceId = request.workspaceId;
|
||||
var language = locale();
|
||||
var controller = new AbortController();
|
||||
|
||||
state.applyController = controller;
|
||||
state.applyInFlight = true;
|
||||
state.applyOutcomeUnknown = false;
|
||||
@@ -2126,6 +2130,25 @@
|
||||
showRetry(false);
|
||||
setStatus(tKey('openapi.status.applying'));
|
||||
|
||||
// A replay can start right after a reload, before the shell has restored the
|
||||
// session and its CSRF token; sending the mutation without that token would
|
||||
// be rejected as forbidden. Wait for the already-required authenticated
|
||||
// session instead of firing an unauthenticated POST.
|
||||
if (window.CrankAuth && typeof window.CrankAuth.getCsrfToken === 'function'
|
||||
&& !window.CrankAuth.getCsrfToken()
|
||||
&& typeof window.CrankAuth.fetchSession === 'function') {
|
||||
try {
|
||||
await window.CrankAuth.fetchSession(true);
|
||||
} catch (_error) {
|
||||
// A missing session stays a real 401/403 from the API, never a silent
|
||||
// local success.
|
||||
}
|
||||
// A cancelled or superseded attempt owns no authority any more: it must
|
||||
// neither re-install itself over the cancel/unknown state nor send its
|
||||
// POST after the wait.
|
||||
if (state.applyController !== controller) return;
|
||||
}
|
||||
|
||||
try {
|
||||
var response = await window.CrankApi.applyOpenApiImportPlan(
|
||||
workspaceId,
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user