@bastani/atomic 0.9.42 → 0.9.43-alpha.1

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.
@@ -0,0 +1,10 @@
1
+ export type WorkflowInfrastructureFault = "worker_lost" | "worker_cleanup_unconfirmed" | "worker_retry_limit" | "worker_startup_failed" | "stale_work_lease" | "intercom_unavailable" | "storage_unavailable";
2
+ export declare class WorkflowInfrastructureError extends Error {
3
+ readonly name = "WorkflowInfrastructureError";
4
+ readonly retryable = true;
5
+ readonly code: WorkflowInfrastructureFault;
6
+ constructor(code: WorkflowInfrastructureFault, message: string, options?: ErrorOptions);
7
+ }
8
+ export declare function isRetryableWorkflowError(error: unknown): boolean;
9
+ export declare function workflowInfrastructureFault(message: string): WorkflowInfrastructureFault | undefined;
10
+ export declare function asWorkflowInfrastructureError(error: unknown): WorkflowInfrastructureError | undefined;
@@ -19,6 +19,8 @@ export interface LocalWorkerOptions {
19
19
  readonly path: string;
20
20
  readonly exportName: string;
21
21
  }[];
22
+ readonly startupTimeoutMs?: number;
23
+ readonly leaseMs?: number;
22
24
  }
23
25
  export interface WorkflowExecutionResources {
24
26
  readonly localWorkers?: LocalWorkerOptions;
@@ -266,6 +266,8 @@ export declare const SettingsSchema: Type.TObject<{
266
266
  path: Type.TString;
267
267
  exportName: Type.TString;
268
268
  }>>;
269
+ startupTimeoutMs: Type.TOptional<Type.TInteger>;
270
+ leaseMs: Type.TOptional<Type.TInteger>;
269
271
  }>>;
