@try-works/dsh-model-as-tool 0.1.3 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dsh-tool-mode-credentials.mjs +20 -0
- package/bin/dsh-tool-mode.mjs +202 -0
- package/catalog/desert-ant-models.json +693 -693
- package/client/client.model-tools.js +592 -0
- package/client/index.js +1679 -0
- package/lib/adapters/index.d.ts.map +1 -1
- package/lib/adapters/index.js +4 -4
- package/lib/bindings.d.ts.map +1 -1
- package/lib/bindings.js +26 -25
- package/lib/capability.d.ts.map +1 -1
- package/lib/capability.js +17 -0
- package/lib/capture-path.d.ts +97 -0
- package/lib/capture-path.d.ts.map +1 -0
- package/lib/capture-path.js +152 -0
- package/lib/diagnostics.d.ts +166 -0
- package/lib/diagnostics.d.ts.map +1 -0
- package/lib/diagnostics.js +135 -0
- package/lib/extension-dependencies.d.ts +197 -0
- package/lib/extension-dependencies.d.ts.map +1 -0
- package/lib/extension-dependencies.js +369 -0
- package/lib/extension-dispatch.d.ts +117 -0
- package/lib/extension-dispatch.d.ts.map +1 -0
- package/lib/extension-dispatch.js +124 -0
- package/lib/extension-registrar.d.ts +100 -0
- package/lib/extension-registrar.d.ts.map +1 -0
- package/lib/extension-registrar.js +134 -0
- package/lib/extensions-api.d.ts +217 -0
- package/lib/extensions-api.d.ts.map +1 -0
- package/lib/extensions-api.js +17 -0
- package/lib/extensions-remote.d.ts +54 -0
- package/lib/extensions-remote.d.ts.map +1 -0
- package/lib/extensions-remote.js +66 -0
- package/lib/extensions-service.d.ts +334 -0
- package/lib/extensions-service.d.ts.map +1 -0
- package/lib/extensions-service.js +1351 -0
- package/lib/harness-llm.d.ts +138 -0
- package/lib/harness-llm.d.ts.map +1 -0
- package/lib/harness-llm.js +218 -0
- package/lib/harness-serving.d.ts +95 -0
- package/lib/harness-serving.d.ts.map +1 -0
- package/lib/harness-serving.js +157 -0
- package/lib/headless.d.ts +97 -0
- package/lib/headless.d.ts.map +1 -0
- package/lib/headless.js +349 -0
- package/lib/http-acquisition.d.ts +27 -0
- package/lib/http-acquisition.d.ts.map +1 -0
- package/lib/http-acquisition.js +136 -0
- package/lib/index.d.ts +250 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2625 -70
- package/lib/invocation-accounting.d.ts +169 -0
- package/lib/invocation-accounting.d.ts.map +1 -0
- package/lib/invocation-accounting.js +148 -0
- package/lib/legacy-migration.d.ts +95 -0
- package/lib/legacy-migration.d.ts.map +1 -0
- package/lib/legacy-migration.js +429 -0
- package/lib/managed-workers.d.ts +151 -0
- package/lib/managed-workers.d.ts.map +1 -0
- package/lib/managed-workers.js +249 -0
- package/lib/mcp/client-grant.d.ts +74 -0
- package/lib/mcp/client-grant.d.ts.map +1 -0
- package/lib/mcp/client-grant.js +60 -0
- package/lib/mcp/credential-cli.d.ts +38 -0
- package/lib/mcp/credential-cli.d.ts.map +1 -0
- package/lib/mcp/credential-cli.js +148 -0
- package/lib/mcp/credential-store.d.ts +143 -0
- package/lib/mcp/credential-store.d.ts.map +1 -0
- package/lib/mcp/credential-store.js +454 -0
- package/lib/mcp/host-binding.d.ts +25 -0
- package/lib/mcp/host-binding.d.ts.map +1 -1
- package/lib/mcp/host-binding.js +107 -14
- package/lib/mcp/http.d.ts +68 -18
- package/lib/mcp/http.d.ts.map +1 -1
- package/lib/mcp/http.js +390 -62
- package/lib/mcp/oauth.d.ts +149 -0
- package/lib/mcp/oauth.d.ts.map +1 -0
- package/lib/mcp/oauth.js +396 -0
- package/lib/mcp/protocol.d.ts +46 -7
- package/lib/mcp/protocol.d.ts.map +1 -1
- package/lib/mcp/protocol.js +63 -16
- package/lib/mcp/rate-limit.d.ts +68 -0
- package/lib/mcp/rate-limit.d.ts.map +1 -0
- package/lib/mcp/rate-limit.js +114 -0
- package/lib/mcp/sdk-v2.d.ts +17 -0
- package/lib/mcp/sdk-v2.d.ts.map +1 -0
- package/lib/mcp/sdk-v2.js +181 -0
- package/lib/mcp/server.d.ts +11 -1
- package/lib/mcp/server.d.ts.map +1 -1
- package/lib/mcp/server.js +80 -13
- package/lib/mcp/stdio.d.ts.map +1 -1
- package/lib/mcp/stdio.js +9 -1
- package/lib/mcp/subscriptions.d.ts +43 -1
- package/lib/mcp/subscriptions.d.ts.map +1 -1
- package/lib/mcp/subscriptions.js +90 -9
- package/lib/model-qualification.d.ts +192 -0
- package/lib/model-qualification.d.ts.map +1 -0
- package/lib/model-qualification.js +178 -0
- package/lib/planning.d.ts +246 -0
- package/lib/planning.d.ts.map +1 -0
- package/lib/planning.js +457 -0
- package/lib/prepared-assets.d.ts +178 -0
- package/lib/prepared-assets.d.ts.map +1 -0
- package/lib/prepared-assets.js +286 -0
- package/lib/provider-bridge.d.ts +37 -0
- package/lib/provider-bridge.d.ts.map +1 -1
- package/lib/provider-bridge.js +189 -12
- package/lib/ptc-authority.d.ts +140 -0
- package/lib/ptc-authority.d.ts.map +1 -0
- package/lib/ptc-authority.js +216 -0
- package/lib/ptc-runtime.d.ts +156 -0
- package/lib/ptc-runtime.d.ts.map +1 -0
- package/lib/ptc-runtime.js +191 -0
- package/lib/publication.d.ts +2 -1
- package/lib/publication.d.ts.map +1 -1
- package/lib/publication.js +13 -5
- package/lib/receipt.d.ts.map +1 -1
- package/lib/receipt.js +8 -0
- package/lib/title-proposal.d.ts +194 -0
- package/lib/title-proposal.d.ts.map +1 -0
- package/lib/title-proposal.js +244 -0
- package/lib/tool-mode-run.d.ts +235 -0
- package/lib/tool-mode-run.d.ts.map +1 -0
- package/lib/tool-mode-run.js +283 -0
- package/lib/types.d.ts +3 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/update-surface.d.ts +79 -0
- package/lib/update-surface.d.ts.map +1 -0
- package/lib/update-surface.js +224 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts +38 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/standard.js +445 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts +14 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-embed.js +63 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts +14 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/contracts/text-rerank.js +76 -0
- package/node_modules/@try-works/tool-mode-contracts/lib/dsh.d.ts.map +1 -1
- package/node_modules/@try-works/tool-mode-contracts/lib/dsh.js +69 -55
- package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts +4 -1
- package/node_modules/@try-works/tool-mode-contracts/lib/index.d.ts.map +1 -1
- package/node_modules/@try-works/tool-mode-contracts/lib/index.js +26 -2
- package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts +28 -2
- package/node_modules/@try-works/tool-mode-contracts/lib/registry.d.ts.map +1 -1
- package/node_modules/@try-works/tool-mode-contracts/lib/registry.js +93 -10
- package/node_modules/@try-works/tool-mode-contracts/package.json +0 -1
- package/node_modules/@try-works/tool-mode-extension-sdk/bin/dsh-tool-mode.mjs +20 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts +80 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/cli.js +533 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts +83 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/declarative-recipes.js +125 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts +70 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/discovery.js +201 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts +57 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/errors.js +83 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts +31 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/index.js +31 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts +86 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/archive.js +185 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts +126 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/dependencies.js +297 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts +216 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/lifecycle.js +800 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts +210 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/migration.js +368 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts +63 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/runtime-link.js +149 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts +35 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/source-directory.js +179 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts +179 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/staged.js +235 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts +367 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/store.js +807 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts +185 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/update-flow.js +504 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts +17 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/install/zip-source.js +80 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts +52 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/load.js +102 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts +171 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/manifest.js +271 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts +242 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/runtime.js +58 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts +118 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/state.js +113 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts +2 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker/worker-child.js +351 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts +150 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/lib/worker.js +670 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/package.json +53 -0
- package/node_modules/@try-works/tool-mode-extension-sdk/schema/extension-manifest-1.1.0.schema.json +253 -0
- package/node_modules/@try-works/tool-mode-recipes/bin/tool-mode-recipe.mjs +15 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts +427 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/broker.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/broker.js +592 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts +60 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/cli.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/cli.js +936 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts +237 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/dsh-adapter.js +200 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts +85 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/fixture-provider.js +176 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts +105 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/images.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/images.js +129 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts +25 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/index.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/index.js +25 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts +325 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/recipe-format.js +1310 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts +51 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/templates.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/templates.js +310 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts +227 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/titles.d.ts.map +1 -0
- package/node_modules/@try-works/tool-mode-recipes/lib/titles.js +407 -0
- package/node_modules/@try-works/tool-mode-recipes/package.json +56 -0
- package/node_modules/@try-works/tool-mode-recipes/recipes/describe-image.json +38 -0
- package/node_modules/@try-works/tool-mode-recipes/recipes/text-title.json +45 -0
- package/node_modules/@try-works/tool-mode-recipes/schema/harness-model-recipe.schema.json +273 -0
- package/package.json +43 -15
- package/remote/spec.mjs +439 -0
- package/remote/typert.host.mjs +14 -0
- package/remote/typert.remote-client.mjs +16 -0
- package/lib/adapters/tongue.d.ts +0 -31
- package/lib/adapters/tongue.d.ts.map +0 -1
- package/lib/adapters/tongue.js +0 -93
- package/lib/adapters/voz.d.ts +0 -28
- package/lib/adapters/voz.d.ts.map +0 -1
- package/lib/adapters/voz.js +0 -102
- /package/{lib → node_modules/@try-works/tool-mode-extension-sdk/lib}/licensing.d.ts +0 -0
- /package/{lib → node_modules/@try-works/tool-mode-extension-sdk/lib}/licensing.d.ts.map +0 -0
- /package/{lib → node_modules/@try-works/tool-mode-extension-sdk/lib}/licensing.js +0 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EXT-30 staged update and rollback (slices 1+2 of the approved design,
|
|
3
|
+
* docs/tool-mode/EXT-30-UPDATE-DESIGN.md).
|
|
4
|
+
*
|
|
5
|
+
* The two properties this module exists to enforce:
|
|
6
|
+
*
|
|
7
|
+
* - **Side-by-side, never in place.** A new version is fetched into
|
|
8
|
+
* `staging/`, validated as DATA (manifest, integrity, schema/license/
|
|
9
|
+
* permission deltas, structural-static self-tests), approved by an operator,
|
|
10
|
+
* and only then promoted to its OWN version directory. The currently active
|
|
11
|
+
* version's bytes are never mutated.
|
|
12
|
+
* - **The active version is a POINTER, committed atomically.** The profile
|
|
13
|
+
* state document carries `activeVersions`/`previousVersions` maps written by
|
|
14
|
+
* the store's single atomic writer under the store lock. Rollback restores
|
|
15
|
+
* the pointer; it never copies bytes over a live install, never re-enables
|
|
16
|
+
* disabled tools, never undoes revocations (those facts live beside the
|
|
17
|
+
* pointer and are not touched).
|
|
18
|
+
*
|
|
19
|
+
* A post-commit rebind failure rolls the pointer back AUTOMATICALLY and names
|
|
20
|
+
* the reason. A corrupted version directory fails closed everywhere.
|
|
21
|
+
*
|
|
22
|
+
* Slice 1's self-tests are STRUCTURAL/STATIC only (manifest, referenced files,
|
|
23
|
+
* schema JSON parses): host-executed self-tests arrive with slice 3, and this
|
|
24
|
+
* module never executes extension code.
|
|
25
|
+
*
|
|
26
|
+
* @module @try-works/tool-mode-extension-sdk/install/update-flow
|
|
27
|
+
*/
|
|
28
|
+
import { type ArchiveSource, type InstallLimits, type InstallSource } from './staged.ts';
|
|
29
|
+
/** One schema compatibility finding (EXT-30's schema recheck). */
|
|
30
|
+
export interface SchemaDelta {
|
|
31
|
+
readonly toolName: string;
|
|
32
|
+
readonly file: 'input' | 'output';
|
|
33
|
+
/** True when a pinned composition would silently change meaning. */
|
|
34
|
+
readonly breaking: boolean;
|
|
35
|
+
readonly detail: string;
|
|
36
|
+
}
|
|
37
|
+
/** The staged update's validation report (EXT-30's gates, slice 1). */
|
|
38
|
+
export interface UpdateValidationReport {
|
|
39
|
+
readonly manifestOk: boolean;
|
|
40
|
+
/** The current version the deltas were computed against. */
|
|
41
|
+
readonly comparedAgainst: string;
|
|
42
|
+
readonly schemaDeltas: readonly SchemaDelta[];
|
|
43
|
+
/** Set when the manifest licence declaration changed. */
|
|
44
|
+
readonly licenseDelta?: string;
|
|
45
|
+
/** Permission EXPANSIONS, one entry per expansion (AT-35). */
|
|
46
|
+
readonly permissionDeltas: readonly string[];
|
|
47
|
+
readonly selfTests: {
|
|
48
|
+
readonly kind: 'structural-static';
|
|
49
|
+
readonly passed: boolean;
|
|
50
|
+
readonly detail: string;
|
|
51
|
+
};
|
|
52
|
+
/** True when an operator approval is required before the commit. */
|
|
53
|
+
readonly requiresApproval: boolean;
|
|
54
|
+
}
|
|
55
|
+
/** The outcome of a successful stage (nothing is visible or active yet). */
|
|
56
|
+
export interface UpdateStageResult {
|
|
57
|
+
readonly extensionId: string;
|
|
58
|
+
readonly stagedVersion: string;
|
|
59
|
+
/** Absolute path of the staged extraction (not the installed pool). */
|
|
60
|
+
readonly stagedPath: string;
|
|
61
|
+
readonly report: UpdateValidationReport;
|
|
62
|
+
}
|
|
63
|
+
/** The outcome of a commit (the pointer moved; the old pointer is the rollback target). */
|
|
64
|
+
export interface UpdateCommitResult {
|
|
65
|
+
readonly extensionId: string;
|
|
66
|
+
readonly activeVersion: string;
|
|
67
|
+
readonly previousVersion?: string;
|
|
68
|
+
}
|
|
69
|
+
/** The outcome of a rollback (pointer restore only). */
|
|
70
|
+
export interface UpdateRollbackResult {
|
|
71
|
+
readonly extensionId: string;
|
|
72
|
+
readonly activeVersion: string;
|
|
73
|
+
readonly previousVersion?: string;
|
|
74
|
+
/**
|
|
75
|
+
* The rebindRestored hook's own failure, when it threw or rejected. The hook
|
|
76
|
+
* is a POST-RESTORE observer: its error is reported here, never thrown — the
|
|
77
|
+
* pointer restore has already committed and must not be rolled back again.
|
|
78
|
+
*/
|
|
79
|
+
readonly hookFailure?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Stage an update (EXT-30 slice 1).
|
|
83
|
+
*
|
|
84
|
+
* Fetch → integrity → entry validation → extract into `staging/` → manifest
|
|
85
|
+
* discovery → schema/licence/permission deltas against the current version →
|
|
86
|
+
* structural-static self-tests. A BREAKING schema delta or an unparseable
|
|
87
|
+
* schema REFUSES the stage (the staged directory is removed); a licence or
|
|
88
|
+
* permission delta only marks the stage as requiring approval. The installed
|
|
89
|
+
* version is never touched.
|
|
90
|
+
*
|
|
91
|
+
* @param options - the source, store, injected archive source, and limits.
|
|
92
|
+
* @returns the staged update and its validation report.
|
|
93
|
+
* @throws ManagementError for every rejection path.
|
|
94
|
+
*/
|
|
95
|
+
export declare function stageUpdate(options: {
|
|
96
|
+
readonly storeDir: string;
|
|
97
|
+
readonly source: InstallSource;
|
|
98
|
+
readonly archive: ArchiveSource;
|
|
99
|
+
readonly expectedSha512?: string;
|
|
100
|
+
/** The comparison base; defaults to the highest recorded version. */
|
|
101
|
+
readonly currentVersion?: string;
|
|
102
|
+
readonly limits?: InstallLimits;
|
|
103
|
+
}): Promise<UpdateStageResult>;
|
|
104
|
+
/**
|
|
105
|
+
* Record ONE operator approval decision for a staged update (EXT-30).
|
|
106
|
+
*
|
|
107
|
+
* The record is retained for the store's lifetime and is write-once per staged
|
|
108
|
+
* version (see {@link ExtensionStore.recordApproval}).
|
|
109
|
+
* @param options - the store, the staged identity, and the decision.
|
|
110
|
+
*/
|
|
111
|
+
export declare function recordApproval(options: {
|
|
112
|
+
readonly storeDir: string;
|
|
113
|
+
readonly extensionId: string;
|
|
114
|
+
readonly stagedVersion: string;
|
|
115
|
+
readonly decision: {
|
|
116
|
+
approved: true;
|
|
117
|
+
} | {
|
|
118
|
+
approved: false;
|
|
119
|
+
reason: string;
|
|
120
|
+
};
|
|
121
|
+
}): void;
|
|
122
|
+
/**
|
|
123
|
+
* Commit a staged, approved update (EXT-30, two-phase seam).
|
|
124
|
+
*
|
|
125
|
+
* Under the store lock, in order: verify the approval → verify the staged
|
|
126
|
+
* bytes (digest re-check, fail-closed) → verify the CURRENT active version's
|
|
127
|
+
* directory (fail-closed) → admit the staged version to its OWN version
|
|
128
|
+
* directory (never the live one) → **quiescePrevious** (the host stops
|
|
129
|
+
* old-generation admissions BEFORE the pointer moves; a failure aborts the
|
|
130
|
+
* commit with the pointer unchanged) → commit the pointer atomically via the
|
|
131
|
+
* profile-state writer → **rebindNext** (the host republishes the new
|
|
132
|
+
* generation; a failure rolls the pointer back AUTOMATICALLY and names the
|
|
133
|
+
* reason).
|
|
134
|
+
*
|
|
135
|
+
* REBIND-REVERT CONTRACT: the automatic rollback after a rebindNext failure
|
|
136
|
+
* runs NO further hooks — quiescePrevious is not re-run and no restore hook
|
|
137
|
+
* fires. A host whose rebind needs its own revert must supply it INSIDE its
|
|
138
|
+
* all-or-nothing rebindNext wrapper; the SDK never re-enters host hooks.
|
|
139
|
+
*
|
|
140
|
+
* NO-SEAM REFUSAL: a commit with no rebindNext REFUSES by default (the durable
|
|
141
|
+
* pointer must not advance while nothing republishes the surface). Pass
|
|
142
|
+
* `pointerOnly: true` as the explicit, documented deployment opt-out.
|
|
143
|
+
*
|
|
144
|
+
* @param options - the store, profile, staged identity, and the two-phase hooks.
|
|
145
|
+
* @returns the committed pointer and the previous one.
|
|
146
|
+
* @throws ManagementError for every rejection path.
|
|
147
|
+
*/
|
|
148
|
+
export declare function commitUpdate(options: {
|
|
149
|
+
readonly storeDir: string;
|
|
150
|
+
readonly profile: string;
|
|
151
|
+
readonly extensionId: string;
|
|
152
|
+
readonly stagedVersion: string;
|
|
153
|
+
/** Explicit opt-out: commit the pointer with NO hooks (deployment tooling only). */
|
|
154
|
+
readonly pointerOnly?: boolean;
|
|
155
|
+
readonly hooks?: {
|
|
156
|
+
/** Runs under the store lock BEFORE the pointer write; a failure aborts the commit. */
|
|
157
|
+
readonly quiescePrevious?: (previousVersion: string) => Promise<void>;
|
|
158
|
+
/** Runs AFTER the pointer write; a failure auto-rolls the pointer back. */
|
|
159
|
+
readonly rebindNext?: (stagedVersion: string) => Promise<void>;
|
|
160
|
+
};
|
|
161
|
+
}): Promise<UpdateCommitResult>;
|
|
162
|
+
/**
|
|
163
|
+
* Roll back one extension to its previous active version (EXT-30 slice 2).
|
|
164
|
+
*
|
|
165
|
+
* POINTER RESTORE ONLY: no bytes are copied over any live install, disabled
|
|
166
|
+
* tools stay disabled, revocations stay revoked (those facts live in the
|
|
167
|
+
* profile state beside the pointer). The previous version's directory is
|
|
168
|
+
* verified first; a corrupt previous version refuses the rollback (quarantine,
|
|
169
|
+
* the current pointer stays).
|
|
170
|
+
*
|
|
171
|
+
* The optional `rebindRestored` hook (the host's republish of the restored
|
|
172
|
+
* generation) runs AFTER the pointer restore. Its failure is REPORTED on the
|
|
173
|
+
* result as `hookFailure` — the restore stands and no second rollback runs.
|
|
174
|
+
*
|
|
175
|
+
* @param options - the store, profile, extension, and the optional restore hook.
|
|
176
|
+
* @returns the restored pointer.
|
|
177
|
+
*/
|
|
178
|
+
export declare function rollback(options: {
|
|
179
|
+
readonly storeDir: string;
|
|
180
|
+
readonly profile: string;
|
|
181
|
+
readonly extensionId: string;
|
|
182
|
+
/** Runs AFTER the pointer restore; a failure is reported, never rolled back again. */
|
|
183
|
+
readonly rebindRestored?: (restoredVersion: string) => Promise<void>;
|
|
184
|
+
}): Promise<UpdateRollbackResult>;
|
|
185
|
+
//# sourceMappingURL=update-flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-flow.d.ts","sourceRoot":"","sources":["../../src/install/update-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AASH,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAA0B,MAAM,aAAa,CAAA;AAEhI,kEAAkE;A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