@try-works/dsh-model-as-tool 0.3.6 → 0.4.0

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.
@@ -50,8 +50,8 @@
50
50
  */
51
51
  import { accessSync, constants, existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
52
52
  import { dirname, join, resolve } from 'node:path';
53
- import { digestInstalledContent, discoverExtension, ExtensionStore, ManagementError, stagedInstallFromDirectory, } from '@try-works/tool-mode-extension-sdk';
54
- import { createFirstPartyDependencyGraph, resolveFirstPartyDependency } from "./extension-dependencies.js";
53
+ import { createTarGzipArchiveSource, digestInstalledContent, discoverExtension, ExtensionStore, ManagementError, stagedInstall, stagedInstallFromDirectory, } from '@try-works/tool-mode-extension-sdk';
54
+ import { createFirstPartyDependencyGraph, createRegistryDependencyGraph, createRegistrySession, DEFAULT_REGISTRY_URL, MAX_DEPENDENCY_ARCHIVE_BYTES, RegistryError, resolveFirstPartyDependency, } from "./extension-dependencies.js";
55
55
  import { createHttpSource } from "./http-acquisition.js";
56
56
  /**
57
57
  * The readiness values that permit activation (the SDK's callable set).
@@ -645,23 +645,42 @@ export class ExtensionsService {
645
645
  else {
646
646
  requirements.push(requirement('store', true, `the extension store at ${input.storeDir} is configured and readable`));
647
647
  }
648
- // SOURCE: the package bytes an install would copy, or the installed copy.
648
+ // SOURCE: where an install would get the bytes. The registry route is preferred
649
+ // by `auto`; the directory route (developer mode) is named when it applies.
649
650
  if (input.installed) {
650
651
  requirements.push(requirement('source', true, `the installed copy is the source of record (version ${input.record?.version ?? 'unknown'})`));
651
652
  }
652
- else if (input.sourcePackage === undefined) {
653
- requirements.push(requirement('source', false, input.sourceDir === ''
654
- ? 'not installed, and no first-party source directory is configured (config.extensionSourceDir)'
655
- : `no first-party package with this identity exists under ${input.sourceDir}`, input.sourceDir === '' ? 'config' : 'none'));
656
- }
657
- else if (input.sourcePackage.problem !== null) {
658
- requirements.push(requirement('source', false, input.sourcePackage.problem, 'none'));
659
- }
660
- else if (this.#options.allowSourceDirectories !== true) {
661
- requirements.push(requirement('source', false, 'installing from a source directory is disabled by configuration (extensions.allowSourceDirectories)', 'config'));
662
- }
663
653
  else {
664
- requirements.push(requirement('source', true, `the first-party package is available at ${join(input.sourceDir, packageDirFor(input.id))}`, 'install'));
654
+ const installSource = this.#options.installSource ?? 'auto';
655
+ const registryUrl = this.#registryBaseUrl();
656
+ const directoryRoute = input.sourceDir !== ''
657
+ && input.sourcePackage !== undefined
658
+ && input.sourcePackage.problem === null
659
+ && this.#options.allowSourceDirectories === true;
660
+ const registryRoute = installSource !== 'directory' && registryUrl !== '';
661
+ if (registryRoute) {
662
+ requirements.push(requirement('source', true, `the npm registry ${registryUrl} can supply ${input.id}@latest, resolved and sha512-verified at install time`
663
+ + (installSource === 'auto' && directoryRoute
664
+ ? '; a directory fallback is available if the registry is unreachable'
665
+ : ''), 'install'));
666
+ }
667
+ else if (installSource === 'registry') {
668
+ requirements.push(requirement('source', false, 'no npm registry is configured (config.extensionRegistry), and registry-only installs are selected (config.extensionInstallSource)', 'config'));
669
+ }
670
+ else if (input.sourcePackage === undefined) {
671
+ requirements.push(requirement('source', false, input.sourceDir === ''
672
+ ? 'not installed, and no first-party source directory is configured (config.extensionSourceDir)'
673
+ : `no first-party package with this identity exists under ${input.sourceDir}`, input.sourceDir === '' ? 'config' : 'none'));
674
+ }
675
+ else if (input.sourcePackage.problem !== null) {
676
+ requirements.push(requirement('source', false, input.sourcePackage.problem, 'none'));
677
+ }
678
+ else if (this.#options.allowSourceDirectories !== true) {
679
+ requirements.push(requirement('source', false, 'installing from a source directory is disabled by configuration (extensions.allowSourceDirectories)', 'config'));
680
+ }
681
+ else {
682
+ requirements.push(requirement('source', true, `the first-party package is available at ${join(input.sourceDir, packageDirFor(input.id))}`, 'install'));
683
+ }
665
684
  }
666
685
  // DEPENDENCIES: declared runtime dependencies must be resolvable/materialized.
667
686
  requirements.push(this.#dependencyRequirement(input));
@@ -978,15 +997,12 @@ export class ExtensionsService {
978
997
  if (!view.installed) {
979
998
  if (view.sourcePackage?.problem !== null && view.sourcePackage?.problem !== undefined)
980
999
  return view.sourcePackage.problem;
981
- if (view.sourceDir === '') {
982
- return 'not installed, and no first-party source directory is configured (config.extensionSourceDir)';
983
- }
984
- if (this.#options.allowSourceDirectories !== true) {
985
- return 'not installed; installing from a source directory is disabled by configuration (extensions.allowSourceDirectories)';
986
- }
987
- return view.sourcePackage === undefined
988
- ? 'not installed, and no first-party package with this identity exists under the configured source directory'
989
- : `not installed; the first-party package is available at ${join(view.sourceDir, packageDirFor(view.id))}`;
1000
+ // The route-aware source requirement already explains where an install would
1001
+ // get the bytes (registry, directory, or why neither is available).
1002
+ const sourceRequirement = view.requirements.find(candidate => candidate.kind === 'source');
1003
+ if (sourceRequirement !== undefined)
1004
+ return sourceRequirement.reason;
1005
+ return 'not installed';
990
1006
  }
991
1007
  if (unmet !== undefined)
992
1008
  return unmet.reason;
@@ -997,6 +1013,165 @@ export class ExtensionsService {
997
1013
  }
998
1014
  return null;
999
1015
  }
1016
+ /**
1017
+ * Install one extension, choosing the route from the operator configuration.
1018
+ *
1019
+ * - An EXPLICIT `source` path is always a developer-mode directory install (the
1020
+ * existing source-directory gate and refusals apply).
1021
+ * - Otherwise `installSource` decides. `registry` resolves `id@latest` from the
1022
+ * npm registry. `directory` uses the configured source directory. `auto` (the
1023
+ * default) prefers the registry and falls back to the directory ONLY for a
1024
+ * transport-level registry failure (unreachable/timeout/5xx) when directory
1025
+ * installs are allowed — a package-level refusal (404, missing integrity, bad
1026
+ * tarball, digest mismatch) is always named and never retried locally.
1027
+ *
1028
+ * INSTALLATION IS NOT ACTIVATION: the result is always `active: false`, and it
1029
+ * names the route that actually supplied the bytes.
1030
+ * @param extensionId - the package identity to install.
1031
+ * @param source - an explicit source directory (developer override), or absent.
1032
+ * @param signal - cancellation.
1033
+ * @returns the installed identity, version and route.
1034
+ * @throws ExtensionsServiceError for every refusal and failure.
1035
+ */
1036
+ async install(extensionId, source, signal) {
1037
+ signal?.throwIfAborted();
1038
+ assertUsableId(extensionId);
1039
+ const storeDir = this.#requireStoreDir();
1040
+ if (source !== undefined && source.trim().length > 0) {
1041
+ return this.#installFromDirectory(extensionId, resolve(source), storeDir, signal);
1042
+ }
1043
+ const mode = this.#options.installSource ?? 'auto';
1044
+ if (mode === 'directory') {
1045
+ return this.#installFromDirectory(extensionId, undefined, storeDir, signal);
1046
+ }
1047
+ try {
1048
+ return await this.#installFromRegistry(extensionId, storeDir, signal);
1049
+ }
1050
+ catch (error) {
1051
+ const transportFallback = mode === 'auto'
1052
+ && error instanceof ExtensionsServiceError
1053
+ && (error.code === 'extension-registry-unavailable' || error.code === 'extension-registry-unconfigured')
1054
+ && this.#options.allowSourceDirectories === true
1055
+ && this.#directorySourceAvailable(extensionId);
1056
+ if (!transportFallback)
1057
+ throw error;
1058
+ return this.#installFromDirectory(extensionId, undefined, storeDir, signal);
1059
+ }
1060
+ }
1061
+ /** The configured registry base URL, trimmed ('' when the operator set it empty). */
1062
+ #registryBaseUrl() {
1063
+ return (this.#options.registryUrl ?? DEFAULT_REGISTRY_URL).trim();
1064
+ }
1065
+ /** Whether the configured source directory holds a package directory for this id. */
1066
+ #directorySourceAvailable(extensionId) {
1067
+ const sourceDir = this.#sourceDir();
1068
+ if (sourceDir === '')
1069
+ return false;
1070
+ try {
1071
+ return statSync(join(sourceDir, packageDirFor(extensionId))).isDirectory();
1072
+ }
1073
+ catch {
1074
+ return false;
1075
+ }
1076
+ }
1077
+ /**
1078
+ * Map a registry failure onto this service's named codes.
1079
+ * @param error - an error from the registry session or the SDK install.
1080
+ * @returns the service refusal, preserving the message and cause.
1081
+ */
1082
+ #mapRegistryFailure(error) {
1083
+ if (!(error instanceof RegistryError)) {
1084
+ return new ExtensionsServiceError('extension-install-failed', messageOf(error), { cause: error });
1085
+ }
1086
+ const codes = {
1087
+ 'registry-not-configured': 'extension-registry-unconfigured',
1088
+ 'registry-not-found': 'extension-registry-not-found',
1089
+ 'registry-no-matching-version': 'extension-registry-not-found',
1090
+ 'registry-integrity-missing': 'extension-registry-integrity-missing',
1091
+ 'registry-invalid-metadata': 'extension-registry-invalid-metadata',
1092
+ 'registry-tarball-fetch-failed': 'extension-registry-fetch-failed',
1093
+ 'registry-tarball-too-large': 'extension-registry-fetch-failed',
1094
+ 'registry-unavailable': 'extension-registry-unavailable',
1095
+ };
1096
+ return new ExtensionsServiceError(codes[error.code], error.message, { cause: error });
1097
+ }
1098
+ /**
1099
+ * Install the extension package from the npm registry (task-104).
1100
+ *
1101
+ * The registry metadata is resolved to one exact version with a sha512 integrity;
1102
+ * the tarball is fetched bounded, verified by `stagedInstall` BEFORE extraction,
1103
+ * and installed through the SDK's tar-gzip ArchiveSource. The extension's runtime
1104
+ * dependencies are resolved from the SAME registry through the SDK dependency
1105
+ * graph (never the host-tree resolver), and EXT-10's install-script refusal is the
1106
+ * SDK's own.
1107
+ * @param extensionId - the package identity to install.
1108
+ * @param storeDir - the configured store.
1109
+ * @param signal - cancellation.
1110
+ * @returns the installed identity/version and `source: 'registry'`.
1111
+ * @throws ExtensionsServiceError for every refusal.
1112
+ */
1113
+ async #installFromRegistry(extensionId, storeDir, signal) {
1114
+ const registryUrl = this.#registryBaseUrl();
1115
+ if (registryUrl === '') {
1116
+ throw new ExtensionsServiceError('extension-registry-unconfigured', 'no npm registry is configured (config.extensionRegistry), so registry installs are unavailable');
1117
+ }
1118
+ const session = createRegistrySession({
1119
+ registryUrl,
1120
+ archiveFactory: createTarGzipArchiveSource,
1121
+ maxTarballBytes: this.#options.registryTarballMaxBytes ?? MAX_DEPENDENCY_ARCHIVE_BYTES,
1122
+ });
1123
+ let resolved;
1124
+ try {
1125
+ // Initial slice: the Settings page does not carry a version yet, so the
1126
+ // configured route installs the registry's `latest` dist-tag. Exact versions
1127
+ // and semver ranges are supported by the resolver itself (dependency ranges
1128
+ // use them); a wire version field is a later slice.
1129
+ resolved = await session.resolve(extensionId, 'latest', signal);
1130
+ }
1131
+ catch (error) {
1132
+ throw this.#mapRegistryFailure(error);
1133
+ }
1134
+ let installed;
1135
+ try {
1136
+ installed = await stagedInstall({
1137
+ source: { kind: 'registry', requested: `${extensionId}@${resolved.version}` },
1138
+ storeDir,
1139
+ expectedSha512: resolved.integrity,
1140
+ archive: session.archive,
1141
+ // Registry metadata recorded AS DATA, never as trust: the bytes are
1142
+ // verified against the same sha512 before anything is extracted.
1143
+ provenance: { registryIntegrity: resolved.integrity },
1144
+ dependencies: createRegistryDependencyGraph(session),
1145
+ });
1146
+ }
1147
+ catch (error) {
1148
+ if (error instanceof RegistryError)
1149
+ throw this.#mapRegistryFailure(error);
1150
+ if (error instanceof ManagementError) {
1151
+ if (error.code === 'INTEGRITY_MISMATCH') {
1152
+ throw new ExtensionsServiceError('extension-registry-integrity-mismatch', `${extensionId}@${resolved.version}: ${error.message}`, { cause: error });
1153
+ }
1154
+ if (error.code === 'DEPENDENCY_UNSATISFIED') {
1155
+ throw new ExtensionsServiceError('extension-dependency-unsatisfied', `[DEPENDENCY_UNSATISFIED] ${error.message}`, { cause: error });
1156
+ }
1157
+ throw new ExtensionsServiceError('extension-install-failed', `[${error.code}] ${error.message}`, { cause: error });
1158
+ }
1159
+ throw new ExtensionsServiceError('extension-install-failed', messageOf(error), { cause: error });
1160
+ }
1161
+ if (installed.extensionId !== extensionId) {
1162
+ throw new ExtensionsServiceError('extension-source-mismatch', `the registry tarball requested as ${extensionId}@${resolved.version} contains ${JSON.stringify(installed.extensionId)}`);
1163
+ }
1164
+ if (installed.archiveDigest.trim().length === 0) {
1165
+ throw new ExtensionsServiceError('extension-digest-unavailable', `${installed.extensionId}@${installed.version} was installed without a content digest, so it cannot be verified before activation`);
1166
+ }
1167
+ return {
1168
+ id: installed.extensionId,
1169
+ version: installed.version,
1170
+ active: false,
1171
+ source: 'registry',
1172
+ resolvedVersion: resolved.version,
1173
+ };
1174
+ }
1000
1175
  /**
1001
1176
  * Install one extension from a local source directory (EXT-06 developer mode).
1002
1177
  *
@@ -1006,21 +1181,17 @@ export class ExtensionsService {
1006
1181
  * digested. The SDK then copies, validates, verifies and records the install; a
1007
1182
  * failure there is re-thrown as `extension-install-failed` with the SDK's own
1008
1183
  * named code in the message.
1009
- *
1010
- * INSTALLATION IS NOT ACTIVATION: the result is always `active: false`.
1011
1184
  * @param extensionId - the package identity to install.
1012
- * @param source - an explicit source directory, or absent to use the configured one.
1185
+ * @param explicitSource - an explicit source directory, or undefined for the configured one.
1186
+ * @param storeDir - the configured store.
1013
1187
  * @param signal - cancellation.
1014
- * @returns the installed identity and version.
1188
+ * @returns the installed identity/version and `source: 'directory'`.
1015
1189
  * @throws ExtensionsServiceError for every refusal and failure.
1016
1190
  */