270
272
  admission: Type.TOptional<Type.TObject<{
271
273
  limits: Type.TOptional<Type.TObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"settings-schema.d.ts","sourceRoot":"","sources":["../../src/core/settings-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAuB,IAAI,EAAE,MAAM,SAAS,CAAC;AAkBjE,QAAA,MAAM,6BAA6B;;;EAGjC,CAAC;AAEH,QAAA,MAAM,wBAAwB;;;;;;;;;;E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C;AACtF,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC;AAC1E,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,CAAC;IACrG,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB"}
@@ -250,6 +250,16 @@ const WorkflowsSettingsSchema = Type.Union([
250
250
  localWorkers: Type.Optional(Type.Object({
251
251
  count: Type.Integer({ minimum: 1, description: "Number of local worker processes." }),
252
252
  definitions: Type.Array(Type.Object({ path: Type.String(), exportName: Type.String() }, { additionalProperties: false }), { description: "Importable child workflow definitions workers may run." }),
253
+ startupTimeoutMs: Type.Optional(Type.Integer({
254
+ minimum: 1,
255
+ maximum: 2_147_483_647,
256
+ description: "Milliseconds each worker process may take to become ready. Default: 30000.",
257
+ })),
258
+ leaseMs: Type.Optional(Type.Integer({
259
+ minimum: 2000,
260
+ maximum: 2_147_483_647,
261
+ description: "Milliseconds a live worker that has stopped responding keeps its child before the child is replayed elsewhere. Default: 30000.",
262
+ })),
253
263
  }, { additionalProperties: false })),
254
264
  admission: Type.Optional(Type.Object({
255
265
  limits: Type.Optional(ResourceLimitsSchema),
@@ -1 +1 @@
1
- {"version":3,"file":"settings-schema.js","sourceRoot":"","sources":["../../src/core/settings-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAoC,IAAI,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,SAAS,sBAAsB,CAAC,OAAO,GAA+C,EAAE;IACvF,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,gBAAgB,EAAE,GAAG,OAAO,E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,CACxB,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,uCAAuC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CACxF;CACD,EACD,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAC9B,CAAC","sourcesContent":["import { ModelThinkingLevelSchema } from \"@bastani/pi-ai/providers/model-schema\";\nimport { type Static, type TSchemaOptions, Type } from \"typebox\";\nimport { SETTINGS_DEFAULTS } from \"./settings-defaults.ts\";\n\nfunction nonNegativeSafeInteger(options: { default?: number; description?: string } = {}) {\n\treturn Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER, ...options });\n}\n\nfunction caseInsensitive(word: string): string {\n\treturn [...word].map((letter) => `[${letter.toLowerCase()}${letter.toUpperCase()}]`).join(\"\");\n}\n\n/** Mirrors `parseHttpIdleTimeoutMs`: milliseconds, `disabled`, or a duration such as `30s`, `5m`, `1h`. */\nconst TIMEOUT_STRING_PATTERN = `^(?:${caseInsensitive(\"disabled\")}|[0-9]+(?:${caseInsensitive(\"ms\")}|[smhSMH])?)$`;\n\nfunction timeoutSetting(options?: TSchemaOptions) {\n\treturn Type.Union([Type.Number({ minimum: 0 }), Type.String({ pattern: TIMEOUT_STRING_PATTERN })], options);\n}\n\nconst CompactionModelOverrideSchema = Type.Object({\n\treserveTokens: Type.Optional(nonNegativeSafeInteger()),\n\tpreserve_recent: Type.Optional(nonNegativeSafeInteger()),\n});\n\nconst CompactionSettingsSchema = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.compaction.enabled })),\n\treserveTokens: Type.Optional(\n\t\tnonNegativeSafeInteger({\n\t\t\tdescription: \"Free context tokens below which automatic compaction starts.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.reserveTokens,\n\t\t}),\n\t),\n\tcompression_ratio: Type.Optional(\n\t\tType.Number({\n\t\t\texclusiveMinimum: 0,\n\t\t\texclusiveMaximum: 1,\n\t\t\tdescription: \"Fraction of compactable transcript lines to keep.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.compression_ratio,\n\t\t}),\n\t),\n\tpreserve_recent: Type.Optional(\n\t\tnonNegativeSafeInteger({\n\t\t\tdescription: \"Exact number of newest context-visible messages kept outside the compactable region.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.preserve_recent,\n\t\t}),\n\t),\n\tquery: Type.Optional(\n\t\tType.String({\n\t\t\tdescription:\n\t\t\t\t\"Relevance focus for selecting older lines to retain. Defaults to the last user message when omitted.\",\n\t\t}),\n\t),\n\tmodelOverrides: Type.Optional(\n\t\tType.Record(Type.String(), CompactionModelOverrideSchema, {\n\t\t\tdescription: 'Per-model overrides keyed by exact \"provider/modelId\" strings.',\n\t\t}),\n\t),\n});\n\nconst BranchSummarySettingsSchema = Type.Object({\n\treserveTokens: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Tokens reserved when selecting branch history; the provider sizes summary output.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.branchSummary.reserveTokens,\n\t\t}),\n\t),\n\tskipPrompt: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: 'When true, skips the \"Summarize branch?\" prompt and defaults to no summary.',\n\t\t\tdefault: SETTINGS_DEFAULTS.branchSummary.skipPrompt,\n\t\t}),\n\t),\n});\n\nconst SessionSummarySettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Generate a one-line resume-picker summary once the agent goes idle.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.sessionSummary.enabled,\n\t\t}),\n\t),\n});\n\nconst ProviderRetrySettingsSchema = Type.Object({\n\ttimeoutMs: Type.Optional(Type.Number({ description: \"SDK or provider request timeout in milliseconds.\" })),\n\tmaxRetries: Type.Optional(Type.Number({ description: \"SDK or provider retry attempts.\" })),\n\tmaxRetryDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Maximum server-requested delay before failing.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.provider.maxRetryDelayMs,\n\t\t}),\n\t),\n});\n\nconst RetrySettingsSchema = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.retry.enabled })),\n\tmaxRetries: Type.Optional(Type.Number({ default: SETTINGS_DEFAULTS.retry.maxRetries })),\n\tbaseDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Exponential backoff base delay in milliseconds: 2s, 4s, 8s.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.baseDelayMs,\n\t\t}),\n\t),\n\tmaxAgentDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Maximum agent-level backoff delay in milliseconds. 0 retries immediately.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.maxAgentDelayMs,\n\t\t}),\n\t),\n\tprovider: Type.Optional(ProviderRetrySettingsSchema),\n\tmaxDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Legacy retry delay setting. Use provider.maxRetryDelayMs instead.\",\n\t\t\tdeprecated: true,\n\t\t}),\n\t),\n});\n\nconst TerminalSettingsSchema = Type.Object({\n\tshowImages: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Show images when the terminal supports them.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.showImages,\n\t\t}),\n\t),\n\timageWidthCells: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Preferred inline image width in terminal cells.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.imageWidthCells,\n\t\t}),\n\t),\n\tclearOnShrink: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Clear empty rows when content shrinks.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.clearOnShrink,\n\t\t}),\n\t),\n\tshowTerminalProgress: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Show OSC 9;4 terminal progress indicators.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.showTerminalProgress,\n\t\t}),\n\t),\n\thyperlinks: Type.Optional(\n\t\tType.Union([Type.Boolean(), Type.Literal(\"auto\")], {\n\t\t\tdescription: 'Hyperlink capability override. \"auto\" and invalid values keep terminal detection.',\n\t\t}),\n\t),\n\timages: Type.Optional(\n\t\tType.Union([Type.Literal(\"kitty\"), Type.Literal(\"iterm2\"), Type.Literal(\"auto\"), Type.Literal(false)], {\n\t\t\tdescription: 'Inline-image protocol override. false disables images; \"auto\" keeps terminal detection.',\n\t\t}),\n\t),\n\ttrueColor: Type.Optional(\n\t\tType.Union([Type.Boolean(), Type.Literal(\"auto\")], {\n\t\t\tdescription: 'Truecolor capability override. \"auto\" and invalid values keep terminal detection.',\n\t\t}),\n\t),\n});\n\nconst ImageSettingsSchema = Type.Object({\n\tautoResize: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Resize images to 2000x2000 maximum for better model compatibility.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.images.autoResize,\n\t\t}),\n\t),\n\tblockImages: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"When true, prevents all images from being sent to LLM providers.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.images.blockImages,\n\t\t}),\n\t),\n});\n\nconst SearchSettingsSchema = Type.Object({\n\tcontextBefore: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Number of context lines before each search match.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.search.contextBefore,\n\t\t}),\n\t),\n\tcontextAfter: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Number of context lines after each search match.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.search.contextAfter,\n\t\t}),\n\t),\n});\n\nconst BashInterceptorSettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription:\n\t\t\t\t\"When true, block shell commands that have dedicated tools and offer remaining bash tool calls to user_bash extension handlers before local execution.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.bashInterceptor.enabled,\n\t\t}),\n\t),\n});\n\nconst HerdrSettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Enable the built-in reporter in an eligible Herdr pane.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.herdr.enabled,\n\t\t}),\n\t),\n});\n\nconst ModelRoutingSettingsSchema = Type.Object(\n\t{\n\t\tallowedProviders: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"When nonempty, only models from these provider IDs are routing candidates.\",\n\t\t\t}),\n\t\t),\n\t\texcludedProviders: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"Provider IDs that are never routing candidates. Applied after allowedProviders.\",\n\t\t\t}),\n\t\t),\n\t\tallowedModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"When nonempty, only models matching these full-ID or glob patterns, as in enabledModels, are routing candidates.\",\n\t\t\t}),\n\t\t),\n\t\texcludedModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Models matching these full-ID or glob patterns are never routing candidates. Applied after allowedModels.\",\n\t\t\t}),\n\t\t),\n\t},\n\t{\n\t\tdescription:\n\t\t\t'Provider and model filters for the candidates model \"auto\" may route to. Does not affect routerModel.',\n\t},\n);\n\nfunction thinkingBudgetsSettings(options?: TSchemaOptions) {\n\treturn Type.Object(\n\t\t{\n\t\t\tminimal: Type.Optional(Type.Number()),\n\t\t\tlow: Type.Optional(Type.Number()),\n\t\t\tmedium: Type.Optional(Type.Number()),\n\t\t\thigh: Type.Optional(Type.Number()),\n\t\t},\n\t\toptions,\n\t);\n}\n\nconst ThinkingBudgetsSettingsSchema = thinkingBudgetsSettings();\n\nconst MarkdownSettingsSchema = Type.Object({\n\tcodeBlockIndent: Type.Optional(Type.String({ default: SETTINGS_DEFAULTS.markdown.codeBlockIndent })),\n\tmermaid: Type.Optional(\n\t\tType.Union([Type.Literal(\"off\"), Type.Literal(\"final\"), Type.Literal(\"streaming\")], {\n\t\t\tdefault: SETTINGS_DEFAULTS.markdown.mermaid,\n\t\t}),\n\t),\n\tlatex: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Render LaTeX expressions as terminal-friendly Unicode math.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.markdown.latex,\n\t\t}),\n\t),\n});\n\nconst WarningSettingsSchema = Type.Object({\n\tanthropicExtraUsage: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.warnings.anthropicExtraUsage })),\n});\n\nfunction codemodeMode(options?: TSchemaOptions) {\n\treturn Type.Union([Type.Literal(\"on\"), Type.Literal(\"only\")], options);\n}\n\nconst CodemodeModeSchema = codemodeMode();\n\nconst CodemodeSettingsSchema = Type.Object({\n\tmode: Type.Optional(\n\t\tcodemodeMode({\n\t\t\tdescription:\n\t\t\t\t'How codemode presents tools. \"on\" keeps direct tool declarations visible with script-call information; \"only\" hides ordinary direct callable declarations so the model uses scripts. Model-only tools remain directly available.',\n\t\t\tdefault: SETTINGS_DEFAULTS.codemode.mode,\n\t\t}),\n\t),\n\tinlineBudget: Type.Optional(\n\t\tType.Number({\n\t\t\tminimum: 0,\n\t\t\tdescription: \"Estimated tokens available for inline codemode tool declarations.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.codemode.inlineBudget,\n\t\t}),\n\t),\n});\n\nconst PackageSourceSchema = Type.Union(\n\t[\n\t\tType.String({ description: \"Load all resources from the package.\" }),\n\t\tType.Object({\n\t\t\tsource: Type.String(),\n\t\t\tautoload: Type.Optional(\n\t\t\t\tType.Boolean({ description: \"When false, start empty and only apply explicit resource patterns.\" }),\n\t\t\t),\n\t\t\textensions: Type.Optional(Type.Array(Type.String())),\n\t\t\tskills: Type.Optional(Type.Array(Type.String())),\n\t\t\tprompts: Type.Optional(Type.Array(Type.String())),\n\t\t\tthemes: Type.Optional(Type.Array(Type.String())),\n\t\t\tworkflows: Type.Optional(Type.Array(Type.String())),\n\t\t\tmcpServers: Type.Optional(Type.Array(Type.String())),\n\t\t}),\n\t],\n\t{\n\t\tdescription:\n\t\t\t\"Package source for npm or git packages. Use the string form to load all resources or the object form to filter resources.\",\n\t},\n);\n\nconst StringArraySchema = Type.Array(Type.String());\n\nconst SkillsInputSchema = Type.Union(\n\t[\n\t\tStringArraySchema,\n\t\tType.Object(\n\t\t\t{\n\t\t\t\tenableSkillCommands: Type.Optional(Type.Boolean()),\n\t\t\t\tcustomDirectories: Type.Optional(StringArraySchema),\n\t\t\t},\n\t\t\t{ deprecated: true },\n\t\t),\n\t],\n\t{ description: \"Local skill file paths or directories.\" },\n);\n\nexport const StorageSelectionSchema = Type.Union([\n\tType.Object(\n\t\t{\n\t\t\tpath: Type.Optional(Type.String({ description: \"Database path relative to the Atomic home directory.\" })),\n\t\t\tmemory: Type.Optional(Type.Boolean({ description: \"Explicitly select ephemeral storage.\" })),\n\t\t\tprefix: Type.Optional(Type.String()),\n\t\t},\n\t\t{\n\t\t\tadditionalProperties: false,\n\t\t\tnot: { required: [\"path\", \"memory\"], properties: { path: { minLength: 1 }, memory: { const: true } } },\n\t\t},\n\t),\n\tType.Object(\n\t\t{\n\t\t\tadapter: Type.String({ minLength: 1, description: \"User-installed storage adapter module specifier.\" }),\n\t\t\toptions: Type.Optional(\n\t\t\t\tType.Record(Type.String(), Type.Union([Type.String(), Type.Number(), Type.Boolean(), Type.Null()])),\n\t\t\t),\n\t\t\tsecrets: Type.Optional(\n\t\t\t\tType.Record(\n\t\t\t\t\tType.String(),\n\t\t\t\t\tType.Union([\n\t\t\t\t\t\tType.Object({ env: Type.String() }, { additionalProperties: false }),\n\t\t\t\t\t\tType.Object({ file: Type.String() }, { additionalProperties: false }),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t),\n\t\t\tprefix: Type.Optional(Type.String()),\n\t\t},\n\t\t{ additionalProperties: false },\n\t),\n]);\n\nexport const SessionStorageSelectionSchema = Type.Union([\n\tStorageSelectionSchema,\n\tType.Object({ dir: Type.String() }, { additionalProperties: false }),\n]);\n\nconst ResourceLimitsSchema = Type.Object(\n\t{\n\t\tsession: Type.Optional(Type.Integer({ minimum: 1 })),\n\t\tprocess: Type.Optional(Type.Integer({ minimum: 1 })),\n\t},\n\t{ additionalProperties: false },\n);\n\nconst WorkflowsSettingsSchema = Type.Union(\n\t[\n\t\tStringArraySchema,\n\t\tType.Object({\n\t\t\tpaths: Type.Optional(Type.Array(Type.String(), { description: \"Workflow resource paths.\" })),\n\t\t\tjournal: Type.Optional(StorageSelectionSchema),\n\t\t\tlocalWorkers: Type.Optional(\n\t\t\t\tType.Object(\n\t\t\t\t\t{\n\t\t\t\t\t\tcount: Type.Integer({ minimum: 1, description: \"Number of local worker processes.\" }),\n\t\t\t\t\t\tdefinitions: Type.Array(\n\t\t\t\t\t\t\tType.Object({ path: Type.String(), exportName: Type.String() }, { additionalProperties: false }),\n\t\t\t\t\t\t\t{ description: \"Importable child workflow definitions workers may run.\" },\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\t{ additionalProperties: false },\n\t\t\t\t),\n\t\t\t),\n\t\t\tadmission: Type.Optional(\n\t\t\t\tType.Object(\n\t\t\t\t\t{\n\t\t\t\t\t\tlimits: Type.Optional(ResourceLimitsSchema),\n\t\t\t\t\t\tuserLimits: Type.Optional(ResourceLimitsSchema),\n\t\t\t\t\t\tuserDatabase: Type.Optional(Type.String()),\n\t\t\t\t\t\thost: Type.Optional(\n\t\t\t\t\t\t\tType.Object(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmaxLoadPerCpu: Type.Optional(Type.Number({ minimum: 0 })),\n\t\t\t\t\t\t\t\t\tminFreeMemoryBytes: Type.Optional(Type.Number({ minimum: 0 })),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{ additionalProperties: false },\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\t{ additionalProperties: false },\n\t\t\t\t),\n\t\t\t),\n\t\t}),\n\t],\n\t{\n\t\tdescription:\n\t\t\t'Local workflow paths, or an object with \"paths\", \"journal\" storage, \"localWorkers\" and \"admission\" settings.',\n\t},\n);\n\nexport const SettingsSchema = Type.Object(\n\t{\n\t\t$schema: Type.Optional(Type.String({ description: \"JSON Schema reference.\" })),\n\t\tstorage: Type.Optional(StorageSelectionSchema),\n\t\tsessions: Type.Optional(Type.Object({ storage: Type.Optional(SessionStorageSelectionSchema) })),\n\t\tlastChangelogVersion: Type.Optional(Type.String()),\n\t\tfirstRunOnboardingStartedVersion: Type.Optional(\n\t\t\tType.String({ description: \"Managed onboarding state; leave unchanged.\" }),\n\t\t),\n\t\tonboardedVersion: Type.Optional(\n\t\t\tType.String({ description: \"Managed onboarding completion state; leave unchanged.\" }),\n\t\t),\n\t\tdefaultProvider: Type.Optional(Type.String()),\n\t\tdefaultModel: Type.Optional(Type.String()),\n\t\trouterModel: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t'Inference model for workflow-stage and subagent model: \"auto\" selection only. An exact provider/model selects a registered chat or classifier model; \"auto\" and an empty string use the current chat model.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.routerModel,\n\t\t\t}),\n\t\t),\n\t\tcompactionModel: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t'Compaction model: \"auto\" or an empty string uses the session model, and an exact provider/model selects a registered chat model, classifier, or compactor.',\n\t\t\t}),\n\t\t),\n\t\tmodelRouting: Type.Optional(ModelRoutingSettingsSchema),\n\t\tdefaultThinkingLevel: Type.Optional(ModelThinkingLevelSchema),\n\t\tmodelThinkingLevels: Type.Optional(\n\t\t\tType.Record(Type.String(), ModelThinkingLevelSchema, {\n\t\t\t\tdescription: 'Per-model default thinking level overrides keyed by \"provider/modelId\".',\n\t\t\t}),\n\t\t),\n\t\tfallbackModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t'Ordered main-chat fallback models, written as \"provider/model\" with an optional thinking-level suffix such as \":high\".',\n\t\t\t}),\n\t\t),\n\t\ttransport: Type.Optional(\n\t\t\tType.Union(\n\t\t\t\t[Type.Literal(\"auto\"), Type.Literal(\"sse\"), Type.Literal(\"websocket\"), Type.Literal(\"websocket-cached\")],\n\t\t\t\t{ default: SETTINGS_DEFAULTS.transport },\n\t\t\t),\n\t\t),\n\t\tsteeringMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdefault: SETTINGS_DEFAULTS.steeringMode,\n\t\t\t}),\n\t\t),\n\t\tfollowUpMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdefault: SETTINGS_DEFAULTS.followUpMode,\n\t\t\t}),\n\t\t),\n\t\ttheme: Type.Optional(Type.String()),\n\t\tenableAnalytics: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Opt in to analytics data sharing. Storage only; Atomic does not transmit analytics.\",\n\t\t\t}),\n\t\t),\n\t\ttrackingId: Type.Optional(\n\t\t\tType.String({ description: \"Analytics tracking identifier, generated when analytics is enabled.\" }),\n\t\t),\n\t\tdeviceId: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"Stable installation UUID, generated when authentication first needs it. Global only.\",\n\t\t\t}),\n\t\t),\n\t\tshowCacheMissNotices: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Show cache cost and provider recovery notices.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.showCacheMissNotices,\n\t\t\t}),\n\t\t),\n\t\tcompaction: Type.Optional(CompactionSettingsSchema),\n\t\tbranchSummary: Type.Optional(BranchSummarySettingsSchema),\n\t\tsessionSummary: Type.Optional(SessionSummarySettingsSchema),\n\t\tretry: Type.Optional(RetrySettingsSchema),\n\t\thideThinkingBlock: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.hideThinkingBlock })),\n\t\texternalEditor: Type.Optional(\n\t\t\tType.String({ description: \"Command for Ctrl+G external editor; takes precedence over VISUAL and EDITOR.\" }),\n\t\t),\n\t\tshellPath: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"Custom shell path, for example for Cygwin on Windows, with support for leading ~ expansion.\",\n\t\t\t}),\n\t\t),\n\t\tquietStartup: Type.Optional(\n\t\t\tType.Union([Type.Boolean(), Type.Literal(\"header\")], {\n\t\t\t\tdescription: 'When true, hide all startup output. When \"header\", keep only the startup header.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.quietStartup,\n\t\t\t}),\n\t\t),\n\t\tdefaultProjectTrust: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"ask\"), Type.Literal(\"always\"), Type.Literal(\"never\")], {\n\t\t\t\tdescription: \"Global setting only.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.defaultProjectTrust,\n\t\t\t}),\n\t\t),\n\t\tshellCommandPrefix: Type.Optional(\n\t\t\tType.String({ description: \"Prefix prepended to every bash command, for example to enable shell aliases.\" }),\n\t\t),\n\t\tbashInterceptor: Type.Optional(BashInterceptorSettingsSchema),\n\t\tsearch: Type.Optional(SearchSettingsSchema),\n\t\tnpmCommand: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t'Command used for npm package lookup and installation, in argv form such as [\"mise\", \"exec\", \"node@20\", \"--\", \"npm\"].',\n\t\t\t}),\n\t\t),\n\t\tcollapseChangelog: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Show the condensed changelog after update; use /changelog for the full changelog.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.collapseChangelog,\n\t\t\t}),\n\t\t),\n\t\tenableInstallTelemetry: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Send an anonymous version-adoption ping on eligible interactive launches.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.enableInstallTelemetry,\n\t\t\t}),\n\t\t),\n\t\tpackages: Type.Optional(\n\t\t\tType.Array(PackageSourceSchema, {\n\t\t\t\tdescription: \"npm or git package sources, as strings or objects with resource filtering.\",\n\t\t\t}),\n\t\t),\n\t\textensions: Type.Optional(\n\t\t\tType.Array(Type.String(), { description: \"Local extension file paths or directories.\" }),\n\t\t),\n\t\tskills: Type.Optional(SkillsInputSchema),\n\t\tprompts: Type.Optional(\n\t\t\tType.Array(Type.String(), { description: \"Local prompt template file paths or directories.\" }),\n\t\t),\n\t\tthemes: Type.Optional(Type.Array(Type.String(), { description: \"Local theme file paths or directories.\" })),\n\t\tworkflows: Type.Optional(WorkflowsSettingsSchema),\n\t\tenableSkillCommands: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Register skills as /skill:name commands.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.enableSkillCommands,\n\t\t\t}),\n\t\t),\n\t\tterminal: Type.Optional(TerminalSettingsSchema),\n\t\therdr: Type.Optional(HerdrSettingsSchema),\n\t\timages: Type.Optional(ImageSettingsSchema),\n\t\tenabledModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"Model patterns for cycling, in the same format as the --models CLI flag.\",\n\t\t\t}),\n\t\t),\n\t\tdefaultTools: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Initial tool selection. Plain names replace the inherited selection; +name and -name entries add or remove tools.\",\n\t\t\t}),\n\t\t),\n\t\tdoubleEscapeAction: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"fork\"), Type.Literal(\"tree\"), Type.Literal(\"none\")], {\n\t\t\t\tdescription: \"Action for double-escape with an empty editor.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.doubleEscapeAction,\n\t\t\t}),\n\t\t),\n\t\ttreeFilterMode: Type.Optional(\n\t\t\tType.Union(\n\t\t\t\t[\n\t\t\t\t\tType.Literal(\"default\"),\n\t\t\t\t\tType.Literal(\"no-tools\"),\n\t\t\t\t\tType.Literal(\"user-only\"),\n\t\t\t\t\tType.Literal(\"labeled-only\"),\n\t\t\t\t\tType.Literal(\"all\"),\n\t\t\t\t],\n\t\t\t\t{\n\t\t\t\t\tdescription: \"Default filter when opening /tree.\",\n\t\t\t\t\tdefault: SETTINGS_DEFAULTS.treeFilterMode,\n\t\t\t\t},\n\t\t\t),\n\t\t),\n\t\tthinkingBudgets: Type.Optional(\n\t\t\tthinkingBudgetsSettings({\n\t\t\t\tdescription: \"Custom token budgets for thinking levels.\",\n\t\t\t}),\n\t\t),\n\t\teditorPaddingX: Type.Optional(\n\t\t\tType.Number({\n\t\t\t\tdescription: \"Horizontal padding for the input editor (0-3).\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.editorPaddingX,\n\t\t\t}),\n\t\t),\n\t\toutputPad: Type.Optional(\n\t\t\tType.Union([Type.Literal(0), Type.Literal(1)], {\n\t\t\t\tdescription: \"Horizontal padding for transcript content.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.outputPad,\n\t\t\t}),\n\t\t),\n\t\tautocompleteMaxVisible: Type.Optional(\n\t\t\tType.Number({\n\t\t\t\tdescription: \"Maximum visible items in the autocomplete dropdown (3-20).\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.autocompleteMaxVisible,\n\t\t\t}),\n\t\t),\n\t\tshowHardwareCursor: Type.Optional(\n\t\t\tType.Boolean({ description: \"Show the terminal cursor while still positioning it for IME.\" }),\n\t\t),\n\t\tfullscreenScrollbar: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"auto\"), Type.Literal(\"always\"), Type.Literal(\"hidden\")], {\n\t\t\t\tdescription: \"Fullscreen transcript scrollbar visibility.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenScrollbar,\n\t\t\t}),\n\t\t),\n\t\tfullscreenExitOutput: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"transcript\"), Type.Literal(\"resume-hint\")], {\n\t\t\t\tdescription:\n\t\t\t\t\t\"What the terminal keeps when a fullscreen session exits: the final transcript with a resume hint, or only the resume hint.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenExitOutput,\n\t\t\t}),\n\t\t),\n\t\tfullscreenCopyOnSelect: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Copy fullscreen text selections automatically on mouse release.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenCopyOnSelect,\n\t\t\t}),\n\t\t),\n\t\tfullscreenWheelScrollLines: Type.Optional(\n\t\t\tType.Union([Type.Number(), Type.Literal(\"auto\")], {\n\t\t\t\tdescription: \"Lines scrolled per wheel event in fullscreen mode; numeric values are clamped from 1 to 100.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenWheelScrollLines,\n\t\t\t}),\n\t\t),\n\t\tcodemode: Type.Optional(CodemodeSettingsSchema),\n\t\tmarkdown: Type.Optional(MarkdownSettingsSchema),\n\t\twarnings: Type.Optional(WarningSettingsSchema),\n\t\thttpProxy: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Proxy URL applied as HTTP_PROXY and HTTPS_PROXY for Atomic-managed HTTP clients. Global only.\",\n\t\t\t}),\n\t\t),\n\t\thttpIdleTimeoutMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'HTTP idle timeout as milliseconds, a duration such as \"30s\", \"5m\", or \"1h\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.httpIdleTimeoutMs,\n\t\t\t}),\n\t\t),\n\t\tcacheWarming: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"off\"), Type.Literal(\"streaming\"), Type.Literal(\"idle\")], {\n\t\t\t\tdescription:\n\t\t\t\t\t'Cache-warming profile. \"idle\" also warms between agent runs. Global only because each refresh costs money.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.cacheWarming,\n\t\t\t}),\n\t\t),\n\t\twebsocketConnectTimeoutMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'WebSocket connect or open handshake timeout as milliseconds, a duration such as \"30s\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t}),\n\t\t),\n\t\tstreamDeadlineMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'Maximum idle gap between two provider stream events as milliseconds, a duration such as \"30s\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t}),\n\t\t),\n\t\tqueueMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdescription: \"Legacy setting migrated to steeringMode.\",\n\t\t\t\tdeprecated: true,\n\t\t\t}),\n\t\t),\n\t\twebsockets: Type.Optional(\n\t\t\tType.Boolean({ description: \"Legacy setting migrated to transport.\", deprecated: true }),\n\t\t),\n\t},\n\t{ additionalProperties: true },\n);\n\ntype SettingsInput = Static<typeof SettingsSchema>;\n\nexport interface CompactionModelOverride extends Static<typeof CompactionModelOverrideSchema> {}\nexport interface CompactionSettings extends Static<typeof CompactionSettingsSchema> {}\nexport interface BranchSummarySettings extends Static<typeof BranchSummarySettingsSchema> {}\nexport interface SessionSummarySettings extends Static<typeof SessionSummarySettingsSchema> {}\nexport interface ProviderRetrySettings extends Static<typeof ProviderRetrySettingsSchema> {}\nexport interface RetrySettings extends Omit<Static<typeof RetrySettingsSchema>, \"maxDelayMs\"> {}\nexport interface TerminalSettings extends Static<typeof TerminalSettingsSchema> {}\nexport interface ImageSettings extends Static<typeof ImageSettingsSchema> {}\nexport interface SearchSettings extends Static<typeof SearchSettingsSchema> {}\nexport interface BashInterceptorSettings extends Static<typeof BashInterceptorSettingsSchema> {}\nexport interface ModelRoutingSettings extends Static<typeof ModelRoutingSettingsSchema> {}\nexport interface ThinkingBudgetsSettings extends Static<typeof ThinkingBudgetsSettingsSchema> {}\nexport type MermaidRenderingMode = NonNullable<Static<typeof MarkdownSettingsSchema>[\"mermaid\"]>;\nexport interface MarkdownSettings extends Static<typeof MarkdownSettingsSchema> {}\nexport interface WarningSettings extends Static<typeof WarningSettingsSchema> {}\nexport type CodemodeMode = Static<typeof CodemodeModeSchema>;\nexport interface CodemodeSettings extends Static<typeof CodemodeSettingsSchema> {}\nexport type DefaultProjectTrust = NonNullable<SettingsInput[\"defaultProjectTrust\"]>;\nexport type QuietStartup = NonNullable<SettingsInput[\"quietStartup\"]>;\nexport type TransportSetting = NonNullable<SettingsInput[\"transport\"]>;\nexport type PackageSource = Static<typeof PackageSourceSchema>;\nexport type FullscreenExitOutput = NonNullable<SettingsInput[\"fullscreenExitOutput\"]>;\nexport type CacheWarmingMode = NonNullable<SettingsInput[\"cacheWarming\"]>;\nexport interface Settings extends Omit<SettingsInput, \"queueMode\" | \"retry\" | \"skills\" | \"websockets\"> {\n\tretry?: RetrySettings;\n\tskills?: string[];\n}\n"]}
1
+ {"version":3,"file":"settings-schema.js","sourceRoot":"","sources":["../../src/core/settings-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAoC,IAAI,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,SAAS,sBAAsB,CAAC,OAAO,GAA+C,EAAE;IACvF,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,gBAAgB,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,eAAe,CAAC,IAAY;IACpC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,W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CAAC,eAAe,CAAC,CAAC,EAAE;QAChE,WAAW,EAAE,0CAA0C;QACvD,UAAU,EAAE,IAAI;KAChB,CAAC,CACF;IACD,UAAU,EAAE,IAAI,CAAC,QAAQ,CACxB,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,uCAAuC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CACxF;CACD,EACD,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAC9B,CAAC","sourcesContent":["import { ModelThinkingLevelSchema } from \"@bastani/pi-ai/providers/model-schema\";\nimport { type Static, type TSchemaOptions, Type } from \"typebox\";\nimport { SETTINGS_DEFAULTS } from \"./settings-defaults.ts\";\n\nfunction nonNegativeSafeInteger(options: { default?: number; description?: string } = {}) {\n\treturn Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER, ...options });\n}\n\nfunction caseInsensitive(word: string): string {\n\treturn [...word].map((letter) => `[${letter.toLowerCase()}${letter.toUpperCase()}]`).join(\"\");\n}\n\n/** Mirrors `parseHttpIdleTimeoutMs`: milliseconds, `disabled`, or a duration such as `30s`, `5m`, `1h`. */\nconst TIMEOUT_STRING_PATTERN = `^(?:${caseInsensitive(\"disabled\")}|[0-9]+(?:${caseInsensitive(\"ms\")}|[smhSMH])?)$`;\n\nfunction timeoutSetting(options?: TSchemaOptions) {\n\treturn Type.Union([Type.Number({ minimum: 0 }), Type.String({ pattern: TIMEOUT_STRING_PATTERN })], options);\n}\n\nconst CompactionModelOverrideSchema = Type.Object({\n\treserveTokens: Type.Optional(nonNegativeSafeInteger()),\n\tpreserve_recent: Type.Optional(nonNegativeSafeInteger()),\n});\n\nconst CompactionSettingsSchema = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.compaction.enabled })),\n\treserveTokens: Type.Optional(\n\t\tnonNegativeSafeInteger({\n\t\t\tdescription: \"Free context tokens below which automatic compaction starts.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.reserveTokens,\n\t\t}),\n\t),\n\tcompression_ratio: Type.Optional(\n\t\tType.Number({\n\t\t\texclusiveMinimum: 0,\n\t\t\texclusiveMaximum: 1,\n\t\t\tdescription: \"Fraction of compactable transcript lines to keep.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.compression_ratio,\n\t\t}),\n\t),\n\tpreserve_recent: Type.Optional(\n\t\tnonNegativeSafeInteger({\n\t\t\tdescription: \"Exact number of newest context-visible messages kept outside the compactable region.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.preserve_recent,\n\t\t}),\n\t),\n\tquery: Type.Optional(\n\t\tType.String({\n\t\t\tdescription:\n\t\t\t\t\"Relevance focus for selecting older lines to retain. Defaults to the last user message when omitted.\",\n\t\t}),\n\t),\n\tmodelOverrides: Type.Optional(\n\t\tType.Record(Type.String(), CompactionModelOverrideSchema, {\n\t\t\tdescription: 'Per-model overrides keyed by exact \"provider/modelId\" strings.',\n\t\t}),\n\t),\n});\n\nconst BranchSummarySettingsSchema = Type.Object({\n\treserveTokens: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Tokens reserved when selecting branch history; the provider sizes summary output.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.branchSummary.reserveTokens,\n\t\t}),\n\t),\n\tskipPrompt: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: 'When true, skips the \"Summarize branch?\" prompt and defaults to no summary.',\n\t\t\tdefault: SETTINGS_DEFAULTS.branchSummary.skipPrompt,\n\t\t}),\n\t),\n});\n\nconst SessionSummarySettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Generate a one-line resume-picker summary once the agent goes idle.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.sessionSummary.enabled,\n\t\t}),\n\t),\n});\n\nconst ProviderRetrySettingsSchema = Type.Object({\n\ttimeoutMs: Type.Optional(Type.Number({ description: \"SDK or provider request timeout in milliseconds.\" })),\n\tmaxRetries: Type.Optional(Type.Number({ description: \"SDK or provider retry attempts.\" })),\n\tmaxRetryDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Maximum server-requested delay before failing.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.provider.maxRetryDelayMs,\n\t\t}),\n\t),\n});\n\nconst RetrySettingsSchema = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.retry.enabled })),\n\tmaxRetries: Type.Optional(Type.Number({ default: SETTINGS_DEFAULTS.retry.maxRetries })),\n\tbaseDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Exponential backoff base delay in milliseconds: 2s, 4s, 8s.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.baseDelayMs,\n\t\t}),\n\t),\n\tmaxAgentDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Maximum agent-level backoff delay in milliseconds. 0 retries immediately.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.maxAgentDelayMs,\n\t\t}),\n\t),\n\tprovider: Type.Optional(ProviderRetrySettingsSchema),\n\tmaxDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Legacy retry delay setting. Use provider.maxRetryDelayMs instead.\",\n\t\t\tdeprecated: true,\n\t\t}),\n\t),\n});\n\nconst TerminalSettingsSchema = Type.Object({\n\tshowImages: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Show images when the terminal supports them.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.showImages,\n\t\t}),\n\t),\n\timageWidthCells: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Preferred inline image width in terminal cells.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.imageWidthCells,\n\t\t}),\n\t),\n\tclearOnShrink: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Clear empty rows when content shrinks.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.clearOnShrink,\n\t\t}),\n\t),\n\tshowTerminalProgress: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Show OSC 9;4 terminal progress indicators.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.showTerminalProgress,\n\t\t}),\n\t),\n\thyperlinks: Type.Optional(\n\t\tType.Union([Type.Boolean(), Type.Literal(\"auto\")], {\n\t\t\tdescription: 'Hyperlink capability override. \"auto\" and invalid values keep terminal detection.',\n\t\t}),\n\t),\n\timages: Type.Optional(\n\t\tType.Union([Type.Literal(\"kitty\"), Type.Literal(\"iterm2\"), Type.Literal(\"auto\"), Type.Literal(false)], {\n\t\t\tdescription: 'Inline-image protocol override. false disables images; \"auto\" keeps terminal detection.',\n\t\t}),\n\t),\n\ttrueColor: Type.Optional(\n\t\tType.Union([Type.Boolean(), Type.Literal(\"auto\")], {\n\t\t\tdescription: 'Truecolor capability override. \"auto\" and invalid values keep terminal detection.',\n\t\t}),\n\t),\n});\n\nconst ImageSettingsSchema = Type.Object({\n\tautoResize: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Resize images to 2000x2000 maximum for better model compatibility.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.images.autoResize,\n\t\t}),\n\t),\n\tblockImages: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"When true, prevents all images from being sent to LLM providers.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.images.blockImages,\n\t\t}),\n\t),\n});\n\nconst SearchSettingsSchema = Type.Object({\n\tcontextBefore: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Number of context lines before each search match.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.search.contextBefore,\n\t\t}),\n\t),\n\tcontextAfter: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Number of context lines after each search match.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.search.contextAfter,\n\t\t}),\n\t),\n});\n\nconst BashInterceptorSettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription:\n\t\t\t\t\"When true, block shell commands that have dedicated tools and offer remaining bash tool calls to user_bash extension handlers before local execution.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.bashInterceptor.enabled,\n\t\t}),\n\t),\n});\n\nconst HerdrSettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Enable the built-in reporter in an eligible Herdr pane.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.herdr.enabled,\n\t\t}),\n\t),\n});\n\nconst ModelRoutingSettingsSchema = Type.Object(\n\t{\n\t\tallowedProviders: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"When nonempty, only models from these provider IDs are routing candidates.\",\n\t\t\t}),\n\t\t),\n\t\texcludedProviders: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"Provider IDs that are never routing candidates. Applied after allowedProviders.\",\n\t\t\t}),\n\t\t),\n\t\tallowedModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"When nonempty, only models matching these full-ID or glob patterns, as in enabledModels, are routing candidates.\",\n\t\t\t}),\n\t\t),\n\t\texcludedModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Models matching these full-ID or glob patterns are never routing candidates. Applied after allowedModels.\",\n\t\t\t}),\n\t\t),\n\t},\n\t{\n\t\tdescription:\n\t\t\t'Provider and model filters for the candidates model \"auto\" may route to. Does not affect routerModel.',\n\t},\n);\n\nfunction thinkingBudgetsSettings(options?: TSchemaOptions) {\n\treturn Type.Object(\n\t\t{\n\t\t\tminimal: Type.Optional(Type.Number()),\n\t\t\tlow: Type.Optional(Type.Number()),\n\t\t\tmedium: Type.Optional(Type.Number()),\n\t\t\thigh: Type.Optional(Type.Number()),\n\t\t},\n\t\toptions,\n\t);\n}\n\nconst ThinkingBudgetsSettingsSchema = thinkingBudgetsSettings();\n\nconst MarkdownSettingsSchema = Type.Object({\n\tcodeBlockIndent: Type.Optional(Type.String({ default: SETTINGS_DEFAULTS.markdown.codeBlockIndent })),\n\tmermaid: Type.Optional(\n\t\tType.Union([Type.Literal(\"off\"), Type.Literal(\"final\"), Type.Literal(\"streaming\")], {\n\t\t\tdefault: SETTINGS_DEFAULTS.markdown.mermaid,\n\t\t}),\n\t),\n\tlatex: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Render LaTeX expressions as terminal-friendly Unicode math.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.markdown.latex,\n\t\t}),\n\t),\n});\n\nconst WarningSettingsSchema = Type.Object({\n\tanthropicExtraUsage: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.warnings.anthropicExtraUsage })),\n});\n\nfunction codemodeMode(options?: TSchemaOptions) {\n\treturn Type.Union([Type.Literal(\"on\"), Type.Literal(\"only\")], options);\n}\n\nconst CodemodeModeSchema = codemodeMode();\n\nconst CodemodeSettingsSchema = Type.Object({\n\tmode: Type.Optional(\n\t\tcodemodeMode({\n\t\t\tdescription:\n\t\t\t\t'How codemode presents tools. \"on\" keeps direct tool declarations visible with script-call information; \"only\" hides ordinary direct callable declarations so the model uses scripts. Model-only tools remain directly available.',\n\t\t\tdefault: SETTINGS_DEFAULTS.codemode.mode,\n\t\t}),\n\t),\n\tinlineBudget: Type.Optional(\n\t\tType.Number({\n\t\t\tminimum: 0,\n\t\t\tdescription: \"Estimated tokens available for inline codemode tool declarations.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.codemode.inlineBudget,\n\t\t}),\n\t),\n});\n\nconst PackageSourceSchema = Type.Union(\n\t[\n\t\tType.String({ description: \"Load all resources from the package.\" }),\n\t\tType.Object({\n\t\t\tsource: Type.String(),\n\t\t\tautoload: Type.Optional(\n\t\t\t\tType.Boolean({ description: \"When false, start empty and only apply explicit resource patterns.\" }),\n\t\t\t),\n\t\t\textensions: Type.Optional(Type.Array(Type.String())),\n\t\t\tskills: Type.Optional(Type.Array(Type.String())),\n\t\t\tprompts: Type.Optional(Type.Array(Type.String())),\n\t\t\tthemes: Type.Optional(Type.Array(Type.String())),\n\t\t\tworkflows: Type.Optional(Type.Array(Type.String())),\n\t\t\tmcpServers: Type.Optional(Type.Array(Type.String())),\n\t\t}),\n\t],\n\t{\n\t\tdescription:\n\t\t\t\"Package source for npm or git packages. Use the string form to load all resources or the object form to filter resources.\",\n\t},\n);\n\nconst StringArraySchema = Type.Array(Type.String());\n\nconst SkillsInputSchema = Type.Union(\n\t[\n\t\tStringArraySchema,\n\t\tType.Object(\n\t\t\t{\n\t\t\t\tenableSkillCommands: Type.Optional(Type.Boolean()),\n\t\t\t\tcustomDirectories: Type.Optional(StringArraySchema),\n\t\t\t},\n\t\t\t{ deprecated: true },\n\t\t),\n\t],\n\t{ description: \"Local skill file paths or directories.\" },\n);\n\nexport const StorageSelectionSchema = Type.Union([\n\tType.Object(\n\t\t{\n\t\t\tpath: Type.Optional(Type.String({ description: \"Database path relative to the Atomic home directory.\" })),\n\t\t\tmemory: Type.Optional(Type.Boolean({ description: \"Explicitly select ephemeral storage.\" })),\n\t\t\tprefix: Type.Optional(Type.String()),\n\t\t},\n\t\t{\n\t\t\tadditionalProperties: false,\n\t\t\tnot: { required: [\"path\", \"memory\"], properties: { path: { minLength: 1 }, memory: { const: true } } },\n\t\t},\n\t),\n\tType.Object(\n\t\t{\n\t\t\tadapter: Type.String({ minLength: 1, description: \"User-installed storage adapter module specifier.\" }),\n\t\t\toptions: Type.Optional(\n\t\t\t\tType.Record(Type.String(), Type.Union([Type.String(), Type.Number(), Type.Boolean(), Type.Null()])),\n\t\t\t),\n\t\t\tsecrets: Type.Optional(\n\t\t\t\tType.Record(\n\t\t\t\t\tType.String(),\n\t\t\t\t\tType.Union([\n\t\t\t\t\t\tType.Object({ env: Type.String() }, { additionalProperties: false }),\n\t\t\t\t\t\tType.Object({ file: Type.String() }, { additionalProperties: false }),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t),\n\t\t\tprefix: Type.Optional(Type.String()),\n\t\t},\n\t\t{ additionalProperties: false },\n\t),\n]);\n\nexport const SessionStorageSelectionSchema = Type.Union([\n\tStorageSelectionSchema,\n\tType.Object({ dir: Type.String() }, { additionalProperties: false }),\n]);\n\nconst ResourceLimitsSchema = Type.Object(\n\t{\n\t\tsession: Type.Optional(Type.Integer({ minimum: 1 })),\n\t\tprocess: Type.Optional(Type.Integer({ minimum: 1 })),\n\t},\n\t{ additionalProperties: false },\n);\n\nconst WorkflowsSettingsSchema = Type.Union(\n\t[\n\t\tStringArraySchema,\n\t\tType.Object({\n\t\t\tpaths: Type.Optional(Type.Array(Type.String(), { description: \"Workflow resource paths.\" })),\n\t\t\tjournal: Type.Optional(StorageSelectionSchema),\n\t\t\tlocalWorkers: Type.Optional(\n\t\t\t\tType.Object(\n\t\t\t\t\t{\n\t\t\t\t\t\tcount: Type.Integer({ minimum: 1, description: \"Number of local worker processes.\" }),\n\t\t\t\t\t\tdefinitions: Type.Array(\n\t\t\t\t\t\t\tType.Object({ path: Type.String(), exportName: Type.String() }, { additionalProperties: false }),\n\t\t\t\t\t\t\t{ description: \"Importable child workflow definitions workers may run.\" },\n\t\t\t\t\t\t),\n\t\t\t\t\t\tstartupTimeoutMs: Type.Optional(\n\t\t\t\t\t\t\tType.Integer({\n\t\t\t\t\t\t\t\tminimum: 1,\n\t\t\t\t\t\t\t\tmaximum: 2_147_483_647,\n\t\t\t\t\t\t\t\tdescription: \"Milliseconds each worker process may take to become ready. Default: 30000.\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tleaseMs: Type.Optional(\n\t\t\t\t\t\t\tType.Integer({\n\t\t\t\t\t\t\t\tminimum: 2000,\n\t\t\t\t\t\t\t\tmaximum: 2_147_483_647,\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\"Milliseconds a live worker that has stopped responding keeps its child before the child is replayed elsewhere. Default: 30000.\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\t{ additionalProperties: false },\n\t\t\t\t),\n\t\t\t),\n\t\t\tadmission: Type.Optional(\n\t\t\t\tType.Object(\n\t\t\t\t\t{\n\t\t\t\t\t\tlimits: Type.Optional(ResourceLimitsSchema),\n\t\t\t\t\t\tuserLimits: Type.Optional(ResourceLimitsSchema),\n\t\t\t\t\t\tuserDatabase: Type.Optional(Type.String()),\n\t\t\t\t\t\thost: Type.Optional(\n\t\t\t\t\t\t\tType.Object(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tmaxLoadPerCpu: Type.Optional(Type.Number({ minimum: 0 })),\n\t\t\t\t\t\t\t\t\tminFreeMemoryBytes: Type.Optional(Type.Number({ minimum: 0 })),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t{ additionalProperties: false },\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\t{ additionalProperties: false },\n\t\t\t\t),\n\t\t\t),\n\t\t}),\n\t],\n\t{\n\t\tdescription:\n\t\t\t'Local workflow paths, or an object with \"paths\", \"journal\" storage, \"localWorkers\" and \"admission\" settings.',\n\t},\n);\n\nexport const SettingsSchema = Type.Object(\n\t{\n\t\t$schema: Type.Optional(Type.String({ description: \"JSON Schema reference.\" })),\n\t\tstorage: Type.Optional(StorageSelectionSchema),\n\t\tsessions: Type.Optional(Type.Object({ storage: Type.Optional(SessionStorageSelectionSchema) })),\n\t\tlastChangelogVersion: Type.Optional(Type.String()),\n\t\tfirstRunOnboardingStartedVersion: Type.Optional(\n\t\t\tType.String({ description: \"Managed onboarding state; leave unchanged.\" }),\n\t\t),\n\t\tonboardedVersion: Type.Optional(\n\t\t\tType.String({ description: \"Managed onboarding completion state; leave unchanged.\" }),\n\t\t),\n\t\tdefaultProvider: Type.Optional(Type.String()),\n\t\tdefaultModel: Type.Optional(Type.String()),\n\t\trouterModel: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t'Inference model for workflow-stage and subagent model: \"auto\" selection only. An exact provider/model selects a registered chat or classifier model; \"auto\" and an empty string use the current chat model.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.routerModel,\n\t\t\t}),\n\t\t),\n\t\tcompactionModel: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t'Compaction model: \"auto\" or an empty string uses the session model, and an exact provider/model selects a registered chat model, classifier, or compactor.',\n\t\t\t}),\n\t\t),\n\t\tmodelRouting: Type.Optional(ModelRoutingSettingsSchema),\n\t\tdefaultThinkingLevel: Type.Optional(ModelThinkingLevelSchema),\n\t\tmodelThinkingLevels: Type.Optional(\n\t\t\tType.Record(Type.String(), ModelThinkingLevelSchema, {\n\t\t\t\tdescription: 'Per-model default thinking level overrides keyed by \"provider/modelId\".',\n\t\t\t}),\n\t\t),\n\t\tfallbackModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t'Ordered main-chat fallback models, written as \"provider/model\" with an optional thinking-level suffix such as \":high\".',\n\t\t\t}),\n\t\t),\n\t\ttransport: Type.Optional(\n\t\t\tType.Union(\n\t\t\t\t[Type.Literal(\"auto\"), Type.Literal(\"sse\"), Type.Literal(\"websocket\"), Type.Literal(\"websocket-cached\")],\n\t\t\t\t{ default: SETTINGS_DEFAULTS.transport },\n\t\t\t),\n\t\t),\n\t\tsteeringMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdefault: SETTINGS_DEFAULTS.steeringMode,\n\t\t\t}),\n\t\t),\n\t\tfollowUpMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdefault: SETTINGS_DEFAULTS.followUpMode,\n\t\t\t}),\n\t\t),\n\t\ttheme: Type.Optional(Type.String()),\n\t\tenableAnalytics: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Opt in to analytics data sharing. Storage only; Atomic does not transmit analytics.\",\n\t\t\t}),\n\t\t),\n\t\ttrackingId: Type.Optional(\n\t\t\tType.String({ description: \"Analytics tracking identifier, generated when analytics is enabled.\" }),\n\t\t),\n\t\tdeviceId: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"Stable installation UUID, generated when authentication first needs it. Global only.\",\n\t\t\t}),\n\t\t),\n\t\tshowCacheMissNotices: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Show cache cost and provider recovery notices.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.showCacheMissNotices,\n\t\t\t}),\n\t\t),\n\t\tcompaction: Type.Optional(CompactionSettingsSchema),\n\t\tbranchSummary: Type.Optional(BranchSummarySettingsSchema),\n\t\tsessionSummary: Type.Optional(SessionSummarySettingsSchema),\n\t\tretry: Type.Optional(RetrySettingsSchema),\n\t\thideThinkingBlock: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.hideThinkingBlock })),\n\t\texternalEditor: Type.Optional(\n\t\t\tType.String({ description: \"Command for Ctrl+G external editor; takes precedence over VISUAL and EDITOR.\" }),\n\t\t),\n\t\tshellPath: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"Custom shell path, for example for Cygwin on Windows, with support for leading ~ expansion.\",\n\t\t\t}),\n\t\t),\n\t\tquietStartup: Type.Optional(\n\t\t\tType.Union([Type.Boolean(), Type.Literal(\"header\")], {\n\t\t\t\tdescription: 'When true, hide all startup output. When \"header\", keep only the startup header.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.quietStartup,\n\t\t\t}),\n\t\t),\n\t\tdefaultProjectTrust: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"ask\"), Type.Literal(\"always\"), Type.Literal(\"never\")], {\n\t\t\t\tdescription: \"Global setting only.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.defaultProjectTrust,\n\t\t\t}),\n\t\t),\n\t\tshellCommandPrefix: Type.Optional(\n\t\t\tType.String({ description: \"Prefix prepended to every bash command, for example to enable shell aliases.\" }),\n\t\t),\n\t\tbashInterceptor: Type.Optional(BashInterceptorSettingsSchema),\n\t\tsearch: Type.Optional(SearchSettingsSchema),\n\t\tnpmCommand: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t'Command used for npm package lookup and installation, in argv form such as [\"mise\", \"exec\", \"node@20\", \"--\", \"npm\"].',\n\t\t\t}),\n\t\t),\n\t\tcollapseChangelog: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Show the condensed changelog after update; use /changelog for the full changelog.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.collapseChangelog,\n\t\t\t}),\n\t\t),\n\t\tenableInstallTelemetry: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Send an anonymous version-adoption ping on eligible interactive launches.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.enableInstallTelemetry,\n\t\t\t}),\n\t\t),\n\t\tpackages: Type.Optional(\n\t\t\tType.Array(PackageSourceSchema, {\n\t\t\t\tdescription: \"npm or git package sources, as strings or objects with resource filtering.\",\n\t\t\t}),\n\t\t),\n\t\textensions: Type.Optional(\n\t\t\tType.Array(Type.String(), { description: \"Local extension file paths or directories.\" }),\n\t\t),\n\t\tskills: Type.Optional(SkillsInputSchema),\n\t\tprompts: Type.Optional(\n\t\t\tType.Array(Type.String(), { description: \"Local prompt template file paths or directories.\" }),\n\t\t),\n\t\tthemes: Type.Optional(Type.Array(Type.String(), { description: \"Local theme file paths or directories.\" })),\n\t\tworkflows: Type.Optional(WorkflowsSettingsSchema),\n\t\tenableSkillCommands: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Register skills as /skill:name commands.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.enableSkillCommands,\n\t\t\t}),\n\t\t),\n\t\tterminal: Type.Optional(TerminalSettingsSchema),\n\t\therdr: Type.Optional(HerdrSettingsSchema),\n\t\timages: Type.Optional(ImageSettingsSchema),\n\t\tenabledModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"Model patterns for cycling, in the same format as the --models CLI flag.\",\n\t\t\t}),\n\t\t),\n\t\tdefaultTools: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Initial tool selection. Plain names replace the inherited selection; +name and -name entries add or remove tools.\",\n\t\t\t}),\n\t\t),\n\t\tdoubleEscapeAction: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"fork\"), Type.Literal(\"tree\"), Type.Literal(\"none\")], {\n\t\t\t\tdescription: \"Action for double-escape with an empty editor.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.doubleEscapeAction,\n\t\t\t}),\n\t\t),\n\t\ttreeFilterMode: Type.Optional(\n\t\t\tType.Union(\n\t\t\t\t[\n\t\t\t\t\tType.Literal(\"default\"),\n\t\t\t\t\tType.Literal(\"no-tools\"),\n\t\t\t\t\tType.Literal(\"user-only\"),\n\t\t\t\t\tType.Literal(\"labeled-only\"),\n\t\t\t\t\tType.Literal(\"all\"),\n\t\t\t\t],\n\t\t\t\t{\n\t\t\t\t\tdescription: \"Default filter when opening /tree.\",\n\t\t\t\t\tdefault: SETTINGS_DEFAULTS.treeFilterMode,\n\t\t\t\t},\n\t\t\t),\n\t\t),\n\t\tthinkingBudgets: Type.Optional(\n\t\t\tthinkingBudgetsSettings({\n\t\t\t\tdescription: \"Custom token budgets for thinking levels.\",\n\t\t\t}),\n\t\t),\n\t\teditorPaddingX: Type.Optional(\n\t\t\tType.Number({\n\t\t\t\tdescription: \"Horizontal padding for the input editor (0-3).\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.editorPaddingX,\n\t\t\t}),\n\t\t),\n\t\toutputPad: Type.Optional(\n\t\t\tType.Union([Type.Literal(0), Type.Literal(1)], {\n\t\t\t\tdescription: \"Horizontal padding for transcript content.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.outputPad,\n\t\t\t}),\n\t\t),\n\t\tautocompleteMaxVisible: Type.Optional(\n\t\t\tType.Number({\n\t\t\t\tdescription: \"Maximum visible items in the autocomplete dropdown (3-20).\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.autocompleteMaxVisible,\n\t\t\t}),\n\t\t),\n\t\tshowHardwareCursor: Type.Optional(\n\t\t\tType.Boolean({ description: \"Show the terminal cursor while still positioning it for IME.\" }),\n\t\t),\n\t\tfullscreenScrollbar: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"auto\"), Type.Literal(\"always\"), Type.Literal(\"hidden\")], {\n\t\t\t\tdescription: \"Fullscreen transcript scrollbar visibility.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenScrollbar,\n\t\t\t}),\n\t\t),\n\t\tfullscreenExitOutput: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"transcript\"), Type.Literal(\"resume-hint\")], {\n\t\t\t\tdescription:\n\t\t\t\t\t\"What the terminal keeps when a fullscreen session exits: the final transcript with a resume hint, or only the resume hint.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenExitOutput,\n\t\t\t}),\n\t\t),\n\t\tfullscreenCopyOnSelect: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Copy fullscreen text selections automatically on mouse release.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenCopyOnSelect,\n\t\t\t}),\n\t\t),\n\t\tfullscreenWheelScrollLines: Type.Optional(\n\t\t\tType.Union([Type.Number(), Type.Literal(\"auto\")], {\n\t\t\t\tdescription: \"Lines scrolled per wheel event in fullscreen mode; numeric values are clamped from 1 to 100.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenWheelScrollLines,\n\t\t\t}),\n\t\t),\n\t\tcodemode: Type.Optional(CodemodeSettingsSchema),\n\t\tmarkdown: Type.Optional(MarkdownSettingsSchema),\n\t\twarnings: Type.Optional(WarningSettingsSchema),\n\t\thttpProxy: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Proxy URL applied as HTTP_PROXY and HTTPS_PROXY for Atomic-managed HTTP clients. Global only.\",\n\t\t\t}),\n\t\t),\n\t\thttpIdleTimeoutMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'HTTP idle timeout as milliseconds, a duration such as \"30s\", \"5m\", or \"1h\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.httpIdleTimeoutMs,\n\t\t\t}),\n\t\t),\n\t\tcacheWarming: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"off\"), Type.Literal(\"streaming\"), Type.Literal(\"idle\")], {\n\t\t\t\tdescription:\n\t\t\t\t\t'Cache-warming profile. \"idle\" also warms between agent runs. Global only because each refresh costs money.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.cacheWarming,\n\t\t\t}),\n\t\t),\n\t\twebsocketConnectTimeoutMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'WebSocket connect or open handshake timeout as milliseconds, a duration such as \"30s\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t}),\n\t\t),\n\t\tstreamDeadlineMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'Maximum idle gap between two provider stream events as milliseconds, a duration such as \"30s\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t}),\n\t\t),\n\t\tqueueMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdescription: \"Legacy setting migrated to steeringMode.\",\n\t\t\t\tdeprecated: true,\n\t\t\t}),\n\t\t),\n\t\twebsockets: Type.Optional(\n\t\t\tType.Boolean({ description: \"Legacy setting migrated to transport.\", deprecated: true }),\n\t\t),\n\t},\n\t{ additionalProperties: true },\n);\n\ntype SettingsInput = Static<typeof SettingsSchema>;\n\nexport interface CompactionModelOverride extends Static<typeof CompactionModelOverrideSchema> {}\nexport interface CompactionSettings extends Static<typeof CompactionSettingsSchema> {}\nexport interface BranchSummarySettings extends Static<typeof BranchSummarySettingsSchema> {}\nexport interface SessionSummarySettings extends Static<typeof SessionSummarySettingsSchema> {}\nexport interface ProviderRetrySettings extends Static<typeof ProviderRetrySettingsSchema> {}\nexport interface RetrySettings extends Omit<Static<typeof RetrySettingsSchema>, \"maxDelayMs\"> {}\nexport interface TerminalSettings extends Static<typeof TerminalSettingsSchema> {}\nexport interface ImageSettings extends Static<typeof ImageSettingsSchema> {}\nexport interface SearchSettings extends Static<typeof SearchSettingsSchema> {}\nexport interface BashInterceptorSettings extends Static<typeof BashInterceptorSettingsSchema> {}\nexport interface ModelRoutingSettings extends Static<typeof ModelRoutingSettingsSchema> {}\nexport interface ThinkingBudgetsSettings extends Static<typeof ThinkingBudgetsSettingsSchema> {}\nexport type MermaidRenderingMode = NonNullable<Static<typeof MarkdownSettingsSchema>[\"mermaid\"]>;\nexport interface MarkdownSettings extends Static<typeof MarkdownSettingsSchema> {}\nexport interface WarningSettings extends Static<typeof WarningSettingsSchema> {}\nexport type CodemodeMode = Static<typeof CodemodeModeSchema>;\nexport interface CodemodeSettings extends Static<typeof CodemodeSettingsSchema> {}\nexport type DefaultProjectTrust = NonNullable<SettingsInput[\"defaultProjectTrust\"]>;\nexport type QuietStartup = NonNullable<SettingsInput[\"quietStartup\"]>;\nexport type TransportSetting = NonNullable<SettingsInput[\"transport\"]>;\nexport type PackageSource = Static<typeof PackageSourceSchema>;\nexport type FullscreenExitOutput = NonNullable<SettingsInput[\"fullscreenExitOutput\"]>;\nexport type CacheWarmingMode = NonNullable<SettingsInput[\"cacheWarming\"]>;\nexport interface Settings extends Omit<SettingsInput, \"queueMode\" | \"retry\" | \"skills\" | \"websockets\"> {\n\tretry?: RetrySettings;\n\tskills?: string[];\n}\n"]}
package/docs/settings.md CHANGED
@@ -602,6 +602,10 @@ Local worker pools are disabled unless `workflows.localWorkers` is set. With the
602
602
 
