@mastra/code-sdk 0.0.0-agent-tags-alpha-20261125185303
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/LICENSE.md +32 -0
- package/README.md +284 -0
- package/dist/acp/agent.d.ts +48 -0
- package/dist/acp/agent.js +414 -0
- package/dist/acp/errors.d.ts +3 -0
- package/dist/acp/errors.js +11 -0
- package/dist/acp/event-mapper.d.ts +28 -0
- package/dist/acp/event-mapper.js +274 -0
- package/dist/acp/index.d.ts +9 -0
- package/dist/acp/index.js +21 -0
- package/dist/acp/runtime.d.ts +5 -0
- package/dist/acp/runtime.js +91 -0
- package/dist/acp/server.d.ts +4 -0
- package/dist/acp/server.js +35 -0
- package/dist/acp/skills.d.ts +6 -0
- package/dist/acp/skills.js +30 -0
- package/dist/acp.d.ts +2 -0
- package/dist/acp.js +1 -0
- package/dist/agent-connections/messaging-processor.d.ts +17 -0
- package/dist/agent-connections/messaging-processor.js +131 -0
- package/dist/agent-connections/ownership.d.ts +24 -0
- package/dist/agent-connections/ownership.js +96 -0
- package/dist/agent-connections/registry.d.ts +20 -0
- package/dist/agent-connections/registry.js +167 -0
- package/dist/agent-connections/session-advertisement.d.ts +27 -0
- package/dist/agent-connections/session-advertisement.js +86 -0
- package/dist/agent-connections/signal-provider.d.ts +141 -0
- package/dist/agent-connections/signal-provider.js +35 -0
- package/dist/agent-connections/state-processor.d.ts +23 -0
- package/dist/agent-connections/state-processor.js +270 -0
- package/dist/agent-connections/thread-state.d.ts +41 -0
- package/dist/agent-connections/thread-state.js +157 -0
- package/dist/agent-connections/tools.d.ts +133 -0
- package/dist/agent-connections/tools.js +616 -0
- package/dist/agent-connections/types.d.ts +99 -0
- package/dist/agent-connections/types.js +4 -0
- package/dist/agent-connections/untrusted-text.d.ts +5 -0
- package/dist/agent-connections/untrusted-text.js +19 -0
- package/dist/agents/background-completion-events.d.ts +16 -0
- package/dist/agents/background-completion-events.js +16 -0
- package/dist/agents/background-completion.d.ts +22 -0
- package/dist/agents/background-completion.js +73 -0
- package/dist/agents/context-audit.d.ts +84 -0
- package/dist/agents/context-audit.js +115 -0
- package/dist/agents/credential-resolver.d.ts +74 -0
- package/dist/agents/credential-resolver.js +142 -0
- package/dist/agents/custom-provider-source.d.ts +35 -0
- package/dist/agents/custom-provider-source.js +22 -0
- package/dist/agents/fastembed-subprocess.d.ts +52 -0
- package/dist/agents/fastembed-subprocess.js +282 -0
- package/dist/agents/instructions.d.ts +42 -0
- package/dist/agents/instructions.js +69 -0
- package/dist/agents/mastracode-gateway.d.ts +85 -0
- package/dist/agents/mastracode-gateway.js +500 -0
- package/dist/agents/memory.d.ts +36 -0
- package/dist/agents/memory.js +248 -0
- package/dist/agents/model.d.ts +158 -0
- package/dist/agents/model.js +382 -0
- package/dist/agents/modes/build.d.ts +12 -0
- package/dist/agents/modes/build.js +33 -0
- package/dist/agents/modes/explore.d.ts +10 -0
- package/dist/agents/modes/explore.js +25 -0
- package/dist/agents/modes/plan.d.ts +8 -0
- package/dist/agents/modes/plan.js +43 -0
- package/dist/agents/prompts/agent-instructions.d.ts +122 -0
- package/dist/agents/prompts/agent-instructions.js +617 -0
- package/dist/agents/prompts/build.d.ts +12 -0
- package/dist/agents/prompts/build.js +73 -0
- package/dist/agents/prompts/fast.d.ts +5 -0
- package/dist/agents/prompts/fast.js +23 -0
- package/dist/agents/prompts/index.d.ts +61 -0
- package/dist/agents/prompts/index.js +141 -0
- package/dist/agents/prompts/model.d.ts +5 -0
- package/dist/agents/prompts/model.js +20 -0
- package/dist/agents/prompts/plan.d.ts +11 -0
- package/dist/agents/prompts/plan.js +132 -0
- package/dist/agents/prompts/tool-guidance.d.ts +18 -0
- package/dist/agents/prompts/tool-guidance.js +158 -0
- package/dist/agents/sandbox-filesystem.d.ts +232 -0
- package/dist/agents/sandbox-filesystem.js +851 -0
- package/dist/agents/subagents/execute.d.ts +3 -0
- package/dist/agents/subagents/execute.js +24 -0
- package/dist/agents/subagents/explore.d.ts +3 -0
- package/dist/agents/subagents/explore.js +15 -0
- package/dist/agents/subagents/index.d.ts +6 -0
- package/dist/agents/subagents/index.js +15 -0
- package/dist/agents/subagents/plan.d.ts +3 -0
- package/dist/agents/subagents/plan.js +15 -0
- package/dist/agents/thread-caveman-state.d.ts +17 -0
- package/dist/agents/thread-caveman-state.js +104 -0
- package/dist/agents/tool-availability.d.ts +17 -0
- package/dist/agents/tool-availability.js +134 -0
- package/dist/agents/tools.d.ts +37 -0
- package/dist/agents/tools.js +154 -0
- package/dist/agents/workflow-builder-agent.d.ts +2 -0
- package/dist/agents/workflow-builder-agent.js +79 -0
- package/dist/agents/workspace.d.ts +35 -0
- package/dist/agents/workspace.js +207 -0
- package/dist/analytics.d.ts +18 -0
- package/dist/analytics.js +159 -0
- package/dist/auth/account-rotation-processor.d.ts +210 -0
- package/dist/auth/account-rotation-processor.js +662 -0
- package/dist/auth/account-routing-context.d.ts +17 -0
- package/dist/auth/account-routing-context.js +38 -0
- package/dist/auth/authorization-input.d.ts +16 -0
- package/dist/auth/authorization-input.js +39 -0
- package/dist/auth/device-code.d.ts +93 -0
- package/dist/auth/device-code.js +126 -0
- package/dist/auth/index.d.ts +13 -0
- package/dist/auth/index.js +9 -0
- package/dist/auth/pkce.d.ts +13 -0
- package/dist/auth/pkce.js +29 -0
- package/dist/auth/provider-auth-error.d.ts +24 -0
- package/dist/auth/provider-auth-error.js +44 -0
- package/dist/auth/providers/anthropic.d.ts +40 -0
- package/dist/auth/providers/anthropic.js +117 -0
- package/dist/auth/providers/github-copilot.d.ts +154 -0
- package/dist/auth/providers/github-copilot.js +359 -0
- package/dist/auth/providers/kimi-coding.d.ts +38 -0
- package/dist/auth/providers/kimi-coding.js +225 -0
- package/dist/auth/providers/openai-codex.d.ts +141 -0
- package/dist/auth/providers/openai-codex.js +531 -0
- package/dist/auth/providers/xai.d.ts +64 -0
- package/dist/auth/providers/xai.js +223 -0
- package/dist/auth/storage.d.ts +222 -0
- package/dist/auth/storage.js +805 -0
- package/dist/auth/types.d.ts +164 -0
- package/dist/auth/types.js +1 -0
- package/dist/clipboard/index.d.ts +26 -0
- package/dist/clipboard/index.js +224 -0
- package/dist/constants.d.ts +29 -0
- package/dist/constants.js +34 -0
- package/dist/error-classification.d.ts +10 -0
- package/dist/error-classification.js +19 -0
- package/dist/evals/context-builder.d.ts +41 -0
- package/dist/evals/context-builder.js +156 -0
- package/dist/evals/index.d.ts +4 -0
- package/dist/evals/index.js +5 -0
- package/dist/evals/scorers/classify-command.d.ts +30 -0
- package/dist/evals/scorers/classify-command.js +61 -0
- package/dist/evals/scorers/efficiency.d.ts +44 -0
- package/dist/evals/scorers/efficiency.js +256 -0
- package/dist/evals/scorers/extract-tools.d.ts +25 -0
- package/dist/evals/scorers/extract-tools.js +57 -0
- package/dist/evals/scorers/index.d.ts +3 -0
- package/dist/evals/scorers/index.js +3 -0
- package/dist/evals/scorers/outcome.d.ts +49 -0
- package/dist/evals/scorers/outcome.js +360 -0
- package/dist/experimental-agent.d.ts +19 -0
- package/dist/experimental-agent.js +45 -0
- package/dist/factory/client.d.ts +44 -0
- package/dist/factory/client.js +110 -0
- package/dist/factory/remote-controller.d.ts +34 -0
- package/dist/factory/remote-controller.js +40 -0
- package/dist/factory/remote-session.d.ts +210 -0
- package/dist/factory/remote-session.js +415 -0
- package/dist/goal-manager.d.ts +114 -0
- package/dist/goal-manager.js +351 -0
- package/dist/goal-signal.d.ts +14 -0
- package/dist/goal-signal.js +14 -0
- package/dist/headless/cli.d.ts +55 -0
- package/dist/headless/cli.js +261 -0
- package/dist/headless/flags.d.ts +33 -0
- package/dist/headless/flags.js +207 -0
- package/dist/headless/format.d.ts +41 -0
- package/dist/headless/format.js +94 -0
- package/dist/headless/index.d.ts +25 -0
- package/dist/headless/index.js +6 -0
- package/dist/headless/policy.d.ts +17 -0
- package/dist/headless/policy.js +39 -0
- package/dist/headless/run-mc.d.ts +7 -0
- package/dist/headless/run-mc.js +438 -0
- package/dist/headless/types.d.ts +175 -0
- package/dist/headless/types.js +16 -0
- package/dist/hooks/config.d.ts +11 -0
- package/dist/hooks/config.js +77 -0
- package/dist/hooks/executor.d.ts +13 -0
- package/dist/hooks/executor.js +128 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +5 -0
- package/dist/hooks/manager.d.ts +75 -0
- package/dist/hooks/manager.js +289 -0
- package/dist/hooks/types.d.ts +180 -0
- package/dist/hooks/types.js +5 -0
- package/dist/index.d.ts +537 -0
- package/dist/index.js +1399 -0
- package/dist/ipc/ipc-reporter.d.ts +14 -0
- package/dist/ipc/ipc-reporter.js +18 -0
- package/dist/knowledge-inspector.d.ts +139 -0
- package/dist/knowledge-inspector.js +533 -0
- package/dist/knowledge-scope-id.d.ts +7 -0
- package/dist/knowledge-scope-id.js +10 -0
- package/dist/knowledge-scope.d.ts +41 -0
- package/dist/knowledge-scope.js +85 -0
- package/dist/lsp/client.d.ts +56 -0
- package/dist/lsp/client.js +248 -0
- package/dist/lsp/index.d.ts +4 -0
- package/dist/lsp/index.js +4 -0
- package/dist/lsp/language.d.ts +9 -0
- package/dist/lsp/language.js +41 -0
- package/dist/lsp/manager.d.ts +34 -0
- package/dist/lsp/manager.js +79 -0
- package/dist/lsp/server.d.ts +27 -0
- package/dist/lsp/server.js +158 -0
- package/dist/lsp/workspace.d.ts +9 -0
- package/dist/lsp/workspace.js +52 -0
- package/dist/mcp/config.d.ts +77 -0
- package/dist/mcp/config.js +313 -0
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/manager.d.ts +104 -0
- package/dist/mcp/manager.js +693 -0
- package/dist/mcp/state.d.ts +35 -0
- package/dist/mcp/state.js +94 -0
- package/dist/mcp/types.d.ts +139 -0
- package/dist/mcp/types.js +1 -0
- package/dist/onboarding/custom-packs.d.ts +7 -0
- package/dist/onboarding/custom-packs.js +17 -0
- package/dist/onboarding/custom-providers.d.ts +4 -0
- package/dist/onboarding/custom-providers.js +27 -0
- package/dist/onboarding/index.d.ts +5 -0
- package/dist/onboarding/index.js +3 -0
- package/dist/onboarding/om-settings.d.ts +47 -0
- package/dist/onboarding/om-settings.js +80 -0
- package/dist/onboarding/pack-activation.d.ts +43 -0
- package/dist/onboarding/pack-activation.js +105 -0
- package/dist/onboarding/packs.d.ts +106 -0
- package/dist/onboarding/packs.js +283 -0
- package/dist/onboarding/settings.d.ts +563 -0
- package/dist/onboarding/settings.js +1110 -0
- package/dist/permissions.d.ts +55 -0
- package/dist/permissions.js +139 -0
- package/dist/platform/index.d.ts +74 -0
- package/dist/platform/index.js +199 -0
- package/dist/plugin.d.ts +156 -0
- package/dist/plugin.js +27 -0
- package/dist/plugins/dependencies.d.ts +9 -0
- package/dist/plugins/dependencies.js +84 -0
- package/dist/plugins/install.d.ts +21 -0
- package/dist/plugins/install.js +187 -0
- package/dist/plugins/loader.d.ts +25 -0
- package/dist/plugins/loader.js +264 -0
- package/dist/plugins/manager.d.ts +115 -0
- package/dist/plugins/manager.js +507 -0
- package/dist/plugins/manifest.d.ts +14 -0
- package/dist/plugins/manifest.js +47 -0
- package/dist/plugins/package-link.d.ts +3 -0
- package/dist/plugins/package-link.js +58 -0
- package/dist/plugins/paths.d.ts +10 -0
- package/dist/plugins/paths.js +22 -0
- package/dist/plugins/registry.d.ts +8 -0
- package/dist/plugins/registry.js +109 -0
- package/dist/plugins/scaffold.d.ts +10 -0
- package/dist/plugins/scaffold.js +115 -0
- package/dist/plugins/signal-lane.d.ts +59 -0
- package/dist/plugins/signal-lane.js +163 -0
- package/dist/plugins/types.d.ts +95 -0
- package/dist/plugins/types.js +1 -0
- package/dist/process-memory-diagnostics.d.ts +136 -0
- package/dist/process-memory-diagnostics.js +497 -0
- package/dist/processors/plan-rejection-abort.d.ts +16 -0
- package/dist/processors/plan-rejection-abort.js +62 -0
- package/dist/providers/amazon-bedrock-gateway.d.ts +47 -0
- package/dist/providers/amazon-bedrock-gateway.js +142 -0
- package/dist/providers/amazon-bedrock.d.ts +28 -0
- package/dist/providers/amazon-bedrock.js +99 -0
- package/dist/providers/anthropic-prompt-cache.d.ts +19 -0
- package/dist/providers/anthropic-prompt-cache.js +8 -0
- package/dist/providers/anthropic-thinking.d.ts +5 -0
- package/dist/providers/anthropic-thinking.js +22 -0
- package/dist/providers/claude-max.d.ts +67 -0
- package/dist/providers/claude-max.js +232 -0
- package/dist/providers/github-copilot-gateway.d.ts +35 -0
- package/dist/providers/github-copilot-gateway.js +58 -0
- package/dist/providers/github-copilot.d.ts +60 -0
- package/dist/providers/github-copilot.js +320 -0
- package/dist/providers/google-thinking.d.ts +31 -0
- package/dist/providers/google-thinking.js +64 -0
- package/dist/providers/google-vertex-gateway.d.ts +23 -0
- package/dist/providers/google-vertex-gateway.js +49 -0
- package/dist/providers/google-vertex.d.ts +6 -0
- package/dist/providers/google-vertex.js +51 -0
- package/dist/providers/kimi-coding.d.ts +14 -0
- package/dist/providers/kimi-coding.js +80 -0
- package/dist/providers/model-ids.d.ts +53 -0
- package/dist/providers/model-ids.js +132 -0
- package/dist/providers/openai-codex.d.ts +114 -0
- package/dist/providers/openai-codex.js +427 -0
- package/dist/providers/provider-thinking.d.ts +23 -0
- package/dist/providers/provider-thinking.js +61 -0
- package/dist/providers/thinking-request.d.ts +14 -0
- package/dist/providers/thinking-request.js +87 -0
- package/dist/providers/xai.d.ts +33 -0
- package/dist/providers/xai.js +72 -0
- package/dist/schedules/index.d.ts +10 -0
- package/dist/schedules/index.js +6 -0
- package/dist/schedules/interval.d.ts +49 -0
- package/dist/schedules/interval.js +212 -0
- package/dist/schedules/prompt.d.ts +36 -0
- package/dist/schedules/prompt.js +36 -0
- package/dist/schedules/run-script.d.ts +8 -0
- package/dist/schedules/run-script.js +80 -0
- package/dist/schedules/scheduler.d.ts +101 -0
- package/dist/schedules/scheduler.js +167 -0
- package/dist/schedules/tools.d.ts +57 -0
- package/dist/schedules/tools.js +217 -0
- package/dist/schema.d.ts +499 -0
- package/dist/schema.js +131 -0
- package/dist/theme-palette.d.ts +17 -0
- package/dist/theme-palette.js +18 -0
- package/dist/thinking-catalog.d.ts +4 -0
- package/dist/thinking-catalog.js +13 -0
- package/dist/thinking.d.ts +37 -0
- package/dist/thinking.js +134 -0
- package/dist/tool-names.d.ts +77 -0
- package/dist/tool-names.js +53 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/index.js +3 -0
- package/dist/tools/request-sandbox-access.d.ts +6 -0
- package/dist/tools/request-sandbox-access.js +80 -0
- package/dist/tools/utils.d.ts +20 -0
- package/dist/tools/utils.js +31 -0
- package/dist/tools/web-search.d.ts +116 -0
- package/dist/tools/web-search.js +158 -0
- package/dist/tools/workflows/create-workflow.d.ts +7 -0
- package/dist/tools/workflows/create-workflow.js +82 -0
- package/dist/tools/workflows/delete-workflow.d.ts +7 -0
- package/dist/tools/workflows/delete-workflow.js +18 -0
- package/dist/tools/workflows/ephemeral-memory.d.ts +28 -0
- package/dist/tools/workflows/ephemeral-memory.js +41 -0
- package/dist/tools/workflows/extract-json-schema.d.ts +12 -0
- package/dist/tools/workflows/extract-json-schema.js +19 -0
- package/dist/tools/workflows/get-workflow.d.ts +11 -0
- package/dist/tools/workflows/get-workflow.js +31 -0
- package/dist/tools/workflows/list-available-agents.d.ts +8 -0
- package/dist/tools/workflows/list-available-agents.js +29 -0
- package/dist/tools/workflows/list-available-classifiers.d.ts +19 -0
- package/dist/tools/workflows/list-available-classifiers.js +53 -0
- package/dist/tools/workflows/list-available-tools.d.ts +9 -0
- package/dist/tools/workflows/list-available-tools.js +37 -0
- package/dist/tools/workflows/list-available-workflows.d.ts +9 -0
- package/dist/tools/workflows/list-available-workflows.js +29 -0
- package/dist/tools/workflows/list-workflows.d.ts +9 -0
- package/dist/tools/workflows/list-workflows.js +30 -0
- package/dist/tools/workflows/run-workflow.d.ts +9 -0
- package/dist/tools/workflows/run-workflow.js +49 -0
- package/dist/tools/workflows/save-workflow.d.ts +1125 -0
- package/dist/tools/workflows/save-workflow.js +25 -0
- package/dist/tools/workflows/tool-ids.d.ts +16 -0
- package/dist/tools/workflows/tool-ids.js +17 -0
- package/dist/utils/binaries.d.ts +7 -0
- package/dist/utils/binaries.js +97 -0
- package/dist/utils/debug-log.d.ts +12 -0
- package/dist/utils/debug-log.js +56 -0
- package/dist/utils/discarding-scores-storage.d.ts +33 -0
- package/dist/utils/discarding-scores-storage.js +51 -0
- package/dist/utils/errors.d.ts +36 -0
- package/dist/utils/errors.js +215 -0
- package/dist/utils/gateway-sync.d.ts +26 -0
- package/dist/utils/gateway-sync.js +58 -0
- package/dist/utils/local-observability.d.ts +19 -0
- package/dist/utils/local-observability.js +54 -0
- package/dist/utils/maintenance-lock.d.ts +42 -0
- package/dist/utils/maintenance-lock.js +196 -0
- package/dist/utils/notification-dispatch.d.ts +74 -0
- package/dist/utils/notification-dispatch.js +128 -0
- package/dist/utils/open-url.d.ts +10 -0
- package/dist/utils/open-url.js +27 -0
- package/dist/utils/path-security.d.ts +2 -0
- package/dist/utils/path-security.js +7 -0
- package/dist/utils/plan-diff.d.ts +25 -0
- package/dist/utils/plan-diff.js +59 -0
- package/dist/utils/plans.d.ts +61 -0
- package/dist/utils/plans.js +120 -0
- package/dist/utils/project.d.ts +160 -0
- package/dist/utils/project.js +361 -0
- package/dist/utils/prune-cli.d.ts +24 -0
- package/dist/utils/prune-cli.js +124 -0
- package/dist/utils/signals-pubsub.d.ts +103 -0
- package/dist/utils/signals-pubsub.js +409 -0
- package/dist/utils/slash-command-loader.d.ts +52 -0
- package/dist/utils/slash-command-loader.js +139 -0
- package/dist/utils/slash-command-processor.d.ts +14 -0
- package/dist/utils/slash-command-processor.js +106 -0
- package/dist/utils/stdin-pipe.d.ts +33 -0
- package/dist/utils/stdin-pipe.js +93 -0
- package/dist/utils/storage-factory.d.ts +50 -0
- package/dist/utils/storage-factory.js +118 -0
- package/dist/utils/storage-maintenance.d.ts +121 -0
- package/dist/utils/storage-maintenance.js +352 -0
- package/dist/utils/thread-lock.d.ts +26 -0
- package/dist/utils/thread-lock.js +109 -0
- package/dist/utils/token-estimator.d.ts +3 -0
- package/dist/utils/token-estimator.js +19 -0
- package/dist/utils/update-check.d.ts +151 -0
- package/dist/utils/update-check.js +430 -0
- package/dist/utils/wake-session.d.ts +44 -0
- package/dist/utils/wake-session.js +83 -0
- package/dist/voice/stt-registry.d.ts +67 -0
- package/dist/voice/stt-registry.js +144 -0
- package/dist/voice/transcribe.d.ts +10 -0
- package/dist/voice/transcribe.js +75 -0
- package/dist/workflows/register-primitives.d.ts +52 -0
- package/dist/workflows/register-primitives.js +40 -0
- package/dist/workflows/service.d.ts +64 -0
- package/dist/workflows/service.js +50 -0
- package/package.json +117 -0
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import type { OMModel } from '@mastra/core/agent-controller';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { ThinkingLevelSetting } from './thinking.js';
|
|
4
|
+
export type PermissionPolicy = 'allow' | 'ask' | 'deny';
|
|
5
|
+
export type MastraCodeSessionState = {
|
|
6
|
+
currentModelId: string;
|
|
7
|
+
modeId: string;
|
|
8
|
+
};
|
|
9
|
+
export type MastraCodeComposedState = MastraCodeState & MastraCodeSessionState;
|
|
10
|
+
export interface ModelRouteEntry {
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
modelId: string;
|
|
14
|
+
accountId?: string;
|
|
15
|
+
memoryModelId?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ModelRoute {
|
|
18
|
+
entries: ModelRouteEntry[];
|
|
19
|
+
}
|
|
20
|
+
export interface PendingModelFallback {
|
|
21
|
+
fromEntryId: string;
|
|
22
|
+
toEntryId: string;
|
|
23
|
+
toModelId: string;
|
|
24
|
+
threadId?: string;
|
|
25
|
+
reason: 'pool-exhausted' | 'persistent-outage';
|
|
26
|
+
at: string;
|
|
27
|
+
}
|
|
28
|
+
export interface MastraCodeState {
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
[key: `subagentModelId_${string}`]: string | undefined;
|
|
31
|
+
subagentModelId?: string;
|
|
32
|
+
projectPath?: string;
|
|
33
|
+
projectName?: string;
|
|
34
|
+
/** Factory project that owns this session. */
|
|
35
|
+
factoryProjectId?: string;
|
|
36
|
+
/** Whether this session uses organization or owner-scoped models and credentials. */
|
|
37
|
+
factoryModelScope?: 'factory' | 'user';
|
|
38
|
+
/** Stable user id of the Factory session owner. */
|
|
39
|
+
factoryOwnerUserId?: string;
|
|
40
|
+
/** Authoritative organization id seeded by factory at session construction. */
|
|
41
|
+
factoryOrgId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Factory owns this session but could not resolve its organization. Knowledge
|
|
44
|
+
* capture refuses rather than filing under a substituted identity; without the
|
|
45
|
+
* marker a projectless factory session is indistinguishable from a local one.
|
|
46
|
+
*/
|
|
47
|
+
factoryOrgUnresolved?: boolean;
|
|
48
|
+
/** Linked repository used by this session when source-control execution is required. */
|
|
49
|
+
projectRepositoryId?: string;
|
|
50
|
+
/** Active feature branch checked out in the session workdir. */
|
|
51
|
+
branch?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The session's checkout contains third-party content (e.g. a PR branch
|
|
54
|
+
* under review). Project-level instruction files (AGENTS.md, CLAUDE.md)
|
|
55
|
+
* are attacker-writable there and must not be ingested into the system
|
|
56
|
+
* prompt or injected as reminders.
|
|
57
|
+
*/
|
|
58
|
+
untrustedCheckout?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Trusted git ref (typically the PR's base branch) to serve project
|
|
61
|
+
* instruction files from when the checkout is untrusted. Without it,
|
|
62
|
+
* project-scope instruction files are skipped entirely.
|
|
63
|
+
*/
|
|
64
|
+
baseRef?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Skip the home-directory instruction files (~/.claude/AGENTS.md and
|
|
67
|
+
* friends). Hosts running sessions for someone else set this so a run never
|
|
68
|
+
* inherits the machine owner's personal configuration.
|
|
69
|
+
*/
|
|
70
|
+
skipGlobalInstructions?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Directories under the working directory whose project instruction files
|
|
73
|
+
* (AGENTS.md, CLAUDE.md) load, the session's own checkout first. Hosts that
|
|
74
|
+
* boot several checkouts under one working directory set it; unset, the
|
|
75
|
+
* working directory itself is the only root.
|
|
76
|
+
*/
|
|
77
|
+
instructionRoots?: string[];
|
|
78
|
+
configDir: string;
|
|
79
|
+
homeDir?: string;
|
|
80
|
+
gitBranch?: string;
|
|
81
|
+
lastCommand?: string;
|
|
82
|
+
observerModelId?: string;
|
|
83
|
+
reflectorModelId?: string;
|
|
84
|
+
observerModelSelection: OMModel;
|
|
85
|
+
reflectorModelSelection: OMModel;
|
|
86
|
+
observationThreshold: number;
|
|
87
|
+
reflectionThreshold: number;
|
|
88
|
+
cavemanObservations: boolean;
|
|
89
|
+
observeAttachments: 'auto' | boolean;
|
|
90
|
+
omScope?: 'thread' | 'resource';
|
|
91
|
+
/** Ordered host-supplied model and account fallback route for this thread. */
|
|
92
|
+
modelRoute?: ModelRoute;
|
|
93
|
+
/** One-hop fallback intent written by account rotation and consumed by the host. */
|
|
94
|
+
mastracodePendingModelFallback?: PendingModelFallback | null;
|
|
95
|
+
/**
|
|
96
|
+
* Session-level reasoning-effort override. When unset, the effective level is
|
|
97
|
+
* resolved at request time from settings (`models.modeThinkingDefaults[mode]`
|
|
98
|
+
* falling back to `preferences.thinkingLevel`).
|
|
99
|
+
*/
|
|
100
|
+
thinkingLevel?: ThinkingLevelSetting;
|
|
101
|
+
yolo: boolean;
|
|
102
|
+
permissionRules: {
|
|
103
|
+
categories: Record<string, PermissionPolicy>;
|
|
104
|
+
tools: Record<string, PermissionPolicy>;
|
|
105
|
+
};
|
|
106
|
+
smartEditing: boolean;
|
|
107
|
+
notifications: 'bell' | 'system' | 'both' | 'off';
|
|
108
|
+
tasks: Array<{
|
|
109
|
+
id?: string;
|
|
110
|
+
content: string;
|
|
111
|
+
status: 'pending' | 'in_progress' | 'completed';
|
|
112
|
+
activeForm: string;
|
|
113
|
+
}>;
|
|
114
|
+
sandboxAllowedPaths: string[];
|
|
115
|
+
pluginSkillPaths: string[];
|
|
116
|
+
pluginCommandPaths: string[];
|
|
117
|
+
pluginInstructions: string[];
|
|
118
|
+
activePlan: {
|
|
119
|
+
title: string;
|
|
120
|
+
plan: string;
|
|
121
|
+
approvedAt: string;
|
|
122
|
+
} | null;
|
|
123
|
+
activeBrowserSettings?: {
|
|
124
|
+
enabled: boolean;
|
|
125
|
+
provider: 'stagehand' | 'agent-browser';
|
|
126
|
+
headless?: boolean;
|
|
127
|
+
viewport?: {
|
|
128
|
+
width: number;
|
|
129
|
+
height: number;
|
|
130
|
+
} | 'window';
|
|
131
|
+
cdpUrl?: string;
|
|
132
|
+
profile?: string;
|
|
133
|
+
executablePath?: string;
|
|
134
|
+
scope?: 'shared' | 'thread';
|
|
135
|
+
stagehand?: {
|
|
136
|
+
env: 'LOCAL' | 'BROWSERBASE';
|
|
137
|
+
projectId?: string;
|
|
138
|
+
model?: string;
|
|
139
|
+
preserveUserDataDir?: boolean;
|
|
140
|
+
};
|
|
141
|
+
agentBrowser?: {
|
|
142
|
+
storageState?: string;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
activeBrowserModel?: {
|
|
146
|
+
modelName?: string;
|
|
147
|
+
source: 'settings' | 'chat-model' | 'codex-oauth' | 'stagehand-default';
|
|
148
|
+
viaCodexOAuth: boolean;
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
export declare const stateSchema: z.ZodPipe<z.ZodObject<{
|
|
152
|
+
currentModelId: z.ZodOptional<z.ZodString>;
|
|
153
|
+
modeId: z.ZodOptional<z.ZodString>;
|
|
154
|
+
modelRoute: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
label: z.ZodString;
|
|
158
|
+
modelId: z.ZodString;
|
|
159
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
160
|
+
memoryModelId: z.ZodOptional<z.ZodString>;
|
|
161
|
+
}, z.core.$strip>>;
|
|
162
|
+
}, z.core.$strip>>;
|
|
163
|
+
subagentModelId: z.ZodOptional<z.ZodString>;
|
|
164
|
+
subagentModelId_explore: z.ZodOptional<z.ZodString>;
|
|
165
|
+
subagentModelId_plan: z.ZodOptional<z.ZodString>;
|
|
166
|
+
subagentModelId_execute: z.ZodOptional<z.ZodString>;
|
|
167
|
+
projectPath: z.ZodOptional<z.ZodString>;
|
|
168
|
+
projectName: z.ZodOptional<z.ZodString>;
|
|
169
|
+
factoryProjectId: z.ZodOptional<z.ZodString>;
|
|
170
|
+
factoryModelScope: z.ZodOptional<z.ZodEnum<{
|
|
171
|
+
factory: "factory";
|
|
172
|
+
user: "user";
|
|
173
|
+
}>>;
|
|
174
|
+
factoryOwnerUserId: z.ZodOptional<z.ZodString>;
|
|
175
|
+
factoryOrgId: z.ZodOptional<z.ZodString>;
|
|
176
|
+
factoryOrgUnresolved: z.ZodOptional<z.ZodBoolean>;
|
|
177
|
+
projectRepositoryId: z.ZodOptional<z.ZodString>;
|
|
178
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
179
|
+
untrustedCheckout: z.ZodOptional<z.ZodBoolean>;
|
|
180
|
+
baseRef: z.ZodOptional<z.ZodString>;
|
|
181
|
+
skipGlobalInstructions: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
instructionRoots: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
183
|
+
configDir: z.ZodDefault<z.ZodString>;
|
|
184
|
+
homeDir: z.ZodOptional<z.ZodString>;
|
|
185
|
+
gitBranch: z.ZodOptional<z.ZodString>;
|
|
186
|
+
lastCommand: z.ZodOptional<z.ZodString>;
|
|
187
|
+
observerModelId: z.ZodOptional<z.ZodString>;
|
|
188
|
+
reflectorModelId: z.ZodOptional<z.ZodString>;
|
|
189
|
+
observerModelSelection: z.ZodOptional<z.ZodString>;
|
|
190
|
+
reflectorModelSelection: z.ZodOptional<z.ZodString>;
|
|
191
|
+
observationThreshold: z.ZodDefault<z.ZodNumber>;
|
|
192
|
+
reflectionThreshold: z.ZodDefault<z.ZodNumber>;
|
|
193
|
+
cavemanObservations: z.ZodDefault<z.ZodBoolean>;
|
|
194
|
+
observeAttachments: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodBoolean]>>;
|
|
195
|
+
omScope: z.ZodOptional<z.ZodEnum<{
|
|
196
|
+
resource: "resource";
|
|
197
|
+
thread: "thread";
|
|
198
|
+
}>>;
|
|
199
|
+
thinkingLevel: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
|
|
200
|
+
high: "high";
|
|
201
|
+
low: "low";
|
|
202
|
+
max: "max";
|
|
203
|
+
medium: "medium";
|
|
204
|
+
off: "off";
|
|
205
|
+
xhigh: "xhigh";
|
|
206
|
+
}>>, unknown>;
|
|
207
|
+
yolo: z.ZodDefault<z.ZodBoolean>;
|
|
208
|
+
permissionRules: z.ZodDefault<z.ZodObject<{
|
|
209
|
+
categories: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
210
|
+
allow: "allow";
|
|
211
|
+
ask: "ask";
|
|
212
|
+
deny: "deny";
|
|
213
|
+
}>>>;
|
|
214
|
+
tools: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
215
|
+
allow: "allow";
|
|
216
|
+
ask: "ask";
|
|
217
|
+
deny: "deny";
|
|
218
|
+
}>>>;
|
|
219
|
+
}, z.core.$strip>>;
|
|
220
|
+
smartEditing: z.ZodDefault<z.ZodBoolean>;
|
|
221
|
+
notifications: z.ZodDefault<z.ZodEnum<{
|
|
222
|
+
bell: "bell";
|
|
223
|
+
both: "both";
|
|
224
|
+
off: "off";
|
|
225
|
+
system: "system";
|
|
226
|
+
}>>;
|
|
227
|
+
tasks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
228
|
+
id: z.ZodOptional<z.ZodString>;
|
|
229
|
+
content: z.ZodString;
|
|
230
|
+
status: z.ZodEnum<{
|
|
231
|
+
completed: "completed";
|
|
232
|
+
in_progress: "in_progress";
|
|
233
|
+
pending: "pending";
|
|
234
|
+
}>;
|
|
235
|
+
activeForm: z.ZodString;
|
|
236
|
+
}, z.core.$strip>>>;
|
|
237
|
+
sandboxAllowedPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
238
|
+
mastracodePendingModelFallback: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
239
|
+
fromEntryId: z.ZodString;
|
|
240
|
+
toEntryId: z.ZodString;
|
|
241
|
+
toModelId: z.ZodString;
|
|
242
|
+
threadId: z.ZodOptional<z.ZodString>;
|
|
243
|
+
reason: z.ZodEnum<{
|
|
244
|
+
"persistent-outage": "persistent-outage";
|
|
245
|
+
"pool-exhausted": "pool-exhausted";
|
|
246
|
+
}>;
|
|
247
|
+
at: z.ZodString;
|
|
248
|
+
}, z.core.$strip>>>;
|
|
249
|
+
pluginSkillPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
250
|
+
pluginCommandPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
251
|
+
pluginInstructions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
252
|
+
activePlan: z.ZodDefault<z.ZodNullable<z.ZodObject<{
|
|
253
|
+
title: z.ZodString;
|
|
254
|
+
plan: z.ZodString;
|
|
255
|
+
approvedAt: z.ZodString;
|
|
256
|
+
}, z.core.$strip>>>;
|
|
257
|
+
activeBrowserSettings: z.ZodOptional<z.ZodObject<{
|
|
258
|
+
enabled: z.ZodBoolean;
|
|
259
|
+
provider: z.ZodEnum<{
|
|
260
|
+
"agent-browser": "agent-browser";
|
|
261
|
+
stagehand: "stagehand";
|
|
262
|
+
}>;
|
|
263
|
+
headless: z.ZodOptional<z.ZodBoolean>;
|
|
264
|
+
viewport: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
265
|
+
width: z.ZodNumber;
|
|
266
|
+
height: z.ZodNumber;
|
|
267
|
+
}, z.core.$strip>, z.ZodLiteral<"window">]>>;
|
|
268
|
+
cdpUrl: z.ZodOptional<z.ZodString>;
|
|
269
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
270
|
+
executablePath: z.ZodOptional<z.ZodString>;
|
|
271
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
272
|
+
shared: "shared";
|
|
273
|
+
thread: "thread";
|
|
274
|
+
}>>;
|
|
275
|
+
stagehand: z.ZodOptional<z.ZodObject<{
|
|
276
|
+
env: z.ZodEnum<{
|
|
277
|
+
BROWSERBASE: "BROWSERBASE";
|
|
278
|
+
LOCAL: "LOCAL";
|
|
279
|
+
}>;
|
|
280
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
281
|
+
model: z.ZodOptional<z.ZodString>;
|
|
282
|
+
preserveUserDataDir: z.ZodOptional<z.ZodBoolean>;
|
|
283
|
+
}, z.core.$strip>>;
|
|
284
|
+
agentBrowser: z.ZodOptional<z.ZodObject<{
|
|
285
|
+
storageState: z.ZodOptional<z.ZodString>;
|
|
286
|
+
}, z.core.$strip>>;
|
|
287
|
+
}, z.core.$strip>>;
|
|
288
|
+
activeBrowserModel: z.ZodOptional<z.ZodObject<{
|
|
289
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
290
|
+
source: z.ZodEnum<{
|
|
291
|
+
"chat-model": "chat-model";
|
|
292
|
+
"codex-oauth": "codex-oauth";
|
|
293
|
+
settings: "settings";
|
|
294
|
+
"stagehand-default": "stagehand-default";
|
|
295
|
+
}>;
|
|
296
|
+
viaCodexOAuth: z.ZodBoolean;
|
|
297
|
+
}, z.core.$strip>>;
|
|
298
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
299
|
+
currentModelId?: string | undefined;
|
|
300
|
+
modeId?: string | undefined;
|
|
301
|
+
modelRoute?: {
|
|
302
|
+
entries: {
|
|
303
|
+
id: string;
|
|
304
|
+
label: string;
|
|
305
|
+
modelId: string;
|
|
306
|
+
accountId?: string | undefined;
|
|
307
|
+
memoryModelId?: string | undefined;
|
|
308
|
+
}[];
|
|
309
|
+
} | undefined;
|
|
310
|
+
subagentModelId?: string | undefined;
|
|
311
|
+
subagentModelId_explore?: string | undefined;
|
|
312
|
+
subagentModelId_plan?: string | undefined;
|
|
313
|
+
subagentModelId_execute?: string | undefined;
|
|
314
|
+
projectPath?: string | undefined;
|
|
315
|
+
projectName?: string | undefined;
|
|
316
|
+
factoryProjectId?: string | undefined;
|
|
317
|
+
factoryModelScope?: "factory" | "user" | undefined;
|
|
318
|
+
factoryOwnerUserId?: string | undefined;
|
|
319
|
+
factoryOrgId?: string | undefined;
|
|
320
|
+
factoryOrgUnresolved?: boolean | undefined;
|
|
321
|
+
projectRepositoryId?: string | undefined;
|
|
322
|
+
branch?: string | undefined;
|
|
323
|
+
untrustedCheckout?: boolean | undefined;
|
|
324
|
+
baseRef?: string | undefined;
|
|
325
|
+
skipGlobalInstructions?: boolean | undefined;
|
|
326
|
+
instructionRoots?: string[] | undefined;
|
|
327
|
+
configDir: string;
|
|
328
|
+
homeDir?: string | undefined;
|
|
329
|
+
gitBranch?: string | undefined;
|
|
330
|
+
lastCommand?: string | undefined;
|
|
331
|
+
observerModelId?: string | undefined;
|
|
332
|
+
reflectorModelId?: string | undefined;
|
|
333
|
+
observationThreshold: number;
|
|
334
|
+
reflectionThreshold: number;
|
|
335
|
+
cavemanObservations: boolean;
|
|
336
|
+
observeAttachments: "auto" | boolean;
|
|
337
|
+
omScope?: "resource" | "thread" | undefined;
|
|
338
|
+
thinkingLevel?: "high" | "low" | "max" | "medium" | "off" | "xhigh" | undefined;
|
|
339
|
+
yolo: boolean;
|
|
340
|
+
permissionRules: {
|
|
341
|
+
categories: Record<string, "allow" | "ask" | "deny">;
|
|
342
|
+
tools: Record<string, "allow" | "ask" | "deny">;
|
|
343
|
+
};
|
|
344
|
+
smartEditing: boolean;
|
|
345
|
+
notifications: "bell" | "both" | "off" | "system";
|
|
346
|
+
tasks: {
|
|
347
|
+
id?: string | undefined;
|
|
348
|
+
content: string;
|
|
349
|
+
status: "completed" | "in_progress" | "pending";
|
|
350
|
+
activeForm: string;
|
|
351
|
+
}[];
|
|
352
|
+
sandboxAllowedPaths: string[];
|
|
353
|
+
mastracodePendingModelFallback?: {
|
|
354
|
+
fromEntryId: string;
|
|
355
|
+
toEntryId: string;
|
|
356
|
+
toModelId: string;
|
|
357
|
+
threadId?: string | undefined;
|
|
358
|
+
reason: "persistent-outage" | "pool-exhausted";
|
|
359
|
+
at: string;
|
|
360
|
+
} | null | undefined;
|
|
361
|
+
pluginSkillPaths: string[];
|
|
362
|
+
pluginCommandPaths: string[];
|
|
363
|
+
pluginInstructions: string[];
|
|
364
|
+
activePlan: {
|
|
365
|
+
title: string;
|
|
366
|
+
plan: string;
|
|
367
|
+
approvedAt: string;
|
|
368
|
+
} | null;
|
|
369
|
+
activeBrowserSettings?: {
|
|
370
|
+
enabled: boolean;
|
|
371
|
+
provider: "agent-browser" | "stagehand";
|
|
372
|
+
headless?: boolean | undefined;
|
|
373
|
+
viewport?: "window" | {
|
|
374
|
+
width: number;
|
|
375
|
+
height: number;
|
|
376
|
+
} | undefined;
|
|
377
|
+
cdpUrl?: string | undefined;
|
|
378
|
+
profile?: string | undefined;
|
|
379
|
+
executablePath?: string | undefined;
|
|
380
|
+
scope?: "shared" | "thread" | undefined;
|
|
381
|
+
stagehand?: {
|
|
382
|
+
env: "BROWSERBASE" | "LOCAL";
|
|
383
|
+
projectId?: string | undefined;
|
|
384
|
+
model?: string | undefined;
|
|
385
|
+
preserveUserDataDir?: boolean | undefined;
|
|
386
|
+
} | undefined;
|
|
387
|
+
agentBrowser?: {
|
|
388
|
+
storageState?: string | undefined;
|
|
389
|
+
} | undefined;
|
|
390
|
+
} | undefined;
|
|
391
|
+
activeBrowserModel?: {
|
|
392
|
+
modelName?: string | undefined;
|
|
393
|
+
source: "chat-model" | "codex-oauth" | "settings" | "stagehand-default";
|
|
394
|
+
viaCodexOAuth: boolean;
|
|
395
|
+
} | undefined;
|
|
396
|
+
observerModelSelection: string;
|
|
397
|
+
reflectorModelSelection: string;
|
|
398
|
+
}, {
|
|
399
|
+
currentModelId?: string | undefined;
|
|
400
|
+
modeId?: string | undefined;
|
|
401
|
+
modelRoute?: {
|
|
402
|
+
entries: {
|
|
403
|
+
id: string;
|
|
404
|
+
label: string;
|
|
405
|
+
modelId: string;
|
|
406
|
+
accountId?: string | undefined;
|
|
407
|
+
memoryModelId?: string | undefined;
|
|
408
|
+
}[];
|
|
409
|
+
} | undefined;
|
|
410
|
+
subagentModelId?: string | undefined;
|
|
411
|
+
subagentModelId_explore?: string | undefined;
|
|
412
|
+
subagentModelId_plan?: string | undefined;
|
|
413
|
+
subagentModelId_execute?: string | undefined;
|
|
414
|
+
projectPath?: string | undefined;
|
|
415
|
+
projectName?: string | undefined;
|
|
416
|
+
factoryProjectId?: string | undefined;
|
|
417
|
+
factoryModelScope?: "factory" | "user" | undefined;
|
|
418
|
+
factoryOwnerUserId?: string | undefined;
|
|
419
|
+
factoryOrgId?: string | undefined;
|
|
420
|
+
factoryOrgUnresolved?: boolean | undefined;
|
|
421
|
+
projectRepositoryId?: string | undefined;
|
|
422
|
+
branch?: string | undefined;
|
|
423
|
+
untrustedCheckout?: boolean | undefined;
|
|
424
|
+
baseRef?: string | undefined;
|
|
425
|
+
skipGlobalInstructions?: boolean | undefined;
|
|
426
|
+
instructionRoots?: string[] | undefined;
|
|
427
|
+
configDir: string;
|
|
428
|
+
homeDir?: string | undefined;
|
|
429
|
+
gitBranch?: string | undefined;
|
|
430
|
+
lastCommand?: string | undefined;
|
|
431
|
+
observerModelId?: string | undefined;
|
|
432
|
+
reflectorModelId?: string | undefined;
|
|
433
|
+
observerModelSelection?: string | undefined;
|
|
434
|
+
reflectorModelSelection?: string | undefined;
|
|
435
|
+
observationThreshold: number;
|
|
436
|
+
reflectionThreshold: number;
|
|
437
|
+
cavemanObservations: boolean;
|
|
438
|
+
observeAttachments: "auto" | boolean;
|
|
439
|
+
omScope?: "resource" | "thread" | undefined;
|
|
440
|
+
thinkingLevel?: "high" | "low" | "max" | "medium" | "off" | "xhigh" | undefined;
|
|
441
|
+
yolo: boolean;
|
|
442
|
+
permissionRules: {
|
|
443
|
+
categories: Record<string, "allow" | "ask" | "deny">;
|
|
444
|
+
tools: Record<string, "allow" | "ask" | "deny">;
|
|
445
|
+
};
|
|
446
|
+
smartEditing: boolean;
|
|
447
|
+
notifications: "bell" | "both" | "off" | "system";
|
|
448
|
+
tasks: {
|
|
449
|
+
id?: string | undefined;
|
|
450
|
+
content: string;
|
|
451
|
+
status: "completed" | "in_progress" | "pending";
|
|
452
|
+
activeForm: string;
|
|
453
|
+
}[];
|
|
454
|
+
sandboxAllowedPaths: string[];
|
|
455
|
+
mastracodePendingModelFallback?: {
|
|
456
|
+
fromEntryId: string;
|
|
457
|
+
toEntryId: string;
|
|
458
|
+
toModelId: string;
|
|
459
|
+
threadId?: string | undefined;
|
|
460
|
+
reason: "persistent-outage" | "pool-exhausted";
|
|
461
|
+
at: string;
|
|
462
|
+
} | null | undefined;
|
|
463
|
+
pluginSkillPaths: string[];
|
|
464
|
+
pluginCommandPaths: string[];
|
|
465
|
+
pluginInstructions: string[];
|
|
466
|
+
activePlan: {
|
|
467
|
+
title: string;
|
|
468
|
+
plan: string;
|
|
469
|
+
approvedAt: string;
|
|
470
|
+
} | null;
|
|
471
|
+
activeBrowserSettings?: {
|
|
472
|
+
enabled: boolean;
|
|
473
|
+
provider: "agent-browser" | "stagehand";
|
|
474
|
+
headless?: boolean | undefined;
|
|
475
|
+
viewport?: "window" | {
|
|
476
|
+
width: number;
|
|
477
|
+
height: number;
|
|
478
|
+
} | undefined;
|
|
479
|
+
cdpUrl?: string | undefined;
|
|
480
|
+
profile?: string | undefined;
|
|
481
|
+
executablePath?: string | undefined;
|
|
482
|
+
scope?: "shared" | "thread" | undefined;
|
|
483
|
+
stagehand?: {
|
|
484
|
+
env: "BROWSERBASE" | "LOCAL";
|
|
485
|
+
projectId?: string | undefined;
|
|
486
|
+
model?: string | undefined;
|
|
487
|
+
preserveUserDataDir?: boolean | undefined;
|
|
488
|
+
} | undefined;
|
|
489
|
+
agentBrowser?: {
|
|
490
|
+
storageState?: string | undefined;
|
|
491
|
+
} | undefined;
|
|
492
|
+
} | undefined;
|
|
493
|
+
activeBrowserModel?: {
|
|
494
|
+
modelName?: string | undefined;
|
|
495
|
+
source: "chat-model" | "codex-oauth" | "settings" | "stagehand-default";
|
|
496
|
+
viaCodexOAuth: boolean;
|
|
497
|
+
} | undefined;
|
|
498
|
+
}>>;
|
|
499
|
+
//# sourceMappingURL=schema.d.ts.map
|
package/dist/schema.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { DEFAULT_CONFIG_DIR } from "./constants.js";
|
|
2
|
+
import { THINKING_LEVEL_VALUES } from "./thinking.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
// src/schema.ts
|
|
5
|
+
const stateSchema = z.object({
|
|
6
|
+
currentModelId: z.string().optional(),
|
|
7
|
+
modeId: z.string().optional(),
|
|
8
|
+
modelRoute: z.object({ entries: z.array(z.object({
|
|
9
|
+
id: z.string().max(512),
|
|
10
|
+
label: z.string().max(512),
|
|
11
|
+
modelId: z.string().max(512),
|
|
12
|
+
accountId: z.string().max(512).optional(),
|
|
13
|
+
memoryModelId: z.string().max(512).optional()
|
|
14
|
+
})).max(32) }).optional(),
|
|
15
|
+
subagentModelId: z.string().optional(),
|
|
16
|
+
subagentModelId_explore: z.string().optional(),
|
|
17
|
+
subagentModelId_plan: z.string().optional(),
|
|
18
|
+
subagentModelId_execute: z.string().optional(),
|
|
19
|
+
projectPath: z.string().optional(),
|
|
20
|
+
projectName: z.string().optional(),
|
|
21
|
+
factoryProjectId: z.string().optional(),
|
|
22
|
+
factoryModelScope: z.enum(["factory", "user"]).optional(),
|
|
23
|
+
factoryOwnerUserId: z.string().optional(),
|
|
24
|
+
factoryOrgId: z.string().optional(),
|
|
25
|
+
factoryOrgUnresolved: z.boolean().optional(),
|
|
26
|
+
projectRepositoryId: z.string().optional(),
|
|
27
|
+
branch: z.string().optional(),
|
|
28
|
+
untrustedCheckout: z.boolean().optional(),
|
|
29
|
+
baseRef: z.string().optional(),
|
|
30
|
+
skipGlobalInstructions: z.boolean().optional(),
|
|
31
|
+
instructionRoots: z.array(z.string()).optional(),
|
|
32
|
+
configDir: z.string().default(DEFAULT_CONFIG_DIR),
|
|
33
|
+
homeDir: z.string().optional(),
|
|
34
|
+
gitBranch: z.string().optional(),
|
|
35
|
+
lastCommand: z.string().optional(),
|
|
36
|
+
observerModelId: z.string().optional(),
|
|
37
|
+
reflectorModelId: z.string().optional(),
|
|
38
|
+
observerModelSelection: z.string().optional(),
|
|
39
|
+
reflectorModelSelection: z.string().optional(),
|
|
40
|
+
observationThreshold: z.number().default(3e4),
|
|
41
|
+
reflectionThreshold: z.number().default(4e4),
|
|
42
|
+
cavemanObservations: z.boolean().default(false),
|
|
43
|
+
observeAttachments: z.union([z.literal("auto"), z.boolean()]).default("auto"),
|
|
44
|
+
omScope: z.enum(["thread", "resource"]).optional(),
|
|
45
|
+
thinkingLevel: z.preprocess((value) => value === null ? void 0 : value, z.enum(THINKING_LEVEL_VALUES).optional()),
|
|
46
|
+
yolo: z.boolean().default(false),
|
|
47
|
+
permissionRules: z.object({
|
|
48
|
+
categories: z.record(z.string(), z.enum([
|
|
49
|
+
"allow",
|
|
50
|
+
"ask",
|
|
51
|
+
"deny"
|
|
52
|
+
])).default({}),
|
|
53
|
+
tools: z.record(z.string(), z.enum([
|
|
54
|
+
"allow",
|
|
55
|
+
"ask",
|
|
56
|
+
"deny"
|
|
57
|
+
])).default({})
|
|
58
|
+
}).default({
|
|
59
|
+
categories: {},
|
|
60
|
+
tools: {}
|
|
61
|
+
}),
|
|
62
|
+
smartEditing: z.boolean().default(true),
|
|
63
|
+
notifications: z.enum([
|
|
64
|
+
"bell",
|
|
65
|
+
"system",
|
|
66
|
+
"both",
|
|
67
|
+
"off"
|
|
68
|
+
]).default("off"),
|
|
69
|
+
tasks: z.array(z.object({
|
|
70
|
+
id: z.string().optional(),
|
|
71
|
+
content: z.string(),
|
|
72
|
+
status: z.enum([
|
|
73
|
+
"pending",
|
|
74
|
+
"in_progress",
|
|
75
|
+
"completed"
|
|
76
|
+
]),
|
|
77
|
+
activeForm: z.string()
|
|
78
|
+
})).default([]),
|
|
79
|
+
sandboxAllowedPaths: z.array(z.string()).default([]),
|
|
80
|
+
mastracodePendingModelFallback: z.object({
|
|
81
|
+
fromEntryId: z.string(),
|
|
82
|
+
toEntryId: z.string(),
|
|
83
|
+
toModelId: z.string(),
|
|
84
|
+
threadId: z.string().optional(),
|
|
85
|
+
reason: z.enum(["pool-exhausted", "persistent-outage"]),
|
|
86
|
+
at: z.string()
|
|
87
|
+
}).nullish(),
|
|
88
|
+
pluginSkillPaths: z.array(z.string()).default([]),
|
|
89
|
+
pluginCommandPaths: z.array(z.string()).default([]),
|
|
90
|
+
pluginInstructions: z.array(z.string()).default([]),
|
|
91
|
+
activePlan: z.object({
|
|
92
|
+
title: z.string(),
|
|
93
|
+
plan: z.string(),
|
|
94
|
+
approvedAt: z.string()
|
|
95
|
+
}).nullable().default(null),
|
|
96
|
+
activeBrowserSettings: z.object({
|
|
97
|
+
enabled: z.boolean(),
|
|
98
|
+
provider: z.enum(["stagehand", "agent-browser"]),
|
|
99
|
+
headless: z.boolean().optional(),
|
|
100
|
+
viewport: z.union([z.object({
|
|
101
|
+
width: z.number(),
|
|
102
|
+
height: z.number()
|
|
103
|
+
}), z.literal("window")]).optional(),
|
|
104
|
+
cdpUrl: z.string().optional(),
|
|
105
|
+
profile: z.string().optional(),
|
|
106
|
+
executablePath: z.string().optional(),
|
|
107
|
+
scope: z.enum(["shared", "thread"]).optional(),
|
|
108
|
+
stagehand: z.object({
|
|
109
|
+
env: z.enum(["LOCAL", "BROWSERBASE"]),
|
|
110
|
+
projectId: z.string().optional(),
|
|
111
|
+
model: z.string().optional(),
|
|
112
|
+
preserveUserDataDir: z.boolean().optional()
|
|
113
|
+
}).optional(),
|
|
114
|
+
agentBrowser: z.object({ storageState: z.string().optional() }).optional()
|
|
115
|
+
}).optional(),
|
|
116
|
+
activeBrowserModel: z.object({
|
|
117
|
+
modelName: z.string().optional(),
|
|
118
|
+
source: z.enum([
|
|
119
|
+
"settings",
|
|
120
|
+
"chat-model",
|
|
121
|
+
"codex-oauth",
|
|
122
|
+
"stagehand-default"
|
|
123
|
+
]),
|
|
124
|
+
viaCodexOAuth: z.boolean()
|
|
125
|
+
}).optional()
|
|
126
|
+
}).transform((state) => ({
|
|
127
|
+
...state,
|
|
128
|
+
observerModelSelection: state.observerModelSelection ?? state.observerModelId ?? "auto",
|
|
129
|
+
reflectorModelSelection: state.reflectorModelSelection ?? state.reflectorModelId ?? "auto"
|
|
130
|
+
}));
|
|
131
|
+
export { stateSchema };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mastra brand palette (immutable — stays constant regardless of theme).
|
|
3
|
+
*
|
|
4
|
+
* Lives outside the TUI so non-TUI code (e.g. mode metadata colors in
|
|
5
|
+
* `createMastraCode`) can use brand colors without importing TUI modules.
|
|
6
|
+
* The TUI's `theme.ts` re-exports this and layers contrast adaptation on top.
|
|
7
|
+
*/
|
|
8
|
+
export declare const mastraBrand: {
|
|
9
|
+
readonly purple: '#7f45e0';
|
|
10
|
+
readonly green: '#16c858';
|
|
11
|
+
readonly orange: '#fdac53';
|
|
12
|
+
readonly pink: '#ff69cc';
|
|
13
|
+
readonly blue: '#2563eb';
|
|
14
|
+
readonly red: '#DC5663';
|
|
15
|
+
readonly yellow: '#e7e67b';
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=theme-palette.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/theme-palette.ts
|
|
2
|
+
/**
|
|
3
|
+
* Mastra brand palette (immutable — stays constant regardless of theme).
|
|
4
|
+
*
|
|
5
|
+
* Lives outside the TUI so non-TUI code (e.g. mode metadata colors in
|
|
6
|
+
* `createMastraCode`) can use brand colors without importing TUI modules.
|
|
7
|
+
* The TUI's `theme.ts` re-exports this and layers contrast adaptation on top.
|
|
8
|
+
*/
|
|
9
|
+
const mastraBrand = {
|
|
10
|
+
purple: "#7f45e0",
|
|
11
|
+
green: "#16c858",
|
|
12
|
+
orange: "#fdac53",
|
|
13
|
+
pink: "#ff69cc",
|
|
14
|
+
blue: "#2563eb",
|
|
15
|
+
red: "#DC5663",
|
|
16
|
+
yellow: "#e7e67b"
|
|
17
|
+
};
|
|
18
|
+
export { mastraBrand };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ThinkingLevelSetting } from './thinking.js';
|
|
2
|
+
export declare function runCatalogThinkingLevel(selectionId: string, level: ThinkingLevelSetting): ThinkingLevelSetting;
|
|
3
|
+
export declare function getCatalogThinkingLevels(selectionId: string): ThinkingLevelSetting[];
|
|
4
|
+
//# sourceMappingURL=thinking-catalog.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { parseCodexModelSelection } from "./providers/model-ids.js";
|
|
2
|
+
import { getAvailableThinkingLevelsForModel, runThinkingLevel } from "./thinking.js";
|
|
3
|
+
import { getModelReasoningOptions } from "@mastra/core/llm";
|
|
4
|
+
// src/thinking-catalog.ts
|
|
5
|
+
function runCatalogThinkingLevel(selectionId, level) {
|
|
6
|
+
const { modelId } = parseCodexModelSelection(selectionId);
|
|
7
|
+
return runThinkingLevel(modelId, level, getModelReasoningOptions(modelId));
|
|
8
|
+
}
|
|
9
|
+
function getCatalogThinkingLevels(selectionId) {
|
|
10
|
+
const { modelId } = parseCodexModelSelection(selectionId);
|
|
11
|
+
return getAvailableThinkingLevelsForModel(modelId, getModelReasoningOptions(modelId));
|
|
12
|
+
}
|
|
13
|
+
export { getCatalogThinkingLevels, runCatalogThinkingLevel };
|