1017
- async install(extensionId, source, signal) {
1191
+ async #installFromDirectory(extensionId, explicitSource, storeDir, signal) {
1018
1192
  signal?.throwIfAborted();
1019
- assertUsableId(extensionId);
1020
- const storeDir = this.#requireStoreDir();
1021
- const sourceDir = source !== undefined && source.trim().length > 0
1022
- ? resolve(source)
1023
- : (() => {
1193
+ const sourceDir = explicitSource
1194
+ ?? (() => {
1024
1195
  const configured = this.#sourceDir();
1025
1196
  if (configured === '') {
1026
1197
  throw new ExtensionsServiceError('extension-source-unconfigured', `no source was given for ${extensionId} and no first-party source directory is configured (config.extensionSourceDir)`);
@@ -1065,10 +1236,9 @@ export class ExtensionsService {
1065
1236
  storeDir,
1066
1237
  allowSourceDirectories: true,
1067
1238
  /**
1068
- * The dependency graph is supplied only on this developer-mode path. It is
1069
- * consulted by the SDK only when the package declares runtime dependencies;
1070
- * every declared dependency is then resolved from the host's own installed
1071
- * tree or the install fails with a named DEPENDENCY_UNSATISFIED reason.
1239
+ * The host-tree dependency graph is supplied only on this developer-mode
1240
+ * path. Registry installs resolve dependencies from the registry instead
1241
+ * (never from the host's tree).
1072
1242
  */
1073
1243
  dependencies: this.#dependencyGraph(sourceDir),
1074
1244
  });
@@ -1083,7 +1253,13 @@ export class ExtensionsService {
1083
1253
  if (installed.archiveDigest.trim().length === 0) {
1084
1254
  throw new ExtensionsServiceError('extension-digest-unavailable', `${installed.extensionId}@${installed.version} was installed without a content digest, so it cannot be verified before activation`);
1085
1255
  }
1086
- return { id: installed.extensionId, version: installed.version, active: false };
1256
+ return {
1257
+ id: installed.extensionId,
1258
+ version: installed.version,
1259
+ active: false,
1260
+ source: 'directory',
1261
+ resolvedVersion: installed.version,
1262
+ };
1087
1263
  }
1088
1264
  /**
1089
1265
  * Activate an installed extension and clear its disabled override.
package/lib/index.d.ts CHANGED
@@ -132,6 +132,27 @@ export interface Config {
132
132
  * the tree rather than linking it, and the installation lands INACTIVE.
133
133
  */
134
134
  extensionSourceDir?: string;
135
+ /**
136
+ * How an install with no explicit source directory gets its package bytes.
137
+ *
138
+ * - `registry`: resolve the package from the npm registry (`extensionRegistry`),
139
+ * verify the registry-declared sha512 and install the tarball.
140
+ * - `directory`: the developer-mode source-directory path above.
141
+ * - `auto` (default): prefer the registry; fall back to the source directory
142
+ * ONLY when the registry is unreachable (transport/timeout/5xx/unconfigured)
143
+ * and `extensions.allowSourceDirectories` is on. A package-level registry
144
+ * refusal (404, missing integrity, bad tarball, digest mismatch) is always a
145
+ * named error and is NEVER silently retried against a local directory.
146
+ */
147
+ extensionInstallSource?: 'registry' | 'directory' | 'auto';
148
+ /**
149
+ * The npm registry registry installs resolve against. Defaults to the public
150
+ * npm registry; set it empty to disable the registry route (directory installs
151
+ * still need `extensions.allowSourceDirectories`).
152
+ */
153
+ extensionRegistry?: string;
154
+ /** Hard cap on one registry package tarball download. Default 256 MiB. */
155
+ extensionTarballMaxBytes?: number;
135
156
  /**
136
157
  * Operator gate: allow dependency content that arrived already materialized.
137
158
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,C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AS,aAAa,EAAE,GAAG,eAAe,EAAE,CAgBpF;AAkCD,wBAAsB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA6nG5E;AAED,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AACrH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACtE,OAAO,EACL,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,KAAK,gBAAgB,GACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AACxF,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,UAAU,GAChB,MAAM,YAAY,CAAA;AACnB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAA"}
package/lib/index.js CHANGED
@@ -93,6 +93,16 @@ export const Config = z.object({
93
93
  * Empty by default: a deployment with no first-party source advertises none.
94
94
  */
95
95
  extensionSourceDir: z.string().default(''),
96
+ /**
97
+ * Install route for the Settings page: registry, directory, or auto (registry
98
+ * first, directory only for a transport failure when directory installs are
99
+ * allowed). Default auto.
100
+ */
101
+ extensionInstallSource: z.union([z.const('registry'), z.const('directory'), z.const('auto')]).default('auto'),
102
+ /** npm registry base URL; empty disables the registry route. Default: public npm. */
103
+ extensionRegistry: z.string().default('https://registry.npmjs.org/'),
104
+ /** Hard cap on one registry tarball download, in bytes. Default 256 MiB. */
105
+ extensionTarballMaxBytes: z.number().min(1).default(256 * 1024 * 1024),
96
106
  allowPreinstalledDependencies: z.boolean().default(false),
97
107
  preinstalledDependenciesRoot: z.string().default(''),
98
108
  /**
@@ -354,6 +364,15 @@ export async function apply(ctx, config = {}) {
354
364
  storeDir: config.extensionStore ?? '',
355
365
  sourceDir: config.extensionSourceDir ?? '',
356
366
  allowSourceDirectories: config.extensions?.allowSourceDirectories === true,
367
+ /**
368
+ * Registry installs (task-104). `auto` prefers the registry and uses the
369
+ * developer-mode directory only as a TRANSPORT-failure fallback when the
370
+ * source-directory gate is on; package-level registry refusals are named and
371
+ * never retried locally.
372
+ */
373
+ installSource: config.extensionInstallSource ?? 'auto',
374
+ registryUrl: config.extensionRegistry ?? 'https://registry.npmjs.org/',
375
+ registryTarballMaxBytes: config.extensionTarballMaxBytes ?? 256 * 1024 * 1024,
357
376
  /**
358
377
  * The operator gate for already-materialized dependencies. OFF by default:
359
378
  * a dependency whose package.json declares install-time scripts still
@@ -20,6 +20,7 @@ export { digestInstalledContent, ExtensionStore, LOCK_FILE, type InstalledRecord
20
20
  export { commitUpdate, recordApproval, rollback, stageUpdate, type SchemaDelta, type UpdateCommitResult, type UpdateRollbackResult, type UpdateStageResult, type UpdateValidationReport, } from './install/update-flow.ts';
21
21
  export { installDependencyGraph, refuseInstallScripts, type DependencyContent, type DependencyResolver, type InstallDependencyGraph, type LockedDependency, } from './install/dependencies.ts';
22
22
  export { stagedInstallFromDirectory } from './install/source-directory.ts';
23
+ export { createTarGzipArchiveSource, type TarGzipLimits } from './install/tar-gzip-source.ts';
23
24
  export { LEGACY_MODEL_MIGRATIONS, STATE_SCHEMA_VERSION, STATE_VERSION, applyLegacyChoices, parseLegacyModelState, type AppliedMigration, type LegacyModelMigration, type LegacyModelState, type LegacyParseResult, type MigratedAssetRecord, type MigrationEntry, type MigrationEntryKind, type MigrationOutcome, type MigrationReport, } from './install/migration.ts';
24
25
  export { assessReadiness, DEFAULT_STOP_GRACE_MS, ExtensionLifecycle, type ActivationDiagnostic, type ActivationResult, type Contribution, type ContributionRegistrar, type DeactivationResult, } from './install/lifecycle.ts';
25
26
  export { assertNoReservedMeta, defineExtension, EXTENSION_API_VERSION, RESERVED_META_FIELD, type DisposeReason, type ExtensionContextV1, type ExtensionInstanceV1, type ExtensionLoggerV1, type ExtensionStorageV1, type InvocationContextV1, type JsonObject, type JsonValue, type ModelProviderV1, type PreparedAssetMapV1, type ProviderInspectionV1, type ToolModeExtensionV1, } from './runtime.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAA;A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AAK,oBAAoB,EACzB,KAAK,YAAY,GAClB,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,aAAa,GACnB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,SAAS,EACT,KAAK,eAAe,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U,EACf,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,cAAc,CAAA;AAErB,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,SAAS,EACT,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,KAAK,EACV,KAAK,UAAU,GAChB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,iCAAiC,EACjC,wBAAwB,EACxB,KAAK,gBAAgB,GACtB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EACL,sBAAsB,EACtB,WAAW,EACX,KAAK,oBAAoB,EACzB,KAAK,YAAY,GAClB,MAAM,aAAa,CAAA"}
@@ -20,6 +20,7 @@ export { digestInstalledContent, ExtensionStore, LOCK_FILE, } from "./install/st
20
20
  export { commitUpdate, recordApproval, rollback, stageUpdate, } from "./install/update-flow.js";
21
21
  export { installDependencyGraph, refuseInstallScripts, } from "./install/dependencies.js";
22
22
  export { stagedInstallFromDirectory } from "./install/source-directory.js";
23
+ export { createTarGzipArchiveSource } from "./install/tar-gzip-source.js";
23
24
  export { LEGACY_MODEL_MIGRATIONS, STATE_SCHEMA_VERSION, STATE_VERSION, applyLegacyChoices, parseLegacyModelState, } from "./install/migration.js";
24
25
  export { assessReadiness, DEFAULT_STOP_GRACE_MS, ExtensionLifecycle, } from "./install/lifecycle.js";
25
26
  export { assertNoReservedMeta, defineExtension, EXTENSION_API_VERSION, RESERVED_META_FIELD, } from "./runtime.js";
@@ -1 +1 @@
1
- {"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../src/install/archive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,iCAAiC;AACjC,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAA;AAE5E,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,mEAAmE;IACnE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;IAC/B,4EAA4E;IAC5E,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CACjC;AAED,+DAA+D;AAC/D,MAAM,WAAW,aAAa;IAC5B,iCAAiC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,wCAAwC;IACxC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;CACnC;AAED,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,EAAE,aAKpC,CAAA;AAiDD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,MAAM,GAAE,aAAsC,GAC7C,MAAM,EAAE,CA4FV;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAoBhE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB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AG,MAAM,CAwBjF"}
@@ -171,12 +171,18 @@ export function findPackageRoot(paths) {
171
171
  */
172
172
  export function verifyIntegrity(bytes, expectedSha512) {
173
173
  const digest = createHash('sha512').update(bytes).digest('hex');
174
- const expected = expectedSha512.trim().toLowerCase().replace(/^sha512-/, '');
175
- // Accept base64 as well as hex, because registry metadata uses base64 while a
176
- // manifest is easier to read in hex; compare on the decoded form.
177
- const expectedHex = /^[0-9a-f]+$/.test(expected)
178
- ? expected
179
- : Buffer.from(expected, 'base64').toString('hex');
174
+ // Strip the optional SRI prefix and trim, but do NOT lowercase before the
175
+ // format decision: base64 is CASE-SENSITIVE (npm's dist.integrity is base64
176
+ // SRI), so lowercasing first corrupts a correct digest. npm's base64 SRI for
177
+ // a SHA-512 always carries '=' padding, which hex never does — that is the
178
+ // deterministic discriminator, and the hex arm is lowercased only after it
179
+ // is recognized as hex.
180
+ const stripped = expectedSha512.trim().replace(/^sha512-/, '');
181
+ const expectedHex = stripped.includes('=')
182
+ ? Buffer.from(stripped, 'base64').toString('hex')
183
+ : /^[0-9a-f]+$/i.test(stripped)
184
+ ? stripped.toLowerCase()
185
+ : Buffer.from(stripped, 'base64').toString('hex');
180
186
  if (digest !== expectedHex) {
181
187
  throw new ManagementError('INTEGRITY_MISMATCH', 'install', 'the fetched archive does not match its declared SHA-512', 'Do not retry blindly: re-fetch from the declared source and confirm the expected digest with the publisher.');
182
188
  }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * A real, npm-tarball-backed {@link ArchiveSource} (gzip + POSIX tar).
3
+ *
4
+ * npm publishes `.tgz` files; the ZIP reader cannot serve them. This reader
5
+ * applies the SAME defense discipline as the ZIP path, plus the inflate-time
6
+ * bound that a zip bomb's metadata makes unnecessary there:
7
+ *
8
+ * - gzip inflation is STREAMED under a byte cap (the cap fires BEFORE the
9
+ * inflated payload is allocated), then the expansion ratio is checked;
10
+ * - tar headers are parsed per block (regular/directory/symlink/hardlink, GNU
11
+ * longname 'L'/'K', pax 'x'/'g' path records); symlinks and hardlinks are
12
+ * reported as links so the entry-list validator REFUSES them — never resolved;
13
+ * - the entry list then flows through the shared `validateArchiveEntries`
14
+ * defenses (traversal, absolute paths, Windows device names, duplicates,
15
+ * case collisions, count/byte/ratio caps) exactly like the ZIP reader;
16
+ * - npm roots everything under `package/`: that one leading segment is
17
+ * stripped, the bare `package` directory entry is ignored, and a MIXED
18
+ * layout (entries both under and outside `package/`) is refused as
19
+ * ambiguous rather than guessed at;
20
+ * - truncation and malformed headers refuse with named codes.
21
+ *
22
+ * Like the ZIP reader, it carries no fetcher of its own: a caller supplies
23
+ * the tarball bytes (a host wraps its registry transport), and a test
24
+ * supplies bytes directly.
25
+ *
26
+ * @module @try-works/tool-mode-extension-sdk/install/tar-gzip-source
27
+ */
28
+ import type { ArchiveSource, InstallSource } from './staged.ts';
29
+ /** Bounds for the inflate side of a tarball. */
30
+ export interface TarGzipLimits {
31
+ /** Maximum inflated bytes, enforced DURING inflation before allocation. */
32
+ readonly maxInflatedBytes: number;
33
+ /** Maximum inflated-to-compressed ratio, checked before the payload is kept. */
34
+ readonly maxExpansionRatio: number;
35
+ }
36
+ /**
37
+ * Build an {@link ArchiveSource} over npm `.tgz` (gzip+tar) bytes.
38
+ *
39
+ * @param fetchBytes - the tarball transport; absent, `fetch` refuses (the SDK
40
+ * carries no network stack — a host supplies its registry fetch).
41
+ * @param limits - inflate-time bounds, mirroring the shared archive defaults.
42
+ */
43
+ export declare function createTarGzipArchiveSource(fetchBytes?: (source: InstallSource) => Promise<Uint8Array>, limits?: TarGzipLimits): ArchiveSource;
44
+ //# sourceMappingURL=tar-gzip-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tar-gzip-source.d.ts","sourceRoot":"","sources":["../../src/install/tar-gzip-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAOH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAc/D,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,gFAAgF;IAChF,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;CACnC;AA2LD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,UAAU,CAAC,EAC3D,MAAM,GAAE,aAAuC,GAC9C,aAAa,CAkCf"}