603
603
  `count` is a positive integer. Paths in the settings object resolve against the invocation working directory. Worker settings and entry-module digests are saved with the root; resume refuses changed settings or definitions. The entry-module digest does not include imported dependencies.
604
604
 
605
+ `startupTimeoutMs` is how long, in milliseconds, each worker process may take to become ready. It defaults to `30000`. The pool runs children once any worker is ready and fails only when no worker starts. This value is not saved with the root, so changing it does not block a resume. Each worker's standard error is written to `worker-logs/<root run ID>/<worker ID>.log` in the workflow journal's directory, and worker failure messages name that file. See [Worker startup and failures](/workflows/operations#worker-startup-and-failures).
606
+
607
+ `leaseMs` is how long, in milliseconds, a worker that is still running but has stopped responding keeps its child before the child is replayed on another worker. It defaults to `30000` and must be at least `2000`. A worker that exits is replaced immediately, and a worker that is still responding keeps its child even when the root itself is briefly too busy to process its heartbeats. Like `startupTimeoutMs`, this value is not saved with the root.
608
+
605
609
  `limits` caps agent sessions and managed tool processes for one root. Session permits cover creation through disposal, including fallback and delegated sessions. Process permits last until confirmed cleanup; yielding an observation wait does not free one. Processes outside Atomic's managed tools are not counted. `host` load and memory thresholds gate launches but do not impose hard OS limits.
606
610
 
607
611
  `userLimits` counts across runs only when all participating runs use the same canonical local SQLite journal. Set `userDatabase` to that exact path, and pass the admission options to participating non-pooled SDK runs. This coordinates processes for one local user; it is not a tenant isolation boundary.
@@ -1247,9 +1247,11 @@ Only first-level child workflow subtrees are placed on workers. Nested children
1247
1247
 
1248
1248
  #### Local worker options
1249
1249
 
1250
- `RunOpts.localWorkers` enables a local process pool for this root. `count` must be a positive integer. `definitions` lists `{ path, exportName }` entries. The definitions are loaded in each worker from the local filesystem. `RunOpts.admission` accepts `limits` for one root, `userLimits` across runs, a `userDatabase` canonical local SQLite path, and optional host thresholds `maxLoadPerCpu` and `minFreeMemoryBytes`.
1250
+ `RunOpts.localWorkers` enables a local process pool for this root. `count` must be a positive integer. `definitions` lists `{ path, exportName }` entries. The definitions are loaded in each worker from the local filesystem. The optional `startupTimeoutMs` is how long, in milliseconds, each worker process may take to become ready; it must be a positive integer no greater than `2147483647` and defaults to `30000`. The optional `leaseMs` is how long, in milliseconds, a worker that is still running but has stopped responding keeps its child before the child is replayed on another worker; it must be an integer from `2000` to `2147483647` and defaults to `30000`. `RunOpts.admission` accepts `limits` for one root, `userLimits` across runs, a `userDatabase` canonical local SQLite path, and optional host thresholds `maxLoadPerCpu` and `minFreeMemoryBytes`.
1251
1251
 
1252
- The option is off by default. Without it, Atomic creates no pool tables, worker processes, or polling loops. CLI users can set the same options under `workflows.localWorkers` and `workflows.admission` in settings. Settings paths resolve against the invocation working directory; SDK paths resolve against `cwd` (or the current directory). Effective settings and definition entry-module digests are persisted with the root and checked on resume. Changing them fails compatibility checks instead of silently changing placement.
1252
+ The option is off by default. Without it, Atomic creates no pool tables, worker processes, or polling loops. CLI users can set the same options under `workflows.localWorkers` and `workflows.admission` in settings. Settings paths resolve against the invocation working directory; SDK paths resolve against `cwd` (or the current directory). Effective settings and definition entry-module digests are persisted with the root and checked on resume. Changing them fails compatibility checks instead of silently changing placement. `startupTimeoutMs` and `leaseMs` are the exceptions: they are not persisted, and each start or resume uses the values it is given.
1253
+
1254
+ The pool runs children once any worker is ready and fails only when no worker starts. A worker that dies while it runs a child is replaced, and the child replays from its last committed checkpoint. Each worker's standard error is written to `worker-logs/<root run ID>/<worker ID>.log` in the journal's directory; worker failure errors name that file and include the end of its output. See [Worker startup and failures](/workflows/operations#worker-startup-and-failures).
1253
1255
 
1254
1256
  Workers are supported only on Linux and macOS hosts with native process identity and boot identity. Windows and hosts without those capabilities refuse activation, including when no process cap is configured. Remote hosts are not supported. Pooled SDK runs reject process-bound adapters, UI, persistence, and similar runtime overrides before worker launch. The CLI keeps its host-specific bindings at the root and gives worker sessions their own adapters.
1255
1257
 
@@ -1433,7 +1435,20 @@ interface RunOpts {
1433
1435
 
1434
1436
  Supplies runtime adapters, execution policy, persistence, MCP, cancellation, graph/store integration, continuation metadata, and lifecycle callbacks to `run(...)`. Every field is optional.
1435
1437
 
1436
- `LocalWorkerOptions` is `{ count: number, definitions: { path: string, exportName: string }[] }`, where `count` is a positive integer. `WorkflowAdmissionOptions` contains optional root `limits`, user-wide `userLimits`, `userDatabase`, and host thresholds. `limits` and `userLimits` accept `session` and `process` counts.
1438
+ `LocalWorkerOptions` is `{ count: number, definitions: { path: string, exportName: string }[], startupTimeoutMs?: number, leaseMs?: number }`, where `count` and `startupTimeoutMs` are positive integers and `leaseMs` is an integer of at least `2000`. `WorkflowAdmissionOptions` contains optional root `limits`, user-wide `userLimits`, `userDatabase`, and host thresholds. `limits` and `userLimits` accept `session` and `process` counts.
1439
+
1440
+ `ctx.workflow(child)` throws `WorkflowInfrastructureError` when the local worker pool cannot run a child because of a fault in the pool or the runtime around it. A failure of the child's own logic is never reported this way. The pool first replays an unfinished child from its last checkpoint on a replacement worker (up to three attempts), and throws only when it cannot absorb the fault. The error has `retryable: true` and a `code` naming the fault: `worker_lost`, `worker_cleanup_unconfirmed`, `worker_retry_limit`, `worker_startup_failed`, `stale_work_lease`, `intercom_unavailable`, or `storage_unavailable`. `isRetryableWorkflowError(error)` returns `true` when the error, or any error in its `cause` chain, is a `WorkflowInfrastructureError`:
1441
+
1442
+ ```ts
1443
+ import { isRetryableWorkflowError } from "@bastani/atomic/workflows";
1444
+
1445
+ try {
1446
+ await ctx.workflow(child, { inputs });
1447
+ } catch (error) {
1448
+ if (!isRetryableWorkflowError(error)) throw error;
1449
+ requeue(inputs);
1450
+ }
1451
+ ```
1437
1452
 
1438
1453
  `onStageSessionEvent` streams every agent-session event from each stage (for example `message_update`, `tool_execution_start`, and `tool_execution_end`), tagged with the stage's `runId` and `stageId`. `AgentSessionEvent` is exported by `@bastani/atomic`. The stream continues when a fallback model replaces a stage's session. Stages in nested `ctx.workflow(...)` runs report the child run's `runId`. Exceptions thrown by the listener, and rejections from an async listener, are ignored and do not affect the stage.
1439
1454
 
@@ -875,7 +875,7 @@ Local workers are opt-in. With no `localWorkers` setting or `RunOpts.localWorker
875
875
 
876
876
  The root workflow remains in its original process and owns the run graph, run controls, journal writes and Intercom routes. It can be an inline closure. Only an entire first-level `ctx.workflow(child)` subtree can move to a local worker. Nested workflows stay on that worker. Independent stage placement is not supported. Register every worker-eligible child definition by its module path and export name. The worker loads the module again in its own process, so the definition must be importable rather than a closure. Missing or incompatible definitions fail the run; Atomic does not fall back to local execution.
877
877
 
878
- Worker definitions are loaded in the SDK with `loadWorkerWorkflow(absolutePath, exportName)`, then passed to `ctx.workflow(...)`. The SDK also accepts `RunOpts.localWorkers`; the settings form applies to CLI launches. Paths in worker settings resolve against the invocation working directory. `RunOpts.localWorkers` paths resolve against `cwd` (or the current working directory when omitted). On resume, Atomic checks the saved worker options and definition entry-module digests. A changed definition or worker configuration is refused. The digest covers the entry file, not its imported dependency graph.
878
+ Worker definitions are loaded in the SDK with `loadWorkerWorkflow(absolutePath, exportName)`, then passed to `ctx.workflow(...)`. The SDK also accepts `RunOpts.localWorkers`; the settings form applies to CLI launches. Paths in worker settings resolve against the invocation working directory. `RunOpts.localWorkers` paths resolve against `cwd` (or the current working directory when omitted). On resume, Atomic checks the saved worker options (`count` and `definitions`) and definition entry-module digests. A changed definition or worker configuration is refused. The digest covers the entry file, not its imported dependency graph.
879
879
 
880
880
  Pools require the default-prefix local SQLite workflow journal. Memory, remote, custom-prefix, and custom journals cannot host workers. Start a new run to opt in; an existing unpooled run cannot change placement on resume. If new global worker settings prevent an older run from resuming, disable those settings for that resume.
881
881
 
@@ -883,6 +883,16 @@ The supported placement is multiple local processes on Linux or macOS. Windows a
883
883
 
884
884
  The root's existing `/workflow status`, `/workflow stages`, steering, pause, quit, and resume controls still address one root. A worker failure can replay an unfinished child from its last committed checkpoint. This is at-least-once recovery. An external effect that happens before its checkpoint can happen again; use stable logical idempotency keys for effects that must not duplicate.
885
885
 
886
+ ### Worker startup and failures
887
+
888
+ Each worker process must report that it is ready within `localWorkers.startupTimeoutMs` milliseconds, 30000 by default. When a pool starts, it runs children as soon as one worker is ready. A worker that exits or times out during that startup is left out of the pool, and the run fails only when no worker starts. A replacement worker that cannot start fails the run. `startupTimeoutMs` is not saved with the root, so you can change it before resuming.
889
+
890
+ A worker that exits is detected immediately, and its child is replayed from its last committed checkpoint on a replacement worker. A worker that is still running keeps its child as long as it keeps responding, even when the root is briefly too busy to process its heartbeats. Only a running worker that has not responded for `localWorkers.leaseMs` milliseconds (30000 by default) is stopped and its child replayed. When a root is resumed after its process crashed, children that were held by the crashed process's workers are replayed on the new workers right away.
891
+
892
+ A worker that exits or is killed while it runs a child does not stop the root. The root fences that worker's attempt and replays the child from its last committed checkpoint on a replacement worker, up to three attempts per child.
893
+
894
+ Each worker writes its standard error to `worker-logs/<root run ID>/<worker ID>.log` in the directory that holds the workflow journal. With the default journal, that is `~/.atomic/workflows/worker-logs/`. Characters in the root run ID that are unsafe in a file name are percent-encoded. The errors `Local worker exited before readiness`, `Local worker startup timed out after … ms`, and `Local worker retry limit` name the log file and include the end of the worker's output. Atomic keeps the logs of workers that fail. It deletes the logs of workers that are still running when the pool shuts down normally.
895
+
886
896
  ### Worker resource limits
887
897
 
888
898
  `admission.limits` caps concurrent agent sessions and managed tool processes for one root. A session permit covers creation through disposal, including fallback and delegated sessions. A process permit remains held until the Atomic-managed process is confirmed stopped; yielding an observation wait does not release it. Processes launched outside Atomic's managed tools are not counted. The worker count is a placement limit, separate from these resource caps.
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.9.42",
3
+ "version": "0.9.43-alpha.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bastani/atomic",
9
- "version": "0.9.42",
9
+ "version": "0.9.43-alpha.1",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@bastani/atomic-natives": "0.9.42",
13
- "@bastani/pi-ai": "0.9.42",
12
+ "@bastani/atomic-natives": "0.9.43-alpha.1",
13
+ "@bastani/pi-ai": "0.9.43-alpha.1",
14
14
  "@earendil-works/pi-agent-core": "1.4.0",
15
15
  "@earendil-works/pi-codemode": "1.4.0",
16
16
  "@earendil-works/pi-tui": "1.4.0",
@@ -427,18 +427,18 @@
427
427
  }
428
428
  },
429
429
  "node_modules/@bastani/atomic-natives": {
430
- "version": "0.9.42",
431
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.42.tgz",
430
+ "version": "0.9.43-alpha.1",
431
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.43-alpha.1.tgz",
432
432
  "license": "MIT",
433
433
  "optionalDependencies": {
434
- "@bastani/atomic-natives-darwin-arm64": "0.9.42",
435
- "@bastani/atomic-natives-darwin-x64": "0.9.42",
436
- "@bastani/atomic-natives-linux-arm64-gnu": "0.9.42",
437
- "@bastani/atomic-natives-linux-arm64-musl": "0.9.42",
438
- "@bastani/atomic-natives-linux-x64-gnu": "0.9.42",
439
- "@bastani/atomic-natives-linux-x64-musl": "0.9.42",
440
- "@bastani/atomic-natives-win32-arm64-msvc": "0.9.42",
441
- "@bastani/atomic-natives-win32-x64-msvc": "0.9.42"
434
+ "@bastani/atomic-natives-darwin-arm64": "0.9.43-alpha.1",
435
+ "@bastani/atomic-natives-darwin-x64": "0.9.43-alpha.1",
436
+ "@bastani/atomic-natives-linux-arm64-gnu": "0.9.43-alpha.1",
437
+ "@bastani/atomic-natives-linux-arm64-musl": "0.9.43-alpha.1",
438
+ "@bastani/atomic-natives-linux-x64-gnu": "0.9.43-alpha.1",
439
+ "@bastani/atomic-natives-linux-x64-musl": "0.9.43-alpha.1",
440
+ "@bastani/atomic-natives-win32-arm64-msvc": "0.9.43-alpha.1",
441
+ "@bastani/atomic-natives-win32-x64-msvc": "0.9.43-alpha.1"
442
442
  },
443
443
  "engines": {
444
444
  "bun": ">=1.4.2",
@@ -446,8 +446,8 @@
446
446
  }
447
447
  },
448
448
  "node_modules/@bastani/atomic-natives-darwin-arm64": {
449
- "version": "0.9.42",
450
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.42.tgz",
449
+ "version": "0.9.43-alpha.1",
450
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.43-alpha.1.tgz",
451
451
  "license": "MIT",
452
452
  "os": [
453
453
  "darwin"
@@ -458,8 +458,8 @@
458
458
  "optional": true
459
459
  },
460
460
  "node_modules/@bastani/atomic-natives-darwin-x64": {
461
- "version": "0.9.42",
462
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.42.tgz",
461
+ "version": "0.9.43-alpha.1",
462
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.43-alpha.1.tgz",
463
463
  "license": "MIT",
464
464
  "os": [
465
465
  "darwin"
@@ -470,8 +470,8 @@
470
470
  "optional": true
471
471
  },
472
472
  "node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
473
- "version": "0.9.42",
474
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.42.tgz",
473
+ "version": "0.9.43-alpha.1",
474
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.43-alpha.1.tgz",
475
475
  "license": "MIT",
476
476
  "os": [
477
477
  "linux"
@@ -485,8 +485,8 @@
485
485
  "optional": true
486
486
  },
487
487
  "node_modules/@bastani/atomic-natives-linux-arm64-musl": {
488
- "version": "0.9.42",
489
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.42.tgz",
488
+ "version": "0.9.43-alpha.1",
489
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.43-alpha.1.tgz",
490
490
  "license": "MIT",
491
491
  "os": [
492
492
  "linux"
@@ -500,8 +500,8 @@
500
500
  "optional": true
501
501
  },
502
502
  "node_modules/@bastani/atomic-natives-linux-x64-gnu": {
503
- "version": "0.9.42",
504
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.42.tgz",
503
+ "version": "0.9.43-alpha.1",
504
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.43-alpha.1.tgz",
505
505
  "license": "MIT",
506
506
  "os": [
507
507
  "linux"
@@ -515,8 +515,8 @@
515
515
  "optional": true
516
516
  },
517
517
  "node_modules/@bastani/atomic-natives-linux-x64-musl": {
518
- "version": "0.9.42",
519
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.42.tgz",
518
+ "version": "0.9.43-alpha.1",
519
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.43-alpha.1.tgz",
520
520
  "license": "MIT",
521
521
  "os": [
522
522
  "linux"
@@ -530,8 +530,8 @@
530
530
  "optional": true
531
531
  },
532
532
  "node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
533
- "version": "0.9.42",
534
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.42.tgz",
533
+ "version": "0.9.43-alpha.1",
534
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.43-alpha.1.tgz",
535
535
  "license": "MIT",
536
536
  "os": [
537
537
  "win32"
@@ -542,8 +542,8 @@
542
542
  "optional": true
543
543
  },
544
544
  "node_modules/@bastani/atomic-natives-win32-x64-msvc": {
545
- "version": "0.9.42",
546
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.42.tgz",
545
+ "version": "0.9.43-alpha.1",
546
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.43-alpha.1.tgz",
547
547
  "license": "MIT",
548
548
  "os": [
549
549
  "win32"
@@ -554,8 +554,8 @@
554
554
  "optional": true
555
555
  },
556
556
  "node_modules/@bastani/pi-ai": {
557
- "version": "0.9.42",
558
- "resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.42.tgz",
557
+ "version": "0.9.43-alpha.1",
558
+ "resolved": "https://registry.npmjs.org/@bastani/pi-ai/-/pi-ai-0.9.43-alpha.1.tgz",
559
559
  "license": "MIT",
560
560
  "dependencies": {
561
561
  "@anthropic-ai/sdk": "0.129.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.9.42",
3
+ "version": "0.9.43-alpha.1",
4
4
  "description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "atomicConfig": {
@@ -89,8 +89,8 @@
89
89
  "prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
90
90
  },
91
91
  "dependencies": {
92
- "@bastani/atomic-natives": "0.9.42",
93
- "@bastani/pi-ai": "0.9.42",
92
+ "@bastani/atomic-natives": "0.9.43-alpha.1",
93
+ "@bastani/pi-ai": "0.9.43-alpha.1",
94
94
  "@earendil-works/pi-agent-core": "1.4.0",
95
95
  "@earendil-works/pi-codemode": "1.4.0",
96
96
  "@earendil-works/pi-tui": "1.4.0",
@@ -559,6 +559,18 @@
559
559
  "additionalProperties": false
560
560
  },
561
561
  "description": "Importable child workflow definitions workers may run."
562
+ },
563
+ "startupTimeoutMs": {
564
+ "type": "integer",
565
+ "minimum": 1,
566
+ "maximum": 2147483647,
567
+ "description": "Milliseconds each worker process may take to become ready. Default: 30000."
568
+ },
569
+ "leaseMs": {
570
+ "type": "integer",
571
+ "minimum": 2000,
572
+ "maximum": 2147483647,
573
+ "description": "Milliseconds a live worker that has stopped responding keeps its child before the child is replayed elsewhere. Default: 30000."
562
574
  }
563
575
  },
564
576
  "additionalProperties": false