oh-my-opencode 5.0.0-beta.51 → 5.0.0-beta.53
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/README.ja.md +11 -18
- package/README.ko.md +10 -17
- package/README.md +11 -18
- package/README.ru.md +11 -18
- package/README.zh-cn.md +11 -18
- package/dist/cli/doctor/checks/index.d.ts +2 -0
- package/dist/cli/doctor/checks/latest-version.d.ts +11 -0
- package/dist/cli/doctor/framework/constants.d.ts +5 -0
- package/dist/cli/doctor/framework/types.d.ts +2 -0
- package/dist/cli/index.js +181 -63
- package/dist/cli-node/index.js +181 -63
- package/dist/features/background-agent/manager.d.ts +7 -0
- package/dist/features/background-agent/types.d.ts +4 -0
- package/dist/features/claude-tasks/storage.d.ts +7 -2
- package/dist/features/hook-message-injector/index.d.ts +1 -0
- package/dist/features/hook-message-injector/sdk-message-lookup.d.ts +1 -0
- package/dist/hooks/keyword-detector/hook.d.ts +2 -0
- package/dist/hooks/keyword-detector/ultrawork/index.d.ts +2 -0
- package/dist/hooks/unstable-agent-babysitter/task-message-analyzer.d.ts +1 -0
- package/dist/index.js +1539 -1292
- package/dist/plugin/chat-message/types.d.ts +3 -1
- package/dist/plugin/stop-continuation.d.ts +3 -0
- package/dist/plugin/system-transform.d.ts +5 -1
- package/dist/skills/frontend/ATTRIBUTION.md +10 -0
- package/dist/skills/frontend/SKILL.md +3 -0
- package/dist/skills/frontend/references/design/README.md +10 -2
- package/dist/skills/frontend/references/design/_INDEX.md +1 -0
- package/dist/skills/frontend/references/design/ambience-skill.md +145 -0
- package/dist/skills/frontend/references/design/interaction-skill.md +2 -0
- package/dist/skills/refactor/SKILL.md +3 -3
- package/dist/skills/review-work/SKILL.md +1 -1
- package/dist/skills/ulw-execute/SKILL.md +5 -5
- package/dist/tui.js +89 -13
- package/package.json +14 -14
- package/packages/lsp-daemon/dist/cli.js +1 -2
- package/packages/lsp-daemon/dist/ownership.js +2 -2
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/dist/cli.js +1 -1
- package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.js +2 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/git-bash/src/codex-hook.ts +2 -1
- package/packages/omo-codex/plugin/components/git-bash/test/codex-hook.test.ts +6 -7
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +12 -12
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +10 -0
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +3 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +10 -2
- package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/ambience-skill.md +145 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/interaction-skill.md +2 -0
- package/packages/omo-codex/plugin/skills/refactor/SKILL.md +3 -3
- package/packages/omo-codex/plugin/skills/ulw-execute/SKILL.md +5 -5
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
- package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +10 -0
- package/packages/shared-skills/skills/frontend/SKILL.md +3 -0
- package/packages/shared-skills/skills/frontend/references/design/README.md +10 -2
- package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +1 -0
- package/packages/shared-skills/skills/frontend/references/design/ambience-skill.md +145 -0
- package/packages/shared-skills/skills/frontend/references/design/interaction-skill.md +2 -0
- package/packages/shared-skills/skills/refactor/SKILL.md +3 -3
- package/packages/shared-skills/skills/review-work/SKILL.md +1 -1
- package/packages/shared-skills/skills/ulw-execute/SKILL.md +5 -5
package/dist/index.js
CHANGED
|
@@ -11684,7 +11684,7 @@ var init_member_parser = __esm(() => {
|
|
|
11684
11684
|
});
|
|
11685
11685
|
|
|
11686
11686
|
// packages/team-core/src/types.ts
|
|
11687
|
-
import * as
|
|
11687
|
+
import * as z51 from "zod";
|
|
11688
11688
|
var MESSAGE_KINDS, TASK_STATUSES, RUNTIME_STATUSES, MemberBaseSchema, CategoryMemberSchema, SubagentMemberSchema, MemberSchema, TeamReferenceSchema, MISSING_TEAM_LEAD_MESSAGE = "leadAgentId required (or write a `lead: {...}` field, or mark one member with `isLead: true`)", TeamSpecSchema, MessageSchema, TaskSchema, RuntimeStateMemberModelSchema, RuntimeStateMemberSchema, RuntimeBoundsSchema, ShutdownRequestSchema, RuntimeStateTmuxLayoutSchema, RuntimeStateSchema, AGENT_ELIGIBILITY_REGISTRY, parseMemberBase;
|
|
11689
11689
|
var init_types2 = __esm(() => {
|
|
11690
11690
|
init_member_parser();
|
|
@@ -11705,40 +11705,40 @@ var init_types2 = __esm(() => {
|
|
|
11705
11705
|
"failed",
|
|
11706
11706
|
"orphaned"
|
|
11707
11707
|
];
|
|
11708
|
-
MemberBaseSchema =
|
|
11709
|
-
name:
|
|
11710
|
-
cwd:
|
|
11711
|
-
worktreePath:
|
|
11712
|
-
task_summary:
|
|
11713
|
-
subscriptions:
|
|
11714
|
-
backendType:
|
|
11715
|
-
color:
|
|
11716
|
-
isActive:
|
|
11708
|
+
MemberBaseSchema = z51.object({
|
|
11709
|
+
name: z51.string().min(1).regex(/^[a-z0-9-]+$/),
|
|
11710
|
+
cwd: z51.string().optional(),
|
|
11711
|
+
worktreePath: z51.string().optional(),
|
|
11712
|
+
task_summary: z51.string().max(80).optional(),
|
|
11713
|
+
subscriptions: z51.array(z51.string()).optional(),
|
|
11714
|
+
backendType: z51.enum(["in-process", "tmux"]).default("in-process"),
|
|
11715
|
+
color: z51.string().optional(),
|
|
11716
|
+
isActive: z51.boolean().default(true)
|
|
11717
11717
|
}).strict();
|
|
11718
11718
|
CategoryMemberSchema = MemberBaseSchema.extend({
|
|
11719
|
-
kind:
|
|
11720
|
-
category:
|
|
11721
|
-
prompt:
|
|
11719
|
+
kind: z51.literal("category"),
|
|
11720
|
+
category: z51.string().min(1),
|
|
11721
|
+
prompt: z51.string().min(1)
|
|
11722
11722
|
});
|
|
11723
11723
|
SubagentMemberSchema = MemberBaseSchema.extend({
|
|
11724
|
-
kind:
|
|
11725
|
-
subagent_type:
|
|
11726
|
-
prompt:
|
|
11724
|
+
kind: z51.literal("subagent_type"),
|
|
11725
|
+
subagent_type: z51.string().min(1),
|
|
11726
|
+
prompt: z51.string().optional()
|
|
11727
11727
|
});
|
|
11728
|
-
MemberSchema =
|
|
11729
|
-
TeamReferenceSchema =
|
|
11730
|
-
path:
|
|
11731
|
-
description:
|
|
11728
|
+
MemberSchema = z51.discriminatedUnion("kind", [CategoryMemberSchema, SubagentMemberSchema]);
|
|
11729
|
+
TeamReferenceSchema = z51.object({
|
|
11730
|
+
path: z51.string(),
|
|
11731
|
+
description: z51.string().optional()
|
|
11732
11732
|
}).strict();
|
|
11733
|
-
TeamSpecSchema =
|
|
11734
|
-
version:
|
|
11735
|
-
name:
|
|
11736
|
-
description:
|
|
11737
|
-
createdAt:
|
|
11738
|
-
leadAgentId:
|
|
11739
|
-
teamAllowedPaths:
|
|
11740
|
-
sessionPermission:
|
|
11741
|
-
members:
|
|
11733
|
+
TeamSpecSchema = z51.object({
|
|
11734
|
+
version: z51.literal(1).default(1),
|
|
11735
|
+
name: z51.string().min(1).regex(/^[a-z0-9-]+$/),
|
|
11736
|
+
description: z51.string().optional(),
|
|
11737
|
+
createdAt: z51.number().int().positive().default(() => Date.now()),
|
|
11738
|
+
leadAgentId: z51.string().optional(),
|
|
11739
|
+
teamAllowedPaths: z51.array(z51.string()).optional(),
|
|
11740
|
+
sessionPermission: z51.string().optional(),
|
|
11741
|
+
members: z51.array(MemberSchema).min(1).max(8)
|
|
11742
11742
|
}).superRefine((teamSpec, ctx) => {
|
|
11743
11743
|
if (teamSpec.leadAgentId === undefined && teamSpec.members.length > 1) {
|
|
11744
11744
|
ctx.addIssue({
|
|
@@ -11760,95 +11760,95 @@ var init_types2 = __esm(() => {
|
|
|
11760
11760
|
leadAgentId: firstMember.name
|
|
11761
11761
|
};
|
|
11762
11762
|
});
|
|
11763
|
-
MessageSchema =
|
|
11764
|
-
version:
|
|
11765
|
-
messageId:
|
|
11766
|
-
from:
|
|
11767
|
-
to:
|
|
11768
|
-
kind:
|
|
11769
|
-
body:
|
|
11770
|
-
summary:
|
|
11771
|
-
references:
|
|
11772
|
-
timestamp:
|
|
11773
|
-
correlationId:
|
|
11774
|
-
color:
|
|
11763
|
+
MessageSchema = z51.object({
|
|
11764
|
+
version: z51.literal(1),
|
|
11765
|
+
messageId: z51.string().uuid(),
|
|
11766
|
+
from: z51.string(),
|
|
11767
|
+
to: z51.string(),
|
|
11768
|
+
kind: z51.enum(MESSAGE_KINDS),
|
|
11769
|
+
body: z51.string().max(32 * 1024),
|
|
11770
|
+
summary: z51.string().optional(),
|
|
11771
|
+
references: z51.array(TeamReferenceSchema).optional(),
|
|
11772
|
+
timestamp: z51.number().int().positive(),
|
|
11773
|
+
correlationId: z51.string().uuid().optional(),
|
|
11774
|
+
color: z51.string().optional()
|
|
11775
11775
|
});
|
|
11776
|
-
TaskSchema =
|
|
11777
|
-
version:
|
|
11778
|
-
id:
|
|
11779
|
-
subject:
|
|
11780
|
-
description:
|
|
11781
|
-
activeForm:
|
|
11782
|
-
status:
|
|
11783
|
-
owner:
|
|
11784
|
-
blocks:
|
|
11785
|
-
blockedBy:
|
|
11786
|
-
metadata:
|
|
11787
|
-
createdAt:
|
|
11788
|
-
updatedAt:
|
|
11789
|
-
claimedAt:
|
|
11776
|
+
TaskSchema = z51.object({
|
|
11777
|
+
version: z51.literal(1),
|
|
11778
|
+
id: z51.string(),
|
|
11779
|
+
subject: z51.string(),
|
|
11780
|
+
description: z51.string(),
|
|
11781
|
+
activeForm: z51.string().optional(),
|
|
11782
|
+
status: z51.enum(TASK_STATUSES),
|
|
11783
|
+
owner: z51.string().optional(),
|
|
11784
|
+
blocks: z51.array(z51.string()).default([]),
|
|
11785
|
+
blockedBy: z51.array(z51.string()).default([]),
|
|
11786
|
+
metadata: z51.record(z51.string(), z51.unknown()).optional(),
|
|
11787
|
+
createdAt: z51.number().int().positive(),
|
|
11788
|
+
updatedAt: z51.number().int().positive(),
|
|
11789
|
+
claimedAt: z51.number().int().positive().optional()
|
|
11790
11790
|
});
|
|
11791
|
-
RuntimeStateMemberModelSchema =
|
|
11792
|
-
providerID:
|
|
11793
|
-
modelID:
|
|
11794
|
-
variant:
|
|
11795
|
-
reasoningEffort:
|
|
11796
|
-
temperature:
|
|
11797
|
-
top_p:
|
|
11798
|
-
maxTokens:
|
|
11799
|
-
thinking:
|
|
11800
|
-
type:
|
|
11801
|
-
budgetTokens:
|
|
11791
|
+
RuntimeStateMemberModelSchema = z51.object({
|
|
11792
|
+
providerID: z51.string(),
|
|
11793
|
+
modelID: z51.string(),
|
|
11794
|
+
variant: z51.string().optional(),
|
|
11795
|
+
reasoningEffort: z51.string().optional(),
|
|
11796
|
+
temperature: z51.number().optional(),
|
|
11797
|
+
top_p: z51.number().optional(),
|
|
11798
|
+
maxTokens: z51.number().optional(),
|
|
11799
|
+
thinking: z51.object({
|
|
11800
|
+
type: z51.enum(["enabled", "disabled"]),
|
|
11801
|
+
budgetTokens: z51.number().int().positive().optional()
|
|
11802
11802
|
}).optional()
|
|
11803
11803
|
}).strict();
|
|
11804
|
-
RuntimeStateMemberSchema =
|
|
11805
|
-
name:
|
|
11806
|
-
sessionId:
|
|
11807
|
-
tmuxPaneId:
|
|
11808
|
-
tmuxGridPaneId:
|
|
11809
|
-
agentType:
|
|
11810
|
-
subagent_type:
|
|
11811
|
-
category:
|
|
11804
|
+
RuntimeStateMemberSchema = z51.object({
|
|
11805
|
+
name: z51.string(),
|
|
11806
|
+
sessionId: z51.string().optional(),
|
|
11807
|
+
tmuxPaneId: z51.string().optional(),
|
|
11808
|
+
tmuxGridPaneId: z51.string().optional(),
|
|
11809
|
+
agentType: z51.enum(["leader", "general-purpose"]),
|
|
11810
|
+
subagent_type: z51.string().optional(),
|
|
11811
|
+
category: z51.string().optional(),
|
|
11812
11812
|
model: RuntimeStateMemberModelSchema.optional(),
|
|
11813
|
-
status:
|
|
11814
|
-
color:
|
|
11815
|
-
worktreePath:
|
|
11816
|
-
lastInjectedTurnMarker:
|
|
11817
|
-
pendingInjectedMessageIds:
|
|
11813
|
+
status: z51.enum(["pending", "running", "idle", "errored", "completed", "shutdown_approved"]),
|
|
11814
|
+
color: z51.string().optional(),
|
|
11815
|
+
worktreePath: z51.string().optional(),
|
|
11816
|
+
lastInjectedTurnMarker: z51.string().optional(),
|
|
11817
|
+
pendingInjectedMessageIds: z51.array(z51.string()).default([])
|
|
11818
11818
|
}).strict();
|
|
11819
|
-
RuntimeBoundsSchema =
|
|
11820
|
-
maxMembers:
|
|
11821
|
-
maxParallelMembers:
|
|
11822
|
-
maxMessagesPerRun:
|
|
11823
|
-
maxWallClockMinutes:
|
|
11824
|
-
maxMemberTurns:
|
|
11819
|
+
RuntimeBoundsSchema = z51.object({
|
|
11820
|
+
maxMembers: z51.number().int().default(8),
|
|
11821
|
+
maxParallelMembers: z51.number().int().default(4),
|
|
11822
|
+
maxMessagesPerRun: z51.number().int().default(1e4),
|
|
11823
|
+
maxWallClockMinutes: z51.number().int().default(120),
|
|
11824
|
+
maxMemberTurns: z51.number().int().default(500)
|
|
11825
11825
|
}).strict();
|
|
11826
|
-
ShutdownRequestSchema =
|
|
11827
|
-
memberId:
|
|
11828
|
-
requesterName:
|
|
11829
|
-
requestedAt:
|
|
11830
|
-
approvedAt:
|
|
11831
|
-
rejectedReason:
|
|
11832
|
-
rejectedAt:
|
|
11826
|
+
ShutdownRequestSchema = z51.object({
|
|
11827
|
+
memberId: z51.string(),
|
|
11828
|
+
requesterName: z51.string(),
|
|
11829
|
+
requestedAt: z51.number().int().positive(),
|
|
11830
|
+
approvedAt: z51.number().int().positive().optional(),
|
|
11831
|
+
rejectedReason: z51.string().optional(),
|
|
11832
|
+
rejectedAt: z51.number().int().positive().optional()
|
|
11833
11833
|
}).strict();
|
|
11834
|
-
RuntimeStateTmuxLayoutSchema =
|
|
11835
|
-
ownedSession:
|
|
11836
|
-
targetSessionId:
|
|
11837
|
-
focusWindowId:
|
|
11838
|
-
gridWindowId:
|
|
11839
|
-
paneIds:
|
|
11834
|
+
RuntimeStateTmuxLayoutSchema = z51.object({
|
|
11835
|
+
ownedSession: z51.boolean(),
|
|
11836
|
+
targetSessionId: z51.string(),
|
|
11837
|
+
focusWindowId: z51.string().optional(),
|
|
11838
|
+
gridWindowId: z51.string().optional(),
|
|
11839
|
+
paneIds: z51.array(z51.string()).optional()
|
|
11840
11840
|
}).strict();
|
|
11841
|
-
RuntimeStateSchema =
|
|
11842
|
-
version:
|
|
11843
|
-
teamRunId:
|
|
11844
|
-
teamName:
|
|
11845
|
-
specSource:
|
|
11846
|
-
createdAt:
|
|
11847
|
-
status:
|
|
11848
|
-
leadSessionId:
|
|
11841
|
+
RuntimeStateSchema = z51.object({
|
|
11842
|
+
version: z51.literal(1),
|
|
11843
|
+
teamRunId: z51.string().uuid(),
|
|
11844
|
+
teamName: z51.string(),
|
|
11845
|
+
specSource: z51.enum(["project", "user"]),
|
|
11846
|
+
createdAt: z51.number().int().positive(),
|
|
11847
|
+
status: z51.enum(RUNTIME_STATUSES),
|
|
11848
|
+
leadSessionId: z51.string().optional(),
|
|
11849
11849
|
tmuxLayout: RuntimeStateTmuxLayoutSchema.optional(),
|
|
11850
|
-
members:
|
|
11851
|
-
shutdownRequests:
|
|
11850
|
+
members: z51.array(RuntimeStateMemberSchema),
|
|
11851
|
+
shutdownRequests: z51.array(ShutdownRequestSchema).default([]),
|
|
11852
11852
|
bounds: RuntimeBoundsSchema
|
|
11853
11853
|
});
|
|
11854
11854
|
AGENT_ELIGIBILITY_REGISTRY = {
|
|
@@ -20379,6 +20379,18 @@ function resolveCompatibleModelSettings(input) {
|
|
|
20379
20379
|
function normalizeModelName(name) {
|
|
20380
20380
|
return name.toLowerCase().replace(/claude-(opus|sonnet|haiku)-(\d+)[.-](\d+)/g, "claude-$1-$2.$3").replace(/kimi-k2[.-](\d+)/g, "kimi-k2.$1").replace(/\b(glm|gpt)-(\d+)[.-](\d+)/g, "$1-$2.$3");
|
|
20381
20381
|
}
|
|
20382
|
+
function modelIdOf(model) {
|
|
20383
|
+
return model.split("/").slice(1).join("/");
|
|
20384
|
+
}
|
|
20385
|
+
function closestMatch(matches, providers) {
|
|
20386
|
+
const providerRank = (model) => providers === undefined || providers.length === 0 ? 0 : providers.indexOf(model.split("/")[0] ?? "");
|
|
20387
|
+
return matches.reduce((best, current) => {
|
|
20388
|
+
const rankDelta = providerRank(current) - providerRank(best);
|
|
20389
|
+
if (rankDelta !== 0)
|
|
20390
|
+
return rankDelta < 0 ? current : best;
|
|
20391
|
+
return modelIdOf(current).length < modelIdOf(best).length ? current : best;
|
|
20392
|
+
});
|
|
20393
|
+
}
|
|
20382
20394
|
function fuzzyMatchModel(target, available, providers) {
|
|
20383
20395
|
if (available.size === 0) {
|
|
20384
20396
|
return null;
|
|
@@ -20403,14 +20415,11 @@ function fuzzyMatchModel(target, available, providers) {
|
|
|
20403
20415
|
if (exactMatch) {
|
|
20404
20416
|
return exactMatch;
|
|
20405
20417
|
}
|
|
20406
|
-
const exactModelIdMatches = matches.filter((model) =>
|
|
20407
|
-
const modelId = model.split("/").slice(1).join("/");
|
|
20408
|
-
return normalizeModelName(modelId) === targetNormalized;
|
|
20409
|
-
});
|
|
20418
|
+
const exactModelIdMatches = matches.filter((model) => normalizeModelName(modelIdOf(model)) === targetNormalized);
|
|
20410
20419
|
if (exactModelIdMatches.length > 0) {
|
|
20411
|
-
return exactModelIdMatches
|
|
20420
|
+
return closestMatch(exactModelIdMatches, providers);
|
|
20412
20421
|
}
|
|
20413
|
-
return matches
|
|
20422
|
+
return closestMatch(matches, providers);
|
|
20414
20423
|
}
|
|
20415
20424
|
|
|
20416
20425
|
// packages/model-core/src/provider-model-id-transform.ts
|
|
@@ -22664,7 +22673,7 @@ var OmoCategoryConfigSchema = z4.preprocess((value) => isRecord7(value) ? normal
|
|
|
22664
22673
|
var OmoCategoriesConfigSchema = z4.record(z4.string(), OmoCategoryConfigSchema);
|
|
22665
22674
|
|
|
22666
22675
|
// packages/omo-config-core/src/schema/config.ts
|
|
22667
|
-
import * as
|
|
22676
|
+
import * as z14 from "zod";
|
|
22668
22677
|
|
|
22669
22678
|
// packages/omo-config-core/src/schema/git-master.ts
|
|
22670
22679
|
import * as z5 from "zod";
|
|
@@ -22865,46 +22874,61 @@ var OmoModelCatalogEntryLayerInputSchema = OmoModelCatalogEntryInputSchema.parti
|
|
|
22865
22874
|
var OmoModelCatalogEntryLayerSchema = z8.preprocess((value) => isRecord8(value) ? normalizeLegacyModelFields(value) : value, OmoModelCatalogEntryLayerInputSchema);
|
|
22866
22875
|
var OmoModelCatalogLayerSchema = z8.record(z8.string(), OmoModelCatalogEntryLayerSchema);
|
|
22867
22876
|
|
|
22877
|
+
// packages/omo-config-core/src/schema/model-profile.ts
|
|
22878
|
+
import * as z9 from "zod";
|
|
22879
|
+
function isRecord9(value) {
|
|
22880
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22881
|
+
}
|
|
22882
|
+
var OmoModelProfileInputSchema = z9.object({
|
|
22883
|
+
display_name: z9.string().optional(),
|
|
22884
|
+
models: z9.array(z9.union([z9.string(), OmoFallbackModelObjectSchema])).optional()
|
|
22885
|
+
}).strict();
|
|
22886
|
+
var OmoModelProfileSchema = z9.preprocess((value) => isRecord9(value) ? normalizeLegacyModelFields(value) : value, OmoModelProfileInputSchema);
|
|
22887
|
+
var OmoModelProfilesSchema = z9.record(z9.string(), OmoModelProfileSchema);
|
|
22888
|
+
var OmoModelProfileLayerInputSchema = OmoModelProfileInputSchema.partial();
|
|
22889
|
+
var OmoModelProfileLayerSchema = z9.preprocess((value) => isRecord9(value) ? normalizeLegacyModelFields(value) : value, OmoModelProfileLayerInputSchema);
|
|
22890
|
+
var OmoModelProfilesLayerSchema = z9.record(z9.string(), OmoModelProfileLayerSchema);
|
|
22891
|
+
|
|
22868
22892
|
// packages/omo-config-core/src/schema/task.ts
|
|
22869
22893
|
import { availableParallelism } from "os";
|
|
22870
|
-
import * as
|
|
22894
|
+
import * as z10 from "zod";
|
|
22871
22895
|
var DEFAULT_RESIDENCY_MAX_CHILDREN = 16;
|
|
22872
|
-
var ResidencyMaxChildrenInputSchema =
|
|
22873
|
-
var OmoTaskWaitSchema =
|
|
22874
|
-
min_ms:
|
|
22875
|
-
default_ms:
|
|
22876
|
-
max_ms:
|
|
22896
|
+
var ResidencyMaxChildrenInputSchema = z10.union([z10.number().int().nonnegative(), z10.literal("unlimited")]);
|
|
22897
|
+
var OmoTaskWaitSchema = z10.object({
|
|
22898
|
+
min_ms: z10.number().int().positive().default(5000),
|
|
22899
|
+
default_ms: z10.number().int().positive().default(60000),
|
|
22900
|
+
max_ms: z10.number().int().positive().default(600000)
|
|
22877
22901
|
}).strict();
|
|
22878
|
-
var OmoTaskTeamSettingsSchema =
|
|
22879
|
-
max_members:
|
|
22880
|
-
max_parallel_members:
|
|
22881
|
-
max_wall_clock_minutes:
|
|
22902
|
+
var OmoTaskTeamSettingsSchema = z10.object({
|
|
22903
|
+
max_members: z10.number().int().min(1).max(8).default(8),
|
|
22904
|
+
max_parallel_members: z10.number().int().min(1).max(8).default(4),
|
|
22905
|
+
max_wall_clock_minutes: z10.number().int().positive().default(120)
|
|
22882
22906
|
}).strict();
|
|
22883
|
-
var OmoTaskWarningsSchema =
|
|
22884
|
-
unavailable_categories:
|
|
22907
|
+
var OmoTaskWarningsSchema = z10.object({
|
|
22908
|
+
unavailable_categories: z10.boolean().default(true)
|
|
22885
22909
|
}).strict();
|
|
22886
|
-
var OmoTaskDagSettingsSchema =
|
|
22887
|
-
max_nodes_per_run:
|
|
22888
|
-
max_runs_per_session:
|
|
22889
|
-
subscriber_ring:
|
|
22890
|
-
heartbeat_ms:
|
|
22891
|
-
history_default_limit:
|
|
22892
|
-
history_max_limit:
|
|
22893
|
-
retention_days:
|
|
22894
|
-
max_prompt_bytes:
|
|
22910
|
+
var OmoTaskDagSettingsSchema = z10.object({
|
|
22911
|
+
max_nodes_per_run: z10.number().int().positive().default(64),
|
|
22912
|
+
max_runs_per_session: z10.number().int().positive().default(16),
|
|
22913
|
+
subscriber_ring: z10.number().int().positive().default(1000),
|
|
22914
|
+
heartbeat_ms: z10.number().int().positive().default(15000),
|
|
22915
|
+
history_default_limit: z10.number().int().positive().default(256),
|
|
22916
|
+
history_max_limit: z10.number().int().positive().default(1000),
|
|
22917
|
+
retention_days: z10.number().int().positive().default(7),
|
|
22918
|
+
max_prompt_bytes: z10.number().int().positive().default(262144)
|
|
22895
22919
|
}).strict();
|
|
22896
|
-
var OmoTaskSettingsSchema =
|
|
22897
|
-
default_execution_mode:
|
|
22898
|
-
default_concurrency:
|
|
22899
|
-
global_concurrency:
|
|
22900
|
-
provider_concurrency:
|
|
22901
|
-
model_concurrency:
|
|
22902
|
-
max_depth:
|
|
22920
|
+
var OmoTaskSettingsSchema = z10.object({
|
|
22921
|
+
default_execution_mode: z10.enum(["in-process", "process"]).default("in-process"),
|
|
22922
|
+
default_concurrency: z10.number().int().nonnegative().default(5),
|
|
22923
|
+
global_concurrency: z10.number().int().nonnegative().default(8),
|
|
22924
|
+
provider_concurrency: z10.record(z10.string(), z10.number().int().nonnegative()).optional(),
|
|
22925
|
+
model_concurrency: z10.record(z10.string(), z10.number().int().nonnegative()).optional(),
|
|
22926
|
+
max_depth: z10.number().int().nonnegative().default(1),
|
|
22903
22927
|
residency_max_children: ResidencyMaxChildrenInputSchema.default(8),
|
|
22904
|
-
ttl_ms:
|
|
22905
|
-
state_dir:
|
|
22906
|
-
reattach_on_reconcile:
|
|
22907
|
-
resume_children:
|
|
22928
|
+
ttl_ms: z10.number().int().positive().default(86400000),
|
|
22929
|
+
state_dir: z10.string().optional(),
|
|
22930
|
+
reattach_on_reconcile: z10.boolean().optional(),
|
|
22931
|
+
resume_children: z10.boolean().default(true),
|
|
22908
22932
|
warnings: OmoTaskWarningsSchema.default({ unavailable_categories: true }),
|
|
22909
22933
|
wait: OmoTaskWaitSchema.default({ min_ms: 5000, default_ms: 60000, max_ms: 600000 }),
|
|
22910
22934
|
team: OmoTaskTeamSettingsSchema.default({
|
|
@@ -22914,48 +22938,48 @@ var OmoTaskSettingsSchema = z9.object({
|
|
|
22914
22938
|
}),
|
|
22915
22939
|
dag: OmoTaskDagSettingsSchema.optional()
|
|
22916
22940
|
}).strict();
|
|
22917
|
-
var OmoTaskDagSettingsLayerSchema =
|
|
22918
|
-
max_nodes_per_run:
|
|
22919
|
-
max_runs_per_session:
|
|
22920
|
-
subscriber_ring:
|
|
22921
|
-
heartbeat_ms:
|
|
22922
|
-
history_default_limit:
|
|
22923
|
-
history_max_limit:
|
|
22924
|
-
retention_days:
|
|
22925
|
-
max_prompt_bytes:
|
|
22941
|
+
var OmoTaskDagSettingsLayerSchema = z10.object({
|
|
22942
|
+
max_nodes_per_run: z10.number().int().positive().optional(),
|
|
22943
|
+
max_runs_per_session: z10.number().int().positive().optional(),
|
|
22944
|
+
subscriber_ring: z10.number().int().positive().optional(),
|
|
22945
|
+
heartbeat_ms: z10.number().int().positive().optional(),
|
|
22946
|
+
history_default_limit: z10.number().int().positive().optional(),
|
|
22947
|
+
history_max_limit: z10.number().int().positive().optional(),
|
|
22948
|
+
retention_days: z10.number().int().positive().optional(),
|
|
22949
|
+
max_prompt_bytes: z10.number().int().positive().optional()
|
|
22926
22950
|
}).strict();
|
|
22927
|
-
var OmoTaskWaitLayerSchema =
|
|
22928
|
-
min_ms:
|
|
22929
|
-
default_ms:
|
|
22930
|
-
max_ms:
|
|
22951
|
+
var OmoTaskWaitLayerSchema = z10.object({
|
|
22952
|
+
min_ms: z10.number().int().positive().optional(),
|
|
22953
|
+
default_ms: z10.number().int().positive().optional(),
|
|
22954
|
+
max_ms: z10.number().int().positive().optional()
|
|
22931
22955
|
}).strict();
|
|
22932
|
-
var OmoTaskTeamSettingsLayerSchema =
|
|
22933
|
-
max_members:
|
|
22934
|
-
max_parallel_members:
|
|
22935
|
-
max_wall_clock_minutes:
|
|
22956
|
+
var OmoTaskTeamSettingsLayerSchema = z10.object({
|
|
22957
|
+
max_members: z10.number().int().min(1).max(8).optional(),
|
|
22958
|
+
max_parallel_members: z10.number().int().min(1).max(8).optional(),
|
|
22959
|
+
max_wall_clock_minutes: z10.number().int().positive().optional()
|
|
22936
22960
|
}).strict();
|
|
22937
|
-
var OmoTaskWarningsLayerSchema =
|
|
22938
|
-
unavailable_categories:
|
|
22961
|
+
var OmoTaskWarningsLayerSchema = z10.object({
|
|
22962
|
+
unavailable_categories: z10.boolean().optional()
|
|
22939
22963
|
}).strict();
|
|
22940
|
-
var OmoTaskSettingsLayerSchema =
|
|
22941
|
-
default_execution_mode:
|
|
22942
|
-
default_concurrency:
|
|
22943
|
-
global_concurrency:
|
|
22944
|
-
provider_concurrency:
|
|
22945
|
-
model_concurrency:
|
|
22946
|
-
max_depth:
|
|
22964
|
+
var OmoTaskSettingsLayerSchema = z10.object({
|
|
22965
|
+
default_execution_mode: z10.enum(["in-process", "process"]).optional(),
|
|
22966
|
+
default_concurrency: z10.number().int().nonnegative().optional(),
|
|
22967
|
+
global_concurrency: z10.number().int().nonnegative().optional(),
|
|
22968
|
+
provider_concurrency: z10.record(z10.string(), z10.number().int().nonnegative()).optional(),
|
|
22969
|
+
model_concurrency: z10.record(z10.string(), z10.number().int().nonnegative()).optional(),
|
|
22970
|
+
max_depth: z10.number().int().nonnegative().optional(),
|
|
22947
22971
|
residency_max_children: ResidencyMaxChildrenInputSchema.optional(),
|
|
22948
|
-
ttl_ms:
|
|
22949
|
-
state_dir:
|
|
22950
|
-
reattach_on_reconcile:
|
|
22951
|
-
resume_children:
|
|
22972
|
+
ttl_ms: z10.number().int().positive().optional(),
|
|
22973
|
+
state_dir: z10.string().optional(),
|
|
22974
|
+
reattach_on_reconcile: z10.boolean().optional(),
|
|
22975
|
+
resume_children: z10.boolean().optional(),
|
|
22952
22976
|
warnings: OmoTaskWarningsLayerSchema.optional(),
|
|
22953
22977
|
wait: OmoTaskWaitLayerSchema.optional(),
|
|
22954
22978
|
team: OmoTaskTeamSettingsLayerSchema.optional(),
|
|
22955
22979
|
dag: OmoTaskDagSettingsLayerSchema.optional()
|
|
22956
22980
|
}).strict();
|
|
22957
22981
|
function resolveOmoTaskSettings(input, resolveParallelism = availableParallelism) {
|
|
22958
|
-
const record =
|
|
22982
|
+
const record = z10.record(z10.string(), z10.unknown()).parse(input);
|
|
22959
22983
|
return OmoTaskSettingsSchema.parse({
|
|
22960
22984
|
...record,
|
|
22961
22985
|
residency_max_children: record["residency_max_children"] ?? Math.min(DEFAULT_RESIDENCY_MAX_CHILDREN, Math.max(8, resolveParallelism() * 2)),
|
|
@@ -22964,39 +22988,39 @@ function resolveOmoTaskSettings(input, resolveParallelism = availableParallelism
|
|
|
22964
22988
|
}
|
|
22965
22989
|
|
|
22966
22990
|
// packages/omo-config-core/src/schema/team.ts
|
|
22967
|
-
import * as
|
|
22968
|
-
var OmoTeamMemberBaseSchema =
|
|
22969
|
-
name:
|
|
22970
|
-
cwd:
|
|
22971
|
-
worktreePath:
|
|
22972
|
-
subscriptions:
|
|
22973
|
-
backendType:
|
|
22974
|
-
color:
|
|
22975
|
-
isActive:
|
|
22991
|
+
import * as z11 from "zod";
|
|
22992
|
+
var OmoTeamMemberBaseSchema = z11.object({
|
|
22993
|
+
name: z11.string().min(1).regex(/^[a-z0-9-]+$/),
|
|
22994
|
+
cwd: z11.string().optional(),
|
|
22995
|
+
worktreePath: z11.string().optional(),
|
|
22996
|
+
subscriptions: z11.array(z11.string()).optional(),
|
|
22997
|
+
backendType: z11.enum(["in-process", "tmux"]).default("in-process"),
|
|
22998
|
+
color: z11.string().optional(),
|
|
22999
|
+
isActive: z11.boolean().default(true)
|
|
22976
23000
|
}).strict();
|
|
22977
23001
|
var OmoTeamCategoryMemberSchema = OmoTeamMemberBaseSchema.extend({
|
|
22978
|
-
kind:
|
|
22979
|
-
category:
|
|
22980
|
-
prompt:
|
|
23002
|
+
kind: z11.literal("category"),
|
|
23003
|
+
category: z11.string().min(1),
|
|
23004
|
+
prompt: z11.string().min(1)
|
|
22981
23005
|
});
|
|
22982
23006
|
var OmoTeamSubagentMemberSchema = OmoTeamMemberBaseSchema.extend({
|
|
22983
|
-
kind:
|
|
22984
|
-
subagent_type:
|
|
22985
|
-
prompt:
|
|
23007
|
+
kind: z11.literal("subagent_type"),
|
|
23008
|
+
subagent_type: z11.string().min(1),
|
|
23009
|
+
prompt: z11.string().optional()
|
|
22986
23010
|
});
|
|
22987
|
-
var OmoTeamMemberSchema =
|
|
23011
|
+
var OmoTeamMemberSchema = z11.discriminatedUnion("kind", [
|
|
22988
23012
|
OmoTeamCategoryMemberSchema,
|
|
22989
23013
|
OmoTeamSubagentMemberSchema
|
|
22990
23014
|
]);
|
|
22991
|
-
var OmoTeamSpecBaseSchema =
|
|
22992
|
-
version:
|
|
22993
|
-
name:
|
|
22994
|
-
description:
|
|
22995
|
-
createdAt:
|
|
22996
|
-
leadAgentId:
|
|
22997
|
-
teamAllowedPaths:
|
|
22998
|
-
sessionPermission:
|
|
22999
|
-
members:
|
|
23015
|
+
var OmoTeamSpecBaseSchema = z11.object({
|
|
23016
|
+
version: z11.literal(1).default(1),
|
|
23017
|
+
name: z11.string().min(1).regex(/^[a-z0-9-]+$/).optional(),
|
|
23018
|
+
description: z11.string().optional(),
|
|
23019
|
+
createdAt: z11.number().int().positive().optional(),
|
|
23020
|
+
leadAgentId: z11.string().optional(),
|
|
23021
|
+
teamAllowedPaths: z11.array(z11.string()).optional(),
|
|
23022
|
+
sessionPermission: z11.string().optional(),
|
|
23023
|
+
members: z11.array(OmoTeamMemberSchema).min(1).max(8)
|
|
23000
23024
|
}).strict();
|
|
23001
23025
|
var OmoTeamSpecSchema = OmoTeamSpecBaseSchema.superRefine((teamSpec, ctx) => {
|
|
23002
23026
|
if (teamSpec.leadAgentId === undefined && teamSpec.members.length > 1) {
|
|
@@ -23008,38 +23032,38 @@ var OmoTeamSpecSchema = OmoTeamSpecBaseSchema.superRefine((teamSpec, ctx) => {
|
|
|
23008
23032
|
}
|
|
23009
23033
|
});
|
|
23010
23034
|
var OmoTeamSpecLayerSchema = OmoTeamSpecBaseSchema.partial();
|
|
23011
|
-
var OmoTeamsConfigSchema =
|
|
23012
|
-
var OmoTeamsConfigLayerSchema =
|
|
23035
|
+
var OmoTeamsConfigSchema = z11.record(z11.string(), OmoTeamSpecSchema);
|
|
23036
|
+
var OmoTeamsConfigLayerSchema = z11.record(z11.string(), OmoTeamSpecLayerSchema);
|
|
23013
23037
|
|
|
23014
23038
|
// packages/omo-config-core/src/schema/telemetry.ts
|
|
23015
|
-
import * as
|
|
23039
|
+
import * as z12 from "zod";
|
|
23016
23040
|
var OmoTelemetrySettingsShape = {
|
|
23017
|
-
enabled:
|
|
23041
|
+
enabled: z12.boolean()
|
|
23018
23042
|
};
|
|
23019
|
-
var OmoTelemetrySettingsLayerSchema =
|
|
23043
|
+
var OmoTelemetrySettingsLayerSchema = z12.object(OmoTelemetrySettingsShape).partial().strict();
|
|
23020
23044
|
var OmoTelemetrySettingsSchema = OmoTelemetrySettingsLayerSchema.extend({
|
|
23021
|
-
enabled:
|
|
23045
|
+
enabled: z12.boolean().default(true)
|
|
23022
23046
|
}).strict();
|
|
23023
23047
|
|
|
23024
23048
|
// packages/omo-config-core/src/schema/format-on-mutation.ts
|
|
23025
|
-
import * as
|
|
23026
|
-
var mode =
|
|
23027
|
-
var languages =
|
|
23028
|
-
var OmoFormatOnMutationLayerSchema =
|
|
23049
|
+
import * as z13 from "zod";
|
|
23050
|
+
var mode = z13.enum(["off", "best-effort", "required"]);
|
|
23051
|
+
var languages = z13.record(z13.string(), z13.boolean()).optional();
|
|
23052
|
+
var OmoFormatOnMutationLayerSchema = z13.object({
|
|
23029
23053
|
mode: mode.optional(),
|
|
23030
23054
|
languages,
|
|
23031
|
-
maxFileBytes:
|
|
23032
|
-
timeoutMs:
|
|
23055
|
+
maxFileBytes: z13.number().int().positive().optional(),
|
|
23056
|
+
timeoutMs: z13.number().int().positive().optional()
|
|
23033
23057
|
}).strict();
|
|
23034
23058
|
var OmoFormatOnMutationSchema = OmoFormatOnMutationLayerSchema.extend({
|
|
23035
23059
|
mode: mode.default("best-effort"),
|
|
23036
|
-
maxFileBytes:
|
|
23037
|
-
timeoutMs:
|
|
23060
|
+
maxFileBytes: z13.number().int().positive().default(1048576),
|
|
23061
|
+
timeoutMs: z13.number().int().positive().default(3000)
|
|
23038
23062
|
}).strict();
|
|
23039
23063
|
|
|
23040
23064
|
// packages/omo-config-core/src/schema/config.ts
|
|
23041
|
-
var OmoOpenCodeHarnessConfigSchema =
|
|
23042
|
-
var OmoTypedHarnessConfigSchema =
|
|
23065
|
+
var OmoOpenCodeHarnessConfigSchema = z14.record(z14.string(), z14.unknown());
|
|
23066
|
+
var OmoTypedHarnessConfigSchema = z14.object({
|
|
23043
23067
|
formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
|
|
23044
23068
|
categories: OmoCategoriesConfigSchema.optional(),
|
|
23045
23069
|
agents: OmoAgentsConfigSchema.optional(),
|
|
@@ -23047,10 +23071,12 @@ var OmoTypedHarnessConfigSchema = z13.object({
|
|
|
23047
23071
|
task: OmoTaskSettingsLayerSchema.optional(),
|
|
23048
23072
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
23049
23073
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
23074
|
+
model_profiles: OmoModelProfilesLayerSchema.optional(),
|
|
23075
|
+
model_profile: z14.string().optional(),
|
|
23050
23076
|
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
23051
23077
|
telemetry: OmoTelemetrySettingsLayerSchema.optional()
|
|
23052
23078
|
}).strict();
|
|
23053
|
-
var OmoConfigProfileSchema =
|
|
23079
|
+
var OmoConfigProfileSchema = z14.object({
|
|
23054
23080
|
formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
|
|
23055
23081
|
categories: OmoCategoriesConfigSchema.optional(),
|
|
23056
23082
|
agents: OmoAgentsConfigSchema.optional(),
|
|
@@ -23058,47 +23084,53 @@ var OmoConfigProfileSchema = z13.object({
|
|
|
23058
23084
|
task: OmoTaskSettingsLayerSchema.optional(),
|
|
23059
23085
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
23060
23086
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
23087
|
+
model_profiles: OmoModelProfilesLayerSchema.optional(),
|
|
23088
|
+
model_profile: z14.string().optional(),
|
|
23061
23089
|
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
23062
23090
|
telemetry: OmoTelemetrySettingsLayerSchema.optional(),
|
|
23063
23091
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
23064
23092
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
23065
23093
|
"[codex]": OmoTypedHarnessConfigSchema.optional()
|
|
23066
23094
|
}).strict();
|
|
23067
|
-
var OmoConfigSchema =
|
|
23095
|
+
var OmoConfigSchema = z14.object({
|
|
23068
23096
|
formatOnMutation: OmoFormatOnMutationSchema.optional(),
|
|
23069
|
-
$schema:
|
|
23097
|
+
$schema: z14.string().optional(),
|
|
23070
23098
|
categories: OmoCategoriesConfigSchema.optional(),
|
|
23071
23099
|
agents: OmoAgentsConfigSchema.optional(),
|
|
23072
23100
|
git_master: OmoGitMasterSettingsSchema.optional(),
|
|
23073
23101
|
task: OmoTaskSettingsSchema.optional(),
|
|
23074
23102
|
teams: OmoTeamsConfigSchema.optional(),
|
|
23075
23103
|
models: OmoModelCatalogSchema.optional(),
|
|
23104
|
+
model_profiles: OmoModelProfilesSchema.optional(),
|
|
23105
|
+
model_profile: z14.string().optional(),
|
|
23076
23106
|
memory: OmoMemorySettingsSchema.optional(),
|
|
23077
23107
|
telemetry: OmoTelemetrySettingsSchema.optional(),
|
|
23078
23108
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
23079
23109
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
23080
23110
|
"[codex]": OmoTypedHarnessConfigSchema.optional(),
|
|
23081
|
-
profiles:
|
|
23082
|
-
_migrations:
|
|
23083
|
-
legacy_migrations:
|
|
23111
|
+
profiles: z14.record(z14.string(), OmoConfigProfileSchema).default({}),
|
|
23112
|
+
_migrations: z14.array(z14.string()).optional(),
|
|
23113
|
+
legacy_migrations: z14.record(z14.string(), z14.unknown()).optional()
|
|
23084
23114
|
}).strict();
|
|
23085
|
-
var OmoConfigLayerSchema =
|
|
23115
|
+
var OmoConfigLayerSchema = z14.object({
|
|
23086
23116
|
formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
|
|
23087
|
-
$schema:
|
|
23117
|
+
$schema: z14.string().optional(),
|
|
23088
23118
|
categories: OmoCategoriesConfigSchema.optional(),
|
|
23089
23119
|
agents: OmoAgentsConfigSchema.optional(),
|
|
23090
23120
|
git_master: OmoGitMasterSettingsLayerSchema.optional(),
|
|
23091
23121
|
task: OmoTaskSettingsLayerSchema.optional(),
|
|
23092
23122
|
teams: OmoTeamsConfigLayerSchema.optional(),
|
|
23093
23123
|
models: OmoModelCatalogLayerSchema.optional(),
|
|
23124
|
+
model_profiles: OmoModelProfilesLayerSchema.optional(),
|
|
23125
|
+
model_profile: z14.string().optional(),
|
|
23094
23126
|
memory: OmoMemorySettingsLayerSchema.optional(),
|
|
23095
23127
|
telemetry: OmoTelemetrySettingsLayerSchema.optional(),
|
|
23096
23128
|
"[opencode]": OmoOpenCodeHarnessConfigSchema.optional(),
|
|
23097
23129
|
"[senpi]": OmoTypedHarnessConfigSchema.optional(),
|
|
23098
23130
|
"[codex]": OmoTypedHarnessConfigSchema.optional(),
|
|
23099
|
-
profiles:
|
|
23100
|
-
_migrations:
|
|
23101
|
-
legacy_migrations:
|
|
23131
|
+
profiles: z14.record(z14.string(), OmoConfigProfileSchema).optional(),
|
|
23132
|
+
_migrations: z14.array(z14.string()).optional(),
|
|
23133
|
+
legacy_migrations: z14.record(z14.string(), z14.unknown()).optional()
|
|
23102
23134
|
}).strict();
|
|
23103
23135
|
|
|
23104
23136
|
// packages/omo-config-core/src/loader/loader.ts
|
|
@@ -23340,29 +23372,27 @@ function validationDiagnostic(path, issues) {
|
|
|
23340
23372
|
function unrecognizedKeyIssues(issues) {
|
|
23341
23373
|
return issues.flatMap((issue) => issue.code === "unrecognized_keys" ? [{ keys: issue.keys, path: issue.path.map((segment) => String(segment)) }] : []);
|
|
23342
23374
|
}
|
|
23343
|
-
function hasUnsafeUnrecognizedKey(
|
|
23344
|
-
|
|
23345
|
-
return true;
|
|
23346
|
-
return hasTamperedPrototype(parsed);
|
|
23375
|
+
function hasUnsafeUnrecognizedKey(issues) {
|
|
23376
|
+
return issues.some((issue) => issue.keys.some((key) => isUnsafeObjectKey2(key)));
|
|
23347
23377
|
}
|
|
23348
23378
|
function hasTamperedPrototype(value) {
|
|
23349
23379
|
if (Array.isArray(value))
|
|
23350
23380
|
return value.some((entry) => hasTamperedPrototype(entry));
|
|
23351
|
-
if (!
|
|
23381
|
+
if (!isRecord10(value))
|
|
23352
23382
|
return false;
|
|
23353
23383
|
const prototype = Object.getPrototypeOf(value);
|
|
23354
23384
|
if (prototype !== Object.prototype && prototype !== null)
|
|
23355
23385
|
return true;
|
|
23356
23386
|
return Object.values(value).some((entry) => hasTamperedPrototype(entry));
|
|
23357
23387
|
}
|
|
23358
|
-
function
|
|
23388
|
+
function isRecord10(value) {
|
|
23359
23389
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23360
23390
|
}
|
|
23361
23391
|
function containerAt(record, path) {
|
|
23362
23392
|
let container = record;
|
|
23363
23393
|
for (const segment of path) {
|
|
23364
23394
|
const next = container[segment];
|
|
23365
|
-
if (!
|
|
23395
|
+
if (!isRecord10(next))
|
|
23366
23396
|
return null;
|
|
23367
23397
|
container = next;
|
|
23368
23398
|
}
|
|
@@ -23416,11 +23446,17 @@ function readConfigSource(path, scope, fileSystem) {
|
|
|
23416
23446
|
source: { exists: true, loaded: false, path, scope }
|
|
23417
23447
|
};
|
|
23418
23448
|
}
|
|
23449
|
+
if (hasTamperedPrototype(parsed.data)) {
|
|
23450
|
+
return {
|
|
23451
|
+
diagnostic: { kind: "validation", message: `Invalid omo config at ${path}: "__proto__" member is not allowed`, path },
|
|
23452
|
+
source: { exists: true, loaded: false, path, scope }
|
|
23453
|
+
};
|
|
23454
|
+
}
|
|
23419
23455
|
const parsedRecord = toRecord2(parsed.data);
|
|
23420
23456
|
const validation = OmoConfigLayerSchema.safeParse(parsed.data);
|
|
23421
23457
|
if (!validation.success) {
|
|
23422
23458
|
const unrecognized = unrecognizedKeyIssues(validation.error.issues);
|
|
23423
|
-
if (
|
|
23459
|
+
if (hasUnsafeUnrecognizedKey(unrecognized)) {
|
|
23424
23460
|
return {
|
|
23425
23461
|
diagnostic: validationDiagnostic(path, validation.error.issues),
|
|
23426
23462
|
source: { exists: true, loaded: false, path, scope }
|
|
@@ -23594,6 +23630,38 @@ function resolveCategoryDefinition(definition, catalog, cycleNames) {
|
|
|
23594
23630
|
...definition.fallback_models === undefined ? {} : { fallback_models: resolveFallbackModels(definition.fallback_models, catalog, cycleNames) }
|
|
23595
23631
|
};
|
|
23596
23632
|
}
|
|
23633
|
+
function resolveModelProfile(definition, catalog, cycleNames) {
|
|
23634
|
+
return {
|
|
23635
|
+
...definition,
|
|
23636
|
+
...definition.models === undefined ? {} : { models: definition.models.map((entry) => resolveModelEntry(entry, catalog, cycleNames)) }
|
|
23637
|
+
};
|
|
23638
|
+
}
|
|
23639
|
+
function profileShadowDiagnostics(view) {
|
|
23640
|
+
if (view.model_profiles === undefined || view.models === undefined)
|
|
23641
|
+
return [];
|
|
23642
|
+
return Object.keys(view.model_profiles).flatMap((name) => view.models?.[name] === undefined ? [] : [{
|
|
23643
|
+
kind: "validation",
|
|
23644
|
+
message: `Model profile "${name}" shadows a model catalog entry of the same name`,
|
|
23645
|
+
path: `model_profiles.${name}`
|
|
23646
|
+
}]);
|
|
23647
|
+
}
|
|
23648
|
+
function profileSpliceDiagnostics(section, definitions, profileNames) {
|
|
23649
|
+
if (definitions === undefined || profileNames.size === 0)
|
|
23650
|
+
return [];
|
|
23651
|
+
return Object.entries(definitions).flatMap(([name, definition]) => (definition.models ?? []).flatMap((entry, index) => typeof entry !== "string" || !profileNames.has(entry) ? [] : [{
|
|
23652
|
+
kind: "validation",
|
|
23653
|
+
message: `"${entry}" is a model profile; splicing a profile into a category chain is not supported yet`,
|
|
23654
|
+
path: `${section}.${name}.models.${index}`
|
|
23655
|
+
}]));
|
|
23656
|
+
}
|
|
23657
|
+
function modelProfileDiagnostics(view) {
|
|
23658
|
+
const profileNames = new Set(Object.keys(view.model_profiles ?? {}));
|
|
23659
|
+
return [
|
|
23660
|
+
...profileShadowDiagnostics(view),
|
|
23661
|
+
...profileSpliceDiagnostics("categories", view.categories, profileNames),
|
|
23662
|
+
...profileSpliceDiagnostics("agents", view.agents, profileNames)
|
|
23663
|
+
];
|
|
23664
|
+
}
|
|
23597
23665
|
function cycleDiagnostics(catalog) {
|
|
23598
23666
|
if (catalog === undefined)
|
|
23599
23667
|
return [];
|
|
@@ -23604,9 +23672,10 @@ function cycleDiagnostics(catalog) {
|
|
|
23604
23672
|
}));
|
|
23605
23673
|
}
|
|
23606
23674
|
function resolveModelReferences(view) {
|
|
23607
|
-
const
|
|
23675
|
+
const cycles = cycleDiagnostics(view.models);
|
|
23676
|
+
const diagnostics = [...cycles, ...modelProfileDiagnostics(view)];
|
|
23608
23677
|
const cycleNames = new Set;
|
|
23609
|
-
for (const diagnostic of
|
|
23678
|
+
for (const diagnostic of cycles) {
|
|
23610
23679
|
const name = diagnostic.path.split(".")[1];
|
|
23611
23680
|
if (name !== undefined)
|
|
23612
23681
|
cycleNames.add(name);
|
|
@@ -23619,12 +23688,17 @@ function resolveModelReferences(view) {
|
|
|
23619
23688
|
name,
|
|
23620
23689
|
resolveCategoryDefinition(definition, view.models, cycleNames)
|
|
23621
23690
|
]));
|
|
23691
|
+
const modelProfiles = view.model_profiles === undefined ? undefined : Object.fromEntries(Object.entries(view.model_profiles).map(([name, definition]) => [
|
|
23692
|
+
name,
|
|
23693
|
+
resolveModelProfile(definition, view.models, cycleNames)
|
|
23694
|
+
]));
|
|
23622
23695
|
return {
|
|
23623
23696
|
diagnostics,
|
|
23624
23697
|
view: {
|
|
23625
23698
|
...view,
|
|
23626
23699
|
...agents === undefined ? {} : { agents },
|
|
23627
|
-
...categories === undefined ? {} : { categories }
|
|
23700
|
+
...categories === undefined ? {} : { categories },
|
|
23701
|
+
...modelProfiles === undefined ? {} : { model_profiles: modelProfiles }
|
|
23628
23702
|
}
|
|
23629
23703
|
};
|
|
23630
23704
|
}
|
|
@@ -24751,8 +24825,8 @@ function findUnknownKeyPaths(schema, value) {
|
|
|
24751
24825
|
}
|
|
24752
24826
|
|
|
24753
24827
|
// packages/omo-opencode/src/config/schema/agent-names.ts
|
|
24754
|
-
import { z as
|
|
24755
|
-
var BuiltinAgentNameSchema =
|
|
24828
|
+
import { z as z15 } from "zod";
|
|
24829
|
+
var BuiltinAgentNameSchema = z15.enum([
|
|
24756
24830
|
"sisyphus",
|
|
24757
24831
|
"hephaestus",
|
|
24758
24832
|
"prometheus",
|
|
@@ -24765,7 +24839,7 @@ var BuiltinAgentNameSchema = z14.enum([
|
|
|
24765
24839
|
"atlas",
|
|
24766
24840
|
"sisyphus-junior"
|
|
24767
24841
|
]);
|
|
24768
|
-
var BuiltinSkillNameSchema =
|
|
24842
|
+
var BuiltinSkillNameSchema = z15.enum([
|
|
24769
24843
|
"playwright",
|
|
24770
24844
|
"agent-browser",
|
|
24771
24845
|
"dev-browser",
|
|
@@ -24780,7 +24854,7 @@ var BuiltinSkillNameSchema = z14.enum([
|
|
|
24780
24854
|
"visual-qa",
|
|
24781
24855
|
"team-mode"
|
|
24782
24856
|
]);
|
|
24783
|
-
var OverridableAgentNameSchema =
|
|
24857
|
+
var OverridableAgentNameSchema = z15.enum([
|
|
24784
24858
|
"build",
|
|
24785
24859
|
"plan",
|
|
24786
24860
|
"sisyphus",
|
|
@@ -24797,41 +24871,41 @@ var OverridableAgentNameSchema = z14.enum([
|
|
|
24797
24871
|
"atlas"
|
|
24798
24872
|
]);
|
|
24799
24873
|
// packages/omo-opencode/src/config/schema/agent-overrides.ts
|
|
24800
|
-
import { z as
|
|
24874
|
+
import { z as z18 } from "zod";
|
|
24801
24875
|
|
|
24802
24876
|
// packages/omo-opencode/src/config/schema/fallback-models.ts
|
|
24803
|
-
import { z as
|
|
24804
|
-
var FallbackModelObjectSchema =
|
|
24805
|
-
model:
|
|
24877
|
+
import { z as z16 } from "zod";
|
|
24878
|
+
var FallbackModelObjectSchema = z16.object({
|
|
24879
|
+
model: z16.string(),
|
|
24806
24880
|
reasoning: OmoReasoningSchema.optional(),
|
|
24807
|
-
variant:
|
|
24808
|
-
reasoningEffort:
|
|
24809
|
-
temperature:
|
|
24810
|
-
top_p:
|
|
24811
|
-
maxTokens:
|
|
24812
|
-
thinking:
|
|
24813
|
-
type:
|
|
24814
|
-
budgetTokens:
|
|
24881
|
+
variant: z16.string().optional(),
|
|
24882
|
+
reasoningEffort: z16.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).optional(),
|
|
24883
|
+
temperature: z16.number().min(0).max(2).optional(),
|
|
24884
|
+
top_p: z16.number().min(0).max(1).optional(),
|
|
24885
|
+
maxTokens: z16.number().optional(),
|
|
24886
|
+
thinking: z16.object({
|
|
24887
|
+
type: z16.enum(["enabled", "disabled"]),
|
|
24888
|
+
budgetTokens: z16.number().optional()
|
|
24815
24889
|
}).optional()
|
|
24816
24890
|
});
|
|
24817
|
-
var FallbackModelStringArraySchema =
|
|
24818
|
-
var FallbackModelObjectArraySchema =
|
|
24819
|
-
var FallbackModelMixedArraySchema =
|
|
24820
|
-
var FallbackModelsSchema =
|
|
24821
|
-
|
|
24891
|
+
var FallbackModelStringArraySchema = z16.array(z16.string());
|
|
24892
|
+
var FallbackModelObjectArraySchema = z16.array(FallbackModelObjectSchema);
|
|
24893
|
+
var FallbackModelMixedArraySchema = z16.array(z16.union([z16.string(), FallbackModelObjectSchema]));
|
|
24894
|
+
var FallbackModelsSchema = z16.union([
|
|
24895
|
+
z16.string(),
|
|
24822
24896
|
FallbackModelStringArraySchema,
|
|
24823
24897
|
FallbackModelObjectArraySchema,
|
|
24824
24898
|
FallbackModelMixedArraySchema
|
|
24825
24899
|
]);
|
|
24826
24900
|
|
|
24827
24901
|
// packages/omo-opencode/src/config/schema/internal/permission.ts
|
|
24828
|
-
import { z as
|
|
24829
|
-
var PermissionValueSchema =
|
|
24830
|
-
var BashPermissionSchema =
|
|
24902
|
+
import { z as z17 } from "zod";
|
|
24903
|
+
var PermissionValueSchema = z17.enum(["ask", "allow", "deny"]);
|
|
24904
|
+
var BashPermissionSchema = z17.union([
|
|
24831
24905
|
PermissionValueSchema,
|
|
24832
|
-
|
|
24906
|
+
z17.record(z17.string(), PermissionValueSchema)
|
|
24833
24907
|
]);
|
|
24834
|
-
var AgentPermissionSchema =
|
|
24908
|
+
var AgentPermissionSchema = z17.object({
|
|
24835
24909
|
edit: PermissionValueSchema.optional(),
|
|
24836
24910
|
bash: BashPermissionSchema.optional(),
|
|
24837
24911
|
webfetch: PermissionValueSchema.optional(),
|
|
@@ -24841,50 +24915,50 @@ var AgentPermissionSchema = z16.object({
|
|
|
24841
24915
|
}).catchall(PermissionValueSchema.optional());
|
|
24842
24916
|
|
|
24843
24917
|
// packages/omo-opencode/src/config/schema/agent-overrides.ts
|
|
24844
|
-
var AgentOverrideConfigSchema =
|
|
24845
|
-
model:
|
|
24846
|
-
models:
|
|
24918
|
+
var AgentOverrideConfigSchema = z18.object({
|
|
24919
|
+
model: z18.string().optional(),
|
|
24920
|
+
models: z18.array(z18.union([z18.string(), FallbackModelObjectSchema])).optional(),
|
|
24847
24921
|
fallback_models: FallbackModelsSchema.optional(),
|
|
24848
24922
|
reasoning: OmoReasoningSchema.optional(),
|
|
24849
|
-
variant:
|
|
24850
|
-
category:
|
|
24851
|
-
skills:
|
|
24852
|
-
temperature:
|
|
24853
|
-
top_p:
|
|
24854
|
-
prompt:
|
|
24855
|
-
prompt_append:
|
|
24856
|
-
tools:
|
|
24857
|
-
disable:
|
|
24858
|
-
description:
|
|
24859
|
-
mode:
|
|
24860
|
-
color:
|
|
24861
|
-
displayName:
|
|
24923
|
+
variant: z18.string().optional(),
|
|
24924
|
+
category: z18.string().optional(),
|
|
24925
|
+
skills: z18.array(z18.string()).optional(),
|
|
24926
|
+
temperature: z18.number().min(0).max(2).optional(),
|
|
24927
|
+
top_p: z18.number().min(0).max(1).optional(),
|
|
24928
|
+
prompt: z18.string().optional(),
|
|
24929
|
+
prompt_append: z18.string().optional(),
|
|
24930
|
+
tools: z18.record(z18.string(), z18.boolean()).optional(),
|
|
24931
|
+
disable: z18.boolean().optional(),
|
|
24932
|
+
description: z18.string().optional(),
|
|
24933
|
+
mode: z18.enum(["subagent", "primary", "all"]).optional(),
|
|
24934
|
+
color: z18.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
|
|
24935
|
+
displayName: z18.string().optional(),
|
|
24862
24936
|
permission: AgentPermissionSchema.optional(),
|
|
24863
|
-
maxTokens:
|
|
24864
|
-
thinking:
|
|
24865
|
-
type:
|
|
24866
|
-
budgetTokens:
|
|
24937
|
+
maxTokens: z18.number().optional(),
|
|
24938
|
+
thinking: z18.object({
|
|
24939
|
+
type: z18.enum(["enabled", "disabled"]),
|
|
24940
|
+
budgetTokens: z18.number().optional()
|
|
24867
24941
|
}).optional(),
|
|
24868
|
-
reasoningEffort:
|
|
24869
|
-
textVerbosity:
|
|
24870
|
-
providerOptions:
|
|
24871
|
-
ultrawork:
|
|
24872
|
-
model:
|
|
24942
|
+
reasoningEffort: z18.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).optional(),
|
|
24943
|
+
textVerbosity: z18.enum(["low", "medium", "high"]).optional(),
|
|
24944
|
+
providerOptions: z18.record(z18.string(), z18.unknown()).optional(),
|
|
24945
|
+
ultrawork: z18.object({
|
|
24946
|
+
model: z18.string().optional(),
|
|
24873
24947
|
reasoning: OmoReasoningSchema.optional(),
|
|
24874
|
-
variant:
|
|
24948
|
+
variant: z18.string().optional()
|
|
24875
24949
|
}).optional(),
|
|
24876
|
-
compaction:
|
|
24877
|
-
model:
|
|
24950
|
+
compaction: z18.object({
|
|
24951
|
+
model: z18.string().optional(),
|
|
24878
24952
|
reasoning: OmoReasoningSchema.optional(),
|
|
24879
|
-
variant:
|
|
24953
|
+
variant: z18.string().optional()
|
|
24880
24954
|
}).optional()
|
|
24881
24955
|
});
|
|
24882
|
-
var AgentOverridesSchema =
|
|
24956
|
+
var AgentOverridesSchema = z18.object({
|
|
24883
24957
|
build: AgentOverrideConfigSchema.optional(),
|
|
24884
24958
|
plan: AgentOverrideConfigSchema.optional(),
|
|
24885
24959
|
sisyphus: AgentOverrideConfigSchema.optional(),
|
|
24886
24960
|
hephaestus: AgentOverrideConfigSchema.extend({
|
|
24887
|
-
allow_non_gpt_model:
|
|
24961
|
+
allow_non_gpt_model: z18.boolean().optional()
|
|
24888
24962
|
}).optional(),
|
|
24889
24963
|
"sisyphus-junior": AgentOverrideConfigSchema.optional(),
|
|
24890
24964
|
"OpenCode-Builder": AgentOverrideConfigSchema.optional(),
|
|
@@ -24898,72 +24972,72 @@ var AgentOverridesSchema = z17.object({
|
|
|
24898
24972
|
atlas: AgentOverrideConfigSchema.optional()
|
|
24899
24973
|
}).catchall(AgentOverrideConfigSchema.optional());
|
|
24900
24974
|
// packages/omo-opencode/src/config/schema/babysitting.ts
|
|
24901
|
-
import { z as
|
|
24902
|
-
var BabysittingConfigSchema =
|
|
24903
|
-
timeout_ms:
|
|
24975
|
+
import { z as z19 } from "zod";
|
|
24976
|
+
var BabysittingConfigSchema = z19.object({
|
|
24977
|
+
timeout_ms: z19.number().default(120000)
|
|
24904
24978
|
});
|
|
24905
24979
|
// packages/omo-opencode/src/config/schema/background-task.ts
|
|
24906
|
-
import { z as
|
|
24907
|
-
var CircuitBreakerConfigSchema =
|
|
24908
|
-
enabled:
|
|
24909
|
-
maxToolCalls:
|
|
24910
|
-
consecutiveThreshold:
|
|
24980
|
+
import { z as z20 } from "zod";
|
|
24981
|
+
var CircuitBreakerConfigSchema = z20.object({
|
|
24982
|
+
enabled: z20.boolean().optional(),
|
|
24983
|
+
maxToolCalls: z20.number().int().min(10).optional(),
|
|
24984
|
+
consecutiveThreshold: z20.number().int().min(5).optional()
|
|
24911
24985
|
});
|
|
24912
|
-
var BackgroundTaskConfigSchema =
|
|
24913
|
-
defaultConcurrency:
|
|
24914
|
-
providerConcurrency:
|
|
24915
|
-
modelConcurrency:
|
|
24916
|
-
maxDepth:
|
|
24917
|
-
maxLiveDescendantsPerRoot:
|
|
24918
|
-
staleTimeoutMs:
|
|
24919
|
-
messageStalenessTimeoutMs:
|
|
24920
|
-
taskTtlMs:
|
|
24921
|
-
sessionGoneTimeoutMs:
|
|
24922
|
-
taskCleanupDelayMs:
|
|
24923
|
-
syncPollTimeoutMs:
|
|
24924
|
-
maxToolCalls:
|
|
24986
|
+
var BackgroundTaskConfigSchema = z20.object({
|
|
24987
|
+
defaultConcurrency: z20.number().min(0).optional(),
|
|
24988
|
+
providerConcurrency: z20.record(z20.string(), z20.number().min(0)).optional(),
|
|
24989
|
+
modelConcurrency: z20.record(z20.string(), z20.number().min(0)).optional(),
|
|
24990
|
+
maxDepth: z20.number().int().min(1).optional(),
|
|
24991
|
+
maxLiveDescendantsPerRoot: z20.number().int().min(0).optional(),
|
|
24992
|
+
staleTimeoutMs: z20.number().min(60000).optional(),
|
|
24993
|
+
messageStalenessTimeoutMs: z20.number().min(60000).optional(),
|
|
24994
|
+
taskTtlMs: z20.number().min(300000).optional(),
|
|
24995
|
+
sessionGoneTimeoutMs: z20.number().min(1e4).optional(),
|
|
24996
|
+
taskCleanupDelayMs: z20.number().min(60000).optional(),
|
|
24997
|
+
syncPollTimeoutMs: z20.number().min(60000).optional(),
|
|
24998
|
+
maxToolCalls: z20.number().int().min(10).optional(),
|
|
24925
24999
|
circuitBreaker: CircuitBreakerConfigSchema.optional()
|
|
24926
25000
|
});
|
|
24927
25001
|
// packages/omo-opencode/src/config/schema/browser-automation.ts
|
|
24928
|
-
import { z as
|
|
24929
|
-
var BrowserAutomationProviderSchema =
|
|
25002
|
+
import { z as z21 } from "zod";
|
|
25003
|
+
var BrowserAutomationProviderSchema = z21.enum([
|
|
24930
25004
|
"playwright",
|
|
24931
25005
|
"agent-browser",
|
|
24932
25006
|
"dev-browser",
|
|
24933
25007
|
"playwright-cli"
|
|
24934
25008
|
]);
|
|
24935
|
-
var BrowserAutomationConfigSchema =
|
|
25009
|
+
var BrowserAutomationConfigSchema = z21.object({
|
|
24936
25010
|
provider: BrowserAutomationProviderSchema.default("playwright"),
|
|
24937
|
-
playwright_mcp_args:
|
|
25011
|
+
playwright_mcp_args: z21.array(z21.string()).optional()
|
|
24938
25012
|
});
|
|
24939
25013
|
// packages/omo-opencode/src/config/schema/categories.ts
|
|
24940
|
-
import { z as
|
|
24941
|
-
var CategoryConfigSchema =
|
|
24942
|
-
description:
|
|
24943
|
-
model:
|
|
24944
|
-
models:
|
|
25014
|
+
import { z as z22 } from "zod";
|
|
25015
|
+
var CategoryConfigSchema = z22.object({
|
|
25016
|
+
description: z22.string().optional(),
|
|
25017
|
+
model: z22.string().optional(),
|
|
25018
|
+
models: z22.array(z22.union([z22.string(), FallbackModelObjectSchema])).optional(),
|
|
24945
25019
|
fallback_models: FallbackModelsSchema.optional(),
|
|
24946
25020
|
reasoning: OmoReasoningSchema.optional(),
|
|
24947
|
-
variant:
|
|
24948
|
-
temperature:
|
|
24949
|
-
top_p:
|
|
24950
|
-
max_tokens:
|
|
24951
|
-
provider_options:
|
|
24952
|
-
maxTokens:
|
|
24953
|
-
thinking:
|
|
24954
|
-
type:
|
|
24955
|
-
budgetTokens:
|
|
25021
|
+
variant: z22.string().optional(),
|
|
25022
|
+
temperature: z22.number().min(0).max(2).optional(),
|
|
25023
|
+
top_p: z22.number().min(0).max(1).optional(),
|
|
25024
|
+
max_tokens: z22.number().int().positive().optional(),
|
|
25025
|
+
provider_options: z22.record(z22.string(), z22.unknown()).optional(),
|
|
25026
|
+
maxTokens: z22.number().optional(),
|
|
25027
|
+
thinking: z22.object({
|
|
25028
|
+
type: z22.enum(["enabled", "disabled"]),
|
|
25029
|
+
budgetTokens: z22.number().optional()
|
|
24956
25030
|
}).optional(),
|
|
24957
|
-
reasoningEffort:
|
|
24958
|
-
textVerbosity:
|
|
24959
|
-
tools:
|
|
24960
|
-
prompt_append:
|
|
24961
|
-
max_prompt_tokens:
|
|
24962
|
-
is_unstable_agent:
|
|
24963
|
-
disable:
|
|
24964
|
-
warn_unavailable:
|
|
25031
|
+
reasoningEffort: z22.enum(["none", "minimal", "low", "medium", "high", "xhigh", "max"]).optional(),
|
|
25032
|
+
textVerbosity: z22.enum(["low", "medium", "high"]).optional(),
|
|
25033
|
+
tools: z22.record(z22.string(), z22.boolean()).optional(),
|
|
25034
|
+
prompt_append: z22.string().optional(),
|
|
25035
|
+
max_prompt_tokens: z22.number().int().positive().optional(),
|
|
25036
|
+
is_unstable_agent: z22.boolean().optional(),
|
|
25037
|
+
disable: z22.boolean().optional(),
|
|
25038
|
+
warn_unavailable: z22.boolean().optional()
|
|
24965
25039
|
});
|
|
24966
|
-
var BuiltinCategoryNameSchema =
|
|
25040
|
+
var BuiltinCategoryNameSchema = z22.enum([
|
|
24967
25041
|
"visual-engineering",
|
|
24968
25042
|
"ultrabrain",
|
|
24969
25043
|
"deep",
|
|
@@ -24973,29 +25047,29 @@ var BuiltinCategoryNameSchema = z21.enum([
|
|
|
24973
25047
|
"unspecified-high",
|
|
24974
25048
|
"writing"
|
|
24975
25049
|
]);
|
|
24976
|
-
var CategoriesConfigSchema =
|
|
25050
|
+
var CategoriesConfigSchema = z22.record(z22.string(), CategoryConfigSchema);
|
|
24977
25051
|
// packages/omo-opencode/src/config/schema/claude-code.ts
|
|
24978
|
-
import { z as
|
|
24979
|
-
var ClaudeCodeConfigSchema =
|
|
24980
|
-
mcp:
|
|
24981
|
-
commands:
|
|
24982
|
-
skills:
|
|
24983
|
-
agents:
|
|
24984
|
-
hooks:
|
|
24985
|
-
plugins:
|
|
24986
|
-
plugins_override:
|
|
24987
|
-
anthropic_provider:
|
|
25052
|
+
import { z as z23 } from "zod";
|
|
25053
|
+
var ClaudeCodeConfigSchema = z23.object({
|
|
25054
|
+
mcp: z23.boolean().optional(),
|
|
25055
|
+
commands: z23.boolean().optional(),
|
|
25056
|
+
skills: z23.boolean().optional(),
|
|
25057
|
+
agents: z23.boolean().optional(),
|
|
25058
|
+
hooks: z23.boolean().optional(),
|
|
25059
|
+
plugins: z23.boolean().optional(),
|
|
25060
|
+
plugins_override: z23.record(z23.string(), z23.boolean()).optional(),
|
|
25061
|
+
anthropic_provider: z23.string().trim().min(1).refine((v) => !v.includes("/"), {
|
|
24988
25062
|
message: "anthropic_provider must be a provider name without '/'"
|
|
24989
25063
|
}).optional()
|
|
24990
25064
|
});
|
|
24991
25065
|
// packages/omo-opencode/src/config/schema/comment-checker.ts
|
|
24992
|
-
import { z as
|
|
24993
|
-
var CommentCheckerConfigSchema =
|
|
24994
|
-
custom_prompt:
|
|
25066
|
+
import { z as z24 } from "zod";
|
|
25067
|
+
var CommentCheckerConfigSchema = z24.object({
|
|
25068
|
+
custom_prompt: z24.string().optional()
|
|
24995
25069
|
});
|
|
24996
25070
|
// packages/omo-opencode/src/config/schema/commands.ts
|
|
24997
|
-
import { z as
|
|
24998
|
-
var BuiltinCommandNameSchema =
|
|
25071
|
+
import { z as z25 } from "zod";
|
|
25072
|
+
var BuiltinCommandNameSchema = z25.enum([
|
|
24999
25073
|
"goal",
|
|
25000
25074
|
"refactor",
|
|
25001
25075
|
"ulw-execute",
|
|
@@ -25004,21 +25078,21 @@ var BuiltinCommandNameSchema = z24.enum([
|
|
|
25004
25078
|
"hyperplan"
|
|
25005
25079
|
]);
|
|
25006
25080
|
// packages/omo-opencode/src/config/schema/default-mode.ts
|
|
25007
|
-
import { z as
|
|
25008
|
-
var DefaultModeConfigSchema =
|
|
25009
|
-
ultrawork:
|
|
25010
|
-
goal:
|
|
25081
|
+
import { z as z26 } from "zod";
|
|
25082
|
+
var DefaultModeConfigSchema = z26.object({
|
|
25083
|
+
ultrawork: z26.boolean().default(false),
|
|
25084
|
+
goal: z26.boolean().default(false)
|
|
25011
25085
|
});
|
|
25012
25086
|
// packages/omo-opencode/src/config/schema/dynamic-context-pruning.ts
|
|
25013
|
-
import { z as
|
|
25014
|
-
var DynamicContextPruningConfigSchema =
|
|
25015
|
-
enabled:
|
|
25016
|
-
notification:
|
|
25017
|
-
turn_protection:
|
|
25018
|
-
enabled:
|
|
25019
|
-
turns:
|
|
25087
|
+
import { z as z27 } from "zod";
|
|
25088
|
+
var DynamicContextPruningConfigSchema = z27.object({
|
|
25089
|
+
enabled: z27.boolean().default(false),
|
|
25090
|
+
notification: z27.enum(["off", "minimal", "detailed"]).default("detailed"),
|
|
25091
|
+
turn_protection: z27.object({
|
|
25092
|
+
enabled: z27.boolean().default(true),
|
|
25093
|
+
turns: z27.number().min(1).max(10).default(3)
|
|
25020
25094
|
}).optional(),
|
|
25021
|
-
protected_tools:
|
|
25095
|
+
protected_tools: z27.array(z27.string()).default([
|
|
25022
25096
|
"task",
|
|
25023
25097
|
"todowrite",
|
|
25024
25098
|
"todoread",
|
|
@@ -25027,45 +25101,45 @@ var DynamicContextPruningConfigSchema = z26.object({
|
|
|
25027
25101
|
"session_write",
|
|
25028
25102
|
"session_search"
|
|
25029
25103
|
]),
|
|
25030
|
-
strategies:
|
|
25031
|
-
deduplication:
|
|
25032
|
-
enabled:
|
|
25104
|
+
strategies: z27.object({
|
|
25105
|
+
deduplication: z27.object({
|
|
25106
|
+
enabled: z27.boolean().default(true)
|
|
25033
25107
|
}).optional(),
|
|
25034
|
-
supersede_writes:
|
|
25035
|
-
enabled:
|
|
25036
|
-
aggressive:
|
|
25108
|
+
supersede_writes: z27.object({
|
|
25109
|
+
enabled: z27.boolean().default(true),
|
|
25110
|
+
aggressive: z27.boolean().default(false)
|
|
25037
25111
|
}).optional(),
|
|
25038
|
-
purge_errors:
|
|
25039
|
-
enabled:
|
|
25040
|
-
turns:
|
|
25112
|
+
purge_errors: z27.object({
|
|
25113
|
+
enabled: z27.boolean().default(true),
|
|
25114
|
+
turns: z27.number().min(1).max(20).default(5)
|
|
25041
25115
|
}).optional()
|
|
25042
25116
|
}).optional()
|
|
25043
25117
|
});
|
|
25044
25118
|
// packages/omo-opencode/src/config/schema/experimental.ts
|
|
25045
|
-
import { z as
|
|
25046
|
-
var ExperimentalConfigSchema =
|
|
25047
|
-
aggressive_truncation:
|
|
25048
|
-
preemptive_compaction:
|
|
25049
|
-
truncate_all_tool_outputs:
|
|
25119
|
+
import { z as z28 } from "zod";
|
|
25120
|
+
var ExperimentalConfigSchema = z28.object({
|
|
25121
|
+
aggressive_truncation: z28.boolean().optional(),
|
|
25122
|
+
preemptive_compaction: z28.boolean().optional(),
|
|
25123
|
+
truncate_all_tool_outputs: z28.boolean().optional(),
|
|
25050
25124
|
dynamic_context_pruning: DynamicContextPruningConfigSchema.optional(),
|
|
25051
|
-
task_system:
|
|
25052
|
-
plugin_load_timeout_ms:
|
|
25053
|
-
safe_hook_creation:
|
|
25054
|
-
disable_omo_env:
|
|
25055
|
-
hashline_edit:
|
|
25056
|
-
model_fallback_title:
|
|
25057
|
-
max_tools:
|
|
25058
|
-
disable_live_parent_wake_routing:
|
|
25125
|
+
task_system: z28.boolean().optional(),
|
|
25126
|
+
plugin_load_timeout_ms: z28.number().min(1000).optional(),
|
|
25127
|
+
safe_hook_creation: z28.boolean().optional(),
|
|
25128
|
+
disable_omo_env: z28.boolean().optional(),
|
|
25129
|
+
hashline_edit: z28.boolean().optional(),
|
|
25130
|
+
model_fallback_title: z28.boolean().optional(),
|
|
25131
|
+
max_tools: z28.number().int().min(1).optional(),
|
|
25132
|
+
disable_live_parent_wake_routing: z28.boolean().optional()
|
|
25059
25133
|
});
|
|
25060
25134
|
// packages/omo-opencode/src/config/schema/goal.ts
|
|
25061
|
-
import { z as
|
|
25062
|
-
var GoalConfigSchema =
|
|
25063
|
-
enabled:
|
|
25064
|
-
auto_start:
|
|
25065
|
-
default_max_iterations:
|
|
25135
|
+
import { z as z29 } from "zod";
|
|
25136
|
+
var GoalConfigSchema = z29.object({
|
|
25137
|
+
enabled: z29.boolean().default(false),
|
|
25138
|
+
auto_start: z29.boolean().default(false),
|
|
25139
|
+
default_max_iterations: z29.number().min(1).max(1000).default(100)
|
|
25066
25140
|
});
|
|
25067
25141
|
// packages/skills-loader-core/src/config/git-env-prefix.ts
|
|
25068
|
-
import { z as
|
|
25142
|
+
import { z as z30 } from "zod";
|
|
25069
25143
|
var GIT_ENV_ASSIGNMENT_PATTERN = /^(?:[A-Za-z_][A-Za-z0-9_]*=[A-Za-z0-9_-]*)(?: [A-Za-z_][A-Za-z0-9_]*=[A-Za-z0-9_-]*)*$/;
|
|
25070
25144
|
var GIT_ENV_PREFIX_VALIDATION_MESSAGE = 'git_env_prefix must be empty or use shell-safe env assignments like "GIT_MASTER=1"';
|
|
25071
25145
|
function isValidGitEnvPrefix(value) {
|
|
@@ -25080,17 +25154,17 @@ function assertValidGitEnvPrefix(value) {
|
|
|
25080
25154
|
}
|
|
25081
25155
|
return value;
|
|
25082
25156
|
}
|
|
25083
|
-
var GitEnvPrefixSchema =
|
|
25157
|
+
var GitEnvPrefixSchema = z30.string().refine(isValidGitEnvPrefix, { message: GIT_ENV_PREFIX_VALIDATION_MESSAGE }).default("GIT_MASTER=1");
|
|
25084
25158
|
// packages/omo-opencode/src/config/schema/git-master.ts
|
|
25085
|
-
import { z as
|
|
25086
|
-
var GitMasterConfigSchema =
|
|
25087
|
-
commit_footer:
|
|
25088
|
-
include_co_authored_by:
|
|
25159
|
+
import { z as z31 } from "zod";
|
|
25160
|
+
var GitMasterConfigSchema = z31.object({
|
|
25161
|
+
commit_footer: z31.union([z31.boolean(), z31.string()]).default(true),
|
|
25162
|
+
include_co_authored_by: z31.boolean().default(true),
|
|
25089
25163
|
git_env_prefix: GitEnvPrefixSchema
|
|
25090
25164
|
});
|
|
25091
25165
|
// packages/omo-opencode/src/config/schema/hooks.ts
|
|
25092
|
-
import { z as
|
|
25093
|
-
var HookNameSchema =
|
|
25166
|
+
import { z as z32 } from "zod";
|
|
25167
|
+
var HookNameSchema = z32.enum([
|
|
25094
25168
|
"todo-continuation-enforcer",
|
|
25095
25169
|
"session-notification",
|
|
25096
25170
|
"comment-checker",
|
|
@@ -25148,240 +25222,240 @@ var HookNameSchema = z31.enum([
|
|
|
25148
25222
|
"legacy-plugin-toast"
|
|
25149
25223
|
]);
|
|
25150
25224
|
// packages/omo-opencode/src/config/schema/i18n.ts
|
|
25151
|
-
import { z as
|
|
25152
|
-
var I18nConfigSchema =
|
|
25153
|
-
locale:
|
|
25225
|
+
import { z as z33 } from "zod";
|
|
25226
|
+
var I18nConfigSchema = z33.object({
|
|
25227
|
+
locale: z33.string().optional()
|
|
25154
25228
|
});
|
|
25155
25229
|
// packages/omo-opencode/src/config/schema/keyword-detector.ts
|
|
25156
|
-
import { z as
|
|
25157
|
-
var KeywordTypeSchema =
|
|
25158
|
-
var KeywordDetectorConfigSchema =
|
|
25159
|
-
enabled_expansions:
|
|
25160
|
-
disabled_keywords:
|
|
25230
|
+
import { z as z34 } from "zod";
|
|
25231
|
+
var KeywordTypeSchema = z34.enum(["ultrawork", "team", "hyperplan", "hyperplan-ultrawork"]);
|
|
25232
|
+
var KeywordDetectorConfigSchema = z34.object({
|
|
25233
|
+
enabled_expansions: z34.array(KeywordTypeSchema).optional(),
|
|
25234
|
+
disabled_keywords: z34.array(KeywordTypeSchema).optional()
|
|
25161
25235
|
});
|
|
25162
25236
|
// packages/omo-opencode/src/config/schema/model-capabilities.ts
|
|
25163
|
-
import { z as
|
|
25164
|
-
var ModelCapabilitiesConfigSchema =
|
|
25165
|
-
enabled:
|
|
25166
|
-
auto_refresh_on_start:
|
|
25167
|
-
refresh_timeout_ms:
|
|
25168
|
-
source_url:
|
|
25237
|
+
import { z as z35 } from "zod";
|
|
25238
|
+
var ModelCapabilitiesConfigSchema = z35.object({
|
|
25239
|
+
enabled: z35.boolean().optional(),
|
|
25240
|
+
auto_refresh_on_start: z35.boolean().optional(),
|
|
25241
|
+
refresh_timeout_ms: z35.number().int().positive().optional(),
|
|
25242
|
+
source_url: z35.string().url().optional()
|
|
25169
25243
|
});
|
|
25170
25244
|
// packages/omo-opencode/src/config/schema/notification.ts
|
|
25171
|
-
import { z as
|
|
25172
|
-
var NotificationConfigSchema =
|
|
25173
|
-
force_enable:
|
|
25245
|
+
import { z as z36 } from "zod";
|
|
25246
|
+
var NotificationConfigSchema = z36.object({
|
|
25247
|
+
force_enable: z36.boolean().optional()
|
|
25174
25248
|
});
|
|
25175
25249
|
// packages/omo-opencode/src/config/schema/oh-my-opencode-config.ts
|
|
25176
|
-
import { z as
|
|
25250
|
+
import { z as z50 } from "zod";
|
|
25177
25251
|
|
|
25178
25252
|
// packages/omo-opencode/src/mcp/types.ts
|
|
25179
|
-
import { z as
|
|
25180
|
-
var McpNameSchema =
|
|
25181
|
-
var AnyMcpNameSchema =
|
|
25253
|
+
import { z as z37 } from "zod";
|
|
25254
|
+
var McpNameSchema = z37.enum(["websearch", "context7", "grep_app", "lsp"]);
|
|
25255
|
+
var AnyMcpNameSchema = z37.string().min(1);
|
|
25182
25256
|
|
|
25183
25257
|
// packages/omo-opencode/src/config/schema/agent-definitions.ts
|
|
25184
|
-
import { z as
|
|
25185
|
-
var AgentDefinitionPathSchema =
|
|
25186
|
-
var AgentDefinitionsConfigSchema =
|
|
25258
|
+
import { z as z38 } from "zod";
|
|
25259
|
+
var AgentDefinitionPathSchema = z38.string().min(1);
|
|
25260
|
+
var AgentDefinitionsConfigSchema = z38.array(AgentDefinitionPathSchema).optional();
|
|
25187
25261
|
|
|
25188
25262
|
// packages/omo-opencode/src/config/schema/openclaw.ts
|
|
25189
|
-
import { z as
|
|
25190
|
-
var OpenClawGatewaySchema =
|
|
25191
|
-
type:
|
|
25192
|
-
url:
|
|
25193
|
-
method:
|
|
25194
|
-
headers:
|
|
25195
|
-
command:
|
|
25196
|
-
timeout:
|
|
25263
|
+
import { z as z39 } from "zod";
|
|
25264
|
+
var OpenClawGatewaySchema = z39.object({
|
|
25265
|
+
type: z39.enum(["http", "command"]).default("http"),
|
|
25266
|
+
url: z39.string().optional(),
|
|
25267
|
+
method: z39.string().default("POST"),
|
|
25268
|
+
headers: z39.record(z39.string(), z39.string()).optional(),
|
|
25269
|
+
command: z39.string().optional(),
|
|
25270
|
+
timeout: z39.number().optional()
|
|
25197
25271
|
});
|
|
25198
|
-
var OpenClawHookSchema =
|
|
25199
|
-
enabled:
|
|
25200
|
-
gateway:
|
|
25201
|
-
instruction:
|
|
25272
|
+
var OpenClawHookSchema = z39.object({
|
|
25273
|
+
enabled: z39.boolean().default(true),
|
|
25274
|
+
gateway: z39.string(),
|
|
25275
|
+
instruction: z39.string()
|
|
25202
25276
|
});
|
|
25203
|
-
var OpenClawReplyListenerConfigSchema =
|
|
25204
|
-
discordBotToken:
|
|
25205
|
-
discordChannelId:
|
|
25206
|
-
discordMention:
|
|
25207
|
-
authorizedDiscordUserIds:
|
|
25208
|
-
telegramBotToken:
|
|
25209
|
-
telegramChatId:
|
|
25210
|
-
pollIntervalMs:
|
|
25211
|
-
rateLimitPerMinute:
|
|
25212
|
-
maxMessageLength:
|
|
25213
|
-
includePrefix:
|
|
25277
|
+
var OpenClawReplyListenerConfigSchema = z39.object({
|
|
25278
|
+
discordBotToken: z39.string().optional(),
|
|
25279
|
+
discordChannelId: z39.string().optional(),
|
|
25280
|
+
discordMention: z39.string().optional(),
|
|
25281
|
+
authorizedDiscordUserIds: z39.array(z39.string()).default([]),
|
|
25282
|
+
telegramBotToken: z39.string().optional(),
|
|
25283
|
+
telegramChatId: z39.string().optional(),
|
|
25284
|
+
pollIntervalMs: z39.number().default(3000),
|
|
25285
|
+
rateLimitPerMinute: z39.number().default(10),
|
|
25286
|
+
maxMessageLength: z39.number().default(500),
|
|
25287
|
+
includePrefix: z39.boolean().default(true)
|
|
25214
25288
|
});
|
|
25215
|
-
var OpenClawConfigSchema =
|
|
25216
|
-
enabled:
|
|
25217
|
-
gateways:
|
|
25218
|
-
hooks:
|
|
25289
|
+
var OpenClawConfigSchema = z39.object({
|
|
25290
|
+
enabled: z39.boolean().default(false),
|
|
25291
|
+
gateways: z39.record(z39.string(), OpenClawGatewaySchema).default({}),
|
|
25292
|
+
hooks: z39.record(z39.string(), OpenClawHookSchema).default({}),
|
|
25219
25293
|
replyListener: OpenClawReplyListenerConfigSchema.optional()
|
|
25220
25294
|
});
|
|
25221
25295
|
|
|
25222
25296
|
// packages/omo-opencode/src/config/schema/monitor.ts
|
|
25223
|
-
import { z as
|
|
25224
|
-
var MonitorConfigSchema =
|
|
25225
|
-
enabled:
|
|
25226
|
-
live_mode_enabled:
|
|
25227
|
-
allowed_commands:
|
|
25228
|
-
max_monitors_per_session:
|
|
25229
|
-
max_runtime_ms:
|
|
25230
|
-
batch_max_lines:
|
|
25231
|
-
batch_max_bytes:
|
|
25232
|
-
flush_interval_ms:
|
|
25233
|
-
ring_max_lines:
|
|
25234
|
-
line_max_bytes:
|
|
25235
|
-
pattern_max_length:
|
|
25297
|
+
import { z as z40 } from "zod";
|
|
25298
|
+
var MonitorConfigSchema = z40.object({
|
|
25299
|
+
enabled: z40.boolean().default(false),
|
|
25300
|
+
live_mode_enabled: z40.boolean().default(false),
|
|
25301
|
+
allowed_commands: z40.array(z40.string()).optional(),
|
|
25302
|
+
max_monitors_per_session: z40.number().int().min(1).max(16).default(3),
|
|
25303
|
+
max_runtime_ms: z40.number().int().min(1000).default(1800000),
|
|
25304
|
+
batch_max_lines: z40.number().int().min(1).default(50),
|
|
25305
|
+
batch_max_bytes: z40.number().int().min(1024).default(16384),
|
|
25306
|
+
flush_interval_ms: z40.number().int().min(250).default(1000),
|
|
25307
|
+
ring_max_lines: z40.number().int().min(1).default(1000),
|
|
25308
|
+
line_max_bytes: z40.number().int().min(256).default(8192),
|
|
25309
|
+
pattern_max_length: z40.number().int().min(1).default(512)
|
|
25236
25310
|
});
|
|
25237
25311
|
|
|
25238
25312
|
// packages/omo-opencode/src/config/schema/runtime-fallback.ts
|
|
25239
|
-
import { z as
|
|
25240
|
-
var RuntimeFallbackConfigSchema =
|
|
25241
|
-
enabled:
|
|
25242
|
-
retry_on_errors:
|
|
25243
|
-
max_fallback_attempts:
|
|
25244
|
-
cooldown_seconds:
|
|
25245
|
-
timeout_seconds:
|
|
25246
|
-
notify_on_fallback:
|
|
25247
|
-
restore_primary_after_cooldown:
|
|
25313
|
+
import { z as z41 } from "zod";
|
|
25314
|
+
var RuntimeFallbackConfigSchema = z41.object({
|
|
25315
|
+
enabled: z41.boolean().optional(),
|
|
25316
|
+
retry_on_errors: z41.array(z41.number()).optional(),
|
|
25317
|
+
max_fallback_attempts: z41.number().min(1).max(20).optional(),
|
|
25318
|
+
cooldown_seconds: z41.number().min(0).optional(),
|
|
25319
|
+
timeout_seconds: z41.number().min(0).optional(),
|
|
25320
|
+
notify_on_fallback: z41.boolean().optional(),
|
|
25321
|
+
restore_primary_after_cooldown: z41.boolean().optional()
|
|
25248
25322
|
});
|
|
25249
25323
|
|
|
25250
25324
|
// packages/team-core/src/config.ts
|
|
25251
|
-
import * as
|
|
25252
|
-
var TeamModeConfigSchema =
|
|
25253
|
-
enabled:
|
|
25254
|
-
tmux_visualization:
|
|
25255
|
-
max_parallel_members:
|
|
25256
|
-
max_members:
|
|
25257
|
-
max_messages_per_run:
|
|
25258
|
-
max_wall_clock_minutes:
|
|
25259
|
-
max_member_turns:
|
|
25260
|
-
base_dir:
|
|
25261
|
-
message_payload_max_bytes:
|
|
25262
|
-
recipient_unread_max_bytes:
|
|
25263
|
-
mailbox_poll_interval_ms:
|
|
25325
|
+
import * as z42 from "zod";
|
|
25326
|
+
var TeamModeConfigSchema = z42.object({
|
|
25327
|
+
enabled: z42.boolean().default(false),
|
|
25328
|
+
tmux_visualization: z42.boolean().default(false),
|
|
25329
|
+
max_parallel_members: z42.number().int().min(1).max(8).default(4),
|
|
25330
|
+
max_members: z42.number().int().min(1).max(8).default(8),
|
|
25331
|
+
max_messages_per_run: z42.number().int().min(1).default(1e4),
|
|
25332
|
+
max_wall_clock_minutes: z42.number().int().min(1).default(120),
|
|
25333
|
+
max_member_turns: z42.number().int().min(1).default(500),
|
|
25334
|
+
base_dir: z42.string().optional(),
|
|
25335
|
+
message_payload_max_bytes: z42.number().int().min(1024).default(32768),
|
|
25336
|
+
recipient_unread_max_bytes: z42.number().int().min(1024).default(262144),
|
|
25337
|
+
mailbox_poll_interval_ms: z42.number().int().min(500).default(3000)
|
|
25264
25338
|
});
|
|
25265
25339
|
// packages/omo-opencode/src/config/schema/skills.ts
|
|
25266
|
-
import { z as
|
|
25267
|
-
var SkillSourceSchema =
|
|
25268
|
-
|
|
25269
|
-
|
|
25270
|
-
path:
|
|
25271
|
-
recursive:
|
|
25272
|
-
glob:
|
|
25340
|
+
import { z as z43 } from "zod";
|
|
25341
|
+
var SkillSourceSchema = z43.union([
|
|
25342
|
+
z43.string(),
|
|
25343
|
+
z43.object({
|
|
25344
|
+
path: z43.string(),
|
|
25345
|
+
recursive: z43.boolean().optional(),
|
|
25346
|
+
glob: z43.string().optional()
|
|
25273
25347
|
})
|
|
25274
25348
|
]);
|
|
25275
|
-
var SkillDefinitionSchema =
|
|
25276
|
-
description:
|
|
25277
|
-
template:
|
|
25278
|
-
from:
|
|
25279
|
-
model:
|
|
25280
|
-
agent:
|
|
25281
|
-
subtask:
|
|
25282
|
-
"argument-hint":
|
|
25283
|
-
license:
|
|
25284
|
-
compatibility:
|
|
25285
|
-
metadata:
|
|
25286
|
-
"allowed-tools":
|
|
25287
|
-
disable:
|
|
25349
|
+
var SkillDefinitionSchema = z43.object({
|
|
25350
|
+
description: z43.string().optional(),
|
|
25351
|
+
template: z43.string().optional(),
|
|
25352
|
+
from: z43.string().optional(),
|
|
25353
|
+
model: z43.string().optional(),
|
|
25354
|
+
agent: z43.string().optional(),
|
|
25355
|
+
subtask: z43.boolean().optional(),
|
|
25356
|
+
"argument-hint": z43.string().optional(),
|
|
25357
|
+
license: z43.string().optional(),
|
|
25358
|
+
compatibility: z43.string().optional(),
|
|
25359
|
+
metadata: z43.record(z43.string(), z43.unknown()).optional(),
|
|
25360
|
+
"allowed-tools": z43.array(z43.string()).optional(),
|
|
25361
|
+
disable: z43.boolean().optional()
|
|
25288
25362
|
});
|
|
25289
|
-
var SkillEntrySchema =
|
|
25290
|
-
var SkillsConfigSchema =
|
|
25291
|
-
|
|
25292
|
-
|
|
25293
|
-
sources:
|
|
25294
|
-
enable:
|
|
25295
|
-
disable:
|
|
25363
|
+
var SkillEntrySchema = z43.union([z43.boolean(), SkillDefinitionSchema]);
|
|
25364
|
+
var SkillsConfigSchema = z43.union([
|
|
25365
|
+
z43.array(z43.string()),
|
|
25366
|
+
z43.object({
|
|
25367
|
+
sources: z43.array(SkillSourceSchema).optional(),
|
|
25368
|
+
enable: z43.array(z43.string()).optional(),
|
|
25369
|
+
disable: z43.array(z43.string()).optional()
|
|
25296
25370
|
}).catchall(SkillEntrySchema)
|
|
25297
25371
|
]);
|
|
25298
25372
|
|
|
25299
25373
|
// packages/omo-opencode/src/config/schema/sisyphus.ts
|
|
25300
|
-
import { z as
|
|
25301
|
-
var SisyphusTasksConfigSchema =
|
|
25302
|
-
storage_path:
|
|
25303
|
-
task_list_id:
|
|
25304
|
-
claude_code_compat:
|
|
25374
|
+
import { z as z44 } from "zod";
|
|
25375
|
+
var SisyphusTasksConfigSchema = z44.object({
|
|
25376
|
+
storage_path: z44.string().optional(),
|
|
25377
|
+
task_list_id: z44.string().optional(),
|
|
25378
|
+
claude_code_compat: z44.boolean().default(false)
|
|
25305
25379
|
});
|
|
25306
|
-
var SisyphusConfigSchema =
|
|
25380
|
+
var SisyphusConfigSchema = z44.object({
|
|
25307
25381
|
tasks: SisyphusTasksConfigSchema.optional()
|
|
25308
25382
|
});
|
|
25309
25383
|
|
|
25310
25384
|
// packages/omo-opencode/src/config/schema/sisyphus-agent.ts
|
|
25311
|
-
import { z as
|
|
25312
|
-
var SisyphusAgentConfigSchema =
|
|
25313
|
-
disabled:
|
|
25314
|
-
default_builder_enabled:
|
|
25315
|
-
planner_enabled:
|
|
25316
|
-
replace_plan:
|
|
25317
|
-
tdd:
|
|
25385
|
+
import { z as z45 } from "zod";
|
|
25386
|
+
var SisyphusAgentConfigSchema = z45.object({
|
|
25387
|
+
disabled: z45.boolean().optional(),
|
|
25388
|
+
default_builder_enabled: z45.boolean().optional(),
|
|
25389
|
+
planner_enabled: z45.boolean().optional(),
|
|
25390
|
+
replace_plan: z45.boolean().optional(),
|
|
25391
|
+
tdd: z45.boolean().default(true).optional()
|
|
25318
25392
|
});
|
|
25319
25393
|
|
|
25320
25394
|
// packages/omo-opencode/src/config/schema/tmux.ts
|
|
25321
25395
|
init_src2();
|
|
25322
|
-
import { z as
|
|
25323
|
-
var TmuxLayoutSchema =
|
|
25324
|
-
var TmuxIsolationSchema =
|
|
25325
|
-
var TmuxConfigSchema =
|
|
25326
|
-
enabled:
|
|
25396
|
+
import { z as z46 } from "zod";
|
|
25397
|
+
var TmuxLayoutSchema = z46.enum(TMUX_LAYOUT_VALUES);
|
|
25398
|
+
var TmuxIsolationSchema = z46.enum(TMUX_ISOLATION_VALUES);
|
|
25399
|
+
var TmuxConfigSchema = z46.object({
|
|
25400
|
+
enabled: z46.boolean().default(false),
|
|
25327
25401
|
layout: TmuxLayoutSchema.default("main-vertical"),
|
|
25328
|
-
main_pane_size:
|
|
25329
|
-
main_pane_min_width:
|
|
25330
|
-
agent_pane_min_width:
|
|
25402
|
+
main_pane_size: z46.number().min(20).max(80).default(60),
|
|
25403
|
+
main_pane_min_width: z46.number().min(40).default(120),
|
|
25404
|
+
agent_pane_min_width: z46.number().min(20).default(40),
|
|
25331
25405
|
isolation: TmuxIsolationSchema.default("inline")
|
|
25332
25406
|
});
|
|
25333
25407
|
|
|
25334
25408
|
// packages/omo-opencode/src/config/schema/tui.ts
|
|
25335
|
-
import { z as
|
|
25336
|
-
var TuiSidebarConfigSchema =
|
|
25337
|
-
enabled:
|
|
25409
|
+
import { z as z47 } from "zod";
|
|
25410
|
+
var TuiSidebarConfigSchema = z47.object({
|
|
25411
|
+
enabled: z47.boolean().default(true)
|
|
25338
25412
|
});
|
|
25339
|
-
var TuiConfigSchema =
|
|
25413
|
+
var TuiConfigSchema = z47.object({
|
|
25340
25414
|
sidebar: TuiSidebarConfigSchema.default({ enabled: true })
|
|
25341
25415
|
});
|
|
25342
25416
|
|
|
25343
25417
|
// packages/omo-opencode/src/config/schema/ulw-execute.ts
|
|
25344
|
-
import { z as
|
|
25345
|
-
var UlwExecuteConfigSchema =
|
|
25346
|
-
auto_commit:
|
|
25418
|
+
import { z as z48 } from "zod";
|
|
25419
|
+
var UlwExecuteConfigSchema = z48.object({
|
|
25420
|
+
auto_commit: z48.boolean().default(true)
|
|
25347
25421
|
});
|
|
25348
25422
|
|
|
25349
25423
|
// packages/omo-opencode/src/config/schema/websearch.ts
|
|
25350
|
-
import { z as
|
|
25351
|
-
var WebsearchProviderSchema =
|
|
25352
|
-
var WebsearchConfigSchema =
|
|
25424
|
+
import { z as z49 } from "zod";
|
|
25425
|
+
var WebsearchProviderSchema = z49.enum(["exa", "tavily"]);
|
|
25426
|
+
var WebsearchConfigSchema = z49.object({
|
|
25353
25427
|
provider: WebsearchProviderSchema.optional()
|
|
25354
25428
|
});
|
|
25355
25429
|
|
|
25356
25430
|
// packages/omo-opencode/src/config/schema/oh-my-opencode-config.ts
|
|
25357
|
-
var OhMyOpenCodeConfigSchema =
|
|
25358
|
-
$schema:
|
|
25359
|
-
new_task_system_enabled:
|
|
25360
|
-
default_run_agent:
|
|
25361
|
-
agent_order:
|
|
25431
|
+
var OhMyOpenCodeConfigSchema = z50.object({
|
|
25432
|
+
$schema: z50.string().optional(),
|
|
25433
|
+
new_task_system_enabled: z50.boolean().optional(),
|
|
25434
|
+
default_run_agent: z50.string().optional(),
|
|
25435
|
+
agent_order: z50.array(z50.string().max(128)).max(64).optional(),
|
|
25362
25436
|
agent_definitions: AgentDefinitionsConfigSchema,
|
|
25363
|
-
disabled_mcps:
|
|
25364
|
-
disabled_agents:
|
|
25365
|
-
disabled_skills:
|
|
25366
|
-
disabled_hooks:
|
|
25367
|
-
disabled_commands:
|
|
25368
|
-
disabled_tools:
|
|
25369
|
-
disabled_providers:
|
|
25370
|
-
mcp_env_allowlist:
|
|
25371
|
-
hashline_edit:
|
|
25372
|
-
telemetry:
|
|
25373
|
-
model_fallback:
|
|
25437
|
+
disabled_mcps: z50.array(AnyMcpNameSchema).optional(),
|
|
25438
|
+
disabled_agents: z50.array(z50.string()).optional(),
|
|
25439
|
+
disabled_skills: z50.array(z50.string()).optional(),
|
|
25440
|
+
disabled_hooks: z50.array(z50.string()).optional(),
|
|
25441
|
+
disabled_commands: z50.array(BuiltinCommandNameSchema).optional(),
|
|
25442
|
+
disabled_tools: z50.array(z50.string()).optional(),
|
|
25443
|
+
disabled_providers: z50.array(z50.string()).optional(),
|
|
25444
|
+
mcp_env_allowlist: z50.array(z50.string()).optional(),
|
|
25445
|
+
hashline_edit: z50.boolean().optional(),
|
|
25446
|
+
telemetry: z50.boolean().optional().describe("Enable or disable anonymous telemetry. Default: enabled when omitted. Set to false to disable."),
|
|
25447
|
+
model_fallback: z50.boolean().optional(),
|
|
25374
25448
|
agents: AgentOverridesSchema.optional(),
|
|
25375
25449
|
categories: CategoriesConfigSchema.optional(),
|
|
25376
25450
|
claude_code: ClaudeCodeConfigSchema.optional(),
|
|
25377
25451
|
sisyphus_agent: SisyphusAgentConfigSchema.optional(),
|
|
25378
25452
|
comment_checker: CommentCheckerConfigSchema.optional(),
|
|
25379
25453
|
experimental: ExperimentalConfigSchema.optional(),
|
|
25380
|
-
auto_update:
|
|
25454
|
+
auto_update: z50.boolean().optional(),
|
|
25381
25455
|
skills: SkillsConfigSchema.optional(),
|
|
25382
25456
|
goal: GoalConfigSchema.optional(),
|
|
25383
|
-
ralph_loop:
|
|
25384
|
-
runtime_fallback:
|
|
25457
|
+
ralph_loop: z50.record(z50.string(), z50.unknown()).optional(),
|
|
25458
|
+
runtime_fallback: z50.union([z50.boolean(), RuntimeFallbackConfigSchema]).optional(),
|
|
25385
25459
|
background_task: BackgroundTaskConfigSchema.optional(),
|
|
25386
25460
|
notification: NotificationConfigSchema.optional(),
|
|
25387
25461
|
model_capabilities: ModelCapabilitiesConfigSchema.optional(),
|
|
@@ -25404,7 +25478,7 @@ var OhMyOpenCodeConfigSchema = z49.object({
|
|
|
25404
25478
|
ulw_execute: UlwExecuteConfigSchema.optional(),
|
|
25405
25479
|
start_work: UlwExecuteConfigSchema.optional(),
|
|
25406
25480
|
default_mode: DefaultModeConfigSchema.optional(),
|
|
25407
|
-
_migrations:
|
|
25481
|
+
_migrations: z50.array(z50.string()).optional()
|
|
25408
25482
|
});
|
|
25409
25483
|
// packages/omo-opencode/src/config/validate.ts
|
|
25410
25484
|
function shortPath(configPath) {
|
|
@@ -82598,7 +82672,7 @@ function convertSDKMessageToStoredMessage(msg) {
|
|
|
82598
82672
|
return null;
|
|
82599
82673
|
const providerID = info.model?.providerID ?? info.providerID;
|
|
82600
82674
|
const modelID = info.model?.modelID ?? info.modelID;
|
|
82601
|
-
const variant = info.model?.variant;
|
|
82675
|
+
const variant = info.model?.variant ?? info.variant;
|
|
82602
82676
|
if (!info.agent && !providerID && !modelID) {
|
|
82603
82677
|
return null;
|
|
82604
82678
|
}
|
|
@@ -82695,6 +82769,10 @@ async function resolveMessageContext(sessionID, client, messageDir) {
|
|
|
82695
82769
|
// packages/omo-opencode/src/features/hook-message-injector/id-generation.ts
|
|
82696
82770
|
import { randomBytes } from "crypto";
|
|
82697
82771
|
var processPrefix = randomBytes(4).toString("hex");
|
|
82772
|
+
var partCounter = 0;
|
|
82773
|
+
function generatePartId() {
|
|
82774
|
+
return `prt_${processPrefix}_${String(++partCounter).padStart(6, "0")}`;
|
|
82775
|
+
}
|
|
82698
82776
|
// packages/omo-opencode/src/shared/internal-initiator-marker.ts
|
|
82699
82777
|
init_internal_initiator_marker();
|
|
82700
82778
|
|
|
@@ -86537,6 +86615,10 @@ var CHECK_NAMES = {
|
|
|
86537
86615
|
[CHECK_IDS.TEAM_MODE]: "Team Mode",
|
|
86538
86616
|
[CHECK_IDS.CODEX]: "Codex"
|
|
86539
86617
|
};
|
|
86618
|
+
var UPDATE_COMMANDS = {
|
|
86619
|
+
opencode: `bunx ${PUBLISHED_PACKAGE_NAME} install`,
|
|
86620
|
+
codex: "npx lazycodex-ai install --no-tui --codex-autonomous"
|
|
86621
|
+
};
|
|
86540
86622
|
|
|
86541
86623
|
// packages/omo-opencode/src/cli/doctor/checks/tui-plugin-config.ts
|
|
86542
86624
|
var TUI_SUBPATH = "tui";
|
|
@@ -96387,7 +96469,7 @@ function getCachedVersion(options = {}) {
|
|
|
96387
96469
|
// package.json
|
|
96388
96470
|
var package_default = {
|
|
96389
96471
|
name: "oh-my-opencode",
|
|
96390
|
-
version: "5.0.0-beta.
|
|
96472
|
+
version: "5.0.0-beta.53",
|
|
96391
96473
|
description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
96392
96474
|
main: "./dist/index.js",
|
|
96393
96475
|
types: "dist/index.d.ts",
|
|
@@ -96571,7 +96653,7 @@ var package_default = {
|
|
|
96571
96653
|
zod: "^4.4.3"
|
|
96572
96654
|
},
|
|
96573
96655
|
devDependencies: {
|
|
96574
|
-
"@code-yeongyu/senpi": "2026.9.
|
|
96656
|
+
"@code-yeongyu/senpi": "2026.9.10-2",
|
|
96575
96657
|
"@oh-my-opencode/agents-md-core": "workspace:*",
|
|
96576
96658
|
"@oh-my-opencode/ast-grep-mcp": "workspace:*",
|
|
96577
96659
|
"@oh-my-opencode/boulder-state": "workspace:*",
|
|
@@ -96612,18 +96694,18 @@ var package_default = {
|
|
|
96612
96694
|
typescript: "^7.0.2"
|
|
96613
96695
|
},
|
|
96614
96696
|
optionalDependencies: {
|
|
96615
|
-
"oh-my-opencode-darwin-arm64": "5.0.0-beta.
|
|
96616
|
-
"oh-my-opencode-darwin-x64": "5.0.0-beta.
|
|
96617
|
-
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.
|
|
96618
|
-
"oh-my-opencode-linux-arm64": "5.0.0-beta.
|
|
96619
|
-
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.
|
|
96620
|
-
"oh-my-opencode-linux-x64": "5.0.0-beta.
|
|
96621
|
-
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.
|
|
96622
|
-
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.
|
|
96623
|
-
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.
|
|
96624
|
-
"oh-my-opencode-windows-arm64": "5.0.0-beta.
|
|
96625
|
-
"oh-my-opencode-windows-x64": "5.0.0-beta.
|
|
96626
|
-
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.
|
|
96697
|
+
"oh-my-opencode-darwin-arm64": "5.0.0-beta.53",
|
|
96698
|
+
"oh-my-opencode-darwin-x64": "5.0.0-beta.53",
|
|
96699
|
+
"oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.53",
|
|
96700
|
+
"oh-my-opencode-linux-arm64": "5.0.0-beta.53",
|
|
96701
|
+
"oh-my-opencode-linux-arm64-musl": "5.0.0-beta.53",
|
|
96702
|
+
"oh-my-opencode-linux-x64": "5.0.0-beta.53",
|
|
96703
|
+
"oh-my-opencode-linux-x64-baseline": "5.0.0-beta.53",
|
|
96704
|
+
"oh-my-opencode-linux-x64-musl": "5.0.0-beta.53",
|
|
96705
|
+
"oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.53",
|
|
96706
|
+
"oh-my-opencode-windows-arm64": "5.0.0-beta.53",
|
|
96707
|
+
"oh-my-opencode-windows-x64": "5.0.0-beta.53",
|
|
96708
|
+
"oh-my-opencode-windows-x64-baseline": "5.0.0-beta.53"
|
|
96627
96709
|
},
|
|
96628
96710
|
overrides: {
|
|
96629
96711
|
"@earendil-works/pi-agent-core": "0.84.2",
|
|
@@ -103400,8 +103482,7 @@ function getDefaultUltraworkMessage() {
|
|
|
103400
103482
|
return ULTRAWORK_DEFAULT_MESSAGE;
|
|
103401
103483
|
}
|
|
103402
103484
|
// packages/omo-opencode/src/hooks/keyword-detector/ultrawork/index.ts
|
|
103403
|
-
function
|
|
103404
|
-
const source = getUltraworkSource(agentName, modelID);
|
|
103485
|
+
function getUltraworkMessageForSource(source) {
|
|
103405
103486
|
switch (source) {
|
|
103406
103487
|
case "planner":
|
|
103407
103488
|
return getPlannerUltraworkMessage();
|
|
@@ -103416,6 +103497,9 @@ function getUltraworkMessage(agentName, modelID) {
|
|
|
103416
103497
|
return getDefaultUltraworkMessage();
|
|
103417
103498
|
}
|
|
103418
103499
|
}
|
|
103500
|
+
function getUltraworkMessage(agentName, modelID) {
|
|
103501
|
+
return getUltraworkMessageForSource(getUltraworkSource(agentName, modelID));
|
|
103502
|
+
}
|
|
103419
103503
|
|
|
103420
103504
|
// packages/omo-opencode/src/hooks/keyword-detector/team/default.ts
|
|
103421
103505
|
var TEAM_PATTERN = /\bteam[\s_-]?mode\b/i;
|
|
@@ -103498,6 +103582,7 @@ function extractPromptText2(parts) {
|
|
|
103498
103582
|
// packages/omo-opencode/src/hooks/keyword-detector/hook.ts
|
|
103499
103583
|
var defaultModeUltraworkInjectedSessions = new Set;
|
|
103500
103584
|
var DEFAULT_MODE_ULTRAWORK_SESSION_CAP = 256;
|
|
103585
|
+
var ULTRAWORK_CONTINUATION_MARKER = "<ultrawork-mode>active</ultrawork-mode>";
|
|
103501
103586
|
function rememberDefaultModeUltraworkInjectedSession(sessionID) {
|
|
103502
103587
|
if (defaultModeUltraworkInjectedSessions.has(sessionID))
|
|
103503
103588
|
return;
|
|
@@ -103526,6 +103611,7 @@ function filterAlreadyInjectedKeywords(detected, text) {
|
|
|
103526
103611
|
function createKeywordDetectorHook(ctx, _collector, _ralphLoop, config, defaultMode) {
|
|
103527
103612
|
const disabledKeywords = config?.disabled_keywords;
|
|
103528
103613
|
const enabledExpansions = config?.enabled_expansions;
|
|
103614
|
+
const explicitUltraworkSessions = new Map;
|
|
103529
103615
|
function getRuntimeVariant(input, message) {
|
|
103530
103616
|
if (typeof message.variant === "string") {
|
|
103531
103617
|
return message.variant;
|
|
@@ -103538,12 +103624,15 @@ function createKeywordDetectorHook(ctx, _collector, _ralphLoop, config, defaultM
|
|
|
103538
103624
|
log2(`[keyword-detector] Skipping synthetic/internal text message`, { sessionID: input.sessionID });
|
|
103539
103625
|
return;
|
|
103540
103626
|
}
|
|
103541
|
-
const promptText = extractPromptText2(output.parts);
|
|
103627
|
+
const promptText = extractPromptText2(output.parts.filter(isRealUserTextPart));
|
|
103542
103628
|
if (isSystemDirective(promptText)) {
|
|
103543
103629
|
log2(`[keyword-detector] Skipping system directive message`, { sessionID: input.sessionID });
|
|
103544
103630
|
return;
|
|
103545
103631
|
}
|
|
103546
103632
|
if (looksLikeSlashCommand(promptText)) {
|
|
103633
|
+
if (/^\s*\/stop-continuation(?:\s|$)/i.test(promptText)) {
|
|
103634
|
+
explicitUltraworkSessions.delete(input.sessionID);
|
|
103635
|
+
}
|
|
103547
103636
|
log2(`[keyword-detector] Skipping slash command invocation`, { sessionID: input.sessionID });
|
|
103548
103637
|
return;
|
|
103549
103638
|
}
|
|
@@ -103553,8 +103642,17 @@ function createKeywordDetectorHook(ctx, _collector, _ralphLoop, config, defaultM
|
|
|
103553
103642
|
return;
|
|
103554
103643
|
}
|
|
103555
103644
|
const cleanText = removeSystemReminders(promptText);
|
|
103556
|
-
const
|
|
103645
|
+
const selectedModel = output.message.model;
|
|
103646
|
+
const modelID = selectedModel !== null && typeof selectedModel === "object" && "modelID" in selectedModel && typeof selectedModel.modelID === "string" ? selectedModel.modelID : input.model?.modelID;
|
|
103647
|
+
const promptSource = getUltraworkSource(currentAgent, modelID);
|
|
103557
103648
|
let detectedKeywords = detectKeywordsWithType(cleanText, currentAgent, modelID, disabledKeywords, enabledExpansions);
|
|
103649
|
+
const explicitUltrawork = detectedKeywords.some((k) => k.type === "ultrawork" || k.type === "hyperplan-ultrawork");
|
|
103650
|
+
const activeUltrawork = explicitUltraworkSessions.get(input.sessionID);
|
|
103651
|
+
const replayUltrawork = !explicitUltrawork && activeUltrawork !== undefined;
|
|
103652
|
+
const compactUltrawork = activeUltrawork !== undefined && !activeUltrawork.needsRestoration && activeUltrawork.source === promptSource;
|
|
103653
|
+
if (replayUltrawork) {
|
|
103654
|
+
detectedKeywords.push({ type: "ultrawork", message: getUltraworkMessageForSource(promptSource) });
|
|
103655
|
+
}
|
|
103558
103656
|
detectedKeywords = suppressComboStandalones(detectedKeywords);
|
|
103559
103657
|
if (isPlannerAgent(currentAgent)) {
|
|
103560
103658
|
const preFilterCount = detectedKeywords.length;
|
|
@@ -103606,7 +103704,7 @@ function createKeywordDetectorHook(ctx, _collector, _ralphLoop, config, defaultM
|
|
|
103606
103704
|
return;
|
|
103607
103705
|
}
|
|
103608
103706
|
const hasUltrawork = detectedKeywords.some((k) => k.type === "ultrawork");
|
|
103609
|
-
if (hasUltrawork) {
|
|
103707
|
+
if (hasUltrawork && explicitUltrawork) {
|
|
103610
103708
|
const runtimeVariant = getRuntimeVariant(input, output.message);
|
|
103611
103709
|
const isRuntimeMax = runtimeVariant === "max";
|
|
103612
103710
|
log2(`[keyword-detector] Ultrawork mode activated`, {
|
|
@@ -103654,34 +103752,83 @@ function createKeywordDetectorHook(ctx, _collector, _ralphLoop, config, defaultM
|
|
|
103654
103752
|
}
|
|
103655
103753
|
}).catch((err) => log2(`[keyword-detector] Failed to show toast`, { error: err, sessionID: input.sessionID }));
|
|
103656
103754
|
}
|
|
103657
|
-
const
|
|
103658
|
-
if (textPartIndex === -1) {
|
|
103659
|
-
log2(`[keyword-detector] No text part found, skipping injection`, { sessionID: input.sessionID });
|
|
103660
|
-
return;
|
|
103661
|
-
}
|
|
103662
|
-
const allMessages = detectedKeywords.map((k) => k.message).join(`
|
|
103755
|
+
const allMessages = detectedKeywords.filter((k) => !(compactUltrawork && k.type === "ultrawork")).map((k) => k.message).join(`
|
|
103663
103756
|
|
|
103664
103757
|
`);
|
|
103665
|
-
const
|
|
103666
|
-
|
|
103758
|
+
const textPart = output.parts.find(isRealUserTextPart);
|
|
103759
|
+
const requiresFullGuidance = (hasUltrawork || hasHyperplanUltrawork) && !compactUltrawork && allMessages.length > 0;
|
|
103760
|
+
const messageID = input.messageID ?? (typeof output.message.id === "string" ? output.message.id : undefined);
|
|
103761
|
+
let fullGuidanceDurablyAdded = textPart !== undefined && requiresFullGuidance;
|
|
103762
|
+
if (textPart && allMessages) {
|
|
103763
|
+
textPart.text = `${textPart.text}
|
|
103667
103764
|
|
|
103668
103765
|
---
|
|
103669
103766
|
|
|
103670
103767
|
${allMessages}`;
|
|
103768
|
+
}
|
|
103769
|
+
if (!textPart && requiresFullGuidance && messageID) {
|
|
103770
|
+
output.parts.push({
|
|
103771
|
+
id: generatePartId(),
|
|
103772
|
+
sessionID: input.sessionID,
|
|
103773
|
+
messageID,
|
|
103774
|
+
type: "text",
|
|
103775
|
+
text: allMessages,
|
|
103776
|
+
synthetic: true
|
|
103777
|
+
});
|
|
103778
|
+
fullGuidanceDurablyAdded = true;
|
|
103779
|
+
}
|
|
103780
|
+
if (hasUltrawork && compactUltrawork && !output.parts.some((part) => part.synthetic === true && part.text === ULTRAWORK_CONTINUATION_MARKER) && messageID) {
|
|
103781
|
+
output.parts.push({
|
|
103782
|
+
id: generatePartId(),
|
|
103783
|
+
sessionID: input.sessionID,
|
|
103784
|
+
messageID,
|
|
103785
|
+
type: "text",
|
|
103786
|
+
text: ULTRAWORK_CONTINUATION_MARKER,
|
|
103787
|
+
synthetic: true
|
|
103788
|
+
});
|
|
103789
|
+
}
|
|
103790
|
+
if ((explicitUltrawork || replayUltrawork) && (hasUltrawork || hasHyperplanUltrawork) && (!requiresFullGuidance || fullGuidanceDurablyAdded)) {
|
|
103791
|
+
if (!explicitUltraworkSessions.has(input.sessionID) && explicitUltraworkSessions.size >= DEFAULT_MODE_ULTRAWORK_SESSION_CAP) {
|
|
103792
|
+
const oldest = explicitUltraworkSessions.keys().next().value;
|
|
103793
|
+
if (oldest !== undefined)
|
|
103794
|
+
explicitUltraworkSessions.delete(oldest);
|
|
103795
|
+
}
|
|
103796
|
+
explicitUltraworkSessions.set(input.sessionID, { source: promptSource, needsRestoration: false });
|
|
103797
|
+
}
|
|
103671
103798
|
log2(`[keyword-detector] Detected ${detectedKeywords.length} keywords`, {
|
|
103672
103799
|
sessionID: input.sessionID,
|
|
103673
103800
|
types: detectedKeywords.map((k) => k.type)
|
|
103674
103801
|
});
|
|
103675
103802
|
},
|
|
103803
|
+
clearSession: (sessionID) => {
|
|
103804
|
+
explicitUltraworkSessions.delete(sessionID);
|
|
103805
|
+
},
|
|
103806
|
+
getSystemTransformGuidance: (sessionID, modelID) => {
|
|
103807
|
+
const activeUltrawork = explicitUltraworkSessions.get(sessionID);
|
|
103808
|
+
const agent = getSessionAgent(sessionID);
|
|
103809
|
+
if (!activeUltrawork?.needsRestoration || isPlannerAgent(agent) || isNonOmoAgent(agent) || subagentSessions.has(sessionID))
|
|
103810
|
+
return;
|
|
103811
|
+
return getUltraworkMessageForSource(modelID === undefined ? activeUltrawork.source : getUltraworkSource(agent, modelID));
|
|
103812
|
+
},
|
|
103676
103813
|
event: ({ event }) => {
|
|
103677
|
-
if (event.type !== "session.deleted")
|
|
103814
|
+
if (event.type !== "session.deleted" && event.type !== "session.compacted")
|
|
103678
103815
|
return;
|
|
103679
103816
|
const sessionID = resolveSessionEventID(event.properties);
|
|
103680
|
-
if (sessionID)
|
|
103817
|
+
if (sessionID) {
|
|
103818
|
+
if (event.type === "session.compacted") {
|
|
103819
|
+
const activeUltrawork = explicitUltraworkSessions.get(sessionID);
|
|
103820
|
+
if (activeUltrawork) {
|
|
103821
|
+
explicitUltraworkSessions.set(sessionID, { ...activeUltrawork, needsRestoration: true });
|
|
103822
|
+
}
|
|
103823
|
+
return;
|
|
103824
|
+
}
|
|
103681
103825
|
clearDefaultModeUltraworkInjectedSession(sessionID);
|
|
103826
|
+
explicitUltraworkSessions.delete(sessionID);
|
|
103827
|
+
}
|
|
103682
103828
|
},
|
|
103683
103829
|
dispose: () => {
|
|
103684
103830
|
clearAllDefaultModeUltraworkInjectedSessions();
|
|
103831
|
+
explicitUltraworkSessions.clear();
|
|
103685
103832
|
}
|
|
103686
103833
|
};
|
|
103687
103834
|
}
|
|
@@ -105070,35 +105217,35 @@ import { mkdirSync as mkdirSync17, readFileSync as readFileSync45, renameSync as
|
|
|
105070
105217
|
import { join as join82 } from "path";
|
|
105071
105218
|
|
|
105072
105219
|
// packages/omo-opencode/src/hooks/goal/types.ts
|
|
105073
|
-
import { z as
|
|
105220
|
+
import { z as z52 } from "zod";
|
|
105074
105221
|
var GOAL_STATUS_VALUES = ["active", "paused", "complete"];
|
|
105075
|
-
var GoalStatusSchema =
|
|
105076
|
-
var GoalSchema =
|
|
105077
|
-
id:
|
|
105078
|
-
sessionID:
|
|
105079
|
-
objective:
|
|
105222
|
+
var GoalStatusSchema = z52.enum(GOAL_STATUS_VALUES);
|
|
105223
|
+
var GoalSchema = z52.object({
|
|
105224
|
+
id: z52.string(),
|
|
105225
|
+
sessionID: z52.string(),
|
|
105226
|
+
objective: z52.string(),
|
|
105080
105227
|
status: GoalStatusSchema,
|
|
105081
|
-
tokensUsed:
|
|
105082
|
-
timeUsedSeconds:
|
|
105083
|
-
createdAt:
|
|
105084
|
-
updatedAt:
|
|
105085
|
-
lastStartedAt:
|
|
105086
|
-
completedAt:
|
|
105228
|
+
tokensUsed: z52.number().int().nonnegative(),
|
|
105229
|
+
timeUsedSeconds: z52.number().int().nonnegative(),
|
|
105230
|
+
createdAt: z52.number().int().nonnegative(),
|
|
105231
|
+
updatedAt: z52.number().int().nonnegative(),
|
|
105232
|
+
lastStartedAt: z52.number().int().nonnegative().optional(),
|
|
105233
|
+
completedAt: z52.number().int().nonnegative().optional()
|
|
105087
105234
|
});
|
|
105088
|
-
var GoalFileSchema =
|
|
105089
|
-
version:
|
|
105235
|
+
var GoalFileSchema = z52.object({
|
|
105236
|
+
version: z52.literal(1),
|
|
105090
105237
|
goal: GoalSchema.nullable()
|
|
105091
105238
|
});
|
|
105092
|
-
var GoalToolSnapshotSchema =
|
|
105093
|
-
sessionID:
|
|
105094
|
-
objective:
|
|
105239
|
+
var GoalToolSnapshotSchema = z52.object({
|
|
105240
|
+
sessionID: z52.string(),
|
|
105241
|
+
objective: z52.string(),
|
|
105095
105242
|
status: GoalStatusSchema,
|
|
105096
|
-
tokensUsed:
|
|
105097
|
-
timeUsedSeconds:
|
|
105098
|
-
createdAt:
|
|
105099
|
-
updatedAt:
|
|
105243
|
+
tokensUsed: z52.number().int().nonnegative(),
|
|
105244
|
+
timeUsedSeconds: z52.number().int().nonnegative(),
|
|
105245
|
+
createdAt: z52.number().int().nonnegative(),
|
|
105246
|
+
updatedAt: z52.number().int().nonnegative()
|
|
105100
105247
|
});
|
|
105101
|
-
var GoalToolResponseSchema =
|
|
105248
|
+
var GoalToolResponseSchema = z52.object({
|
|
105102
105249
|
goal: GoalToolSnapshotSchema.nullable()
|
|
105103
105250
|
});
|
|
105104
105251
|
|
|
@@ -113354,7 +113501,14 @@ async function resolveRecentPromptContextForSession(ctx, sessionID, deps = defau
|
|
|
113354
113501
|
};
|
|
113355
113502
|
}
|
|
113356
113503
|
if (info?.providerID && info?.modelID) {
|
|
113357
|
-
return {
|
|
113504
|
+
return {
|
|
113505
|
+
model: {
|
|
113506
|
+
providerID: info.providerID,
|
|
113507
|
+
modelID: info.modelID,
|
|
113508
|
+
...info.variant ? { variant: info.variant } : {}
|
|
113509
|
+
},
|
|
113510
|
+
tools
|
|
113511
|
+
};
|
|
113358
113512
|
}
|
|
113359
113513
|
}
|
|
113360
113514
|
} catch (error) {
|
|
@@ -116577,6 +116731,7 @@ function getMessageInfo(value) {
|
|
|
116577
116731
|
model,
|
|
116578
116732
|
providerID: typeof info.providerID === "string" ? info.providerID : undefined,
|
|
116579
116733
|
modelID: typeof info.modelID === "string" ? info.modelID : undefined,
|
|
116734
|
+
variant: typeof info.variant === "string" ? info.variant : undefined,
|
|
116580
116735
|
tools: isRecord(info.tools) ? Object.entries(info.tools).reduce((acc, [key, value]) => {
|
|
116581
116736
|
if (value === true || value === false || value === "allow" || value === "deny" || value === "ask") {
|
|
116582
116737
|
acc[key] = value;
|
|
@@ -116672,7 +116827,11 @@ async function resolveMainSessionTarget(ctx, sessionID) {
|
|
|
116672
116827
|
const info = getMessageInfo(messages[i]);
|
|
116673
116828
|
if (info?.agent || info?.model || info?.providerID && info?.modelID) {
|
|
116674
116829
|
agent = agent ?? info?.agent;
|
|
116675
|
-
model = info?.model ?? (info?.providerID && info?.modelID ? {
|
|
116830
|
+
model = info?.model ?? (info?.providerID && info?.modelID ? {
|
|
116831
|
+
providerID: info.providerID,
|
|
116832
|
+
modelID: info.modelID,
|
|
116833
|
+
...info.variant ? { variant: info.variant } : {}
|
|
116834
|
+
} : undefined);
|
|
116676
116835
|
tools = resolveInheritedPromptTools(sessionID, info?.tools) ?? tools;
|
|
116677
116836
|
break;
|
|
116678
116837
|
}
|
|
@@ -122614,11 +122773,11 @@ function createMonitorStatusInjectorHook(monitorManager, config) {
|
|
|
122614
122773
|
import { resolve as resolve25 } from "path";
|
|
122615
122774
|
|
|
122616
122775
|
// node_modules/.bun/@opencode-ai+plugin@1.18.22+5df5880790e6b42e/node_modules/@opencode-ai/plugin/dist/tool.js
|
|
122617
|
-
import { z as
|
|
122776
|
+
import { z as z53 } from "zod";
|
|
122618
122777
|
function tool(input) {
|
|
122619
122778
|
return input;
|
|
122620
122779
|
}
|
|
122621
|
-
tool.schema =
|
|
122780
|
+
tool.schema = z53;
|
|
122622
122781
|
|
|
122623
122782
|
// packages/omo-opencode/src/shared/ripgrep-cli.ts
|
|
122624
122783
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
@@ -129573,6 +129732,7 @@ async function executeSyncContinuation(args, ctx, executorCtx, parentContext, de
|
|
|
129573
129732
|
throw new Error("task_id is required to continue a sync task");
|
|
129574
129733
|
}
|
|
129575
129734
|
cancelSyncSessionDeletion(continuationID);
|
|
129735
|
+
const detachFromManager = executorCtx.manager?.attachSyncContinuation?.(continuationID);
|
|
129576
129736
|
const taskId = `resume_sync_${continuationID.slice(0, 8)}`;
|
|
129577
129737
|
const startTime = new Date;
|
|
129578
129738
|
if (toastManager) {
|
|
@@ -129644,6 +129804,7 @@ async function executeSyncContinuation(args, ctx, executorCtx, parentContext, de
|
|
|
129644
129804
|
toastManager.removeTask(taskId);
|
|
129645
129805
|
}
|
|
129646
129806
|
const errorMessage = promptError instanceof Error ? promptError.message : String(promptError);
|
|
129807
|
+
detachFromManager?.();
|
|
129647
129808
|
scheduleSyncSessionDeletion(client, continuationID);
|
|
129648
129809
|
return `Failed to send continuation prompt: ${errorMessage}
|
|
129649
129810
|
|
|
@@ -129718,6 +129879,7 @@ ${buildTaskMetadataBlock({
|
|
|
129718
129879
|
});
|
|
129719
129880
|
}
|
|
129720
129881
|
}
|
|
129882
|
+
detachFromManager?.();
|
|
129721
129883
|
scheduleSyncSessionDeletion(client, continuationID);
|
|
129722
129884
|
}
|
|
129723
129885
|
}
|
|
@@ -131731,55 +131893,55 @@ function isExplicitSyncRun(runInBackground) {
|
|
|
131731
131893
|
import { join as join114 } from "path";
|
|
131732
131894
|
|
|
131733
131895
|
// packages/omo-opencode/src/tools/task/types.ts
|
|
131734
|
-
import { z as
|
|
131735
|
-
var TaskStatusSchema =
|
|
131736
|
-
var TaskObjectSchema =
|
|
131737
|
-
id:
|
|
131738
|
-
subject:
|
|
131739
|
-
description:
|
|
131896
|
+
import { z as z54 } from "zod";
|
|
131897
|
+
var TaskStatusSchema = z54.enum(["pending", "in_progress", "completed", "deleted"]);
|
|
131898
|
+
var TaskObjectSchema = z54.object({
|
|
131899
|
+
id: z54.string(),
|
|
131900
|
+
subject: z54.string(),
|
|
131901
|
+
description: z54.string(),
|
|
131740
131902
|
status: TaskStatusSchema,
|
|
131741
|
-
activeForm:
|
|
131742
|
-
blocks:
|
|
131743
|
-
blockedBy:
|
|
131744
|
-
owner:
|
|
131745
|
-
metadata:
|
|
131746
|
-
repoURL:
|
|
131747
|
-
parentID:
|
|
131748
|
-
threadID:
|
|
131903
|
+
activeForm: z54.string().optional(),
|
|
131904
|
+
blocks: z54.array(z54.string()).default([]),
|
|
131905
|
+
blockedBy: z54.array(z54.string()).default([]),
|
|
131906
|
+
owner: z54.string().optional(),
|
|
131907
|
+
metadata: z54.record(z54.string(), z54.unknown()).optional(),
|
|
131908
|
+
repoURL: z54.string().optional(),
|
|
131909
|
+
parentID: z54.string().optional(),
|
|
131910
|
+
threadID: z54.string()
|
|
131749
131911
|
}).strict();
|
|
131750
|
-
var TaskCreateInputSchema =
|
|
131751
|
-
subject:
|
|
131752
|
-
description:
|
|
131753
|
-
activeForm:
|
|
131754
|
-
blocks:
|
|
131755
|
-
blockedBy:
|
|
131756
|
-
owner:
|
|
131757
|
-
metadata:
|
|
131758
|
-
repoURL:
|
|
131759
|
-
parentID:
|
|
131912
|
+
var TaskCreateInputSchema = z54.object({
|
|
131913
|
+
subject: z54.string(),
|
|
131914
|
+
description: z54.string().optional(),
|
|
131915
|
+
activeForm: z54.string().optional(),
|
|
131916
|
+
blocks: z54.array(z54.string()).optional(),
|
|
131917
|
+
blockedBy: z54.array(z54.string()).optional(),
|
|
131918
|
+
owner: z54.string().optional(),
|
|
131919
|
+
metadata: z54.record(z54.string(), z54.unknown()).optional(),
|
|
131920
|
+
repoURL: z54.string().optional(),
|
|
131921
|
+
parentID: z54.string().optional()
|
|
131760
131922
|
});
|
|
131761
|
-
var TaskListInputSchema =
|
|
131923
|
+
var TaskListInputSchema = z54.object({
|
|
131762
131924
|
status: TaskStatusSchema.optional(),
|
|
131763
|
-
parentID:
|
|
131925
|
+
parentID: z54.string().optional()
|
|
131764
131926
|
});
|
|
131765
|
-
var TaskGetInputSchema =
|
|
131766
|
-
id:
|
|
131927
|
+
var TaskGetInputSchema = z54.object({
|
|
131928
|
+
id: z54.string()
|
|
131767
131929
|
});
|
|
131768
|
-
var TaskUpdateInputSchema =
|
|
131769
|
-
id:
|
|
131770
|
-
subject:
|
|
131771
|
-
description:
|
|
131930
|
+
var TaskUpdateInputSchema = z54.object({
|
|
131931
|
+
id: z54.string(),
|
|
131932
|
+
subject: z54.string().optional(),
|
|
131933
|
+
description: z54.string().optional(),
|
|
131772
131934
|
status: TaskStatusSchema.optional(),
|
|
131773
|
-
activeForm:
|
|
131774
|
-
addBlocks:
|
|
131775
|
-
addBlockedBy:
|
|
131776
|
-
owner:
|
|
131777
|
-
metadata:
|
|
131778
|
-
repoURL:
|
|
131779
|
-
parentID:
|
|
131935
|
+
activeForm: z54.string().optional(),
|
|
131936
|
+
addBlocks: z54.array(z54.string()).optional(),
|
|
131937
|
+
addBlockedBy: z54.array(z54.string()).optional(),
|
|
131938
|
+
owner: z54.string().optional(),
|
|
131939
|
+
metadata: z54.record(z54.string(), z54.unknown()).optional(),
|
|
131940
|
+
repoURL: z54.string().optional(),
|
|
131941
|
+
parentID: z54.string().optional()
|
|
131780
131942
|
});
|
|
131781
|
-
var TaskDeleteInputSchema =
|
|
131782
|
-
id:
|
|
131943
|
+
var TaskDeleteInputSchema = z54.object({
|
|
131944
|
+
id: z54.string()
|
|
131783
131945
|
});
|
|
131784
131946
|
|
|
131785
131947
|
// packages/omo-opencode/src/features/claude-tasks/storage.ts
|
|
@@ -131857,21 +132019,39 @@ function writeJsonAtomic(filePath, data) {
|
|
|
131857
132019
|
}
|
|
131858
132020
|
}
|
|
131859
132021
|
var STALE_LOCK_THRESHOLD_MS = 30000;
|
|
132022
|
+
var DEFAULT_LOCK_WAIT_TIMEOUT_MS = 5000;
|
|
132023
|
+
var DEFAULT_LOCK_RETRY_DELAY_MS = 10;
|
|
132024
|
+
var MAX_LOCK_RETRY_DELAY_MS = 50;
|
|
132025
|
+
function resolveLockWaitTimeoutMs() {
|
|
132026
|
+
const raw = process.env.OMO_TASK_LOCK_WAIT_TIMEOUT_MS?.trim();
|
|
132027
|
+
if (!raw)
|
|
132028
|
+
return DEFAULT_LOCK_WAIT_TIMEOUT_MS;
|
|
132029
|
+
const parsed = Number(raw);
|
|
132030
|
+
if (!Number.isFinite(parsed) || parsed < 0)
|
|
132031
|
+
return DEFAULT_LOCK_WAIT_TIMEOUT_MS;
|
|
132032
|
+
return parsed;
|
|
132033
|
+
}
|
|
132034
|
+
function delay5(ms) {
|
|
132035
|
+
return new Promise((resolve) => {
|
|
132036
|
+
setTimeout(resolve, ms);
|
|
132037
|
+
});
|
|
132038
|
+
}
|
|
131860
132039
|
function generateTaskId() {
|
|
131861
132040
|
return `T-${randomUUID9()}`;
|
|
131862
132041
|
}
|
|
131863
|
-
function acquireLock2(dirPath) {
|
|
132042
|
+
async function acquireLock2(dirPath, options = {}) {
|
|
131864
132043
|
const lockPath = join113(dirPath, ".lock");
|
|
131865
132044
|
const lockId = randomUUID9();
|
|
132045
|
+
const waitTimeoutMs = options.waitTimeoutMs ?? resolveLockWaitTimeoutMs();
|
|
132046
|
+
const baseRetryDelayMs = options.retryDelayMs ?? DEFAULT_LOCK_RETRY_DELAY_MS;
|
|
131866
132047
|
const createLock = (timestamp) => {
|
|
131867
132048
|
writeFileSync22(lockPath, JSON.stringify({ id: lockId, timestamp }), {
|
|
131868
132049
|
encoding: "utf-8",
|
|
131869
132050
|
flag: "wx"
|
|
131870
132051
|
});
|
|
131871
132052
|
};
|
|
131872
|
-
const isStale = () => {
|
|
132053
|
+
const isStale = (lockContent) => {
|
|
131873
132054
|
try {
|
|
131874
|
-
const lockContent = readFileSync62(lockPath, "utf-8");
|
|
131875
132055
|
const lockData = JSON.parse(lockContent);
|
|
131876
132056
|
const lockAge = Date.now() - lockData.timestamp;
|
|
131877
132057
|
return lockAge > STALE_LOCK_THRESHOLD_MS;
|
|
@@ -131880,6 +132060,25 @@ function acquireLock2(dirPath) {
|
|
|
131880
132060
|
return true;
|
|
131881
132061
|
}
|
|
131882
132062
|
};
|
|
132063
|
+
const reclaimStaleLock = () => {
|
|
132064
|
+
let snapshot;
|
|
132065
|
+
try {
|
|
132066
|
+
snapshot = readFileSync62(lockPath, "utf-8");
|
|
132067
|
+
} catch (error) {
|
|
132068
|
+
ignoreClaudeTaskStorageError(error);
|
|
132069
|
+
return true;
|
|
132070
|
+
}
|
|
132071
|
+
if (!isStale(snapshot))
|
|
132072
|
+
return false;
|
|
132073
|
+
try {
|
|
132074
|
+
if (readFileSync62(lockPath, "utf-8") !== snapshot)
|
|
132075
|
+
return false;
|
|
132076
|
+
unlinkSync16(lockPath);
|
|
132077
|
+
} catch (error) {
|
|
132078
|
+
ignoreClaudeTaskStorageError(error);
|
|
132079
|
+
}
|
|
132080
|
+
return true;
|
|
132081
|
+
};
|
|
131883
132082
|
const tryAcquire = () => {
|
|
131884
132083
|
const now = Date.now();
|
|
131885
132084
|
try {
|
|
@@ -131892,15 +132091,27 @@ function acquireLock2(dirPath) {
|
|
|
131892
132091
|
throw error;
|
|
131893
132092
|
}
|
|
131894
132093
|
};
|
|
132094
|
+
const nextDelayMs = (attempt, deadline) => {
|
|
132095
|
+
const cap = Math.max(MAX_LOCK_RETRY_DELAY_MS, baseRetryDelayMs);
|
|
132096
|
+
const step = Math.min(baseRetryDelayMs * 2 ** attempt, cap);
|
|
132097
|
+
const jittered = step / 2 + Math.random() * (step / 2);
|
|
132098
|
+
return Math.max(1, Math.min(jittered, deadline - Date.now()));
|
|
132099
|
+
};
|
|
131895
132100
|
ensureDir(dirPath);
|
|
131896
|
-
|
|
131897
|
-
|
|
131898
|
-
|
|
131899
|
-
|
|
131900
|
-
|
|
131901
|
-
|
|
132101
|
+
const deadline = Date.now() + waitTimeoutMs;
|
|
132102
|
+
let acquired = false;
|
|
132103
|
+
for (let attempt = 0;; attempt++) {
|
|
132104
|
+
if (tryAcquire()) {
|
|
132105
|
+
acquired = true;
|
|
132106
|
+
break;
|
|
132107
|
+
}
|
|
132108
|
+
if (reclaimStaleLock() && tryAcquire()) {
|
|
132109
|
+
acquired = true;
|
|
132110
|
+
break;
|
|
131902
132111
|
}
|
|
131903
|
-
|
|
132112
|
+
if (Date.now() >= deadline)
|
|
132113
|
+
break;
|
|
132114
|
+
await delay5(nextDelayMs(attempt, deadline));
|
|
131904
132115
|
}
|
|
131905
132116
|
if (!acquired) {
|
|
131906
132117
|
return {
|
|
@@ -132059,10 +132270,11 @@ async function handleCreate(args, config, ctx, context) {
|
|
|
132059
132270
|
try {
|
|
132060
132271
|
const validatedArgs = TaskCreateInputSchema.parse(args);
|
|
132061
132272
|
const taskDir = getTaskDir(config);
|
|
132062
|
-
const lock = acquireLock2(taskDir);
|
|
132273
|
+
const lock = await acquireLock2(taskDir);
|
|
132063
132274
|
if (!lock.acquired) {
|
|
132064
|
-
return JSON.stringify({ error: "task_lock_unavailable" });
|
|
132275
|
+
return JSON.stringify({ error: "task_lock_unavailable", retryable: true });
|
|
132065
132276
|
}
|
|
132277
|
+
let validatedTask;
|
|
132066
132278
|
try {
|
|
132067
132279
|
const taskId = generateTaskId();
|
|
132068
132280
|
const task = {
|
|
@@ -132078,18 +132290,18 @@ async function handleCreate(args, config, ctx, context) {
|
|
|
132078
132290
|
parentID: validatedArgs.parentID,
|
|
132079
132291
|
threadID: context.sessionID
|
|
132080
132292
|
};
|
|
132081
|
-
|
|
132293
|
+
validatedTask = TaskObjectSchema.parse(task);
|
|
132082
132294
|
writeJsonAtomic(join114(taskDir, `${taskId}.json`), validatedTask);
|
|
132083
|
-
await syncTaskTodoUpdate(ctx, validatedTask, context.sessionID);
|
|
132084
|
-
return JSON.stringify({
|
|
132085
|
-
task: {
|
|
132086
|
-
id: validatedTask.id,
|
|
132087
|
-
subject: validatedTask.subject
|
|
132088
|
-
}
|
|
132089
|
-
});
|
|
132090
132295
|
} finally {
|
|
132091
132296
|
lock.release();
|
|
132092
132297
|
}
|
|
132298
|
+
await syncTaskTodoUpdate(ctx, validatedTask, context.sessionID);
|
|
132299
|
+
return JSON.stringify({
|
|
132300
|
+
task: {
|
|
132301
|
+
id: validatedTask.id,
|
|
132302
|
+
subject: validatedTask.subject
|
|
132303
|
+
}
|
|
132304
|
+
});
|
|
132093
132305
|
} catch (error) {
|
|
132094
132306
|
if (error instanceof Error && error.message.includes("Required")) {
|
|
132095
132307
|
return JSON.stringify({
|
|
@@ -132223,6 +132435,44 @@ Properly managed dependencies enable maximum parallel execution.`,
|
|
|
132223
132435
|
}
|
|
132224
132436
|
});
|
|
132225
132437
|
}
|
|
132438
|
+
function applyTaskUpdate(taskPath, input) {
|
|
132439
|
+
const task = readJsonSafe(taskPath, TaskObjectSchema);
|
|
132440
|
+
if (!task) {
|
|
132441
|
+
return null;
|
|
132442
|
+
}
|
|
132443
|
+
if (input.subject !== undefined) {
|
|
132444
|
+
task.subject = input.subject;
|
|
132445
|
+
}
|
|
132446
|
+
if (input.description !== undefined) {
|
|
132447
|
+
task.description = input.description;
|
|
132448
|
+
}
|
|
132449
|
+
if (input.status !== undefined) {
|
|
132450
|
+
task.status = input.status;
|
|
132451
|
+
}
|
|
132452
|
+
if (input.activeForm !== undefined) {
|
|
132453
|
+
task.activeForm = input.activeForm;
|
|
132454
|
+
}
|
|
132455
|
+
if (input.owner !== undefined) {
|
|
132456
|
+
task.owner = input.owner;
|
|
132457
|
+
}
|
|
132458
|
+
if (input.addBlocks) {
|
|
132459
|
+
task.blocks = [...new Set([...task.blocks, ...input.addBlocks])];
|
|
132460
|
+
}
|
|
132461
|
+
if (input.addBlockedBy) {
|
|
132462
|
+
task.blockedBy = [...new Set([...task.blockedBy, ...input.addBlockedBy])];
|
|
132463
|
+
}
|
|
132464
|
+
if (input.metadata !== undefined) {
|
|
132465
|
+
task.metadata = { ...task.metadata, ...input.metadata };
|
|
132466
|
+
Object.keys(task.metadata).forEach((key) => {
|
|
132467
|
+
if (task.metadata?.[key] === null) {
|
|
132468
|
+
delete task.metadata[key];
|
|
132469
|
+
}
|
|
132470
|
+
});
|
|
132471
|
+
}
|
|
132472
|
+
const updatedTask = TaskObjectSchema.parse(task);
|
|
132473
|
+
writeJsonAtomic(taskPath, updatedTask);
|
|
132474
|
+
return updatedTask;
|
|
132475
|
+
}
|
|
132226
132476
|
async function handleUpdate(args, config, ctx, context) {
|
|
132227
132477
|
try {
|
|
132228
132478
|
const validatedArgs = TaskUpdateInputSchema.parse(args);
|
|
@@ -132231,54 +132481,21 @@ async function handleUpdate(args, config, ctx, context) {
|
|
|
132231
132481
|
return JSON.stringify({ error: "invalid_task_id" });
|
|
132232
132482
|
}
|
|
132233
132483
|
const taskDir = getTaskDir(config);
|
|
132234
|
-
const lock = acquireLock2(taskDir);
|
|
132484
|
+
const lock = await acquireLock2(taskDir);
|
|
132235
132485
|
if (!lock.acquired) {
|
|
132236
|
-
return JSON.stringify({ error: "task_lock_unavailable" });
|
|
132486
|
+
return JSON.stringify({ error: "task_lock_unavailable", retryable: true });
|
|
132237
132487
|
}
|
|
132488
|
+
let updatedTask = null;
|
|
132238
132489
|
try {
|
|
132239
|
-
|
|
132240
|
-
const task = readJsonSafe(taskPath, TaskObjectSchema);
|
|
132241
|
-
if (!task) {
|
|
132242
|
-
return JSON.stringify({ error: "task_not_found" });
|
|
132243
|
-
}
|
|
132244
|
-
if (validatedArgs.subject !== undefined) {
|
|
132245
|
-
task.subject = validatedArgs.subject;
|
|
132246
|
-
}
|
|
132247
|
-
if (validatedArgs.description !== undefined) {
|
|
132248
|
-
task.description = validatedArgs.description;
|
|
132249
|
-
}
|
|
132250
|
-
if (validatedArgs.status !== undefined) {
|
|
132251
|
-
task.status = validatedArgs.status;
|
|
132252
|
-
}
|
|
132253
|
-
if (validatedArgs.activeForm !== undefined) {
|
|
132254
|
-
task.activeForm = validatedArgs.activeForm;
|
|
132255
|
-
}
|
|
132256
|
-
if (validatedArgs.owner !== undefined) {
|
|
132257
|
-
task.owner = validatedArgs.owner;
|
|
132258
|
-
}
|
|
132259
|
-
const addBlocks = args.addBlocks;
|
|
132260
|
-
if (addBlocks) {
|
|
132261
|
-
task.blocks = [...new Set([...task.blocks, ...addBlocks])];
|
|
132262
|
-
}
|
|
132263
|
-
const addBlockedBy = args.addBlockedBy;
|
|
132264
|
-
if (addBlockedBy) {
|
|
132265
|
-
task.blockedBy = [...new Set([...task.blockedBy, ...addBlockedBy])];
|
|
132266
|
-
}
|
|
132267
|
-
if (validatedArgs.metadata !== undefined) {
|
|
132268
|
-
task.metadata = { ...task.metadata, ...validatedArgs.metadata };
|
|
132269
|
-
Object.keys(task.metadata).forEach((key) => {
|
|
132270
|
-
if (task.metadata?.[key] === null) {
|
|
132271
|
-
delete task.metadata[key];
|
|
132272
|
-
}
|
|
132273
|
-
});
|
|
132274
|
-
}
|
|
132275
|
-
const validatedTask = TaskObjectSchema.parse(task);
|
|
132276
|
-
writeJsonAtomic(taskPath, validatedTask);
|
|
132277
|
-
await syncTaskTodoUpdate(ctx, validatedTask, context.sessionID);
|
|
132278
|
-
return JSON.stringify({ task: validatedTask });
|
|
132490
|
+
updatedTask = applyTaskUpdate(join117(taskDir, `${taskId}.json`), validatedArgs);
|
|
132279
132491
|
} finally {
|
|
132280
132492
|
lock.release();
|
|
132281
132493
|
}
|
|
132494
|
+
if (!updatedTask) {
|
|
132495
|
+
return JSON.stringify({ error: "task_not_found" });
|
|
132496
|
+
}
|
|
132497
|
+
await syncTaskTodoUpdate(ctx, updatedTask, context.sessionID);
|
|
132498
|
+
return JSON.stringify({ task: updatedTask });
|
|
132282
132499
|
} catch (error) {
|
|
132283
132500
|
if (error instanceof Error && error.message.includes("Required")) {
|
|
132284
132501
|
return JSON.stringify({
|
|
@@ -132625,7 +132842,7 @@ function createHashlineEditTool(ctx) {
|
|
|
132625
132842
|
// packages/omo-opencode/src/features/team-mode/tools/messaging.ts
|
|
132626
132843
|
import { randomUUID as randomUUID10 } from "crypto";
|
|
132627
132844
|
init_logger2();
|
|
132628
|
-
import { z as
|
|
132845
|
+
import { z as z55 } from "zod";
|
|
132629
132846
|
|
|
132630
132847
|
// packages/team-core/src/team-mailbox/send.ts
|
|
132631
132848
|
init_paths();
|
|
@@ -133206,18 +133423,18 @@ async function resolveTeamRuntimeDetails(teamRunId, sessionID, config, deps) {
|
|
|
133206
133423
|
|
|
133207
133424
|
// packages/omo-opencode/src/features/team-mode/tools/messaging.ts
|
|
133208
133425
|
var MESSAGE_TOOL_KINDS = ["message", "announcement"];
|
|
133209
|
-
var TeamReferenceArgsSchema =
|
|
133210
|
-
path:
|
|
133211
|
-
description:
|
|
133426
|
+
var TeamReferenceArgsSchema = z55.object({
|
|
133427
|
+
path: z55.string().min(1),
|
|
133428
|
+
description: z55.string().optional()
|
|
133212
133429
|
});
|
|
133213
|
-
var TeamSendMessageArgsSchema =
|
|
133214
|
-
teamRunId:
|
|
133215
|
-
to:
|
|
133216
|
-
body:
|
|
133217
|
-
kind:
|
|
133218
|
-
correlationId:
|
|
133219
|
-
summary:
|
|
133220
|
-
references:
|
|
133430
|
+
var TeamSendMessageArgsSchema = z55.object({
|
|
133431
|
+
teamRunId: z55.string().min(1),
|
|
133432
|
+
to: z55.string().min(1),
|
|
133433
|
+
body: z55.string(),
|
|
133434
|
+
kind: z55.enum(MESSAGE_TOOL_KINDS).optional(),
|
|
133435
|
+
correlationId: z55.preprocess((value) => value === "" ? undefined : value, z55.uuid().optional()),
|
|
133436
|
+
summary: z55.string().optional(),
|
|
133437
|
+
references: z55.array(TeamReferenceArgsSchema).optional()
|
|
133221
133438
|
});
|
|
133222
133439
|
function createTeamSendMessageTool(config, client, deps = defaultTeamSendMessageToolDeps) {
|
|
133223
133440
|
return tool({
|
|
@@ -134858,6 +135075,7 @@ async function tryFallbackRetry(args) {
|
|
|
134858
135075
|
sessionPermission: task.sessionPermission,
|
|
134859
135076
|
category: task.category,
|
|
134860
135077
|
isUnstableAgent: task.isUnstableAgent,
|
|
135078
|
+
cwd: task.cwd,
|
|
134861
135079
|
onSessionCreated: task.onSessionCreated
|
|
134862
135080
|
};
|
|
134863
135081
|
if (previousSessionID) {
|
|
@@ -137330,6 +137548,7 @@ class BackgroundManager {
|
|
|
137330
137548
|
queuesByKey = new Map;
|
|
137331
137549
|
processingKeys = new Set;
|
|
137332
137550
|
completionTimers = new Map;
|
|
137551
|
+
syncAttachedSessions = new Set;
|
|
137333
137552
|
completedTaskArchive = new Map;
|
|
137334
137553
|
completedTaskSummaries = new Map;
|
|
137335
137554
|
idleDeferralTimers = new Map;
|
|
@@ -137636,6 +137855,7 @@ class BackgroundManager {
|
|
|
137636
137855
|
sessionPermission: input.sessionPermission,
|
|
137637
137856
|
attemptCount: 0,
|
|
137638
137857
|
category: input.category,
|
|
137858
|
+
cwd: input.cwd,
|
|
137639
137859
|
onSessionCreated: input.onSessionCreated
|
|
137640
137860
|
};
|
|
137641
137861
|
const firstAttempt = startAttempt(task, input.model);
|
|
@@ -137750,7 +137970,8 @@ class BackgroundManager {
|
|
|
137750
137970
|
return null;
|
|
137751
137971
|
});
|
|
137752
137972
|
const parentDirectory = parentSession?.data?.directory ?? this.directory;
|
|
137753
|
-
|
|
137973
|
+
const childDirectory = input.cwd ?? parentDirectory;
|
|
137974
|
+
log2(`[background-agent] Parent dir: ${parentSession?.data?.directory}, using: ${childDirectory}`);
|
|
137754
137975
|
const createResult = await this.client.session.create({
|
|
137755
137976
|
body: {
|
|
137756
137977
|
parentID: input.parentSessionId,
|
|
@@ -137765,7 +137986,7 @@ class BackgroundManager {
|
|
|
137765
137986
|
} : {}
|
|
137766
137987
|
},
|
|
137767
137988
|
query: {
|
|
137768
|
-
directory:
|
|
137989
|
+
directory: childDirectory
|
|
137769
137990
|
}
|
|
137770
137991
|
});
|
|
137771
137992
|
if (createResult.error) {
|
|
@@ -137816,7 +138037,7 @@ class BackgroundManager {
|
|
|
137816
138037
|
task.concurrencyGroup = concurrencyKey;
|
|
137817
138038
|
if (task.retryNotification) {
|
|
137818
138039
|
const attemptNumber = boundAttempt.attemptNumber;
|
|
137819
|
-
const retrySessionUrl = buildLocalSessionUrl(
|
|
138040
|
+
const retrySessionUrl = buildLocalSessionUrl(childDirectory, sessionID);
|
|
137820
138041
|
const previousAttempt = getPreviousAttempt(task, boundAttempt.attemptId);
|
|
137821
138042
|
const failedSessionID = previousAttempt?.sessionId ?? task.retryNotification.previousSessionID;
|
|
137822
138043
|
const failedSessionLine = failedSessionID ? `
|
|
@@ -137901,7 +138122,7 @@ The fallback retry session is now created and can be inspected directly.
|
|
|
137901
138122
|
promptWithRetryInDirectory(this.client, {
|
|
137902
138123
|
path: { id: sessionID },
|
|
137903
138124
|
body: promptBody
|
|
137904
|
-
},
|
|
138125
|
+
}, childDirectory).catch(async (error) => {
|
|
137905
138126
|
if (isAgentNotFoundError(error) && input.agent !== FALLBACK_AGENT) {
|
|
137906
138127
|
log2("[background-agent] Agent not found, retrying with fallback agent", {
|
|
137907
138128
|
original: input.agent,
|
|
@@ -137927,7 +138148,7 @@ The fallback retry session is now created and can be inspected directly.
|
|
|
137927
138148
|
await promptWithRetryInDirectory(this.client, {
|
|
137928
138149
|
path: { id: sessionID },
|
|
137929
138150
|
body: fallbackBody
|
|
137930
|
-
},
|
|
138151
|
+
}, childDirectory);
|
|
137931
138152
|
task.agent = FALLBACK_AGENT;
|
|
137932
138153
|
return;
|
|
137933
138154
|
} catch (retryError) {
|
|
@@ -138057,6 +138278,19 @@ The fallback retry session is now created and can be inspected directly.
|
|
|
138057
138278
|
}
|
|
138058
138279
|
return;
|
|
138059
138280
|
}
|
|
138281
|
+
attachSyncContinuation(sessionID) {
|
|
138282
|
+
this.syncAttachedSessions.add(sessionID);
|
|
138283
|
+
return () => {
|
|
138284
|
+
if (!this.syncAttachedSessions.delete(sessionID))
|
|
138285
|
+
return;
|
|
138286
|
+
const task = this.findBySession(sessionID);
|
|
138287
|
+
if (!task || !TERMINAL_BACKGROUND_TASK_STATUSES.has(task.status))
|
|
138288
|
+
return;
|
|
138289
|
+
if (this.completionTimers.has(task.id))
|
|
138290
|
+
return;
|
|
138291
|
+
this.scheduleTaskRemoval(task.id);
|
|
138292
|
+
};
|
|
138293
|
+
}
|
|
138060
138294
|
resolveTaskAttemptBySession(sessionID) {
|
|
138061
138295
|
const task = this.findBySession(sessionID);
|
|
138062
138296
|
if (!task) {
|
|
@@ -138247,7 +138481,7 @@ The fallback retry session is now created and can be inspected directly.
|
|
|
138247
138481
|
})(),
|
|
138248
138482
|
parts: [createInternalAgentTextPart(input.prompt)]
|
|
138249
138483
|
},
|
|
138250
|
-
query: { directory: this.directory }
|
|
138484
|
+
query: { directory: existingTask.cwd ?? this.directory }
|
|
138251
138485
|
}
|
|
138252
138486
|
}).then((promptResult) => {
|
|
138253
138487
|
if (promptResult.status === "failed") {
|
|
@@ -138984,6 +139218,8 @@ The task was re-queued on a fallback model after a retryable failure.
|
|
|
138984
139218
|
const task = this.tasks.get(taskId);
|
|
138985
139219
|
if (!task)
|
|
138986
139220
|
return;
|
|
139221
|
+
if (task.sessionId && this.syncAttachedSessions.has(task.sessionId))
|
|
139222
|
+
return;
|
|
138987
139223
|
if (task.parentSessionId) {
|
|
138988
139224
|
const siblings = this.getTasksByParentSession(task.parentSessionId);
|
|
138989
139225
|
const runningOrPendingSiblings = siblings.filter((sibling) => sibling.id !== taskId && (sibling.status === "running" || sibling.status === "pending"));
|
|
@@ -139622,6 +139858,7 @@ The task was re-queued on a fallback model after a retryable failure.
|
|
|
139622
139858
|
clearTimeout(timer);
|
|
139623
139859
|
}
|
|
139624
139860
|
this.completionTimers.clear();
|
|
139861
|
+
this.syncAttachedSessions.clear();
|
|
139625
139862
|
for (const timer of this.idleDeferralTimers.values()) {
|
|
139626
139863
|
clearTimeout(timer);
|
|
139627
139864
|
}
|
|
@@ -141843,63 +142080,63 @@ function getLiteralValue(schema) {
|
|
|
141843
142080
|
}
|
|
141844
142081
|
|
|
141845
142082
|
// node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
141846
|
-
import * as
|
|
142083
|
+
import * as z56 from "zod/v4";
|
|
141847
142084
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
141848
142085
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
141849
142086
|
var RELATED_TASK_META_KEY = "io.modelcontextprotocol/related-task";
|
|
141850
142087
|
var JSONRPC_VERSION = "2.0";
|
|
141851
|
-
var AssertObjectSchema =
|
|
141852
|
-
var ProgressTokenSchema =
|
|
141853
|
-
var CursorSchema =
|
|
141854
|
-
var TaskCreationParamsSchema =
|
|
141855
|
-
ttl:
|
|
141856
|
-
pollInterval:
|
|
142088
|
+
var AssertObjectSchema = z56.custom((v) => v !== null && (typeof v === "object" || typeof v === "function"));
|
|
142089
|
+
var ProgressTokenSchema = z56.union([z56.string(), z56.number().int()]);
|
|
142090
|
+
var CursorSchema = z56.string();
|
|
142091
|
+
var TaskCreationParamsSchema = z56.looseObject({
|
|
142092
|
+
ttl: z56.number().optional(),
|
|
142093
|
+
pollInterval: z56.number().optional()
|
|
141857
142094
|
});
|
|
141858
|
-
var TaskMetadataSchema =
|
|
141859
|
-
ttl:
|
|
142095
|
+
var TaskMetadataSchema = z56.object({
|
|
142096
|
+
ttl: z56.number().optional()
|
|
141860
142097
|
});
|
|
141861
|
-
var RelatedTaskMetadataSchema =
|
|
141862
|
-
taskId:
|
|
142098
|
+
var RelatedTaskMetadataSchema = z56.object({
|
|
142099
|
+
taskId: z56.string()
|
|
141863
142100
|
});
|
|
141864
|
-
var RequestMetaSchema =
|
|
142101
|
+
var RequestMetaSchema = z56.looseObject({
|
|
141865
142102
|
progressToken: ProgressTokenSchema.optional(),
|
|
141866
142103
|
[RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
|
|
141867
142104
|
});
|
|
141868
|
-
var BaseRequestParamsSchema =
|
|
142105
|
+
var BaseRequestParamsSchema = z56.object({
|
|
141869
142106
|
_meta: RequestMetaSchema.optional()
|
|
141870
142107
|
});
|
|
141871
142108
|
var TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
141872
142109
|
task: TaskMetadataSchema.optional()
|
|
141873
142110
|
});
|
|
141874
142111
|
var isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
|
|
141875
|
-
var RequestSchema =
|
|
141876
|
-
method:
|
|
142112
|
+
var RequestSchema = z56.object({
|
|
142113
|
+
method: z56.string(),
|
|
141877
142114
|
params: BaseRequestParamsSchema.loose().optional()
|
|
141878
142115
|
});
|
|
141879
|
-
var NotificationsParamsSchema =
|
|
142116
|
+
var NotificationsParamsSchema = z56.object({
|
|
141880
142117
|
_meta: RequestMetaSchema.optional()
|
|
141881
142118
|
});
|
|
141882
|
-
var NotificationSchema =
|
|
141883
|
-
method:
|
|
142119
|
+
var NotificationSchema = z56.object({
|
|
142120
|
+
method: z56.string(),
|
|
141884
142121
|
params: NotificationsParamsSchema.loose().optional()
|
|
141885
142122
|
});
|
|
141886
|
-
var ResultSchema =
|
|
142123
|
+
var ResultSchema = z56.looseObject({
|
|
141887
142124
|
_meta: RequestMetaSchema.optional()
|
|
141888
142125
|
});
|
|
141889
|
-
var RequestIdSchema =
|
|
141890
|
-
var JSONRPCRequestSchema =
|
|
141891
|
-
jsonrpc:
|
|
142126
|
+
var RequestIdSchema = z56.union([z56.string(), z56.number().int()]);
|
|
142127
|
+
var JSONRPCRequestSchema = z56.object({
|
|
142128
|
+
jsonrpc: z56.literal(JSONRPC_VERSION),
|
|
141892
142129
|
id: RequestIdSchema,
|
|
141893
142130
|
...RequestSchema.shape
|
|
141894
142131
|
}).strict();
|
|
141895
142132
|
var isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
|
|
141896
|
-
var JSONRPCNotificationSchema =
|
|
141897
|
-
jsonrpc:
|
|
142133
|
+
var JSONRPCNotificationSchema = z56.object({
|
|
142134
|
+
jsonrpc: z56.literal(JSONRPC_VERSION),
|
|
141898
142135
|
...NotificationSchema.shape
|
|
141899
142136
|
}).strict();
|
|
141900
142137
|
var isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
|
|
141901
|
-
var JSONRPCResultResponseSchema =
|
|
141902
|
-
jsonrpc:
|
|
142138
|
+
var JSONRPCResultResponseSchema = z56.object({
|
|
142139
|
+
jsonrpc: z56.literal(JSONRPC_VERSION),
|
|
141903
142140
|
id: RequestIdSchema,
|
|
141904
142141
|
result: ResultSchema
|
|
141905
142142
|
}).strict();
|
|
@@ -141915,153 +142152,153 @@ var ErrorCode;
|
|
|
141915
142152
|
ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError";
|
|
141916
142153
|
ErrorCode[ErrorCode["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
|
|
141917
142154
|
})(ErrorCode || (ErrorCode = {}));
|
|
141918
|
-
var JSONRPCErrorResponseSchema =
|
|
141919
|
-
jsonrpc:
|
|
142155
|
+
var JSONRPCErrorResponseSchema = z56.object({
|
|
142156
|
+
jsonrpc: z56.literal(JSONRPC_VERSION),
|
|
141920
142157
|
id: RequestIdSchema.optional(),
|
|
141921
|
-
error:
|
|
141922
|
-
code:
|
|
141923
|
-
message:
|
|
141924
|
-
data:
|
|
142158
|
+
error: z56.object({
|
|
142159
|
+
code: z56.number().int(),
|
|
142160
|
+
message: z56.string(),
|
|
142161
|
+
data: z56.unknown().optional()
|
|
141925
142162
|
})
|
|
141926
142163
|
}).strict();
|
|
141927
142164
|
var isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
|
|
141928
|
-
var JSONRPCMessageSchema =
|
|
142165
|
+
var JSONRPCMessageSchema = z56.union([
|
|
141929
142166
|
JSONRPCRequestSchema,
|
|
141930
142167
|
JSONRPCNotificationSchema,
|
|
141931
142168
|
JSONRPCResultResponseSchema,
|
|
141932
142169
|
JSONRPCErrorResponseSchema
|
|
141933
142170
|
]);
|
|
141934
|
-
var JSONRPCResponseSchema =
|
|
142171
|
+
var JSONRPCResponseSchema = z56.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
|
|
141935
142172
|
var EmptyResultSchema = ResultSchema.strict();
|
|
141936
142173
|
var CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
141937
142174
|
requestId: RequestIdSchema.optional(),
|
|
141938
|
-
reason:
|
|
142175
|
+
reason: z56.string().optional()
|
|
141939
142176
|
});
|
|
141940
142177
|
var CancelledNotificationSchema = NotificationSchema.extend({
|
|
141941
|
-
method:
|
|
142178
|
+
method: z56.literal("notifications/cancelled"),
|
|
141942
142179
|
params: CancelledNotificationParamsSchema
|
|
141943
142180
|
});
|
|
141944
|
-
var IconSchema =
|
|
141945
|
-
src:
|
|
141946
|
-
mimeType:
|
|
141947
|
-
sizes:
|
|
141948
|
-
theme:
|
|
142181
|
+
var IconSchema = z56.object({
|
|
142182
|
+
src: z56.string(),
|
|
142183
|
+
mimeType: z56.string().optional(),
|
|
142184
|
+
sizes: z56.array(z56.string()).optional(),
|
|
142185
|
+
theme: z56.enum(["light", "dark"]).optional()
|
|
141949
142186
|
});
|
|
141950
|
-
var IconsSchema =
|
|
141951
|
-
icons:
|
|
142187
|
+
var IconsSchema = z56.object({
|
|
142188
|
+
icons: z56.array(IconSchema).optional()
|
|
141952
142189
|
});
|
|
141953
|
-
var BaseMetadataSchema =
|
|
141954
|
-
name:
|
|
141955
|
-
title:
|
|
142190
|
+
var BaseMetadataSchema = z56.object({
|
|
142191
|
+
name: z56.string(),
|
|
142192
|
+
title: z56.string().optional()
|
|
141956
142193
|
});
|
|
141957
142194
|
var ImplementationSchema = BaseMetadataSchema.extend({
|
|
141958
142195
|
...BaseMetadataSchema.shape,
|
|
141959
142196
|
...IconsSchema.shape,
|
|
141960
|
-
version:
|
|
141961
|
-
websiteUrl:
|
|
141962
|
-
description:
|
|
142197
|
+
version: z56.string(),
|
|
142198
|
+
websiteUrl: z56.string().optional(),
|
|
142199
|
+
description: z56.string().optional()
|
|
141963
142200
|
});
|
|
141964
|
-
var FormElicitationCapabilitySchema =
|
|
141965
|
-
applyDefaults:
|
|
141966
|
-
}),
|
|
141967
|
-
var ElicitationCapabilitySchema =
|
|
142201
|
+
var FormElicitationCapabilitySchema = z56.intersection(z56.object({
|
|
142202
|
+
applyDefaults: z56.boolean().optional()
|
|
142203
|
+
}), z56.record(z56.string(), z56.unknown()));
|
|
142204
|
+
var ElicitationCapabilitySchema = z56.preprocess((value) => {
|
|
141968
142205
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
141969
142206
|
if (Object.keys(value).length === 0) {
|
|
141970
142207
|
return { form: {} };
|
|
141971
142208
|
}
|
|
141972
142209
|
}
|
|
141973
142210
|
return value;
|
|
141974
|
-
},
|
|
142211
|
+
}, z56.intersection(z56.object({
|
|
141975
142212
|
form: FormElicitationCapabilitySchema.optional(),
|
|
141976
142213
|
url: AssertObjectSchema.optional()
|
|
141977
|
-
}),
|
|
141978
|
-
var ClientTasksCapabilitySchema =
|
|
142214
|
+
}), z56.record(z56.string(), z56.unknown()).optional()));
|
|
142215
|
+
var ClientTasksCapabilitySchema = z56.looseObject({
|
|
141979
142216
|
list: AssertObjectSchema.optional(),
|
|
141980
142217
|
cancel: AssertObjectSchema.optional(),
|
|
141981
|
-
requests:
|
|
141982
|
-
sampling:
|
|
142218
|
+
requests: z56.looseObject({
|
|
142219
|
+
sampling: z56.looseObject({
|
|
141983
142220
|
createMessage: AssertObjectSchema.optional()
|
|
141984
142221
|
}).optional(),
|
|
141985
|
-
elicitation:
|
|
142222
|
+
elicitation: z56.looseObject({
|
|
141986
142223
|
create: AssertObjectSchema.optional()
|
|
141987
142224
|
}).optional()
|
|
141988
142225
|
}).optional()
|
|
141989
142226
|
});
|
|
141990
|
-
var ServerTasksCapabilitySchema =
|
|
142227
|
+
var ServerTasksCapabilitySchema = z56.looseObject({
|
|
141991
142228
|
list: AssertObjectSchema.optional(),
|
|
141992
142229
|
cancel: AssertObjectSchema.optional(),
|
|
141993
|
-
requests:
|
|
141994
|
-
tools:
|
|
142230
|
+
requests: z56.looseObject({
|
|
142231
|
+
tools: z56.looseObject({
|
|
141995
142232
|
call: AssertObjectSchema.optional()
|
|
141996
142233
|
}).optional()
|
|
141997
142234
|
}).optional()
|
|
141998
142235
|
});
|
|
141999
|
-
var ClientCapabilitiesSchema =
|
|
142000
|
-
experimental:
|
|
142001
|
-
sampling:
|
|
142236
|
+
var ClientCapabilitiesSchema = z56.object({
|
|
142237
|
+
experimental: z56.record(z56.string(), AssertObjectSchema).optional(),
|
|
142238
|
+
sampling: z56.object({
|
|
142002
142239
|
context: AssertObjectSchema.optional(),
|
|
142003
142240
|
tools: AssertObjectSchema.optional()
|
|
142004
142241
|
}).optional(),
|
|
142005
142242
|
elicitation: ElicitationCapabilitySchema.optional(),
|
|
142006
|
-
roots:
|
|
142007
|
-
listChanged:
|
|
142243
|
+
roots: z56.object({
|
|
142244
|
+
listChanged: z56.boolean().optional()
|
|
142008
142245
|
}).optional(),
|
|
142009
142246
|
tasks: ClientTasksCapabilitySchema.optional(),
|
|
142010
|
-
extensions:
|
|
142247
|
+
extensions: z56.record(z56.string(), AssertObjectSchema).optional()
|
|
142011
142248
|
});
|
|
142012
142249
|
var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
142013
|
-
protocolVersion:
|
|
142250
|
+
protocolVersion: z56.string(),
|
|
142014
142251
|
capabilities: ClientCapabilitiesSchema,
|
|
142015
142252
|
clientInfo: ImplementationSchema
|
|
142016
142253
|
});
|
|
142017
142254
|
var InitializeRequestSchema = RequestSchema.extend({
|
|
142018
|
-
method:
|
|
142255
|
+
method: z56.literal("initialize"),
|
|
142019
142256
|
params: InitializeRequestParamsSchema
|
|
142020
142257
|
});
|
|
142021
|
-
var ServerCapabilitiesSchema =
|
|
142022
|
-
experimental:
|
|
142258
|
+
var ServerCapabilitiesSchema = z56.object({
|
|
142259
|
+
experimental: z56.record(z56.string(), AssertObjectSchema).optional(),
|
|
142023
142260
|
logging: AssertObjectSchema.optional(),
|
|
142024
142261
|
completions: AssertObjectSchema.optional(),
|
|
142025
|
-
prompts:
|
|
142026
|
-
listChanged:
|
|
142262
|
+
prompts: z56.object({
|
|
142263
|
+
listChanged: z56.boolean().optional()
|
|
142027
142264
|
}).optional(),
|
|
142028
|
-
resources:
|
|
142029
|
-
subscribe:
|
|
142030
|
-
listChanged:
|
|
142265
|
+
resources: z56.object({
|
|
142266
|
+
subscribe: z56.boolean().optional(),
|
|
142267
|
+
listChanged: z56.boolean().optional()
|
|
142031
142268
|
}).optional(),
|
|
142032
|
-
tools:
|
|
142033
|
-
listChanged:
|
|
142269
|
+
tools: z56.object({
|
|
142270
|
+
listChanged: z56.boolean().optional()
|
|
142034
142271
|
}).optional(),
|
|
142035
142272
|
tasks: ServerTasksCapabilitySchema.optional(),
|
|
142036
|
-
extensions:
|
|
142273
|
+
extensions: z56.record(z56.string(), AssertObjectSchema).optional()
|
|
142037
142274
|
});
|
|
142038
142275
|
var InitializeResultSchema = ResultSchema.extend({
|
|
142039
|
-
protocolVersion:
|
|
142276
|
+
protocolVersion: z56.string(),
|
|
142040
142277
|
capabilities: ServerCapabilitiesSchema,
|
|
142041
142278
|
serverInfo: ImplementationSchema,
|
|
142042
|
-
instructions:
|
|
142279
|
+
instructions: z56.string().optional()
|
|
142043
142280
|
});
|
|
142044
142281
|
var InitializedNotificationSchema = NotificationSchema.extend({
|
|
142045
|
-
method:
|
|
142282
|
+
method: z56.literal("notifications/initialized"),
|
|
142046
142283
|
params: NotificationsParamsSchema.optional()
|
|
142047
142284
|
});
|
|
142048
142285
|
var isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;
|
|
142049
142286
|
var PingRequestSchema = RequestSchema.extend({
|
|
142050
|
-
method:
|
|
142287
|
+
method: z56.literal("ping"),
|
|
142051
142288
|
params: BaseRequestParamsSchema.optional()
|
|
142052
142289
|
});
|
|
142053
|
-
var ProgressSchema =
|
|
142054
|
-
progress:
|
|
142055
|
-
total:
|
|
142056
|
-
message:
|
|
142290
|
+
var ProgressSchema = z56.object({
|
|
142291
|
+
progress: z56.number(),
|
|
142292
|
+
total: z56.optional(z56.number()),
|
|
142293
|
+
message: z56.optional(z56.string())
|
|
142057
142294
|
});
|
|
142058
|
-
var ProgressNotificationParamsSchema =
|
|
142295
|
+
var ProgressNotificationParamsSchema = z56.object({
|
|
142059
142296
|
...NotificationsParamsSchema.shape,
|
|
142060
142297
|
...ProgressSchema.shape,
|
|
142061
142298
|
progressToken: ProgressTokenSchema
|
|
142062
142299
|
});
|
|
142063
142300
|
var ProgressNotificationSchema = NotificationSchema.extend({
|
|
142064
|
-
method:
|
|
142301
|
+
method: z56.literal("notifications/progress"),
|
|
142065
142302
|
params: ProgressNotificationParamsSchema
|
|
142066
142303
|
});
|
|
142067
142304
|
var PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
@@ -142073,60 +142310,60 @@ var PaginatedRequestSchema = RequestSchema.extend({
|
|
|
142073
142310
|
var PaginatedResultSchema = ResultSchema.extend({
|
|
142074
142311
|
nextCursor: CursorSchema.optional()
|
|
142075
142312
|
});
|
|
142076
|
-
var TaskStatusSchema2 =
|
|
142077
|
-
var TaskSchema2 =
|
|
142078
|
-
taskId:
|
|
142313
|
+
var TaskStatusSchema2 = z56.enum(["working", "input_required", "completed", "failed", "cancelled"]);
|
|
142314
|
+
var TaskSchema2 = z56.object({
|
|
142315
|
+
taskId: z56.string(),
|
|
142079
142316
|
status: TaskStatusSchema2,
|
|
142080
|
-
ttl:
|
|
142081
|
-
createdAt:
|
|
142082
|
-
lastUpdatedAt:
|
|
142083
|
-
pollInterval:
|
|
142084
|
-
statusMessage:
|
|
142317
|
+
ttl: z56.union([z56.number(), z56.null()]),
|
|
142318
|
+
createdAt: z56.string(),
|
|
142319
|
+
lastUpdatedAt: z56.string(),
|
|
142320
|
+
pollInterval: z56.optional(z56.number()),
|
|
142321
|
+
statusMessage: z56.optional(z56.string())
|
|
142085
142322
|
});
|
|
142086
142323
|
var CreateTaskResultSchema = ResultSchema.extend({
|
|
142087
142324
|
task: TaskSchema2
|
|
142088
142325
|
});
|
|
142089
142326
|
var TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema2);
|
|
142090
142327
|
var TaskStatusNotificationSchema = NotificationSchema.extend({
|
|
142091
|
-
method:
|
|
142328
|
+
method: z56.literal("notifications/tasks/status"),
|
|
142092
142329
|
params: TaskStatusNotificationParamsSchema
|
|
142093
142330
|
});
|
|
142094
142331
|
var GetTaskRequestSchema = RequestSchema.extend({
|
|
142095
|
-
method:
|
|
142332
|
+
method: z56.literal("tasks/get"),
|
|
142096
142333
|
params: BaseRequestParamsSchema.extend({
|
|
142097
|
-
taskId:
|
|
142334
|
+
taskId: z56.string()
|
|
142098
142335
|
})
|
|
142099
142336
|
});
|
|
142100
142337
|
var GetTaskResultSchema = ResultSchema.merge(TaskSchema2);
|
|
142101
142338
|
var GetTaskPayloadRequestSchema = RequestSchema.extend({
|
|
142102
|
-
method:
|
|
142339
|
+
method: z56.literal("tasks/result"),
|
|
142103
142340
|
params: BaseRequestParamsSchema.extend({
|
|
142104
|
-
taskId:
|
|
142341
|
+
taskId: z56.string()
|
|
142105
142342
|
})
|
|
142106
142343
|
});
|
|
142107
142344
|
var GetTaskPayloadResultSchema = ResultSchema.loose();
|
|
142108
142345
|
var ListTasksRequestSchema = PaginatedRequestSchema.extend({
|
|
142109
|
-
method:
|
|
142346
|
+
method: z56.literal("tasks/list")
|
|
142110
142347
|
});
|
|
142111
142348
|
var ListTasksResultSchema = PaginatedResultSchema.extend({
|
|
142112
|
-
tasks:
|
|
142349
|
+
tasks: z56.array(TaskSchema2)
|
|
142113
142350
|
});
|
|
142114
142351
|
var CancelTaskRequestSchema = RequestSchema.extend({
|
|
142115
|
-
method:
|
|
142352
|
+
method: z56.literal("tasks/cancel"),
|
|
142116
142353
|
params: BaseRequestParamsSchema.extend({
|
|
142117
|
-
taskId:
|
|
142354
|
+
taskId: z56.string()
|
|
142118
142355
|
})
|
|
142119
142356
|
});
|
|
142120
142357
|
var CancelTaskResultSchema = ResultSchema.merge(TaskSchema2);
|
|
142121
|
-
var ResourceContentsSchema =
|
|
142122
|
-
uri:
|
|
142123
|
-
mimeType:
|
|
142124
|
-
_meta:
|
|
142358
|
+
var ResourceContentsSchema = z56.object({
|
|
142359
|
+
uri: z56.string(),
|
|
142360
|
+
mimeType: z56.optional(z56.string()),
|
|
142361
|
+
_meta: z56.record(z56.string(), z56.unknown()).optional()
|
|
142125
142362
|
});
|
|
142126
142363
|
var TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
142127
|
-
text:
|
|
142364
|
+
text: z56.string()
|
|
142128
142365
|
});
|
|
142129
|
-
var Base64Schema =
|
|
142366
|
+
var Base64Schema = z56.string().refine((val) => {
|
|
142130
142367
|
try {
|
|
142131
142368
|
atob(val);
|
|
142132
142369
|
return true;
|
|
@@ -142137,447 +142374,447 @@ var Base64Schema = z55.string().refine((val) => {
|
|
|
142137
142374
|
var BlobResourceContentsSchema = ResourceContentsSchema.extend({
|
|
142138
142375
|
blob: Base64Schema
|
|
142139
142376
|
});
|
|
142140
|
-
var RoleSchema =
|
|
142141
|
-
var AnnotationsSchema =
|
|
142142
|
-
audience:
|
|
142143
|
-
priority:
|
|
142144
|
-
lastModified:
|
|
142377
|
+
var RoleSchema = z56.enum(["user", "assistant"]);
|
|
142378
|
+
var AnnotationsSchema = z56.object({
|
|
142379
|
+
audience: z56.array(RoleSchema).optional(),
|
|
142380
|
+
priority: z56.number().min(0).max(1).optional(),
|
|
142381
|
+
lastModified: z56.iso.datetime({ offset: true }).optional()
|
|
142145
142382
|
});
|
|
142146
|
-
var ResourceSchema =
|
|
142383
|
+
var ResourceSchema = z56.object({
|
|
142147
142384
|
...BaseMetadataSchema.shape,
|
|
142148
142385
|
...IconsSchema.shape,
|
|
142149
|
-
uri:
|
|
142150
|
-
description:
|
|
142151
|
-
mimeType:
|
|
142152
|
-
size:
|
|
142386
|
+
uri: z56.string(),
|
|
142387
|
+
description: z56.optional(z56.string()),
|
|
142388
|
+
mimeType: z56.optional(z56.string()),
|
|
142389
|
+
size: z56.optional(z56.number()),
|
|
142153
142390
|
annotations: AnnotationsSchema.optional(),
|
|
142154
|
-
_meta:
|
|
142391
|
+
_meta: z56.optional(z56.looseObject({}))
|
|
142155
142392
|
});
|
|
142156
|
-
var ResourceTemplateSchema =
|
|
142393
|
+
var ResourceTemplateSchema = z56.object({
|
|
142157
142394
|
...BaseMetadataSchema.shape,
|
|
142158
142395
|
...IconsSchema.shape,
|
|
142159
|
-
uriTemplate:
|
|
142160
|
-
description:
|
|
142161
|
-
mimeType:
|
|
142396
|
+
uriTemplate: z56.string(),
|
|
142397
|
+
description: z56.optional(z56.string()),
|
|
142398
|
+
mimeType: z56.optional(z56.string()),
|
|
142162
142399
|
annotations: AnnotationsSchema.optional(),
|
|
142163
|
-
_meta:
|
|
142400
|
+
_meta: z56.optional(z56.looseObject({}))
|
|
142164
142401
|
});
|
|
142165
142402
|
var ListResourcesRequestSchema = PaginatedRequestSchema.extend({
|
|
142166
|
-
method:
|
|
142403
|
+
method: z56.literal("resources/list")
|
|
142167
142404
|
});
|
|
142168
142405
|
var ListResourcesResultSchema = PaginatedResultSchema.extend({
|
|
142169
|
-
resources:
|
|
142406
|
+
resources: z56.array(ResourceSchema)
|
|
142170
142407
|
});
|
|
142171
142408
|
var ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
|
|
142172
|
-
method:
|
|
142409
|
+
method: z56.literal("resources/templates/list")
|
|
142173
142410
|
});
|
|
142174
142411
|
var ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
|
|
142175
|
-
resourceTemplates:
|
|
142412
|
+
resourceTemplates: z56.array(ResourceTemplateSchema)
|
|
142176
142413
|
});
|
|
142177
142414
|
var ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
142178
|
-
uri:
|
|
142415
|
+
uri: z56.string()
|
|
142179
142416
|
});
|
|
142180
142417
|
var ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
|
|
142181
142418
|
var ReadResourceRequestSchema = RequestSchema.extend({
|
|
142182
|
-
method:
|
|
142419
|
+
method: z56.literal("resources/read"),
|
|
142183
142420
|
params: ReadResourceRequestParamsSchema
|
|
142184
142421
|
});
|
|
142185
142422
|
var ReadResourceResultSchema = ResultSchema.extend({
|
|
142186
|
-
contents:
|
|
142423
|
+
contents: z56.array(z56.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
|
|
142187
142424
|
});
|
|
142188
142425
|
var ResourceListChangedNotificationSchema = NotificationSchema.extend({
|
|
142189
|
-
method:
|
|
142426
|
+
method: z56.literal("notifications/resources/list_changed"),
|
|
142190
142427
|
params: NotificationsParamsSchema.optional()
|
|
142191
142428
|
});
|
|
142192
142429
|
var SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
142193
142430
|
var SubscribeRequestSchema = RequestSchema.extend({
|
|
142194
|
-
method:
|
|
142431
|
+
method: z56.literal("resources/subscribe"),
|
|
142195
142432
|
params: SubscribeRequestParamsSchema
|
|
142196
142433
|
});
|
|
142197
142434
|
var UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
|
|
142198
142435
|
var UnsubscribeRequestSchema = RequestSchema.extend({
|
|
142199
|
-
method:
|
|
142436
|
+
method: z56.literal("resources/unsubscribe"),
|
|
142200
142437
|
params: UnsubscribeRequestParamsSchema
|
|
142201
142438
|
});
|
|
142202
142439
|
var ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
142203
|
-
uri:
|
|
142440
|
+
uri: z56.string()
|
|
142204
142441
|
});
|
|
142205
142442
|
var ResourceUpdatedNotificationSchema = NotificationSchema.extend({
|
|
142206
|
-
method:
|
|
142443
|
+
method: z56.literal("notifications/resources/updated"),
|
|
142207
142444
|
params: ResourceUpdatedNotificationParamsSchema
|
|
142208
142445
|
});
|
|
142209
|
-
var PromptArgumentSchema =
|
|
142210
|
-
name:
|
|
142211
|
-
description:
|
|
142212
|
-
required:
|
|
142446
|
+
var PromptArgumentSchema = z56.object({
|
|
142447
|
+
name: z56.string(),
|
|
142448
|
+
description: z56.optional(z56.string()),
|
|
142449
|
+
required: z56.optional(z56.boolean())
|
|
142213
142450
|
});
|
|
142214
|
-
var PromptSchema =
|
|
142451
|
+
var PromptSchema = z56.object({
|
|
142215
142452
|
...BaseMetadataSchema.shape,
|
|
142216
142453
|
...IconsSchema.shape,
|
|
142217
|
-
description:
|
|
142218
|
-
arguments:
|
|
142219
|
-
_meta:
|
|
142454
|
+
description: z56.optional(z56.string()),
|
|
142455
|
+
arguments: z56.optional(z56.array(PromptArgumentSchema)),
|
|
142456
|
+
_meta: z56.optional(z56.looseObject({}))
|
|
142220
142457
|
});
|
|
142221
142458
|
var ListPromptsRequestSchema = PaginatedRequestSchema.extend({
|
|
142222
|
-
method:
|
|
142459
|
+
method: z56.literal("prompts/list")
|
|
142223
142460
|
});
|
|
142224
142461
|
var ListPromptsResultSchema = PaginatedResultSchema.extend({
|
|
142225
|
-
prompts:
|
|
142462
|
+
prompts: z56.array(PromptSchema)
|
|
142226
142463
|
});
|
|
142227
142464
|
var GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
142228
|
-
name:
|
|
142229
|
-
arguments:
|
|
142465
|
+
name: z56.string(),
|
|
142466
|
+
arguments: z56.record(z56.string(), z56.string()).optional()
|
|
142230
142467
|
});
|
|
142231
142468
|
var GetPromptRequestSchema = RequestSchema.extend({
|
|
142232
|
-
method:
|
|
142469
|
+
method: z56.literal("prompts/get"),
|
|
142233
142470
|
params: GetPromptRequestParamsSchema
|
|
142234
142471
|
});
|
|
142235
|
-
var TextContentSchema =
|
|
142236
|
-
type:
|
|
142237
|
-
text:
|
|
142472
|
+
var TextContentSchema = z56.object({
|
|
142473
|
+
type: z56.literal("text"),
|
|
142474
|
+
text: z56.string(),
|
|
142238
142475
|
annotations: AnnotationsSchema.optional(),
|
|
142239
|
-
_meta:
|
|
142476
|
+
_meta: z56.record(z56.string(), z56.unknown()).optional()
|
|
142240
142477
|
});
|
|
142241
|
-
var ImageContentSchema =
|
|
142242
|
-
type:
|
|
142478
|
+
var ImageContentSchema = z56.object({
|
|
142479
|
+
type: z56.literal("image"),
|
|
142243
142480
|
data: Base64Schema,
|
|
142244
|
-
mimeType:
|
|
142481
|
+
mimeType: z56.string(),
|
|
142245
142482
|
annotations: AnnotationsSchema.optional(),
|
|
142246
|
-
_meta:
|
|
142483
|
+
_meta: z56.record(z56.string(), z56.unknown()).optional()
|
|
142247
142484
|
});
|
|
142248
|
-
var AudioContentSchema =
|
|
142249
|
-
type:
|
|
142485
|
+
var AudioContentSchema = z56.object({
|
|
142486
|
+
type: z56.literal("audio"),
|
|
142250
142487
|
data: Base64Schema,
|
|
142251
|
-
mimeType:
|
|
142488
|
+
mimeType: z56.string(),
|
|
142252
142489
|
annotations: AnnotationsSchema.optional(),
|
|
142253
|
-
_meta:
|
|
142490
|
+
_meta: z56.record(z56.string(), z56.unknown()).optional()
|
|
142254
142491
|
});
|
|
142255
|
-
var ToolUseContentSchema =
|
|
142256
|
-
type:
|
|
142257
|
-
name:
|
|
142258
|
-
id:
|
|
142259
|
-
input:
|
|
142260
|
-
_meta:
|
|
142492
|
+
var ToolUseContentSchema = z56.object({
|
|
142493
|
+
type: z56.literal("tool_use"),
|
|
142494
|
+
name: z56.string(),
|
|
142495
|
+
id: z56.string(),
|
|
142496
|
+
input: z56.record(z56.string(), z56.unknown()),
|
|
142497
|
+
_meta: z56.record(z56.string(), z56.unknown()).optional()
|
|
142261
142498
|
});
|
|
142262
|
-
var EmbeddedResourceSchema =
|
|
142263
|
-
type:
|
|
142264
|
-
resource:
|
|
142499
|
+
var EmbeddedResourceSchema = z56.object({
|
|
142500
|
+
type: z56.literal("resource"),
|
|
142501
|
+
resource: z56.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
|
|
142265
142502
|
annotations: AnnotationsSchema.optional(),
|
|
142266
|
-
_meta:
|
|
142503
|
+
_meta: z56.record(z56.string(), z56.unknown()).optional()
|
|
142267
142504
|
});
|
|
142268
142505
|
var ResourceLinkSchema = ResourceSchema.extend({
|
|
142269
|
-
type:
|
|
142506
|
+
type: z56.literal("resource_link")
|
|
142270
142507
|
});
|
|
142271
|
-
var ContentBlockSchema =
|
|
142508
|
+
var ContentBlockSchema = z56.union([
|
|
142272
142509
|
TextContentSchema,
|
|
142273
142510
|
ImageContentSchema,
|
|
142274
142511
|
AudioContentSchema,
|
|
142275
142512
|
ResourceLinkSchema,
|
|
142276
142513
|
EmbeddedResourceSchema
|
|
142277
142514
|
]);
|
|
142278
|
-
var PromptMessageSchema =
|
|
142515
|
+
var PromptMessageSchema = z56.object({
|
|
142279
142516
|
role: RoleSchema,
|
|
142280
142517
|
content: ContentBlockSchema
|
|
142281
142518
|
});
|
|
142282
142519
|
var GetPromptResultSchema = ResultSchema.extend({
|
|
142283
|
-
description:
|
|
142284
|
-
messages:
|
|
142520
|
+
description: z56.string().optional(),
|
|
142521
|
+
messages: z56.array(PromptMessageSchema)
|
|
142285
142522
|
});
|
|
142286
142523
|
var PromptListChangedNotificationSchema = NotificationSchema.extend({
|
|
142287
|
-
method:
|
|
142524
|
+
method: z56.literal("notifications/prompts/list_changed"),
|
|
142288
142525
|
params: NotificationsParamsSchema.optional()
|
|
142289
142526
|
});
|
|
142290
|
-
var ToolAnnotationsSchema =
|
|
142291
|
-
title:
|
|
142292
|
-
readOnlyHint:
|
|
142293
|
-
destructiveHint:
|
|
142294
|
-
idempotentHint:
|
|
142295
|
-
openWorldHint:
|
|
142527
|
+
var ToolAnnotationsSchema = z56.object({
|
|
142528
|
+
title: z56.string().optional(),
|
|
142529
|
+
readOnlyHint: z56.boolean().optional(),
|
|
142530
|
+
destructiveHint: z56.boolean().optional(),
|
|
142531
|
+
idempotentHint: z56.boolean().optional(),
|
|
142532
|
+
openWorldHint: z56.boolean().optional()
|
|
142296
142533
|
});
|
|
142297
|
-
var ToolExecutionSchema =
|
|
142298
|
-
taskSupport:
|
|
142534
|
+
var ToolExecutionSchema = z56.object({
|
|
142535
|
+
taskSupport: z56.enum(["required", "optional", "forbidden"]).optional()
|
|
142299
142536
|
});
|
|
142300
|
-
var ToolSchema =
|
|
142537
|
+
var ToolSchema = z56.object({
|
|
142301
142538
|
...BaseMetadataSchema.shape,
|
|
142302
142539
|
...IconsSchema.shape,
|
|
142303
|
-
description:
|
|
142304
|
-
inputSchema:
|
|
142305
|
-
type:
|
|
142306
|
-
properties:
|
|
142307
|
-
required:
|
|
142308
|
-
}).catchall(
|
|
142309
|
-
outputSchema:
|
|
142310
|
-
type:
|
|
142311
|
-
properties:
|
|
142312
|
-
required:
|
|
142313
|
-
}).catchall(
|
|
142540
|
+
description: z56.string().optional(),
|
|
142541
|
+
inputSchema: z56.object({
|
|
142542
|
+
type: z56.literal("object"),
|
|
142543
|
+
properties: z56.record(z56.string(), AssertObjectSchema).optional(),
|
|
142544
|
+
required: z56.array(z56.string()).optional()
|
|
142545
|
+
}).catchall(z56.unknown()),
|
|
142546
|
+
outputSchema: z56.object({
|
|
142547
|
+
type: z56.literal("object"),
|
|
142548
|
+
properties: z56.record(z56.string(), AssertObjectSchema).optional(),
|
|
142549
|
+
required: z56.array(z56.string()).optional()
|
|
142550
|
+
}).catchall(z56.unknown()).optional(),
|
|
142314
142551
|
annotations: ToolAnnotationsSchema.optional(),
|
|
142315
142552
|
execution: ToolExecutionSchema.optional(),
|
|
142316
|
-
_meta:
|
|
142553
|
+
_meta: z56.record(z56.string(), z56.unknown()).optional()
|
|
142317
142554
|
});
|
|
142318
142555
|
var ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
142319
|
-
method:
|
|
142556
|
+
method: z56.literal("tools/list")
|
|
142320
142557
|
});
|
|
142321
142558
|
var ListToolsResultSchema = PaginatedResultSchema.extend({
|
|
142322
|
-
tools:
|
|
142559
|
+
tools: z56.array(ToolSchema)
|
|
142323
142560
|
});
|
|
142324
142561
|
var CallToolResultSchema = ResultSchema.extend({
|
|
142325
|
-
content:
|
|
142326
|
-
structuredContent:
|
|
142327
|
-
isError:
|
|
142562
|
+
content: z56.array(ContentBlockSchema).default([]),
|
|
142563
|
+
structuredContent: z56.record(z56.string(), z56.unknown()).optional(),
|
|
142564
|
+
isError: z56.boolean().optional()
|
|
142328
142565
|
});
|
|
142329
142566
|
var CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
|
|
142330
|
-
toolResult:
|
|
142567
|
+
toolResult: z56.unknown()
|
|
142331
142568
|
}));
|
|
142332
142569
|
var CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
142333
|
-
name:
|
|
142334
|
-
arguments:
|
|
142570
|
+
name: z56.string(),
|
|
142571
|
+
arguments: z56.record(z56.string(), z56.unknown()).optional()
|
|
142335
142572
|
});
|
|
142336
142573
|
var CallToolRequestSchema = RequestSchema.extend({
|
|
142337
|
-
method:
|
|
142574
|
+
method: z56.literal("tools/call"),
|
|
142338
142575
|
params: CallToolRequestParamsSchema
|
|
142339
142576
|
});
|
|
142340
142577
|
var ToolListChangedNotificationSchema = NotificationSchema.extend({
|
|
142341
|
-
method:
|
|
142578
|
+
method: z56.literal("notifications/tools/list_changed"),
|
|
142342
142579
|
params: NotificationsParamsSchema.optional()
|
|
142343
142580
|
});
|
|
142344
|
-
var ListChangedOptionsBaseSchema =
|
|
142345
|
-
autoRefresh:
|
|
142346
|
-
debounceMs:
|
|
142581
|
+
var ListChangedOptionsBaseSchema = z56.object({
|
|
142582
|
+
autoRefresh: z56.boolean().default(true),
|
|
142583
|
+
debounceMs: z56.number().int().nonnegative().default(300)
|
|
142347
142584
|
});
|
|
142348
|
-
var LoggingLevelSchema =
|
|
142585
|
+
var LoggingLevelSchema = z56.enum(["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]);
|
|
142349
142586
|
var SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
142350
142587
|
level: LoggingLevelSchema
|
|
142351
142588
|
});
|
|
142352
142589
|
var SetLevelRequestSchema = RequestSchema.extend({
|
|
142353
|
-
method:
|
|
142590
|
+
method: z56.literal("logging/setLevel"),
|
|
142354
142591
|
params: SetLevelRequestParamsSchema
|
|
142355
142592
|
});
|
|
142356
142593
|
var LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
142357
142594
|
level: LoggingLevelSchema,
|
|
142358
|
-
logger:
|
|
142359
|
-
data:
|
|
142595
|
+
logger: z56.string().optional(),
|
|
142596
|
+
data: z56.unknown()
|
|
142360
142597
|
});
|
|
142361
142598
|
var LoggingMessageNotificationSchema = NotificationSchema.extend({
|
|
142362
|
-
method:
|
|
142599
|
+
method: z56.literal("notifications/message"),
|
|
142363
142600
|
params: LoggingMessageNotificationParamsSchema
|
|
142364
142601
|
});
|
|
142365
|
-
var ModelHintSchema =
|
|
142366
|
-
name:
|
|
142602
|
+
var ModelHintSchema = z56.object({
|
|
142603
|
+
name: z56.string().optional()
|
|
142367
142604
|
});
|
|
142368
|
-
var ModelPreferencesSchema =
|
|
142369
|
-
hints:
|
|
142370
|
-
costPriority:
|
|
142371
|
-
speedPriority:
|
|
142372
|
-
intelligencePriority:
|
|
142605
|
+
var ModelPreferencesSchema = z56.object({
|
|
142606
|
+
hints: z56.array(ModelHintSchema).optional(),
|
|
142607
|
+
costPriority: z56.number().min(0).max(1).optional(),
|
|
142608
|
+
speedPriority: z56.number().min(0).max(1).optional(),
|
|
142609
|
+
intelligencePriority: z56.number().min(0).max(1).optional()
|
|
142373
142610
|
});
|
|
142374
|
-
var ToolChoiceSchema =
|
|
142375
|
-
mode:
|
|
142611
|
+
var ToolChoiceSchema = z56.object({
|
|
142612
|
+
mode: z56.enum(["auto", "required", "none"]).optional()
|
|
142376
142613
|
});
|
|
142377
|
-
var ToolResultContentSchema =
|
|
142378
|
-
type:
|
|
142379
|
-
toolUseId:
|
|
142380
|
-
content:
|
|
142381
|
-
structuredContent:
|
|
142382
|
-
isError:
|
|
142383
|
-
_meta:
|
|
142614
|
+
var ToolResultContentSchema = z56.object({
|
|
142615
|
+
type: z56.literal("tool_result"),
|
|
142616
|
+
toolUseId: z56.string().describe("The unique identifier for the corresponding tool call."),
|
|
142617
|
+
content: z56.array(ContentBlockSchema).default([]),
|
|
142618
|
+
structuredContent: z56.object({}).loose().optional(),
|
|
142619
|
+
isError: z56.boolean().optional(),
|
|
142620
|
+
_meta: z56.record(z56.string(), z56.unknown()).optional()
|
|
142384
142621
|
});
|
|
142385
|
-
var SamplingContentSchema =
|
|
142386
|
-
var SamplingMessageContentBlockSchema =
|
|
142622
|
+
var SamplingContentSchema = z56.discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
|
|
142623
|
+
var SamplingMessageContentBlockSchema = z56.discriminatedUnion("type", [
|
|
142387
142624
|
TextContentSchema,
|
|
142388
142625
|
ImageContentSchema,
|
|
142389
142626
|
AudioContentSchema,
|
|
142390
142627
|
ToolUseContentSchema,
|
|
142391
142628
|
ToolResultContentSchema
|
|
142392
142629
|
]);
|
|
142393
|
-
var SamplingMessageSchema =
|
|
142630
|
+
var SamplingMessageSchema = z56.object({
|
|
142394
142631
|
role: RoleSchema,
|
|
142395
|
-
content:
|
|
142396
|
-
_meta:
|
|
142632
|
+
content: z56.union([SamplingMessageContentBlockSchema, z56.array(SamplingMessageContentBlockSchema)]),
|
|
142633
|
+
_meta: z56.record(z56.string(), z56.unknown()).optional()
|
|
142397
142634
|
});
|
|
142398
142635
|
var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
142399
|
-
messages:
|
|
142636
|
+
messages: z56.array(SamplingMessageSchema),
|
|
142400
142637
|
modelPreferences: ModelPreferencesSchema.optional(),
|
|
142401
|
-
systemPrompt:
|
|
142402
|
-
includeContext:
|
|
142403
|
-
temperature:
|
|
142404
|
-
maxTokens:
|
|
142405
|
-
stopSequences:
|
|
142638
|
+
systemPrompt: z56.string().optional(),
|
|
142639
|
+
includeContext: z56.enum(["none", "thisServer", "allServers"]).optional(),
|
|
142640
|
+
temperature: z56.number().optional(),
|
|
142641
|
+
maxTokens: z56.number().int(),
|
|
142642
|
+
stopSequences: z56.array(z56.string()).optional(),
|
|
142406
142643
|
metadata: AssertObjectSchema.optional(),
|
|
142407
|
-
tools:
|
|
142644
|
+
tools: z56.array(ToolSchema).optional(),
|
|
142408
142645
|
toolChoice: ToolChoiceSchema.optional()
|
|
142409
142646
|
});
|
|
142410
142647
|
var CreateMessageRequestSchema = RequestSchema.extend({
|
|
142411
|
-
method:
|
|
142648
|
+
method: z56.literal("sampling/createMessage"),
|
|
142412
142649
|
params: CreateMessageRequestParamsSchema
|
|
142413
142650
|
});
|
|
142414
142651
|
var CreateMessageResultSchema = ResultSchema.extend({
|
|
142415
|
-
model:
|
|
142416
|
-
stopReason:
|
|
142652
|
+
model: z56.string(),
|
|
142653
|
+
stopReason: z56.optional(z56.enum(["endTurn", "stopSequence", "maxTokens"]).or(z56.string())),
|
|
142417
142654
|
role: RoleSchema,
|
|
142418
142655
|
content: SamplingContentSchema
|
|
142419
142656
|
});
|
|
142420
142657
|
var CreateMessageResultWithToolsSchema = ResultSchema.extend({
|
|
142421
|
-
model:
|
|
142422
|
-
stopReason:
|
|
142658
|
+
model: z56.string(),
|
|
142659
|
+
stopReason: z56.optional(z56.enum(["endTurn", "stopSequence", "maxTokens", "toolUse"]).or(z56.string())),
|
|
142423
142660
|
role: RoleSchema,
|
|
142424
|
-
content:
|
|
142661
|
+
content: z56.union([SamplingMessageContentBlockSchema, z56.array(SamplingMessageContentBlockSchema)])
|
|
142425
142662
|
});
|
|
142426
|
-
var BooleanSchemaSchema =
|
|
142427
|
-
type:
|
|
142428
|
-
title:
|
|
142429
|
-
description:
|
|
142430
|
-
default:
|
|
142663
|
+
var BooleanSchemaSchema = z56.object({
|
|
142664
|
+
type: z56.literal("boolean"),
|
|
142665
|
+
title: z56.string().optional(),
|
|
142666
|
+
description: z56.string().optional(),
|
|
142667
|
+
default: z56.boolean().optional()
|
|
142431
142668
|
});
|
|
142432
|
-
var StringSchemaSchema =
|
|
142433
|
-
type:
|
|
142434
|
-
title:
|
|
142435
|
-
description:
|
|
142436
|
-
minLength:
|
|
142437
|
-
maxLength:
|
|
142438
|
-
format:
|
|
142439
|
-
default:
|
|
142669
|
+
var StringSchemaSchema = z56.object({
|
|
142670
|
+
type: z56.literal("string"),
|
|
142671
|
+
title: z56.string().optional(),
|
|
142672
|
+
description: z56.string().optional(),
|
|
142673
|
+
minLength: z56.number().optional(),
|
|
142674
|
+
maxLength: z56.number().optional(),
|
|
142675
|
+
format: z56.enum(["email", "uri", "date", "date-time"]).optional(),
|
|
142676
|
+
default: z56.string().optional()
|
|
142440
142677
|
});
|
|
142441
|
-
var NumberSchemaSchema =
|
|
142442
|
-
type:
|
|
142443
|
-
title:
|
|
142444
|
-
description:
|
|
142445
|
-
minimum:
|
|
142446
|
-
maximum:
|
|
142447
|
-
default:
|
|
142678
|
+
var NumberSchemaSchema = z56.object({
|
|
142679
|
+
type: z56.enum(["number", "integer"]),
|
|
142680
|
+
title: z56.string().optional(),
|
|
142681
|
+
description: z56.string().optional(),
|
|
142682
|
+
minimum: z56.number().optional(),
|
|
142683
|
+
maximum: z56.number().optional(),
|
|
142684
|
+
default: z56.number().optional()
|
|
142448
142685
|
});
|
|
142449
|
-
var UntitledSingleSelectEnumSchemaSchema =
|
|
142450
|
-
type:
|
|
142451
|
-
title:
|
|
142452
|
-
description:
|
|
142453
|
-
enum:
|
|
142454
|
-
default:
|
|
142686
|
+
var UntitledSingleSelectEnumSchemaSchema = z56.object({
|
|
142687
|
+
type: z56.literal("string"),
|
|
142688
|
+
title: z56.string().optional(),
|
|
142689
|
+
description: z56.string().optional(),
|
|
142690
|
+
enum: z56.array(z56.string()),
|
|
142691
|
+
default: z56.string().optional()
|
|
142455
142692
|
});
|
|
142456
|
-
var TitledSingleSelectEnumSchemaSchema =
|
|
142457
|
-
type:
|
|
142458
|
-
title:
|
|
142459
|
-
description:
|
|
142460
|
-
oneOf:
|
|
142461
|
-
const:
|
|
142462
|
-
title:
|
|
142693
|
+
var TitledSingleSelectEnumSchemaSchema = z56.object({
|
|
142694
|
+
type: z56.literal("string"),
|
|
142695
|
+
title: z56.string().optional(),
|
|
142696
|
+
description: z56.string().optional(),
|
|
142697
|
+
oneOf: z56.array(z56.object({
|
|
142698
|
+
const: z56.string(),
|
|
142699
|
+
title: z56.string()
|
|
142463
142700
|
})),
|
|
142464
|
-
default:
|
|
142701
|
+
default: z56.string().optional()
|
|
142465
142702
|
});
|
|
142466
|
-
var LegacyTitledEnumSchemaSchema =
|
|
142467
|
-
type:
|
|
142468
|
-
title:
|
|
142469
|
-
description:
|
|
142470
|
-
enum:
|
|
142471
|
-
enumNames:
|
|
142472
|
-
default:
|
|
142703
|
+
var LegacyTitledEnumSchemaSchema = z56.object({
|
|
142704
|
+
type: z56.literal("string"),
|
|
142705
|
+
title: z56.string().optional(),
|
|
142706
|
+
description: z56.string().optional(),
|
|
142707
|
+
enum: z56.array(z56.string()),
|
|
142708
|
+
enumNames: z56.array(z56.string()).optional(),
|
|
142709
|
+
default: z56.string().optional()
|
|
142473
142710
|
});
|
|
142474
|
-
var SingleSelectEnumSchemaSchema =
|
|
142475
|
-
var UntitledMultiSelectEnumSchemaSchema =
|
|
142476
|
-
type:
|
|
142477
|
-
title:
|
|
142478
|
-
description:
|
|
142479
|
-
minItems:
|
|
142480
|
-
maxItems:
|
|
142481
|
-
items:
|
|
142482
|
-
type:
|
|
142483
|
-
enum:
|
|
142711
|
+
var SingleSelectEnumSchemaSchema = z56.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
|
|
142712
|
+
var UntitledMultiSelectEnumSchemaSchema = z56.object({
|
|
142713
|
+
type: z56.literal("array"),
|
|
142714
|
+
title: z56.string().optional(),
|
|
142715
|
+
description: z56.string().optional(),
|
|
142716
|
+
minItems: z56.number().optional(),
|
|
142717
|
+
maxItems: z56.number().optional(),
|
|
142718
|
+
items: z56.object({
|
|
142719
|
+
type: z56.literal("string"),
|
|
142720
|
+
enum: z56.array(z56.string())
|
|
142484
142721
|
}),
|
|
142485
|
-
default:
|
|
142722
|
+
default: z56.array(z56.string()).optional()
|
|
142486
142723
|
});
|
|
142487
|
-
var TitledMultiSelectEnumSchemaSchema =
|
|
142488
|
-
type:
|
|
142489
|
-
title:
|
|
142490
|
-
description:
|
|
142491
|
-
minItems:
|
|
142492
|
-
maxItems:
|
|
142493
|
-
items:
|
|
142494
|
-
anyOf:
|
|
142495
|
-
const:
|
|
142496
|
-
title:
|
|
142724
|
+
var TitledMultiSelectEnumSchemaSchema = z56.object({
|
|
142725
|
+
type: z56.literal("array"),
|
|
142726
|
+
title: z56.string().optional(),
|
|
142727
|
+
description: z56.string().optional(),
|
|
142728
|
+
minItems: z56.number().optional(),
|
|
142729
|
+
maxItems: z56.number().optional(),
|
|
142730
|
+
items: z56.object({
|
|
142731
|
+
anyOf: z56.array(z56.object({
|
|
142732
|
+
const: z56.string(),
|
|
142733
|
+
title: z56.string()
|
|
142497
142734
|
}))
|
|
142498
142735
|
}),
|
|
142499
|
-
default:
|
|
142736
|
+
default: z56.array(z56.string()).optional()
|
|
142500
142737
|
});
|
|
142501
|
-
var MultiSelectEnumSchemaSchema =
|
|
142502
|
-
var EnumSchemaSchema =
|
|
142503
|
-
var PrimitiveSchemaDefinitionSchema =
|
|
142738
|
+
var MultiSelectEnumSchemaSchema = z56.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
|
|
142739
|
+
var EnumSchemaSchema = z56.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
|
|
142740
|
+
var PrimitiveSchemaDefinitionSchema = z56.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
|
|
142504
142741
|
var ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
142505
|
-
mode:
|
|
142506
|
-
message:
|
|
142507
|
-
requestedSchema:
|
|
142508
|
-
type:
|
|
142509
|
-
properties:
|
|
142510
|
-
required:
|
|
142742
|
+
mode: z56.literal("form").optional(),
|
|
142743
|
+
message: z56.string(),
|
|
142744
|
+
requestedSchema: z56.object({
|
|
142745
|
+
type: z56.literal("object"),
|
|
142746
|
+
properties: z56.record(z56.string(), PrimitiveSchemaDefinitionSchema),
|
|
142747
|
+
required: z56.array(z56.string()).optional()
|
|
142511
142748
|
})
|
|
142512
142749
|
});
|
|
142513
142750
|
var ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
142514
|
-
mode:
|
|
142515
|
-
message:
|
|
142516
|
-
elicitationId:
|
|
142517
|
-
url:
|
|
142751
|
+
mode: z56.literal("url"),
|
|
142752
|
+
message: z56.string(),
|
|
142753
|
+
elicitationId: z56.string(),
|
|
142754
|
+
url: z56.string().url()
|
|
142518
142755
|
});
|
|
142519
|
-
var ElicitRequestParamsSchema =
|
|
142756
|
+
var ElicitRequestParamsSchema = z56.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
|
|
142520
142757
|
var ElicitRequestSchema = RequestSchema.extend({
|
|
142521
|
-
method:
|
|
142758
|
+
method: z56.literal("elicitation/create"),
|
|
142522
142759
|
params: ElicitRequestParamsSchema
|
|
142523
142760
|
});
|
|
142524
142761
|
var ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
|
|
142525
|
-
elicitationId:
|
|
142762
|
+
elicitationId: z56.string()
|
|
142526
142763
|
});
|
|
142527
142764
|
var ElicitationCompleteNotificationSchema = NotificationSchema.extend({
|
|
142528
|
-
method:
|
|
142765
|
+
method: z56.literal("notifications/elicitation/complete"),
|
|
142529
142766
|
params: ElicitationCompleteNotificationParamsSchema
|
|
142530
142767
|
});
|
|
142531
142768
|
var ElicitResultSchema = ResultSchema.extend({
|
|
142532
|
-
action:
|
|
142533
|
-
content:
|
|
142769
|
+
action: z56.enum(["accept", "decline", "cancel"]),
|
|
142770
|
+
content: z56.preprocess((val) => val === null ? undefined : val, z56.record(z56.string(), z56.union([z56.string(), z56.number(), z56.boolean(), z56.array(z56.string())])).optional())
|
|
142534
142771
|
});
|
|
142535
|
-
var ResourceTemplateReferenceSchema =
|
|
142536
|
-
type:
|
|
142537
|
-
uri:
|
|
142772
|
+
var ResourceTemplateReferenceSchema = z56.object({
|
|
142773
|
+
type: z56.literal("ref/resource"),
|
|
142774
|
+
uri: z56.string()
|
|
142538
142775
|
});
|
|
142539
|
-
var PromptReferenceSchema =
|
|
142540
|
-
type:
|
|
142541
|
-
name:
|
|
142776
|
+
var PromptReferenceSchema = z56.object({
|
|
142777
|
+
type: z56.literal("ref/prompt"),
|
|
142778
|
+
name: z56.string()
|
|
142542
142779
|
});
|
|
142543
142780
|
var CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
142544
|
-
ref:
|
|
142545
|
-
argument:
|
|
142546
|
-
name:
|
|
142547
|
-
value:
|
|
142781
|
+
ref: z56.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
|
|
142782
|
+
argument: z56.object({
|
|
142783
|
+
name: z56.string(),
|
|
142784
|
+
value: z56.string()
|
|
142548
142785
|
}),
|
|
142549
|
-
context:
|
|
142550
|
-
arguments:
|
|
142786
|
+
context: z56.object({
|
|
142787
|
+
arguments: z56.record(z56.string(), z56.string()).optional()
|
|
142551
142788
|
}).optional()
|
|
142552
142789
|
});
|
|
142553
142790
|
var CompleteRequestSchema = RequestSchema.extend({
|
|
142554
|
-
method:
|
|
142791
|
+
method: z56.literal("completion/complete"),
|
|
142555
142792
|
params: CompleteRequestParamsSchema
|
|
142556
142793
|
});
|
|
142557
142794
|
var CompleteResultSchema = ResultSchema.extend({
|
|
142558
|
-
completion:
|
|
142559
|
-
values:
|
|
142560
|
-
total:
|
|
142561
|
-
hasMore:
|
|
142795
|
+
completion: z56.looseObject({
|
|
142796
|
+
values: z56.array(z56.string()).max(100),
|
|
142797
|
+
total: z56.optional(z56.number().int()),
|
|
142798
|
+
hasMore: z56.optional(z56.boolean())
|
|
142562
142799
|
})
|
|
142563
142800
|
});
|
|
142564
|
-
var RootSchema =
|
|
142565
|
-
uri:
|
|
142566
|
-
name:
|
|
142567
|
-
_meta:
|
|
142801
|
+
var RootSchema = z56.object({
|
|
142802
|
+
uri: z56.string().startsWith("file://"),
|
|
142803
|
+
name: z56.string().optional(),
|
|
142804
|
+
_meta: z56.record(z56.string(), z56.unknown()).optional()
|
|
142568
142805
|
});
|
|
142569
142806
|
var ListRootsRequestSchema = RequestSchema.extend({
|
|
142570
|
-
method:
|
|
142807
|
+
method: z56.literal("roots/list"),
|
|
142571
142808
|
params: BaseRequestParamsSchema.optional()
|
|
142572
142809
|
});
|
|
142573
142810
|
var ListRootsResultSchema = ResultSchema.extend({
|
|
142574
|
-
roots:
|
|
142811
|
+
roots: z56.array(RootSchema)
|
|
142575
142812
|
});
|
|
142576
142813
|
var RootsListChangedNotificationSchema = NotificationSchema.extend({
|
|
142577
|
-
method:
|
|
142814
|
+
method: z56.literal("notifications/roots/list_changed"),
|
|
142578
142815
|
params: NotificationsParamsSchema.optional()
|
|
142579
142816
|
});
|
|
142580
|
-
var ClientRequestSchema =
|
|
142817
|
+
var ClientRequestSchema = z56.union([
|
|
142581
142818
|
PingRequestSchema,
|
|
142582
142819
|
InitializeRequestSchema,
|
|
142583
142820
|
CompleteRequestSchema,
|
|
@@ -142596,14 +142833,14 @@ var ClientRequestSchema = z55.union([
|
|
|
142596
142833
|
ListTasksRequestSchema,
|
|
142597
142834
|
CancelTaskRequestSchema
|
|
142598
142835
|
]);
|
|
142599
|
-
var ClientNotificationSchema =
|
|
142836
|
+
var ClientNotificationSchema = z56.union([
|
|
142600
142837
|
CancelledNotificationSchema,
|
|
142601
142838
|
ProgressNotificationSchema,
|
|
142602
142839
|
InitializedNotificationSchema,
|
|
142603
142840
|
RootsListChangedNotificationSchema,
|
|
142604
142841
|
TaskStatusNotificationSchema
|
|
142605
142842
|
]);
|
|
142606
|
-
var ClientResultSchema =
|
|
142843
|
+
var ClientResultSchema = z56.union([
|
|
142607
142844
|
EmptyResultSchema,
|
|
142608
142845
|
CreateMessageResultSchema,
|
|
142609
142846
|
CreateMessageResultWithToolsSchema,
|
|
@@ -142613,7 +142850,7 @@ var ClientResultSchema = z55.union([
|
|
|
142613
142850
|
ListTasksResultSchema,
|
|
142614
142851
|
CreateTaskResultSchema
|
|
142615
142852
|
]);
|
|
142616
|
-
var ServerRequestSchema =
|
|
142853
|
+
var ServerRequestSchema = z56.union([
|
|
142617
142854
|
PingRequestSchema,
|
|
142618
142855
|
CreateMessageRequestSchema,
|
|
142619
142856
|
ElicitRequestSchema,
|
|
@@ -142623,7 +142860,7 @@ var ServerRequestSchema = z55.union([
|
|
|
142623
142860
|
ListTasksRequestSchema,
|
|
142624
142861
|
CancelTaskRequestSchema
|
|
142625
142862
|
]);
|
|
142626
|
-
var ServerNotificationSchema =
|
|
142863
|
+
var ServerNotificationSchema = z56.union([
|
|
142627
142864
|
CancelledNotificationSchema,
|
|
142628
142865
|
ProgressNotificationSchema,
|
|
142629
142866
|
LoggingMessageNotificationSchema,
|
|
@@ -142634,7 +142871,7 @@ var ServerNotificationSchema = z55.union([
|
|
|
142634
142871
|
TaskStatusNotificationSchema,
|
|
142635
142872
|
ElicitationCompleteNotificationSchema
|
|
142636
142873
|
]);
|
|
142637
|
-
var ServerResultSchema =
|
|
142874
|
+
var ServerResultSchema = z56.union([
|
|
142638
142875
|
EmptyResultSchema,
|
|
142639
142876
|
InitializeResultSchema,
|
|
142640
142877
|
CompleteResultSchema,
|
|
@@ -144312,149 +144549,149 @@ async function pkceChallenge(length) {
|
|
|
144312
144549
|
}
|
|
144313
144550
|
|
|
144314
144551
|
// node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
144315
|
-
import * as
|
|
144316
|
-
var SafeUrlSchema =
|
|
144552
|
+
import * as z57 from "zod/v4";
|
|
144553
|
+
var SafeUrlSchema = z57.url().superRefine((val, ctx) => {
|
|
144317
144554
|
if (!URL.canParse(val)) {
|
|
144318
144555
|
ctx.addIssue({
|
|
144319
|
-
code:
|
|
144556
|
+
code: z57.ZodIssueCode.custom,
|
|
144320
144557
|
message: "URL must be parseable",
|
|
144321
144558
|
fatal: true
|
|
144322
144559
|
});
|
|
144323
|
-
return
|
|
144560
|
+
return z57.NEVER;
|
|
144324
144561
|
}
|
|
144325
144562
|
}).refine((url) => {
|
|
144326
144563
|
const u = new URL(url);
|
|
144327
144564
|
return u.protocol !== "javascript:" && u.protocol !== "data:" && u.protocol !== "vbscript:";
|
|
144328
144565
|
}, { message: "URL cannot use javascript:, data:, or vbscript: scheme" });
|
|
144329
|
-
var OAuthProtectedResourceMetadataSchema =
|
|
144330
|
-
resource:
|
|
144331
|
-
authorization_servers:
|
|
144332
|
-
jwks_uri:
|
|
144333
|
-
scopes_supported:
|
|
144334
|
-
bearer_methods_supported:
|
|
144335
|
-
resource_signing_alg_values_supported:
|
|
144336
|
-
resource_name:
|
|
144337
|
-
resource_documentation:
|
|
144338
|
-
resource_policy_uri:
|
|
144339
|
-
resource_tos_uri:
|
|
144340
|
-
tls_client_certificate_bound_access_tokens:
|
|
144341
|
-
authorization_details_types_supported:
|
|
144342
|
-
dpop_signing_alg_values_supported:
|
|
144343
|
-
dpop_bound_access_tokens_required:
|
|
144566
|
+
var OAuthProtectedResourceMetadataSchema = z57.looseObject({
|
|
144567
|
+
resource: z57.string().url(),
|
|
144568
|
+
authorization_servers: z57.array(SafeUrlSchema).optional(),
|
|
144569
|
+
jwks_uri: z57.string().url().optional(),
|
|
144570
|
+
scopes_supported: z57.array(z57.string()).optional(),
|
|
144571
|
+
bearer_methods_supported: z57.array(z57.string()).optional(),
|
|
144572
|
+
resource_signing_alg_values_supported: z57.array(z57.string()).optional(),
|
|
144573
|
+
resource_name: z57.string().optional(),
|
|
144574
|
+
resource_documentation: z57.string().optional(),
|
|
144575
|
+
resource_policy_uri: z57.string().url().optional(),
|
|
144576
|
+
resource_tos_uri: z57.string().url().optional(),
|
|
144577
|
+
tls_client_certificate_bound_access_tokens: z57.boolean().optional(),
|
|
144578
|
+
authorization_details_types_supported: z57.array(z57.string()).optional(),
|
|
144579
|
+
dpop_signing_alg_values_supported: z57.array(z57.string()).optional(),
|
|
144580
|
+
dpop_bound_access_tokens_required: z57.boolean().optional()
|
|
144344
144581
|
});
|
|
144345
|
-
var OAuthMetadataSchema =
|
|
144346
|
-
issuer:
|
|
144582
|
+
var OAuthMetadataSchema = z57.looseObject({
|
|
144583
|
+
issuer: z57.string(),
|
|
144347
144584
|
authorization_endpoint: SafeUrlSchema,
|
|
144348
144585
|
token_endpoint: SafeUrlSchema,
|
|
144349
144586
|
registration_endpoint: SafeUrlSchema.optional(),
|
|
144350
|
-
scopes_supported:
|
|
144351
|
-
response_types_supported:
|
|
144352
|
-
response_modes_supported:
|
|
144353
|
-
grant_types_supported:
|
|
144354
|
-
token_endpoint_auth_methods_supported:
|
|
144355
|
-
token_endpoint_auth_signing_alg_values_supported:
|
|
144587
|
+
scopes_supported: z57.array(z57.string()).optional(),
|
|
144588
|
+
response_types_supported: z57.array(z57.string()),
|
|
144589
|
+
response_modes_supported: z57.array(z57.string()).optional(),
|
|
144590
|
+
grant_types_supported: z57.array(z57.string()).optional(),
|
|
144591
|
+
token_endpoint_auth_methods_supported: z57.array(z57.string()).optional(),
|
|
144592
|
+
token_endpoint_auth_signing_alg_values_supported: z57.array(z57.string()).optional(),
|
|
144356
144593
|
service_documentation: SafeUrlSchema.optional(),
|
|
144357
144594
|
revocation_endpoint: SafeUrlSchema.optional(),
|
|
144358
|
-
revocation_endpoint_auth_methods_supported:
|
|
144359
|
-
revocation_endpoint_auth_signing_alg_values_supported:
|
|
144360
|
-
introspection_endpoint:
|
|
144361
|
-
introspection_endpoint_auth_methods_supported:
|
|
144362
|
-
introspection_endpoint_auth_signing_alg_values_supported:
|
|
144363
|
-
code_challenge_methods_supported:
|
|
144364
|
-
client_id_metadata_document_supported:
|
|
144595
|
+
revocation_endpoint_auth_methods_supported: z57.array(z57.string()).optional(),
|
|
144596
|
+
revocation_endpoint_auth_signing_alg_values_supported: z57.array(z57.string()).optional(),
|
|
144597
|
+
introspection_endpoint: z57.string().optional(),
|
|
144598
|
+
introspection_endpoint_auth_methods_supported: z57.array(z57.string()).optional(),
|
|
144599
|
+
introspection_endpoint_auth_signing_alg_values_supported: z57.array(z57.string()).optional(),
|
|
144600
|
+
code_challenge_methods_supported: z57.array(z57.string()).optional(),
|
|
144601
|
+
client_id_metadata_document_supported: z57.boolean().optional()
|
|
144365
144602
|
});
|
|
144366
|
-
var OpenIdProviderMetadataSchema =
|
|
144367
|
-
issuer:
|
|
144603
|
+
var OpenIdProviderMetadataSchema = z57.looseObject({
|
|
144604
|
+
issuer: z57.string(),
|
|
144368
144605
|
authorization_endpoint: SafeUrlSchema,
|
|
144369
144606
|
token_endpoint: SafeUrlSchema,
|
|
144370
144607
|
userinfo_endpoint: SafeUrlSchema.optional(),
|
|
144371
144608
|
jwks_uri: SafeUrlSchema,
|
|
144372
144609
|
registration_endpoint: SafeUrlSchema.optional(),
|
|
144373
|
-
scopes_supported:
|
|
144374
|
-
response_types_supported:
|
|
144375
|
-
response_modes_supported:
|
|
144376
|
-
grant_types_supported:
|
|
144377
|
-
acr_values_supported:
|
|
144378
|
-
subject_types_supported:
|
|
144379
|
-
id_token_signing_alg_values_supported:
|
|
144380
|
-
id_token_encryption_alg_values_supported:
|
|
144381
|
-
id_token_encryption_enc_values_supported:
|
|
144382
|
-
userinfo_signing_alg_values_supported:
|
|
144383
|
-
userinfo_encryption_alg_values_supported:
|
|
144384
|
-
userinfo_encryption_enc_values_supported:
|
|
144385
|
-
request_object_signing_alg_values_supported:
|
|
144386
|
-
request_object_encryption_alg_values_supported:
|
|
144387
|
-
request_object_encryption_enc_values_supported:
|
|
144388
|
-
token_endpoint_auth_methods_supported:
|
|
144389
|
-
token_endpoint_auth_signing_alg_values_supported:
|
|
144390
|
-
display_values_supported:
|
|
144391
|
-
claim_types_supported:
|
|
144392
|
-
claims_supported:
|
|
144393
|
-
service_documentation:
|
|
144394
|
-
claims_locales_supported:
|
|
144395
|
-
ui_locales_supported:
|
|
144396
|
-
claims_parameter_supported:
|
|
144397
|
-
request_parameter_supported:
|
|
144398
|
-
request_uri_parameter_supported:
|
|
144399
|
-
require_request_uri_registration:
|
|
144610
|
+
scopes_supported: z57.array(z57.string()).optional(),
|
|
144611
|
+
response_types_supported: z57.array(z57.string()),
|
|
144612
|
+
response_modes_supported: z57.array(z57.string()).optional(),
|
|
144613
|
+
grant_types_supported: z57.array(z57.string()).optional(),
|
|
144614
|
+
acr_values_supported: z57.array(z57.string()).optional(),
|
|
144615
|
+
subject_types_supported: z57.array(z57.string()),
|
|
144616
|
+
id_token_signing_alg_values_supported: z57.array(z57.string()),
|
|
144617
|
+
id_token_encryption_alg_values_supported: z57.array(z57.string()).optional(),
|
|
144618
|
+
id_token_encryption_enc_values_supported: z57.array(z57.string()).optional(),
|
|
144619
|
+
userinfo_signing_alg_values_supported: z57.array(z57.string()).optional(),
|
|
144620
|
+
userinfo_encryption_alg_values_supported: z57.array(z57.string()).optional(),
|
|
144621
|
+
userinfo_encryption_enc_values_supported: z57.array(z57.string()).optional(),
|
|
144622
|
+
request_object_signing_alg_values_supported: z57.array(z57.string()).optional(),
|
|
144623
|
+
request_object_encryption_alg_values_supported: z57.array(z57.string()).optional(),
|
|
144624
|
+
request_object_encryption_enc_values_supported: z57.array(z57.string()).optional(),
|
|
144625
|
+
token_endpoint_auth_methods_supported: z57.array(z57.string()).optional(),
|
|
144626
|
+
token_endpoint_auth_signing_alg_values_supported: z57.array(z57.string()).optional(),
|
|
144627
|
+
display_values_supported: z57.array(z57.string()).optional(),
|
|
144628
|
+
claim_types_supported: z57.array(z57.string()).optional(),
|
|
144629
|
+
claims_supported: z57.array(z57.string()).optional(),
|
|
144630
|
+
service_documentation: z57.string().optional(),
|
|
144631
|
+
claims_locales_supported: z57.array(z57.string()).optional(),
|
|
144632
|
+
ui_locales_supported: z57.array(z57.string()).optional(),
|
|
144633
|
+
claims_parameter_supported: z57.boolean().optional(),
|
|
144634
|
+
request_parameter_supported: z57.boolean().optional(),
|
|
144635
|
+
request_uri_parameter_supported: z57.boolean().optional(),
|
|
144636
|
+
require_request_uri_registration: z57.boolean().optional(),
|
|
144400
144637
|
op_policy_uri: SafeUrlSchema.optional(),
|
|
144401
144638
|
op_tos_uri: SafeUrlSchema.optional(),
|
|
144402
|
-
client_id_metadata_document_supported:
|
|
144639
|
+
client_id_metadata_document_supported: z57.boolean().optional()
|
|
144403
144640
|
});
|
|
144404
|
-
var OpenIdProviderDiscoveryMetadataSchema =
|
|
144641
|
+
var OpenIdProviderDiscoveryMetadataSchema = z57.object({
|
|
144405
144642
|
...OpenIdProviderMetadataSchema.shape,
|
|
144406
144643
|
...OAuthMetadataSchema.pick({
|
|
144407
144644
|
code_challenge_methods_supported: true
|
|
144408
144645
|
}).shape
|
|
144409
144646
|
});
|
|
144410
|
-
var OAuthTokensSchema =
|
|
144411
|
-
access_token:
|
|
144412
|
-
id_token:
|
|
144413
|
-
token_type:
|
|
144414
|
-
expires_in:
|
|
144415
|
-
scope:
|
|
144416
|
-
refresh_token:
|
|
144647
|
+
var OAuthTokensSchema = z57.object({
|
|
144648
|
+
access_token: z57.string(),
|
|
144649
|
+
id_token: z57.string().optional(),
|
|
144650
|
+
token_type: z57.string(),
|
|
144651
|
+
expires_in: z57.coerce.number().optional(),
|
|
144652
|
+
scope: z57.string().optional(),
|
|
144653
|
+
refresh_token: z57.string().optional()
|
|
144417
144654
|
}).strip();
|
|
144418
|
-
var OAuthErrorResponseSchema =
|
|
144419
|
-
error:
|
|
144420
|
-
error_description:
|
|
144421
|
-
error_uri:
|
|
144655
|
+
var OAuthErrorResponseSchema = z57.object({
|
|
144656
|
+
error: z57.string(),
|
|
144657
|
+
error_description: z57.string().optional(),
|
|
144658
|
+
error_uri: z57.string().optional()
|
|
144422
144659
|
});
|
|
144423
|
-
var OptionalSafeUrlSchema = SafeUrlSchema.optional().or(
|
|
144660
|
+
var OptionalSafeUrlSchema = SafeUrlSchema.optional().or(z57.literal("").transform(() => {
|
|
144424
144661
|
return;
|
|
144425
144662
|
}));
|
|
144426
|
-
var OAuthClientMetadataSchema =
|
|
144427
|
-
redirect_uris:
|
|
144428
|
-
token_endpoint_auth_method:
|
|
144429
|
-
grant_types:
|
|
144430
|
-
response_types:
|
|
144431
|
-
client_name:
|
|
144663
|
+
var OAuthClientMetadataSchema = z57.object({
|
|
144664
|
+
redirect_uris: z57.array(SafeUrlSchema),
|
|
144665
|
+
token_endpoint_auth_method: z57.string().optional(),
|
|
144666
|
+
grant_types: z57.array(z57.string()).optional(),
|
|
144667
|
+
response_types: z57.array(z57.string()).optional(),
|
|
144668
|
+
client_name: z57.string().optional(),
|
|
144432
144669
|
client_uri: SafeUrlSchema.optional(),
|
|
144433
144670
|
logo_uri: OptionalSafeUrlSchema,
|
|
144434
|
-
scope:
|
|
144435
|
-
contacts:
|
|
144671
|
+
scope: z57.string().optional(),
|
|
144672
|
+
contacts: z57.array(z57.string()).optional(),
|
|
144436
144673
|
tos_uri: OptionalSafeUrlSchema,
|
|
144437
|
-
policy_uri:
|
|
144674
|
+
policy_uri: z57.string().optional(),
|
|
144438
144675
|
jwks_uri: SafeUrlSchema.optional(),
|
|
144439
|
-
jwks:
|
|
144440
|
-
software_id:
|
|
144441
|
-
software_version:
|
|
144442
|
-
software_statement:
|
|
144676
|
+
jwks: z57.any().optional(),
|
|
144677
|
+
software_id: z57.string().optional(),
|
|
144678
|
+
software_version: z57.string().optional(),
|
|
144679
|
+
software_statement: z57.string().optional()
|
|
144443
144680
|
}).strip();
|
|
144444
|
-
var OAuthClientInformationSchema =
|
|
144445
|
-
client_id:
|
|
144446
|
-
client_secret:
|
|
144447
|
-
client_id_issued_at:
|
|
144448
|
-
client_secret_expires_at:
|
|
144681
|
+
var OAuthClientInformationSchema = z57.object({
|
|
144682
|
+
client_id: z57.string(),
|
|
144683
|
+
client_secret: z57.string().optional(),
|
|
144684
|
+
client_id_issued_at: z57.number().optional(),
|
|
144685
|
+
client_secret_expires_at: z57.number().optional()
|
|
144449
144686
|
}).strip();
|
|
144450
144687
|
var OAuthClientInformationFullSchema = OAuthClientMetadataSchema.merge(OAuthClientInformationSchema);
|
|
144451
|
-
var OAuthClientRegistrationErrorSchema =
|
|
144452
|
-
error:
|
|
144453
|
-
error_description:
|
|
144688
|
+
var OAuthClientRegistrationErrorSchema = z57.object({
|
|
144689
|
+
error: z57.string(),
|
|
144690
|
+
error_description: z57.string().optional()
|
|
144454
144691
|
}).strip();
|
|
144455
|
-
var OAuthTokenRevocationRequestSchema =
|
|
144456
|
-
token:
|
|
144457
|
-
token_type_hint:
|
|
144692
|
+
var OAuthTokenRevocationRequestSchema = z57.object({
|
|
144693
|
+
token: z57.string(),
|
|
144694
|
+
token_type_hint: z57.string().optional()
|
|
144458
144695
|
}).strip();
|
|
144459
144696
|
|
|
144460
144697
|
// node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth-utils.js
|
|
@@ -146666,7 +146903,7 @@ function mirrorFilePath(projectDir) {
|
|
|
146666
146903
|
}
|
|
146667
146904
|
|
|
146668
146905
|
// packages/omo-opencode/src/features/tui-sidebar/snapshot-schema.ts
|
|
146669
|
-
import { z as
|
|
146906
|
+
import { z as z58 } from "zod";
|
|
146670
146907
|
var AGENT_STATUS_VALUES = [
|
|
146671
146908
|
"busy",
|
|
146672
146909
|
"idle",
|
|
@@ -146682,32 +146919,32 @@ var BACKGROUND_TASK_STATUS_VALUES = [
|
|
|
146682
146919
|
"cancelled",
|
|
146683
146920
|
"interrupt"
|
|
146684
146921
|
];
|
|
146685
|
-
var AgentRowSchema =
|
|
146686
|
-
name:
|
|
146687
|
-
status:
|
|
146922
|
+
var AgentRowSchema = z58.object({
|
|
146923
|
+
name: z58.string(),
|
|
146924
|
+
status: z58.enum(AGENT_STATUS_VALUES)
|
|
146688
146925
|
});
|
|
146689
|
-
var JobRowSchema =
|
|
146690
|
-
title:
|
|
146691
|
-
status:
|
|
146692
|
-
toolCalls:
|
|
146693
|
-
lastTool:
|
|
146926
|
+
var JobRowSchema = z58.object({
|
|
146927
|
+
title: z58.string(),
|
|
146928
|
+
status: z58.enum(BACKGROUND_TASK_STATUS_VALUES),
|
|
146929
|
+
toolCalls: z58.number().int().nonnegative().nullable(),
|
|
146930
|
+
lastTool: z58.string().nullable()
|
|
146694
146931
|
});
|
|
146695
|
-
var LoopLiveSchema =
|
|
146696
|
-
kind:
|
|
146697
|
-
goalsDone:
|
|
146698
|
-
goalsTotal:
|
|
146699
|
-
pass:
|
|
146700
|
-
fail:
|
|
146701
|
-
pending:
|
|
146702
|
-
blocked:
|
|
146703
|
-
activeGoal:
|
|
146932
|
+
var LoopLiveSchema = z58.object({
|
|
146933
|
+
kind: z58.literal("live"),
|
|
146934
|
+
goalsDone: z58.number().int().nonnegative(),
|
|
146935
|
+
goalsTotal: z58.number().int().nonnegative(),
|
|
146936
|
+
pass: z58.number().int().nonnegative(),
|
|
146937
|
+
fail: z58.number().int().nonnegative(),
|
|
146938
|
+
pending: z58.number().int().nonnegative(),
|
|
146939
|
+
blocked: z58.number().int().nonnegative(),
|
|
146940
|
+
activeGoal: z58.string().nullable()
|
|
146704
146941
|
});
|
|
146705
|
-
var TuiRuntimeSnapshotSchema =
|
|
146706
|
-
version:
|
|
146707
|
-
projectDir:
|
|
146708
|
-
updatedAt:
|
|
146709
|
-
activeAgents:
|
|
146710
|
-
jobBoard:
|
|
146942
|
+
var TuiRuntimeSnapshotSchema = z58.object({
|
|
146943
|
+
version: z58.literal(MIRROR_SCHEMA_VERSION),
|
|
146944
|
+
projectDir: z58.string(),
|
|
146945
|
+
updatedAt: z58.number(),
|
|
146946
|
+
activeAgents: z58.array(AgentRowSchema),
|
|
146947
|
+
jobBoard: z58.array(JobRowSchema),
|
|
146711
146948
|
loop: LoopLiveSchema.nullable()
|
|
146712
146949
|
});
|
|
146713
146950
|
|
|
@@ -146722,25 +146959,25 @@ function writeMirror(projectDir, snapshot) {
|
|
|
146722
146959
|
// packages/omo-opencode/src/features/tui-sidebar/loop-reader.ts
|
|
146723
146960
|
import { readdirSync as readdirSync29, readFileSync as readFileSync67, statSync as statSync13 } from "fs";
|
|
146724
146961
|
import { join as join124 } from "path";
|
|
146725
|
-
import { z as
|
|
146726
|
-
var CriterionSchema =
|
|
146727
|
-
status:
|
|
146962
|
+
import { z as z59 } from "zod";
|
|
146963
|
+
var CriterionSchema = z59.object({
|
|
146964
|
+
status: z59.string()
|
|
146728
146965
|
});
|
|
146729
|
-
var GoalBaseSchema =
|
|
146730
|
-
id:
|
|
146731
|
-
title:
|
|
146732
|
-
status:
|
|
146966
|
+
var GoalBaseSchema = z59.object({
|
|
146967
|
+
id: z59.string(),
|
|
146968
|
+
title: z59.string(),
|
|
146969
|
+
status: z59.string()
|
|
146733
146970
|
});
|
|
146734
|
-
var CurrentLoopSchema =
|
|
146735
|
-
version:
|
|
146736
|
-
activeGoalId:
|
|
146737
|
-
goals:
|
|
146738
|
-
successCriteria:
|
|
146971
|
+
var CurrentLoopSchema = z59.object({
|
|
146972
|
+
version: z59.literal(1),
|
|
146973
|
+
activeGoalId: z59.string().optional(),
|
|
146974
|
+
goals: z59.array(GoalBaseSchema.extend({
|
|
146975
|
+
successCriteria: z59.array(CriterionSchema)
|
|
146739
146976
|
}))
|
|
146740
146977
|
});
|
|
146741
|
-
var LegacyLoopSchema =
|
|
146742
|
-
goals:
|
|
146743
|
-
criteria:
|
|
146978
|
+
var LegacyLoopSchema = z59.object({
|
|
146979
|
+
goals: z59.array(GoalBaseSchema.extend({
|
|
146980
|
+
criteria: z59.array(CriterionSchema)
|
|
146744
146981
|
}))
|
|
146745
146982
|
});
|
|
146746
146983
|
function readActiveLoop(projectDir) {
|
|
@@ -163379,7 +163616,7 @@ var grep_app = {
|
|
|
163379
163616
|
import { existsSync as existsSync106, readFileSync as readFileSync74 } from "fs";
|
|
163380
163617
|
import { delimiter as delimiter2, dirname as dirname47, resolve as resolve35 } from "path";
|
|
163381
163618
|
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
163382
|
-
import { z as
|
|
163619
|
+
import { z as z60 } from "zod";
|
|
163383
163620
|
|
|
163384
163621
|
// packages/omo-opencode/src/mcp/cli-suffix.ts
|
|
163385
163622
|
function normalizeCliPath(path) {
|
|
@@ -163480,8 +163717,8 @@ var PROJECT_LSP_CONFIGS = [".opencode/lsp.json", ".omo/lsp.json", ".omo/lsp-clie
|
|
|
163480
163717
|
var DAEMON_PACKAGE_NAME = "@code-yeongyu/lsp-daemon";
|
|
163481
163718
|
var OMO_LSP_DAEMON_CLI = "OMO_LSP_DAEMON_CLI";
|
|
163482
163719
|
var OMO_LSP_DAEMON_VERSION = "OMO_LSP_DAEMON_VERSION";
|
|
163483
|
-
var DaemonPackageSchema =
|
|
163484
|
-
version:
|
|
163720
|
+
var DaemonPackageSchema = z60.object({
|
|
163721
|
+
version: z60.string().min(1)
|
|
163485
163722
|
});
|
|
163486
163723
|
var LSP_BOOTSTRAP_SCRIPT = [
|
|
163487
163724
|
"const { existsSync } = require('node:fs')",
|
|
@@ -168721,14 +168958,14 @@ class OpencodeClient2 extends HeyApiClient {
|
|
|
168721
168958
|
// node_modules/.bun/@opencode-ai+sdk@1.18.22/node_modules/@opencode-ai/sdk/dist/v2/server.js
|
|
168722
168959
|
var import_cross_spawn3 = __toESM(require_cross_spawn(), 1);
|
|
168723
168960
|
// packages/omo-opencode/src/plugin/native-skills.ts
|
|
168724
|
-
import { z as
|
|
168725
|
-
var NativeSkillEntrySchema =
|
|
168726
|
-
name:
|
|
168727
|
-
description:
|
|
168728
|
-
location:
|
|
168729
|
-
content:
|
|
168961
|
+
import { z as z61 } from "zod";
|
|
168962
|
+
var NativeSkillEntrySchema = z61.object({
|
|
168963
|
+
name: z61.string(),
|
|
168964
|
+
description: z61.string().default(""),
|
|
168965
|
+
location: z61.string(),
|
|
168966
|
+
content: z61.string()
|
|
168730
168967
|
});
|
|
168731
|
-
var NativeSkillEntriesSchema =
|
|
168968
|
+
var NativeSkillEntriesSchema = z61.array(NativeSkillEntrySchema);
|
|
168732
168969
|
function getObjectProperty(value, property) {
|
|
168733
168970
|
if (typeof value !== "object" || value === null)
|
|
168734
168971
|
return;
|
|
@@ -169753,6 +169990,7 @@ async function createTeamRun(spec, leadSessionId, ctx, config, bgMgr, tmuxMgr, o
|
|
|
169753
169990
|
skillContent: resolvedMember.systemContent,
|
|
169754
169991
|
category: member.kind === "category" ? member.category : undefined,
|
|
169755
169992
|
sessionPermission: QUESTION_DENIED_SESSION_PERMISSION,
|
|
169993
|
+
...resource.worktreePath ? { cwd: resource.worktreePath } : {},
|
|
169756
169994
|
onSessionCreated: async (sessionId) => {
|
|
169757
169995
|
registerTeamSession(sessionId, {
|
|
169758
169996
|
teamRunId: runtimeState.teamRunId,
|
|
@@ -169877,7 +170115,7 @@ async function resolveParticipant2(teamRunId, sessionID, config, deps) {
|
|
|
169877
170115
|
}
|
|
169878
170116
|
|
|
169879
170117
|
// packages/omo-opencode/src/features/team-mode/tools/lifecycle-inline-spec.ts
|
|
169880
|
-
import { z as
|
|
170118
|
+
import { z as z62 } from "zod";
|
|
169881
170119
|
init_types2();
|
|
169882
170120
|
var TEAM_CREATE_USAGE = 'team_create requires exactly one of teamName or inline_spec. Use team_create({ teamName: "existing-team" }) or team_create({ inline_spec: { name: "team-name", members: [{ name: "worker", category: "quick", prompt: "Do the assigned work." }] } }).';
|
|
169883
170121
|
function omitEmptyStringArgs(rawArgs) {
|
|
@@ -169886,10 +170124,10 @@ function omitEmptyStringArgs(rawArgs) {
|
|
|
169886
170124
|
}
|
|
169887
170125
|
return Object.fromEntries(Object.entries(rawArgs).filter(([, value]) => value !== ""));
|
|
169888
170126
|
}
|
|
169889
|
-
var TeamCreateArgsSchema =
|
|
169890
|
-
teamName:
|
|
169891
|
-
inline_spec:
|
|
169892
|
-
leadSessionId:
|
|
170127
|
+
var TeamCreateArgsSchema = z62.preprocess(omitEmptyStringArgs, z62.object({
|
|
170128
|
+
teamName: z62.string().min(1).nullish(),
|
|
170129
|
+
inline_spec: z62.unknown().nullish(),
|
|
170130
|
+
leadSessionId: z62.string().nullish()
|
|
169893
170131
|
}).superRefine((value, ctx) => {
|
|
169894
170132
|
const optionCount = Number(value.teamName != null) + Number(value.inline_spec != null);
|
|
169895
170133
|
if (optionCount !== 1) {
|
|
@@ -170010,7 +170248,7 @@ function createTeamCreateTool(config, client, bgMgr, tmuxMgr, executorConfig, de
|
|
|
170010
170248
|
});
|
|
170011
170249
|
}
|
|
170012
170250
|
// packages/omo-opencode/src/features/team-mode/tools/lifecycle-shutdown-tools.ts
|
|
170013
|
-
import { z as
|
|
170251
|
+
import { z as z63 } from "zod";
|
|
170014
170252
|
// packages/omo-opencode/src/features/team-mode/team-runtime/shutdown.ts
|
|
170015
170253
|
init_store2();
|
|
170016
170254
|
init_shutdown_helpers();
|
|
@@ -170099,13 +170337,13 @@ async function rejectShutdown(teamRunId, memberName, rejectorName, reason, confi
|
|
|
170099
170337
|
|
|
170100
170338
|
// packages/omo-opencode/src/features/team-mode/tools/lifecycle-shutdown-tools.ts
|
|
170101
170339
|
init_store();
|
|
170102
|
-
var TeamDeleteArgsSchema =
|
|
170103
|
-
var TeamShutdownRequestArgsSchema =
|
|
170104
|
-
var TeamApproveShutdownArgsSchema =
|
|
170105
|
-
var TeamRejectShutdownArgsSchema =
|
|
170106
|
-
teamRunId:
|
|
170107
|
-
memberName:
|
|
170108
|
-
reason:
|
|
170340
|
+
var TeamDeleteArgsSchema = z63.object({ teamRunId: z63.string().min(1), force: z63.boolean().optional() });
|
|
170341
|
+
var TeamShutdownRequestArgsSchema = z63.object({ teamRunId: z63.string().min(1), targetMemberName: z63.string().min(1) });
|
|
170342
|
+
var TeamApproveShutdownArgsSchema = z63.object({ teamRunId: z63.string().min(1), memberName: z63.string().min(1) });
|
|
170343
|
+
var TeamRejectShutdownArgsSchema = z63.object({
|
|
170344
|
+
teamRunId: z63.string().min(1),
|
|
170345
|
+
memberName: z63.string().min(1),
|
|
170346
|
+
reason: z63.string().min(1)
|
|
170109
170347
|
});
|
|
170110
170348
|
var defaultTeamShutdownToolDeps = {
|
|
170111
170349
|
listActiveTeams,
|
|
@@ -171589,6 +171827,7 @@ init_logger2();
|
|
|
171589
171827
|
// packages/omo-opencode/src/plugin/stop-continuation.ts
|
|
171590
171828
|
function stopContinuation(args) {
|
|
171591
171829
|
const { directory, hooks, sessionID } = args;
|
|
171830
|
+
hooks.keywordDetector?.clearSession?.(sessionID);
|
|
171592
171831
|
hooks.stopContinuationGuard?.stop?.(sessionID);
|
|
171593
171832
|
hooks.todoContinuationEnforcer?.cancelAllCountdowns();
|
|
171594
171833
|
hooks.goal?.clearGoal(sessionID);
|
|
@@ -171928,9 +172167,16 @@ function toCanonicalModel(model) {
|
|
|
171928
172167
|
return model.id;
|
|
171929
172168
|
return `${model.providerID}/${model.id}`;
|
|
171930
172169
|
}
|
|
171931
|
-
function createSystemTransformHandler(defaultMode, getUltraworkMessage) {
|
|
172170
|
+
function createSystemTransformHandler(defaultMode, getUltraworkMessage, ultraworkRestoration) {
|
|
171932
172171
|
return async (input, output) => {
|
|
171933
172172
|
reconcileSisyphusRuntimePrompt(output.system, toCanonicalModel(input.model));
|
|
172173
|
+
const restoredGuidance = input.sessionID ? ultraworkRestoration?.getSystemTransformGuidance?.(input.sessionID, input.model?.id) : undefined;
|
|
172174
|
+
if (restoredGuidance) {
|
|
172175
|
+
if (!output.system.some((part) => part.includes(ULTRAWORK_MODE_TAG))) {
|
|
172176
|
+
output.system.push(restoredGuidance);
|
|
172177
|
+
}
|
|
172178
|
+
return;
|
|
172179
|
+
}
|
|
171934
172180
|
if (!defaultMode?.ultrawork || !getUltraworkMessage)
|
|
171935
172181
|
return;
|
|
171936
172182
|
if (output.system.some((part) => part.includes(ULTRAWORK_MODE_TAG)))
|
|
@@ -172103,6 +172349,7 @@ function createEventHookDispatcher(hooks, runEventHookSafely) {
|
|
|
172103
172349
|
await runEventHookSafely("directoryAgentsInjector", hooks.directoryAgentsInjector?.event, input);
|
|
172104
172350
|
await runEventHookSafely("directoryReadmeInjector", hooks.directoryReadmeInjector?.event, input);
|
|
172105
172351
|
await runEventHookSafely("rulesInjector", hooks.rulesInjector?.event, input);
|
|
172352
|
+
await runEventHookSafely("keywordDetector", hooks.keywordDetector?.event, input);
|
|
172106
172353
|
await runEventHookSafely("hephaestusAgentsMdInjector", hooks.hephaestusAgentsMdInjector?.event, input);
|
|
172107
172354
|
await runEventHookSafely("thinkMode", hooks.thinkMode?.event, input);
|
|
172108
172355
|
await runEventHookSafely("anthropicContextWindowLimitRecovery", hooks.anthropicContextWindowLimitRecovery?.event, input);
|
|
@@ -173663,7 +173910,7 @@ function createPluginInterface(args) {
|
|
|
173663
173910
|
"experimental.chat.messages.transform": createMessagesTransformHandler({
|
|
173664
173911
|
hooks
|
|
173665
173912
|
}),
|
|
173666
|
-
"experimental.chat.system.transform": createSystemTransformHandler(pluginConfig.default_mode, getUltraworkMessage),
|
|
173913
|
+
"experimental.chat.system.transform": createSystemTransformHandler(pluginConfig.default_mode, getUltraworkMessage, hooks.keywordDetector),
|
|
173667
173914
|
config: managers.configHandler,
|
|
173668
173915
|
event: createEventHandler2({
|
|
173669
173916
|
ctx,
|
|
@@ -173958,7 +174205,7 @@ function parseWindowsProcessTable(output) {
|
|
|
173958
174205
|
const entries = Array.isArray(parsed) ? parsed : parsed === undefined ? [] : [parsed];
|
|
173959
174206
|
const processes = [];
|
|
173960
174207
|
for (const entry of entries) {
|
|
173961
|
-
if (!
|
|
174208
|
+
if (!isRecord11(entry))
|
|
173962
174209
|
continue;
|
|
173963
174210
|
const pid = numberField(entry, "ProcessId");
|
|
173964
174211
|
const ppid = numberField(entry, "ParentProcessId");
|
|
@@ -173992,7 +174239,7 @@ function stringField(record, key) {
|
|
|
173992
174239
|
const value = record[key];
|
|
173993
174240
|
return typeof value === "string" ? value : undefined;
|
|
173994
174241
|
}
|
|
173995
|
-
function
|
|
174242
|
+
function isRecord11(value) {
|
|
173996
174243
|
return typeof value === "object" && value !== null;
|
|
173997
174244
|
}
|
|
173998
174245
|
|
|
@@ -174096,7 +174343,7 @@ async function attestLspDaemonOwner(target, deps = {}) {
|
|
|
174096
174343
|
}
|
|
174097
174344
|
}
|
|
174098
174345
|
function parseLspDaemonOwner(value) {
|
|
174099
|
-
if (!
|
|
174346
|
+
if (!isRecord12(value))
|
|
174100
174347
|
return null;
|
|
174101
174348
|
const pid = value["pid"];
|
|
174102
174349
|
const nonce = value["nonce"];
|
|
@@ -174108,7 +174355,7 @@ function parseLspDaemonOwner(value) {
|
|
|
174108
174355
|
return null;
|
|
174109
174356
|
if (typeof startedAt !== "string" || startedAt.length === 0)
|
|
174110
174357
|
return null;
|
|
174111
|
-
if (!
|
|
174358
|
+
if (!isRecord12(endpoint))
|
|
174112
174359
|
return null;
|
|
174113
174360
|
const kind = endpoint["kind"];
|
|
174114
174361
|
const path = endpoint["path"];
|
|
@@ -174160,7 +174407,7 @@ async function pingLspDaemonOwner(endpoint, authToken) {
|
|
|
174160
174407
|
return finish(null);
|
|
174161
174408
|
try {
|
|
174162
174409
|
const response = JSON.parse(line);
|
|
174163
|
-
if (!
|
|
174410
|
+
if (!isRecord12(response) || response["id"] !== OWNER_PING_REQUEST_ID || "error" in response) {
|
|
174164
174411
|
return finish(null);
|
|
174165
174412
|
}
|
|
174166
174413
|
finish(parseLspDaemonOwner(response["result"]));
|
|
@@ -174173,7 +174420,7 @@ async function pingLspDaemonOwner(endpoint, authToken) {
|
|
|
174173
174420
|
function sameOwner(left, right) {
|
|
174174
174421
|
return left.pid === right.pid && left.nonce === right.nonce && left.startedAt === right.startedAt && left.endpoint.kind === right.endpoint.kind && left.endpoint.path === right.endpoint.path && left.endpoint.dev === right.endpoint.dev && left.endpoint.ino === right.endpoint.ino;
|
|
174175
174422
|
}
|
|
174176
|
-
function
|
|
174423
|
+
function isRecord12(value) {
|
|
174177
174424
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
174178
174425
|
}
|
|
174179
174426
|
|
|
@@ -174410,7 +174657,7 @@ async function killTargets(targets, options, config) {
|
|
|
174410
174657
|
const terminated = await safelyTerminate(target.pid, context);
|
|
174411
174658
|
if (!terminated)
|
|
174412
174659
|
continue;
|
|
174413
|
-
await
|
|
174660
|
+
await delay6(options.graceMs ?? DEFAULT_GRACE_MS);
|
|
174414
174661
|
if (!await context.killer.isAlive(target.pid)) {
|
|
174415
174662
|
killed.push(target);
|
|
174416
174663
|
continue;
|
|
@@ -174469,7 +174716,7 @@ function writeSweepStamp(stampFile, nowMs) {
|
|
|
174469
174716
|
const stampDate = new Date(nowMs);
|
|
174470
174717
|
utimesSync(stampFile, stampDate, stampDate);
|
|
174471
174718
|
}
|
|
174472
|
-
function
|
|
174719
|
+
function delay6(ms) {
|
|
174473
174720
|
if (ms <= 0)
|
|
174474
174721
|
return Promise.resolve();
|
|
174475
174722
|
return new Promise((resolvePromise) => {
|
|
@@ -179834,7 +180081,7 @@ var TOPLEVEL_SENTINELS = [
|
|
|
179834
180081
|
field: "window_id"
|
|
179835
180082
|
}
|
|
179836
180083
|
];
|
|
179837
|
-
function
|
|
180084
|
+
function isRecord13(value) {
|
|
179838
180085
|
return typeof value == "object" && value !== null && !Array.isArray(value);
|
|
179839
180086
|
}
|
|
179840
180087
|
function toRfc3339(timestamp) {
|
|
@@ -179856,7 +180103,7 @@ function relocateInto(properties, key, value) {
|
|
|
179856
180103
|
properties[key] = value;
|
|
179857
180104
|
}
|
|
179858
180105
|
function buildV1Event(message) {
|
|
179859
|
-
const sourceProperties =
|
|
180106
|
+
const sourceProperties = isRecord13(message.properties) ? message.properties : {};
|
|
179860
180107
|
const properties = {
|
|
179861
180108
|
...sourceProperties
|
|
179862
180109
|
};
|