@tangle-network/agent-profile-materialize 1.1.122 → 1.1.124

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/dist/index.d.ts CHANGED
@@ -222,6 +222,8 @@ interface WorkspacePlanApplication {
222
222
  spawn: WorkspacePlanSpawnInputs;
223
223
  /** Resolved generated files intentionally consumed in memory by the runtime. */
224
224
  runtimeOnlyFiles: Record<string, string>;
225
+ /** With `secretFileSlotReferences`: each secret-bearing file's bytes, which hold references only. */
226
+ secretSlotFiles?: Record<string, string>;
225
227
  }
226
228
  /** The plan was applied, but one or more private staging files remain. */
227
229
  declare class WorkspacePlanCleanupError extends AggregateError {
@@ -253,8 +255,8 @@ interface ApplyWorkspacePlanOptions {
253
255
  * over them stay identical when only a secret's value changes. The value
254
256
  * lands here under NAME for the executor alone: never put it in the launch
255
257
  * environment, argv or any file the native process reads, because that
256
- * process hands everything it holds to every tool it runs. A value that
257
- * could not be substituted safely is refused.
258
+ * process hands everything it holds to every tool it runs. The executor
259
+ * resolves each reference itself.
258
260
  */
259
261
  secretFileSlotReferences?: Record<string, string>;
260
262
  }
@@ -523,6 +525,8 @@ declare function buildPiModelsConfigFile(input: PiModelsConfigInput): PiModelsCo
523
525
  //#endregion
524
526
  //#region src/plan-application.d.ts
525
527
  declare function applyWorkspacePlan(plan: WorkspacePlan, workspaceDir: string, options?: ApplyWorkspacePlanOptions): WorkspacePlanReceipt;
528
+ /** How many secret references a plan carries: file slots, env values and launch arguments. */
529
+ declare function workspacePlanSecretCount(plan: WorkspacePlan): number;
526
530
  /**
527
531
  * Resolve opaque profile references through an executor-owned provider, then
528
532
  * apply the resulting private native files and launch inputs. Resolution
@@ -652,6 +656,7 @@ declare const ERROR_CATALOG: {
652
656
  readonly COMPLIANCE_CAPACITY_UNAVAILABLE: "503 retry | No verified compliance-scope host can take this sandbox now. | Retry after the Retry-After interval.";
653
657
  readonly CPU_FEATURES_UNAVAILABLE: "503 final | No verified host has capacity with the required CPU features. | Retry when matching capacity is available; the platform does not substitute an incompatible CPU.";
654
658
  readonly FIRECRACKER_IMAGE_UNAVAILABLE: "503 final | No host carries the requested Firecracker image. | Choose an image whose runtimes include firecracker in `environments list`, or set runtime: docker.";
659
+ readonly FIRECRACKER_IMAGE_BUILDING: "503 retry | The requested Firecracker image is being prepared on a host and is not ready yet; the build keeps running. | Send the same create again after the Retry-After interval, which is the remaining build estimate.";
655
660
  readonly PLACEMENT_WARMING: "503 retry | The cell's controller has just started and has not heard a host yet. | Retry after the Retry-After interval.";
656
661
  readonly HOST_UNAVAILABLE: "503 retry | The host did not answer; the sandbox and its files remain. | Retry after the Retry-After interval.";
657
662
  readonly HOST_LOST: "503 retry | The sandbox's host was destroyed; any run unfinished on it is gone. | Resume the sandbox or create another, then run the turn again.";
@@ -710,7 +715,7 @@ declare class CatalogError extends Error {
710
715
  toJSON(): {
711
716
  success: boolean;
712
717
  error: {
713
- code: "VALIDATION_ERROR" | "INVALID_REQUEST" | "INVALID_TEXT_PART" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "FEATURE_DISABLED" | "NOT_FOUND" | "SIDECAR_NOT_FOUND" | "CONFLICT" | "STALE_STATE" | "INVALID_STATE" | "IN_PROGRESS" | "EGRESS_PROXY_RECOVERY_REQUIRED" | "EGRESS_PROXY_SECRETS_UNAVAILABLE" | "EGRESS_IN_PLACE_RELOAD_UNAVAILABLE" | "NATIVE_CREDENTIAL_SEAT_SWITCH_UNSUPPORTED" | "EXPIRED" | "PAYLOAD_TOO_LARGE" | "NOT_CONNECTED" | "QUOTA_EXCEEDED" | "RATE_LIMITED" | "RATE_LIMIT_EXCEEDED" | "INTERNAL_ERROR" | "OPERATION_FAILED" | "CONFIGURATION_ERROR" | "AGENT_EXECUTION_FAILED" | "BACKEND_START_FAILED" | "MESSAGE_RETRIEVAL_FAILED" | "UNSUPPORTED" | "UPSTREAM_ERROR" | "UNAVAILABLE" | "UPSTREAM_UNAVAILABLE" | "NOT_READY" | "BACKEND_UNAVAILABLE" | "MESSAGE_RETRIEVAL_UNAVAILABLE" | "TIMEOUT" | "KV_VALUE_TOO_LARGE" | "KV_KEY_LIMIT" | "KV_VERSION_CONFLICT" | "PRECONDITION_FAILED" | "UNPROCESSABLE" | "BASE_IMAGE_NOT_FOUND" | "BASE_IMAGE_MISSING_BEFORE_CREATE" | "UNSUPPORTED_EGRESS_POLICY" | "UNSUPPORTED_FOR_RUNTIME" | "ROOT_USER_FORBIDDEN" | "EGRESS_DOMAIN_NOT_ALLOWED" | "EGRESS_REQUEST_REFUSED" | "NOT_MANAGED" | "SNAPSHOT_NOT_FOUND" | "BRANCH_PARENT_NOT_RUNNING" | "BRANCH_NOT_MATERIALIZED" | "CONTAINER_RESERVATION_CONFLICT" | "CONTAINER_NETWORK_MISSING" | "EGRESS_DISABLED" | "NATIVE_CAPTURE_UNAVAILABLE" | "NETWORK_ISOLATION_REQUIRED" | "SESSION_CLAIM_MISMATCH" | "SNAPSHOT_LIMIT_REACHED" | "SNAPSHOT_NOT_SYNCED" | "WARM_CLAIM_REMOVED" | "WORKSPACE_STORAGE_MISSING" | "RESTORE_QUOTA_EXCEEDED" | "GIT_CLONE_REFUSED" | "BRANCH_FAILED" | "CONTAINER_START_FAILED" | "GIT_CLONE_FAILED" | "GIT_CLONE_TIMEOUT" | "HOST_CLEANUP_UNCONFIRMED" | "HOST_RESERVATION_COMMIT_FAILED" | "MISSING_SIDECAR_AUTH_TOKEN" | "SNAPSHOT_RESTORE_FAILED" | "VM_START_FAILED" | "SIDECAR_UPSTREAM_UNAVAILABLE" | "BRANCH_UFFD_UNAVAILABLE" | "CAPACITY_EXHAUSTED" | "COMPLIANCE_CAPACITY_UNAVAILABLE" | "CPU_FEATURES_UNAVAILABLE" | "FIRECRACKER_IMAGE_UNAVAILABLE" | "PLACEMENT_WARMING" | "HOST_UNAVAILABLE" | "HOST_LOST" | "HOST_PRESSURE" | "HOST_AGENT_RESTARTING" | "IN_BOX_DOCKER_UNAVAILABLE" | "NO_IP" | "ROUTE_LOOKUP_FAILED" | "SNAPSHOT_STORAGE_UNAVAILABLE" | "THIN_POOL_HEADROOM" | "WARM_RECONNECT_MISS" | "WORKSPACE_IMAGE_BUILDER_BUSY" | "WORKSPACE_IMAGE_BUILDER_UNAVAILABLE" | "SIDECAR_HEALTH_TIMEOUT" | "rate_limit_error" | "provider_quota_exhausted" | "native_api_error" | "empty_visible_output" | "session_rehydration_failed" | "SESSION_DIED" | "MEMORY_LIMIT_KILLED" | "PROCESS_OUTPUT_GAP" | "SESSION_CREDENTIAL_NOT_RETAINED" | "interaction_kind_unsupported" | "invalid_attachment" | "PROFILE_UNSUPPORTED" | "PROFILE_NOT_CACHED" | "MODEL_CALL_LIMIT_REACHED" | "MODEL_CALL_LIMIT_UNSUPPORTED" | "TOOL_DISABLED_TURN_UNSUPPORTED" | "EXECUTION_TTL_EXPIRED" | "EXECUTION_TTL_EXCEEDS_LIMIT" | "MESSAGE_ADMISSION_EXPIRED" | "BACKEND_HARNESS_CONFLICT" | "HARNESS_MODEL_UNSUPPORTED" | "HARNESS_RUNTIME_UNAVAILABLE" | "GPU_PROVIDER_NOT_CONFIGURED" | "COMPLIANCE_NOT_ENTITLED" | "COMPLIANCE_CELL_UNAVAILABLE" | "NETWORK_ERROR" | "TRANSPORT_LOST" | "EXECUTION_INTERRUPTED" | "STREAM_INTERRUPTED" | "PUBLIC_PROFILE_PIN_REFUSED" | "model_credential_refused" | "TEMPLATE_PUBLICATION_WAIT_INTERRUPTED";
718
+ code: "VALIDATION_ERROR" | "INVALID_REQUEST" | "INVALID_TEXT_PART" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "FEATURE_DISABLED" | "NOT_FOUND" | "SIDECAR_NOT_FOUND" | "CONFLICT" | "STALE_STATE" | "INVALID_STATE" | "IN_PROGRESS" | "EGRESS_PROXY_RECOVERY_REQUIRED" | "EGRESS_PROXY_SECRETS_UNAVAILABLE" | "EGRESS_IN_PLACE_RELOAD_UNAVAILABLE" | "NATIVE_CREDENTIAL_SEAT_SWITCH_UNSUPPORTED" | "EXPIRED" | "PAYLOAD_TOO_LARGE" | "NOT_CONNECTED" | "QUOTA_EXCEEDED" | "RATE_LIMITED" | "RATE_LIMIT_EXCEEDED" | "INTERNAL_ERROR" | "OPERATION_FAILED" | "CONFIGURATION_ERROR" | "AGENT_EXECUTION_FAILED" | "BACKEND_START_FAILED" | "MESSAGE_RETRIEVAL_FAILED" | "UNSUPPORTED" | "UPSTREAM_ERROR" | "UNAVAILABLE" | "UPSTREAM_UNAVAILABLE" | "NOT_READY" | "BACKEND_UNAVAILABLE" | "MESSAGE_RETRIEVAL_UNAVAILABLE" | "TIMEOUT" | "KV_VALUE_TOO_LARGE" | "KV_KEY_LIMIT" | "KV_VERSION_CONFLICT" | "PRECONDITION_FAILED" | "UNPROCESSABLE" | "BASE_IMAGE_NOT_FOUND" | "BASE_IMAGE_MISSING_BEFORE_CREATE" | "UNSUPPORTED_EGRESS_POLICY" | "UNSUPPORTED_FOR_RUNTIME" | "ROOT_USER_FORBIDDEN" | "EGRESS_DOMAIN_NOT_ALLOWED" | "EGRESS_REQUEST_REFUSED" | "NOT_MANAGED" | "SNAPSHOT_NOT_FOUND" | "BRANCH_PARENT_NOT_RUNNING" | "BRANCH_NOT_MATERIALIZED" | "CONTAINER_RESERVATION_CONFLICT" | "CONTAINER_NETWORK_MISSING" | "EGRESS_DISABLED" | "NATIVE_CAPTURE_UNAVAILABLE" | "NETWORK_ISOLATION_REQUIRED" | "SESSION_CLAIM_MISMATCH" | "SNAPSHOT_LIMIT_REACHED" | "SNAPSHOT_NOT_SYNCED" | "WARM_CLAIM_REMOVED" | "WORKSPACE_STORAGE_MISSING" | "RESTORE_QUOTA_EXCEEDED" | "GIT_CLONE_REFUSED" | "BRANCH_FAILED" | "CONTAINER_START_FAILED" | "GIT_CLONE_FAILED" | "GIT_CLONE_TIMEOUT" | "HOST_CLEANUP_UNCONFIRMED" | "HOST_RESERVATION_COMMIT_FAILED" | "MISSING_SIDECAR_AUTH_TOKEN" | "SNAPSHOT_RESTORE_FAILED" | "VM_START_FAILED" | "SIDECAR_UPSTREAM_UNAVAILABLE" | "BRANCH_UFFD_UNAVAILABLE" | "CAPACITY_EXHAUSTED" | "COMPLIANCE_CAPACITY_UNAVAILABLE" | "CPU_FEATURES_UNAVAILABLE" | "FIRECRACKER_IMAGE_UNAVAILABLE" | "FIRECRACKER_IMAGE_BUILDING" | "PLACEMENT_WARMING" | "HOST_UNAVAILABLE" | "HOST_LOST" | "HOST_PRESSURE" | "HOST_AGENT_RESTARTING" | "IN_BOX_DOCKER_UNAVAILABLE" | "NO_IP" | "ROUTE_LOOKUP_FAILED" | "SNAPSHOT_STORAGE_UNAVAILABLE" | "THIN_POOL_HEADROOM" | "WARM_RECONNECT_MISS" | "WORKSPACE_IMAGE_BUILDER_BUSY" | "WORKSPACE_IMAGE_BUILDER_UNAVAILABLE" | "SIDECAR_HEALTH_TIMEOUT" | "rate_limit_error" | "provider_quota_exhausted" | "native_api_error" | "empty_visible_output" | "session_rehydration_failed" | "SESSION_DIED" | "MEMORY_LIMIT_KILLED" | "PROCESS_OUTPUT_GAP" | "SESSION_CREDENTIAL_NOT_RETAINED" | "interaction_kind_unsupported" | "invalid_attachment" | "PROFILE_UNSUPPORTED" | "PROFILE_NOT_CACHED" | "MODEL_CALL_LIMIT_REACHED" | "MODEL_CALL_LIMIT_UNSUPPORTED" | "TOOL_DISABLED_TURN_UNSUPPORTED" | "EXECUTION_TTL_EXPIRED" | "EXECUTION_TTL_EXCEEDS_LIMIT" | "MESSAGE_ADMISSION_EXPIRED" | "BACKEND_HARNESS_CONFLICT" | "HARNESS_MODEL_UNSUPPORTED" | "HARNESS_RUNTIME_UNAVAILABLE" | "GPU_PROVIDER_NOT_CONFIGURED" | "COMPLIANCE_NOT_ENTITLED" | "COMPLIANCE_CELL_UNAVAILABLE" | "NETWORK_ERROR" | "TRANSPORT_LOST" | "EXECUTION_INTERRUPTED" | "STREAM_INTERRUPTED" | "PUBLIC_PROFILE_PIN_REFUSED" | "model_credential_refused" | "TEMPLATE_PUBLICATION_WAIT_INTERRUPTED";
714
719
  message: string;
715
720
  details: Record<string, unknown> | undefined;
716
721
  };
@@ -1229,4 +1234,4 @@ declare function parseSandboxToolBinDirs(value: string | undefined): string[];
1229
1234
  */
1230
1235
  declare function bindLaunchToolBinDirs(env: Readonly<Record<string, string | undefined>>, toolBinDirs: readonly string[], appToolBinDirs?: readonly string[]): Record<string, string | undefined>;
1231
1236
  //#endregion
1232
- export { type AgentCandidateWorkspacePlan, type AgentCandidateWorkspacePlanReceipt, type ApplyAgentCandidateWorkspacePlanOptions, type ApplyWorkspacePlanOptions, BINDABLE_LAUNCH_CONTROLS, type BindableLaunchControl, CODEX_DISABLED_FEATURE_ARGS, type ConcurrentProfileRevision, EXECUTOR_SYSTEM_PROMPT_BINDINGS, type ExecutorSystemPromptBinding, HARNESS_LAUNCH_MATERIALIZE_OPTIONS, HARNESS_SKILL_DIRS, type HarnessId, MATERIALIZER_CONTEXT_PATHS, MATERIALIZER_HARNESSES, type ManagedWorkspaceFileDigest, type ManagedWorkspaceManifest, type MaterializeCandidateProfileOptions, OPENCODE_NATIVE_TOOL_IDS, type OpenCodeMcpConfig, PI_MODELS_CONFIG_PATH, PRIME_AGENT_DIR_ENV_VAR, PRIME_AGENT_DIR_ENV_VARS, PRIME_HARNESS_STATE_ENV_DENYLIST, PRIME_KERNEL_DEAD_MARKERS, PRIME_KERNEL_ENV_PASSTHROUGH, PRIME_MCP_UNSUPPORTED_REASON, PRIME_THINKING_LEVELS, PROFILE_BUNDLE_DEFAULT_MAX_BYTES, PROFILE_BUNDLE_MAX_BYTES, PROFILE_BUNDLE_MAX_FILES, PROFILE_BUNDLE_MAX_FILE_BYTES, PROFILE_BUNDLE_SCHEMA, type PiModelsConfigFile, type PiModelsConfigInput, type PiRuntimePaths, type PlanFile, type PlanFileRoot, type PlanFileSecretSlot, type PlanRequirement, PrimeHarnessStateError, type PrimeMaterializeOptions, type PrimeProfileControls, PrimeProfileError, type PrimeProfileErrorKind, type PrimeProfileSkill, type PrimeProfileSubagent, type PrimeThinkingLevel, ProfileBundleCache, ProfileBundleClaim, ProfileBundleClaimResult, ProfileBundleFileEntry, ProfileBundleManifest, ProfileUnsupportedError, type ResolveAgentProfileResourcesOptions, SANDBOX_TOOL_BIN_DIRS_ENV, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SKIPPABLE_DIMENSIONS, type SkippableDimension, UNAVAILABLE_AGENT_PROFILE_SECRET_PROVIDER, type Unsupported, type WorkspacePlan, type WorkspacePlanApplication, type WorkspacePlanArgument, type WorkspacePlanArgumentTemplate, WorkspacePlanCleanupError, type WorkspacePlanConfigValue, type WorkspacePlanReceipt, type WorkspacePlanSecretSegment, type WorkspacePlanSpawnInputs, type WorkspacePlanSystemPromptBinding, type WorkspacePlanWrittenFile, admitProfileBundle, agentCandidateProfilePlanMaterial, applyAgentCandidateWorkspacePlan, applyWorkspacePlan, applyWorkspacePlanWithSecretProvider, assertPrimeModelAgreement, assertWorkspacePlanSupported, bindLaunchToolBinDirs, bindSecretSessionView, buildPiModelsConfig, buildPiModelsConfigFile, canonicalizeAgentCandidateProfilePlan, captureAgentCandidateProfilePlan, claimProfileBundle, codexDeveloperInstructionArgs, digestEnvName, enforceWorkspacePlanSupport, ensurePublicConcurrentProfileRoots, evictProfileBundles, executionControlConflict, harnessAutoLoadsAgentContextFile, hasPrimeProfileMaterial, hashWorkspacePlan, isExecutableProfileFile, isMaterializerHarness, isMaterializerMcpConfig, isSkippableDimension, joinSystemPromptAdditions, keepsHarnessSystemPrompt, markMaterializerContextFile, matchPrimeKernelDeadMarker, materializeCandidateProfile, materializePrimeProfileControls, materializeProfile, modelIdsMatch, normalizeSkillMd, openCodeMcpConfig, openCodeNativeToolId, openProfileBundleCache, parsePrimeModelsJson, parseSandboxToolBinDirs, preparePublicConcurrentProfileRevision, prepareSecretConcurrentProfileRevision, primeAgentDirEnv, primeApiKeyEnvNames, primeHarnessStatePath, primeProfileNeedsAgentDir, primeSubagentEntryId, primeThinkingLevel, profileBundleFileEntry, profileBundleFileTable, profileBundleManifestPath, profileFileBundleKey, prunePrimeProfileMaterial, qualifyModelId, readPrimeProfileControls, resolveAgentProfileResources, resolvePiRuntimePaths, secretSessionViewWorkspace, seedPrimeProfileSubagents, skillDirForHarness, stripPrimeJsonComments, sweepProfileBundleCache, takeSystemPromptBinding, unqualifyModelId, writePrimeAgentFile };
1237
+ export { type AgentCandidateWorkspacePlan, type AgentCandidateWorkspacePlanReceipt, type ApplyAgentCandidateWorkspacePlanOptions, type ApplyWorkspacePlanOptions, BINDABLE_LAUNCH_CONTROLS, type BindableLaunchControl, CODEX_DISABLED_FEATURE_ARGS, type ConcurrentProfileRevision, EXECUTOR_SYSTEM_PROMPT_BINDINGS, type ExecutorSystemPromptBinding, HARNESS_LAUNCH_MATERIALIZE_OPTIONS, HARNESS_SKILL_DIRS, type HarnessId, MATERIALIZER_CONTEXT_PATHS, MATERIALIZER_HARNESSES, type ManagedWorkspaceFileDigest, type ManagedWorkspaceManifest, type MaterializeCandidateProfileOptions, OPENCODE_NATIVE_TOOL_IDS, type OpenCodeMcpConfig, PI_MODELS_CONFIG_PATH, PRIME_AGENT_DIR_ENV_VAR, PRIME_AGENT_DIR_ENV_VARS, PRIME_HARNESS_STATE_ENV_DENYLIST, PRIME_KERNEL_DEAD_MARKERS, PRIME_KERNEL_ENV_PASSTHROUGH, PRIME_MCP_UNSUPPORTED_REASON, PRIME_THINKING_LEVELS, PROFILE_BUNDLE_DEFAULT_MAX_BYTES, PROFILE_BUNDLE_MAX_BYTES, PROFILE_BUNDLE_MAX_FILES, PROFILE_BUNDLE_MAX_FILE_BYTES, PROFILE_BUNDLE_SCHEMA, type PiModelsConfigFile, type PiModelsConfigInput, type PiRuntimePaths, type PlanFile, type PlanFileRoot, type PlanFileSecretSlot, type PlanRequirement, PrimeHarnessStateError, type PrimeMaterializeOptions, type PrimeProfileControls, PrimeProfileError, type PrimeProfileErrorKind, type PrimeProfileSkill, type PrimeProfileSubagent, type PrimeThinkingLevel, ProfileBundleCache, ProfileBundleClaim, ProfileBundleClaimResult, ProfileBundleFileEntry, ProfileBundleManifest, ProfileUnsupportedError, type ResolveAgentProfileResourcesOptions, SANDBOX_TOOL_BIN_DIRS_ENV, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SKIPPABLE_DIMENSIONS, type SkippableDimension, UNAVAILABLE_AGENT_PROFILE_SECRET_PROVIDER, type Unsupported, type WorkspacePlan, type WorkspacePlanApplication, type WorkspacePlanArgument, type WorkspacePlanArgumentTemplate, WorkspacePlanCleanupError, type WorkspacePlanConfigValue, type WorkspacePlanReceipt, type WorkspacePlanSecretSegment, type WorkspacePlanSpawnInputs, type WorkspacePlanSystemPromptBinding, type WorkspacePlanWrittenFile, admitProfileBundle, agentCandidateProfilePlanMaterial, applyAgentCandidateWorkspacePlan, applyWorkspacePlan, applyWorkspacePlanWithSecretProvider, assertPrimeModelAgreement, assertWorkspacePlanSupported, bindLaunchToolBinDirs, bindSecretSessionView, buildPiModelsConfig, buildPiModelsConfigFile, canonicalizeAgentCandidateProfilePlan, captureAgentCandidateProfilePlan, claimProfileBundle, codexDeveloperInstructionArgs, digestEnvName, enforceWorkspacePlanSupport, ensurePublicConcurrentProfileRoots, evictProfileBundles, executionControlConflict, harnessAutoLoadsAgentContextFile, hasPrimeProfileMaterial, hashWorkspacePlan, isExecutableProfileFile, isMaterializerHarness, isMaterializerMcpConfig, isSkippableDimension, joinSystemPromptAdditions, keepsHarnessSystemPrompt, markMaterializerContextFile, matchPrimeKernelDeadMarker, materializeCandidateProfile, materializePrimeProfileControls, materializeProfile, modelIdsMatch, normalizeSkillMd, openCodeMcpConfig, openCodeNativeToolId, openProfileBundleCache, parsePrimeModelsJson, parseSandboxToolBinDirs, preparePublicConcurrentProfileRevision, prepareSecretConcurrentProfileRevision, primeAgentDirEnv, primeApiKeyEnvNames, primeHarnessStatePath, primeProfileNeedsAgentDir, primeSubagentEntryId, primeThinkingLevel, profileBundleFileEntry, profileBundleFileTable, profileBundleManifestPath, profileFileBundleKey, prunePrimeProfileMaterial, qualifyModelId, readPrimeProfileControls, resolveAgentProfileResources, resolvePiRuntimePaths, secretSessionViewWorkspace, seedPrimeProfileSubagents, skillDirForHarness, stripPrimeJsonComments, sweepProfileBundleCache, takeSystemPromptBinding, unqualifyModelId, workspacePlanSecretCount, writePrimeAgentFile };
package/dist/index.js CHANGED
@@ -739,6 +739,7 @@ const ERROR_CATALOG = {
739
739
  COMPLIANCE_CAPACITY_UNAVAILABLE: "503 retry | No verified compliance-scope host can take this sandbox now. | Retry after the Retry-After interval.",
740
740
  CPU_FEATURES_UNAVAILABLE: "503 final | No verified host has capacity with the required CPU features. | Retry when matching capacity is available; the platform does not substitute an incompatible CPU.",
741
741
  FIRECRACKER_IMAGE_UNAVAILABLE: "503 final | No host carries the requested Firecracker image. | Choose an image whose runtimes include firecracker in `environments list`, or set runtime: docker.",
742
+ FIRECRACKER_IMAGE_BUILDING: "503 retry | The requested Firecracker image is being prepared on a host and is not ready yet; the build keeps running. | Send the same create again after the Retry-After interval, which is the remaining build estimate.",
742
743
  PLACEMENT_WARMING: "503 retry | The cell's controller has just started and has not heard a host yet. | Retry after the Retry-After interval.",
743
744
  HOST_UNAVAILABLE: "503 retry | The host did not answer; the sandbox and its files remain. | Retry after the Retry-After interval.",
744
745
  HOST_LOST: "503 retry | The sandbox's host was destroyed; any run unfinished on it is gone. | Resume the sandbox or create another, then run the turn again.",
@@ -1555,7 +1556,8 @@ function applyResolvedWorkspacePlan(publicPlan, resolvedPlan, workspaceDir, opti
1555
1556
  ...promptIntentFields(resolvedPlan, samePromptIntentValue),
1556
1557
  ...systemPromptBindingField(resolvedPlan)
1557
1558
  },
1558
- runtimeOnlyFiles: privateRuntimeFiles
1559
+ runtimeOnlyFiles: privateRuntimeFiles,
1560
+ ...options.secretFileSlotReferences && { secretSlotFiles: Object.fromEntries(resolvedPlan.files.filter((file) => privateFilePaths.has(fileIdentity(file))).map((file) => [file.relPath, file.content])) }
1559
1561
  };
1560
1562
  const resumeSamePlan = existingFiles === "allow-identical" && options.appliedPlanDigest !== void 0 && options.appliedPlanDigest === publicPlanDigest;
1561
1563
  const filesToApply = resumeSamePlan ? selectResumeFiles(files, ownership, privateFilePaths) : files;
@@ -1584,6 +1586,14 @@ function applyResolvedWorkspacePlan(publicPlan, resolvedPlan, workspaceDir, opti
1584
1586
  function applyWorkspacePlan(plan, workspaceDir, options = {}) {
1585
1587
  return applyResolvedWorkspacePlan(plan, resolvePublicWorkspacePlan(plan), workspaceDir, options).receipt;
1586
1588
  }
1589
+ /** How many secret references a plan carries: file slots, env values and launch arguments. */
1590
+ function workspacePlanSecretCount(plan) {
1591
+ return [
1592
+ ...plan.files.flatMap((file) => file.secretSlots ?? []),
1593
+ ...Object.values(plan.env),
1594
+ ...plan.flags
1595
+ ].filter((value) => typeof value !== "string").length;
1596
+ }
1587
1597
  /**
1588
1598
  * Resolve opaque profile references through an executor-owned provider, then
1589
1599
  * apply the resulting private native files and launch inputs. Resolution
@@ -1641,13 +1651,6 @@ function resolvePublicWorkspacePlan(plan) {
1641
1651
  ...systemPromptBindingField(plan)
1642
1652
  };
1643
1653
  }
1644
- /**
1645
- * OpenCode substitutes `{env:NAME}` textually into its config before parsing
1646
- * it, so only a value that cannot break out of a JSON string or start another
1647
- * substitution may stand behind a reference.
1648
- */
1649
- const SUBSTITUTABLE_SECRET_VALUE = /^[\x20-\x7e]+$/;
1650
- const UNSUBSTITUTABLE_SECRET_CHARACTERS = /["\\{}]/;
1651
1654
  async function resolvePrivateWorkspacePlan(plan, secretProvider, fileSlotReferences) {
1652
1655
  if (!secretProvider || typeof secretProvider.get !== "function") throw new Error("AgentProfileSecretProvider.get is required");
1653
1656
  const pending = /* @__PURE__ */ new Map();
@@ -1672,11 +1675,11 @@ async function resolvePrivateWorkspacePlan(plan, secretProvider, fileSlotReferen
1672
1675
  const value = await resolveRawRef(ref);
1673
1676
  return ref.format === "bearer" ? `Bearer ${value}` : value;
1674
1677
  };
1675
- const resolveFileSlot = async (input) => {
1678
+ const resolveFileSlot = async (input, header) => {
1676
1679
  const ref = agentProfileSecretRefSchema.parse(input);
1677
1680
  const value = await resolveRawRef(ref);
1678
1681
  if (!fileSlotReferences) return ref.format === "bearer" ? `Bearer ${value}` : value;
1679
- if (!SUBSTITUTABLE_SECRET_VALUE.test(value) || UNSUBSTITUTABLE_SECRET_CHARACTERS.test(value)) throw new Error(`AgentProfile secret ${secretRefLabel(ref)} has a value that cannot be referenced from a secret OpenCode config: it may hold only printable ASCII without quotes, backslashes or braces`);
1682
+ if ((header ? /[\r\n\0]|[^\0-\xff]/ : /\0/).test(value)) throw new CatalogError("VALIDATION_ERROR", `AgentProfile secret ${secretRefLabel(ref)} holds a character its slot cannot carry`);
1680
1683
  const name = digestEnvName(SECRET_REFERENCE_PREFIX, ref.key);
1681
1684
  fileSlotReferences[name] = value;
1682
1685
  return ref.format === "bearer" ? `Bearer {env:${name}}` : `{env:${name}}`;
@@ -1687,7 +1690,7 @@ async function resolvePrivateWorkspacePlan(plan, secretProvider, fileSlotReferen
1687
1690
  const parsed = JSON.parse(file.content);
1688
1691
  const values = await Promise.all(file.secretSlots.map(async (slot) => ({
1689
1692
  path: slot.path,
1690
- value: await resolveFileSlot(slot.ref)
1693
+ value: await resolveFileSlot(slot.ref, slot.path[0] === "mcp" && slot.path[2] === "headers")
1691
1694
  })));
1692
1695
  for (const resolved of values) setValueAtJsonPath(parsed, resolved.path, resolved.value);
1693
1696
  return {
@@ -5023,4 +5026,4 @@ function bindLaunchToolBinDirs(env, toolBinDirs, appToolBinDirs = parseSandboxTo
5023
5026
  };
5024
5027
  }
5025
5028
  //#endregion
5026
- export { BINDABLE_LAUNCH_CONTROLS, CODEX_DISABLED_FEATURE_ARGS, EXECUTOR_SYSTEM_PROMPT_BINDINGS, HARNESS_LAUNCH_MATERIALIZE_OPTIONS, HARNESS_SKILL_DIRS, MATERIALIZER_CONTEXT_PATHS, MATERIALIZER_HARNESSES, OPENCODE_NATIVE_TOOL_IDS, PI_MODELS_CONFIG_PATH, PRIME_AGENT_DIR_ENV_VAR, PRIME_AGENT_DIR_ENV_VARS, PRIME_HARNESS_STATE_ENV_DENYLIST, PRIME_KERNEL_DEAD_MARKERS, PRIME_KERNEL_ENV_PASSTHROUGH, PRIME_MCP_UNSUPPORTED_REASON, PRIME_THINKING_LEVELS, PROFILE_BUNDLE_DEFAULT_MAX_BYTES, PROFILE_BUNDLE_MAX_BYTES, PROFILE_BUNDLE_MAX_FILES, PROFILE_BUNDLE_MAX_FILE_BYTES, PROFILE_BUNDLE_SCHEMA, PrimeHarnessStateError, PrimeProfileError, ProfileUnsupportedError, SANDBOX_TOOL_BIN_DIRS_ENV, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SKIPPABLE_DIMENSIONS, UNAVAILABLE_AGENT_PROFILE_SECRET_PROVIDER, WorkspacePlanCleanupError, admitProfileBundle, agentCandidateProfilePlanMaterial, applyAgentCandidateWorkspacePlan, applyWorkspacePlan, applyWorkspacePlanWithSecretProvider, assertPrimeModelAgreement, assertWorkspacePlanSupported, bindLaunchToolBinDirs, bindSecretSessionView, buildPiModelsConfig, buildPiModelsConfigFile, canonicalizeAgentCandidateProfilePlan, captureAgentCandidateProfilePlan, claimProfileBundle, codexDeveloperInstructionArgs, digestEnvName, enforceWorkspacePlanSupport, ensurePublicConcurrentProfileRoots, evictProfileBundles, executionControlConflict, harnessAutoLoadsAgentContextFile, hasPrimeProfileMaterial, hashWorkspacePlan, isExecutableProfileFile, isMaterializerHarness, isMaterializerMcpConfig, isSkippableDimension, joinSystemPromptAdditions, keepsHarnessSystemPrompt, markMaterializerContextFile, matchPrimeKernelDeadMarker, materializeCandidateProfile, materializePrimeProfileControls, materializeProfile, modelIdsMatch, normalizeSkillMd, openCodeMcpConfig, openCodeNativeToolId, openProfileBundleCache, parsePrimeModelsJson, parseSandboxToolBinDirs, preparePublicConcurrentProfileRevision, prepareSecretConcurrentProfileRevision, primeAgentDirEnv, primeApiKeyEnvNames, primeHarnessStatePath, primeProfileNeedsAgentDir, primeSubagentEntryId, primeThinkingLevel, profileBundleFileEntry, profileBundleFileTable, profileBundleManifestPath, profileFileBundleKey, prunePrimeProfileMaterial, qualifyModelId, readPrimeProfileControls, resolveAgentProfileResources, resolvePiRuntimePaths, secretSessionViewWorkspace, seedPrimeProfileSubagents, skillDirForHarness, stripPrimeJsonComments, sweepProfileBundleCache, takeSystemPromptBinding, unqualifyModelId, writePrimeAgentFile };
5029
+ export { BINDABLE_LAUNCH_CONTROLS, CODEX_DISABLED_FEATURE_ARGS, EXECUTOR_SYSTEM_PROMPT_BINDINGS, HARNESS_LAUNCH_MATERIALIZE_OPTIONS, HARNESS_SKILL_DIRS, MATERIALIZER_CONTEXT_PATHS, MATERIALIZER_HARNESSES, OPENCODE_NATIVE_TOOL_IDS, PI_MODELS_CONFIG_PATH, PRIME_AGENT_DIR_ENV_VAR, PRIME_AGENT_DIR_ENV_VARS, PRIME_HARNESS_STATE_ENV_DENYLIST, PRIME_KERNEL_DEAD_MARKERS, PRIME_KERNEL_ENV_PASSTHROUGH, PRIME_MCP_UNSUPPORTED_REASON, PRIME_THINKING_LEVELS, PROFILE_BUNDLE_DEFAULT_MAX_BYTES, PROFILE_BUNDLE_MAX_BYTES, PROFILE_BUNDLE_MAX_FILES, PROFILE_BUNDLE_MAX_FILE_BYTES, PROFILE_BUNDLE_SCHEMA, PrimeHarnessStateError, PrimeProfileError, ProfileUnsupportedError, SANDBOX_TOOL_BIN_DIRS_ENV, SECRET_REFERENCE, SECRET_REFERENCE_PREFIX, SKIPPABLE_DIMENSIONS, UNAVAILABLE_AGENT_PROFILE_SECRET_PROVIDER, WorkspacePlanCleanupError, admitProfileBundle, agentCandidateProfilePlanMaterial, applyAgentCandidateWorkspacePlan, applyWorkspacePlan, applyWorkspacePlanWithSecretProvider, assertPrimeModelAgreement, assertWorkspacePlanSupported, bindLaunchToolBinDirs, bindSecretSessionView, buildPiModelsConfig, buildPiModelsConfigFile, canonicalizeAgentCandidateProfilePlan, captureAgentCandidateProfilePlan, claimProfileBundle, codexDeveloperInstructionArgs, digestEnvName, enforceWorkspacePlanSupport, ensurePublicConcurrentProfileRoots, evictProfileBundles, executionControlConflict, harnessAutoLoadsAgentContextFile, hasPrimeProfileMaterial, hashWorkspacePlan, isExecutableProfileFile, isMaterializerHarness, isMaterializerMcpConfig, isSkippableDimension, joinSystemPromptAdditions, keepsHarnessSystemPrompt, markMaterializerContextFile, matchPrimeKernelDeadMarker, materializeCandidateProfile, materializePrimeProfileControls, materializeProfile, modelIdsMatch, normalizeSkillMd, openCodeMcpConfig, openCodeNativeToolId, openProfileBundleCache, parsePrimeModelsJson, parseSandboxToolBinDirs, preparePublicConcurrentProfileRevision, prepareSecretConcurrentProfileRevision, primeAgentDirEnv, primeApiKeyEnvNames, primeHarnessStatePath, primeProfileNeedsAgentDir, primeSubagentEntryId, primeThinkingLevel, profileBundleFileEntry, profileBundleFileTable, profileBundleManifestPath, profileFileBundleKey, prunePrimeProfileMaterial, qualifyModelId, readPrimeProfileControls, resolveAgentProfileResources, resolvePiRuntimePaths, secretSessionViewWorkspace, seedPrimeProfileSubagents, skillDirForHarness, stripPrimeJsonComments, sweepProfileBundleCache, takeSystemPromptBinding, unqualifyModelId, workspacePlanSecretCount, writePrimeAgentFile };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-profile-materialize",
3
- "version": "1.1.122",
3
+ "version": "1.1.124",
4
4
  "description": "Materialize an AgentProfile into the native per-harness workspace files (the one shared materializer for cli-bridge, agent-container, and VB).",
5
5
  "type": "module",
6
6
  "repository": {
@@ -37,8 +37,8 @@
37
37
  "@tangle-network/agent-interface": "^5.10.23"
38
38
  },
39
39
  "tangleRelease": {
40
- "sourceSha": "75e6490a63b73e3b65fc98d907d659c1368997a4",
41
- "mergedAt": "2026-11-16T11:16:28-08:00"
40
+ "sourceSha": "6aff3be689017f16245ef66af8ffd540fabcde78",
41
+ "mergedAt": "2026-11-16T12:46:21-08:00"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "tsdown",