@agimon-ai/doompi-extension-contracts 0.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +34 -0
- package/dist/backgroundWork.cjs +2 -0
- package/dist/backgroundWork.cjs.map +1 -0
- package/dist/backgroundWork.d.cts +73 -0
- package/dist/backgroundWork.d.cts.map +1 -0
- package/dist/backgroundWork.d.mts +73 -0
- package/dist/backgroundWork.d.mts.map +1 -0
- package/dist/backgroundWork.mjs +2 -0
- package/dist/backgroundWork.mjs.map +1 -0
- package/dist/childProcess.cjs +2 -0
- package/dist/childProcess.cjs.map +1 -0
- package/dist/childProcess.d.cts +20 -0
- package/dist/childProcess.d.cts.map +1 -0
- package/dist/childProcess.d.mts +20 -0
- package/dist/childProcess.d.mts.map +1 -0
- package/dist/childProcess.mjs +2 -0
- package/dist/childProcess.mjs.map +1 -0
- package/dist/config.cjs +2 -0
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +517 -0
- package/dist/config.d.cts.map +1 -0
- package/dist/config.d.mts +517 -0
- package/dist/config.d.mts.map +1 -0
- package/dist/config.mjs +2 -0
- package/dist/config.mjs.map +1 -0
- package/dist/delegation.cjs +2 -0
- package/dist/delegation.cjs.map +1 -0
- package/dist/delegation.d.cts +114 -0
- package/dist/delegation.d.cts.map +1 -0
- package/dist/delegation.d.mts +114 -0
- package/dist/delegation.d.mts.map +1 -0
- package/dist/delegation.mjs +2 -0
- package/dist/delegation.mjs.map +1 -0
- package/dist/fablePlan.cjs +2 -0
- package/dist/fablePlan.cjs.map +1 -0
- package/dist/fablePlan.d.cts +143 -0
- package/dist/fablePlan.d.cts.map +1 -0
- package/dist/fablePlan.d.mts +143 -0
- package/dist/fablePlan.d.mts.map +1 -0
- package/dist/fablePlan.mjs +2 -0
- package/dist/fablePlan.mjs.map +1 -0
- package/dist/footer.cjs +2 -0
- package/dist/footer.cjs.map +1 -0
- package/dist/footer.d.cts +141 -0
- package/dist/footer.d.cts.map +1 -0
- package/dist/footer.d.mts +141 -0
- package/dist/footer.d.mts.map +1 -0
- package/dist/footer.mjs +2 -0
- package/dist/footer.mjs.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -0
- package/dist/leader.cjs +2 -0
- package/dist/leader.cjs.map +1 -0
- package/dist/leader.d.cts +171 -0
- package/dist/leader.d.cts.map +1 -0
- package/dist/leader.d.mts +171 -0
- package/dist/leader.d.mts.map +1 -0
- package/dist/leader.mjs +2 -0
- package/dist/leader.mjs.map +1 -0
- package/dist/mcpStatus.cjs +2 -0
- package/dist/mcpStatus.cjs.map +1 -0
- package/dist/mcpStatus.d.cts +79 -0
- package/dist/mcpStatus.d.cts.map +1 -0
- package/dist/mcpStatus.d.mts +79 -0
- package/dist/mcpStatus.d.mts.map +1 -0
- package/dist/mcpStatus.mjs +2 -0
- package/dist/mcpStatus.mjs.map +1 -0
- package/dist/mode.cjs +2 -0
- package/dist/mode.cjs.map +1 -0
- package/dist/mode.d.cts +132 -0
- package/dist/mode.d.cts.map +1 -0
- package/dist/mode.d.mts +132 -0
- package/dist/mode.d.mts.map +1 -0
- package/dist/mode.mjs +2 -0
- package/dist/mode.mjs.map +1 -0
- package/dist/protocol.cjs +2 -0
- package/dist/protocol.cjs.map +1 -0
- package/dist/protocol.d.cts +83 -0
- package/dist/protocol.d.cts.map +1 -0
- package/dist/protocol.d.mts +83 -0
- package/dist/protocol.d.mts.map +1 -0
- package/dist/protocol.mjs +2 -0
- package/dist/protocol.mjs.map +1 -0
- package/dist/runnerPty.cjs +2 -0
- package/dist/runnerPty.cjs.map +1 -0
- package/dist/runnerPty.d.cts +39 -0
- package/dist/runnerPty.d.cts.map +1 -0
- package/dist/runnerPty.d.mts +39 -0
- package/dist/runnerPty.d.mts.map +1 -0
- package/dist/runnerPty.mjs +2 -0
- package/dist/runnerPty.mjs.map +1 -0
- package/dist/skills.cjs +2 -0
- package/dist/skills.cjs.map +1 -0
- package/dist/skills.d.cts +51 -0
- package/dist/skills.d.cts.map +1 -0
- package/dist/skills.d.mts +51 -0
- package/dist/skills.d.mts.map +1 -0
- package/dist/skills.mjs +2 -0
- package/dist/skills.mjs.map +1 -0
- package/dist/subagentPolicy.cjs +2 -0
- package/dist/subagentPolicy.cjs.map +1 -0
- package/dist/subagentPolicy.d.cts +47 -0
- package/dist/subagentPolicy.d.cts.map +1 -0
- package/dist/subagentPolicy.d.mts +47 -0
- package/dist/subagentPolicy.d.mts.map +1 -0
- package/dist/subagentPolicy.mjs +2 -0
- package/dist/subagentPolicy.mjs.map +1 -0
- package/dist/subagentTool.cjs +2 -0
- package/dist/subagentTool.cjs.map +1 -0
- package/dist/subagentTool.d.cts +78 -0
- package/dist/subagentTool.d.cts.map +1 -0
- package/dist/subagentTool.d.mts +78 -0
- package/dist/subagentTool.d.mts.map +1 -0
- package/dist/subagentTool.mjs +2 -0
- package/dist/subagentTool.mjs.map +1 -0
- package/dist/workflow.cjs +2 -0
- package/dist/workflow.cjs.map +1 -0
- package/dist/workflow.d.cts +15 -0
- package/dist/workflow.d.cts.map +1 -0
- package/dist/workflow.d.mts +15 -0
- package/dist/workflow.d.mts.map +1 -0
- package/dist/workflow.mjs +2 -0
- package/dist/workflow.mjs.map +1 -0
- package/package.json +121 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { NotificationDefinition } from "./protocol.cjs";
|
|
2
|
+
import { Static, Type } from "typebox";
|
|
3
|
+
//#region src/delegation.d.ts
|
|
4
|
+
declare const DelegationRequestSchema: Type.TObject<{
|
|
5
|
+
requestId: Type.TString;
|
|
6
|
+
taskId: Type.TUnion<[Type.TString, Type.TNumber]>;
|
|
7
|
+
agent: Type.TString;
|
|
8
|
+
inlineAgent: Type.TOptional<Type.TObject<{
|
|
9
|
+
systemPrompt: Type.TString;
|
|
10
|
+
}>>;
|
|
11
|
+
prompt: Type.TString;
|
|
12
|
+
cwd: Type.TString;
|
|
13
|
+
model: Type.TOptional<Type.TString>;
|
|
14
|
+
context: Type.TOptional<Type.TUnion<[Type.TLiteral<"fresh">, Type.TLiteral<"fork">]>>;
|
|
15
|
+
timeoutMs: Type.TOptional<Type.TInteger>;
|
|
16
|
+
artifacts: Type.TOptional<Type.TBoolean>;
|
|
17
|
+
runMode: Type.TOptional<Type.TUnion<[Type.TLiteral<"foreground">, Type.TLiteral<"detached">]>>;
|
|
18
|
+
teamTask: Type.TOptional<Type.TObject<{
|
|
19
|
+
id: Type.TString;
|
|
20
|
+
subject: Type.TString;
|
|
21
|
+
}>>;
|
|
22
|
+
}>;
|
|
23
|
+
type DelegationRequest = Static<typeof DelegationRequestSchema>;
|
|
24
|
+
declare const DelegationAcceptedSchema: Type.TObject<{
|
|
25
|
+
requestId: Type.TString;
|
|
26
|
+
}>;
|
|
27
|
+
type DelegationAccepted = Static<typeof DelegationAcceptedSchema>;
|
|
28
|
+
declare const DelegationStartedSchema: Type.TObject<{
|
|
29
|
+
requestId: Type.TString;
|
|
30
|
+
runId: Type.TString;
|
|
31
|
+
}>;
|
|
32
|
+
type DelegationStarted = Static<typeof DelegationStartedSchema>;
|
|
33
|
+
declare const DelegationUpdateSchema: Type.TObject<{
|
|
34
|
+
requestId: Type.TString;
|
|
35
|
+
runId: Type.TString;
|
|
36
|
+
status: Type.TOptional<Type.TString>;
|
|
37
|
+
currentTool: Type.TOptional<Type.TString>;
|
|
38
|
+
toolCount: Type.TOptional<Type.TInteger>;
|
|
39
|
+
durationMs: Type.TOptional<Type.TInteger>;
|
|
40
|
+
tokens: Type.TOptional<Type.TInteger>;
|
|
41
|
+
}>;
|
|
42
|
+
type DelegationUpdate = Static<typeof DelegationUpdateSchema>;
|
|
43
|
+
declare const DelegationStatusSchema: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">, Type.TLiteral<"turn_budget_exhausted">, Type.TLiteral<"tool_budget_exhausted">, Type.TLiteral<"acceptance_failed">, Type.TLiteral<"invalid_request">, Type.TLiteral<"unavailable_context">]>;
|
|
44
|
+
type DelegationStatus = Static<typeof DelegationStatusSchema>;
|
|
45
|
+
declare const DelegationResultSchema: Type.TObject<{
|
|
46
|
+
requestId: Type.TString;
|
|
47
|
+
runId: Type.TString;
|
|
48
|
+
status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">, Type.TLiteral<"turn_budget_exhausted">, Type.TLiteral<"tool_budget_exhausted">, Type.TLiteral<"acceptance_failed">, Type.TLiteral<"invalid_request">, Type.TLiteral<"unavailable_context">]>;
|
|
49
|
+
output: Type.TOptional<Type.TString>;
|
|
50
|
+
error: Type.TOptional<Type.TString>;
|
|
51
|
+
outputPath: Type.TOptional<Type.TString>;
|
|
52
|
+
sessionFile: Type.TOptional<Type.TString>;
|
|
53
|
+
durationMs: Type.TOptional<Type.TInteger>;
|
|
54
|
+
toolCount: Type.TOptional<Type.TInteger>;
|
|
55
|
+
}>;
|
|
56
|
+
type DelegationResult = Static<typeof DelegationResultSchema>;
|
|
57
|
+
declare const DelegationCancelSchema: Type.TObject<{
|
|
58
|
+
requestId: Type.TString;
|
|
59
|
+
reason: Type.TOptional<Type.TString>;
|
|
60
|
+
}>;
|
|
61
|
+
type DelegationCancel = Static<typeof DelegationCancelSchema>;
|
|
62
|
+
declare const DelegationRequested: NotificationDefinition<Type.TObject<{
|
|
63
|
+
requestId: Type.TString;
|
|
64
|
+
taskId: Type.TUnion<[Type.TString, Type.TNumber]>;
|
|
65
|
+
agent: Type.TString;
|
|
66
|
+
inlineAgent: Type.TOptional<Type.TObject<{
|
|
67
|
+
systemPrompt: Type.TString;
|
|
68
|
+
}>>;
|
|
69
|
+
prompt: Type.TString;
|
|
70
|
+
cwd: Type.TString;
|
|
71
|
+
model: Type.TOptional<Type.TString>;
|
|
72
|
+
context: Type.TOptional<Type.TUnion<[Type.TLiteral<"fresh">, Type.TLiteral<"fork">]>>;
|
|
73
|
+
timeoutMs: Type.TOptional<Type.TInteger>;
|
|
74
|
+
artifacts: Type.TOptional<Type.TBoolean>;
|
|
75
|
+
runMode: Type.TOptional<Type.TUnion<[Type.TLiteral<"foreground">, Type.TLiteral<"detached">]>>;
|
|
76
|
+
teamTask: Type.TOptional<Type.TObject<{
|
|
77
|
+
id: Type.TString;
|
|
78
|
+
subject: Type.TString;
|
|
79
|
+
}>>;
|
|
80
|
+
}>>;
|
|
81
|
+
declare const DelegationAccepted: NotificationDefinition<Type.TObject<{
|
|
82
|
+
requestId: Type.TString;
|
|
83
|
+
}>>;
|
|
84
|
+
declare const DelegationStarted: NotificationDefinition<Type.TObject<{
|
|
85
|
+
requestId: Type.TString;
|
|
86
|
+
runId: Type.TString;
|
|
87
|
+
}>>;
|
|
88
|
+
declare const DelegationUpdated: NotificationDefinition<Type.TObject<{
|
|
89
|
+
requestId: Type.TString;
|
|
90
|
+
runId: Type.TString;
|
|
91
|
+
status: Type.TOptional<Type.TString>;
|
|
92
|
+
currentTool: Type.TOptional<Type.TString>;
|
|
93
|
+
toolCount: Type.TOptional<Type.TInteger>;
|
|
94
|
+
durationMs: Type.TOptional<Type.TInteger>;
|
|
95
|
+
tokens: Type.TOptional<Type.TInteger>;
|
|
96
|
+
}>>;
|
|
97
|
+
declare const DelegationFinished: NotificationDefinition<Type.TObject<{
|
|
98
|
+
requestId: Type.TString;
|
|
99
|
+
runId: Type.TString;
|
|
100
|
+
status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">, Type.TLiteral<"turn_budget_exhausted">, Type.TLiteral<"tool_budget_exhausted">, Type.TLiteral<"acceptance_failed">, Type.TLiteral<"invalid_request">, Type.TLiteral<"unavailable_context">]>;
|
|
101
|
+
output: Type.TOptional<Type.TString>;
|
|
102
|
+
error: Type.TOptional<Type.TString>;
|
|
103
|
+
outputPath: Type.TOptional<Type.TString>;
|
|
104
|
+
sessionFile: Type.TOptional<Type.TString>;
|
|
105
|
+
durationMs: Type.TOptional<Type.TInteger>;
|
|
106
|
+
toolCount: Type.TOptional<Type.TInteger>;
|
|
107
|
+
}>>;
|
|
108
|
+
declare const DelegationCancelled: NotificationDefinition<Type.TObject<{
|
|
109
|
+
requestId: Type.TString;
|
|
110
|
+
reason: Type.TOptional<Type.TString>;
|
|
111
|
+
}>>;
|
|
112
|
+
//#endregion
|
|
113
|
+
export { DelegationAccepted, DelegationAcceptedSchema, DelegationCancel, DelegationCancelSchema, DelegationCancelled, DelegationFinished, DelegationRequest, DelegationRequestSchema, DelegationRequested, DelegationResult, DelegationResultSchema, DelegationStarted, DelegationStartedSchema, DelegationStatus, DelegationStatusSchema, DelegationUpdate, DelegationUpdateSchema, DelegationUpdated };
|
|
114
|
+
//# sourceMappingURL=delegation.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation.d.cts","names":[],"sources":["../src/delegation.ts"],"mappings":";;;cAIa,yBAAuB,KAAA;;;;;;;;;;;;;;;;;;;KAsBxB,oBAAoB,cAAc;cAEjC,0BAAwB,KAAA;aAAxB,KAAA;;KAID,qBAAqB,cAAc;cAElC,yBAAuB,KAAA;;;;KAIxB,oBAAoB,cAAc;cAEjC,wBAAsB,KAAA;;;;;;;;;KAYvB,mBAAmB,cAAc;cAEhC,wBAAsB,KAAA,QAAA,KAAA,uBAAA,KAAA,oBAAA,KAAA,uBAAA,KAAA,uBAAA,KAAA,yBAAA,KAAA,mCAAA,KAAA,mCAAA,KAAA,+BAAA,KAAA,6BAAA,KAAA;KAYvB,mBAAmB,cAAc;cAEhC,wBAAsB,KAAA;;;;;;;;;;;KAcvB,mBAAmB,cAAc;cAEhC,wBAAsB,KAAA;;;;KAIvB,mBAAmB,cAAc;cAEhC,qBAAmB,uBAAA,KAAA;;;;;;;;;;;;;;;;;;;cAMnB,oBAAkB,uBAAA,KAAA;;;cAMlB,mBAAiB,uBAAA,KAAA;;;;cAMjB,mBAAiB,uBAAA,KAAA;;;;;;;;;cAMjB,oBAAkB,uBAAA,KAAA;;;;;;;;;;;cAMlB,qBAAmB,uBAAA,KAAA"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { NotificationDefinition } from "./protocol.mjs";
|
|
2
|
+
import { Static, Type } from "typebox";
|
|
3
|
+
//#region src/delegation.d.ts
|
|
4
|
+
declare const DelegationRequestSchema: Type.TObject<{
|
|
5
|
+
requestId: Type.TString;
|
|
6
|
+
taskId: Type.TUnion<[Type.TString, Type.TNumber]>;
|
|
7
|
+
agent: Type.TString;
|
|
8
|
+
inlineAgent: Type.TOptional<Type.TObject<{
|
|
9
|
+
systemPrompt: Type.TString;
|
|
10
|
+
}>>;
|
|
11
|
+
prompt: Type.TString;
|
|
12
|
+
cwd: Type.TString;
|
|
13
|
+
model: Type.TOptional<Type.TString>;
|
|
14
|
+
context: Type.TOptional<Type.TUnion<[Type.TLiteral<"fresh">, Type.TLiteral<"fork">]>>;
|
|
15
|
+
timeoutMs: Type.TOptional<Type.TInteger>;
|
|
16
|
+
artifacts: Type.TOptional<Type.TBoolean>;
|
|
17
|
+
runMode: Type.TOptional<Type.TUnion<[Type.TLiteral<"foreground">, Type.TLiteral<"detached">]>>;
|
|
18
|
+
teamTask: Type.TOptional<Type.TObject<{
|
|
19
|
+
id: Type.TString;
|
|
20
|
+
subject: Type.TString;
|
|
21
|
+
}>>;
|
|
22
|
+
}>;
|
|
23
|
+
type DelegationRequest = Static<typeof DelegationRequestSchema>;
|
|
24
|
+
declare const DelegationAcceptedSchema: Type.TObject<{
|
|
25
|
+
requestId: Type.TString;
|
|
26
|
+
}>;
|
|
27
|
+
type DelegationAccepted = Static<typeof DelegationAcceptedSchema>;
|
|
28
|
+
declare const DelegationStartedSchema: Type.TObject<{
|
|
29
|
+
requestId: Type.TString;
|
|
30
|
+
runId: Type.TString;
|
|
31
|
+
}>;
|
|
32
|
+
type DelegationStarted = Static<typeof DelegationStartedSchema>;
|
|
33
|
+
declare const DelegationUpdateSchema: Type.TObject<{
|
|
34
|
+
requestId: Type.TString;
|
|
35
|
+
runId: Type.TString;
|
|
36
|
+
status: Type.TOptional<Type.TString>;
|
|
37
|
+
currentTool: Type.TOptional<Type.TString>;
|
|
38
|
+
toolCount: Type.TOptional<Type.TInteger>;
|
|
39
|
+
durationMs: Type.TOptional<Type.TInteger>;
|
|
40
|
+
tokens: Type.TOptional<Type.TInteger>;
|
|
41
|
+
}>;
|
|
42
|
+
type DelegationUpdate = Static<typeof DelegationUpdateSchema>;
|
|
43
|
+
declare const DelegationStatusSchema: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">, Type.TLiteral<"turn_budget_exhausted">, Type.TLiteral<"tool_budget_exhausted">, Type.TLiteral<"acceptance_failed">, Type.TLiteral<"invalid_request">, Type.TLiteral<"unavailable_context">]>;
|
|
44
|
+
type DelegationStatus = Static<typeof DelegationStatusSchema>;
|
|
45
|
+
declare const DelegationResultSchema: Type.TObject<{
|
|
46
|
+
requestId: Type.TString;
|
|
47
|
+
runId: Type.TString;
|
|
48
|
+
status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">, Type.TLiteral<"turn_budget_exhausted">, Type.TLiteral<"tool_budget_exhausted">, Type.TLiteral<"acceptance_failed">, Type.TLiteral<"invalid_request">, Type.TLiteral<"unavailable_context">]>;
|
|
49
|
+
output: Type.TOptional<Type.TString>;
|
|
50
|
+
error: Type.TOptional<Type.TString>;
|
|
51
|
+
outputPath: Type.TOptional<Type.TString>;
|
|
52
|
+
sessionFile: Type.TOptional<Type.TString>;
|
|
53
|
+
durationMs: Type.TOptional<Type.TInteger>;
|
|
54
|
+
toolCount: Type.TOptional<Type.TInteger>;
|
|
55
|
+
}>;
|
|
56
|
+
type DelegationResult = Static<typeof DelegationResultSchema>;
|
|
57
|
+
declare const DelegationCancelSchema: Type.TObject<{
|
|
58
|
+
requestId: Type.TString;
|
|
59
|
+
reason: Type.TOptional<Type.TString>;
|
|
60
|
+
}>;
|
|
61
|
+
type DelegationCancel = Static<typeof DelegationCancelSchema>;
|
|
62
|
+
declare const DelegationRequested: NotificationDefinition<Type.TObject<{
|
|
63
|
+
requestId: Type.TString;
|
|
64
|
+
taskId: Type.TUnion<[Type.TString, Type.TNumber]>;
|
|
65
|
+
agent: Type.TString;
|
|
66
|
+
inlineAgent: Type.TOptional<Type.TObject<{
|
|
67
|
+
systemPrompt: Type.TString;
|
|
68
|
+
}>>;
|
|
69
|
+
prompt: Type.TString;
|
|
70
|
+
cwd: Type.TString;
|
|
71
|
+
model: Type.TOptional<Type.TString>;
|
|
72
|
+
context: Type.TOptional<Type.TUnion<[Type.TLiteral<"fresh">, Type.TLiteral<"fork">]>>;
|
|
73
|
+
timeoutMs: Type.TOptional<Type.TInteger>;
|
|
74
|
+
artifacts: Type.TOptional<Type.TBoolean>;
|
|
75
|
+
runMode: Type.TOptional<Type.TUnion<[Type.TLiteral<"foreground">, Type.TLiteral<"detached">]>>;
|
|
76
|
+
teamTask: Type.TOptional<Type.TObject<{
|
|
77
|
+
id: Type.TString;
|
|
78
|
+
subject: Type.TString;
|
|
79
|
+
}>>;
|
|
80
|
+
}>>;
|
|
81
|
+
declare const DelegationAccepted: NotificationDefinition<Type.TObject<{
|
|
82
|
+
requestId: Type.TString;
|
|
83
|
+
}>>;
|
|
84
|
+
declare const DelegationStarted: NotificationDefinition<Type.TObject<{
|
|
85
|
+
requestId: Type.TString;
|
|
86
|
+
runId: Type.TString;
|
|
87
|
+
}>>;
|
|
88
|
+
declare const DelegationUpdated: NotificationDefinition<Type.TObject<{
|
|
89
|
+
requestId: Type.TString;
|
|
90
|
+
runId: Type.TString;
|
|
91
|
+
status: Type.TOptional<Type.TString>;
|
|
92
|
+
currentTool: Type.TOptional<Type.TString>;
|
|
93
|
+
toolCount: Type.TOptional<Type.TInteger>;
|
|
94
|
+
durationMs: Type.TOptional<Type.TInteger>;
|
|
95
|
+
tokens: Type.TOptional<Type.TInteger>;
|
|
96
|
+
}>>;
|
|
97
|
+
declare const DelegationFinished: NotificationDefinition<Type.TObject<{
|
|
98
|
+
requestId: Type.TString;
|
|
99
|
+
runId: Type.TString;
|
|
100
|
+
status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">, Type.TLiteral<"turn_budget_exhausted">, Type.TLiteral<"tool_budget_exhausted">, Type.TLiteral<"acceptance_failed">, Type.TLiteral<"invalid_request">, Type.TLiteral<"unavailable_context">]>;
|
|
101
|
+
output: Type.TOptional<Type.TString>;
|
|
102
|
+
error: Type.TOptional<Type.TString>;
|
|
103
|
+
outputPath: Type.TOptional<Type.TString>;
|
|
104
|
+
sessionFile: Type.TOptional<Type.TString>;
|
|
105
|
+
durationMs: Type.TOptional<Type.TInteger>;
|
|
106
|
+
toolCount: Type.TOptional<Type.TInteger>;
|
|
107
|
+
}>>;
|
|
108
|
+
declare const DelegationCancelled: NotificationDefinition<Type.TObject<{
|
|
109
|
+
requestId: Type.TString;
|
|
110
|
+
reason: Type.TOptional<Type.TString>;
|
|
111
|
+
}>>;
|
|
112
|
+
//#endregion
|
|
113
|
+
export { DelegationAccepted, DelegationAcceptedSchema, DelegationCancel, DelegationCancelSchema, DelegationCancelled, DelegationFinished, DelegationRequest, DelegationRequestSchema, DelegationRequested, DelegationResult, DelegationResultSchema, DelegationStarted, DelegationStartedSchema, DelegationStatus, DelegationStatusSchema, DelegationUpdate, DelegationUpdateSchema, DelegationUpdated };
|
|
114
|
+
//# sourceMappingURL=delegation.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation.d.mts","names":[],"sources":["../src/delegation.ts"],"mappings":";;;cAIa,yBAAuB,KAAA;;;;;;;;;;;;;;;;;;;KAsBxB,oBAAoB,cAAc;cAEjC,0BAAwB,KAAA;aAAxB,KAAA;;KAID,qBAAqB,cAAc;cAElC,yBAAuB,KAAA;;;;KAIxB,oBAAoB,cAAc;cAEjC,wBAAsB,KAAA;;;;;;;;;KAYvB,mBAAmB,cAAc;cAEhC,wBAAsB,KAAA,QAAA,KAAA,uBAAA,KAAA,oBAAA,KAAA,uBAAA,KAAA,uBAAA,KAAA,yBAAA,KAAA,mCAAA,KAAA,mCAAA,KAAA,+BAAA,KAAA,6BAAA,KAAA;KAYvB,mBAAmB,cAAc;cAEhC,wBAAsB,KAAA;;;;;;;;;;;KAcvB,mBAAmB,cAAc;cAEhC,wBAAsB,KAAA;;;;KAIvB,mBAAmB,cAAc;cAEhC,qBAAmB,uBAAA,KAAA;;;;;;;;;;;;;;;;;;;cAMnB,oBAAkB,uBAAA,KAAA;;;cAMlB,mBAAiB,uBAAA,KAAA;;;;cAMjB,mBAAiB,uBAAA,KAAA;;;;;;;;;cAMjB,oBAAkB,uBAAA,KAAA;;;;;;;;;;;cAMlB,qBAAmB,uBAAA,KAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{defineNotification as e}from"./protocol.mjs";import{InlineAgentSchema as t}from"./subagentTool.mjs";import{Type as n}from"typebox";const r=n.Object({requestId:n.String({minLength:1}),taskId:n.Union([n.String(),n.Number()]),agent:n.String({minLength:1}),inlineAgent:n.Optional(t),prompt:n.String({minLength:1}),cwd:n.String({minLength:1}),model:n.Optional(n.String({minLength:1})),context:n.Optional(n.Union([n.Literal(`fresh`),n.Literal(`fork`)])),timeoutMs:n.Optional(n.Integer({minimum:1})),artifacts:n.Optional(n.Boolean()),runMode:n.Optional(n.Union([n.Literal(`foreground`),n.Literal(`detached`)])),teamTask:n.Optional(n.Object({id:n.String({minLength:1}),subject:n.String({minLength:1})},{additionalProperties:!1}))},{additionalProperties:!1}),i=n.Object({requestId:n.String({minLength:1})},{additionalProperties:!1}),a=n.Object({requestId:n.String({minLength:1}),runId:n.String({minLength:1})},{additionalProperties:!1}),o=n.Object({requestId:n.String({minLength:1}),runId:n.String({minLength:1}),status:n.Optional(n.String({minLength:1})),currentTool:n.Optional(n.String({minLength:1})),toolCount:n.Optional(n.Integer({minimum:0})),durationMs:n.Optional(n.Integer({minimum:0})),tokens:n.Optional(n.Integer({minimum:0}))},{additionalProperties:!1}),s=n.Union([n.Literal(`completed`),n.Literal(`failed`),n.Literal(`timed_out`),n.Literal(`cancelled`),n.Literal(`interrupted`),n.Literal(`turn_budget_exhausted`),n.Literal(`tool_budget_exhausted`),n.Literal(`acceptance_failed`),n.Literal(`invalid_request`),n.Literal(`unavailable_context`)]),c=n.Object({requestId:n.String({minLength:1}),runId:n.String({minLength:1}),status:s,output:n.Optional(n.String()),error:n.Optional(n.String()),outputPath:n.Optional(n.String({minLength:1})),sessionFile:n.Optional(n.String({minLength:1})),durationMs:n.Optional(n.Integer({minimum:0})),toolCount:n.Optional(n.Integer({minimum:0}))},{additionalProperties:!1}),l=n.Object({requestId:n.String({minLength:1}),reason:n.Optional(n.String({minLength:1}))},{additionalProperties:!1}),u=e({channel:`doom:team:delegation:v1:requested`,kind:`delegation.requested`,payload:r}),d=e({channel:`doom:team:delegation:v1:accepted`,kind:`delegation.accepted`,payload:i}),f=e({channel:`doom:team:delegation:v1:started`,kind:`delegation.started`,payload:a}),p=e({channel:`doom:team:delegation:v1:updated`,kind:`delegation.updated`,payload:o}),m=e({channel:`doom:team:delegation:v1:finished`,kind:`delegation.finished`,payload:c}),h=e({channel:`doom:team:delegation:v1:cancelled`,kind:`delegation.cancelled`,payload:l});export{d as DelegationAccepted,i as DelegationAcceptedSchema,l as DelegationCancelSchema,h as DelegationCancelled,m as DelegationFinished,r as DelegationRequestSchema,u as DelegationRequested,c as DelegationResultSchema,f as DelegationStarted,a as DelegationStartedSchema,s as DelegationStatusSchema,o as DelegationUpdateSchema,p as DelegationUpdated};
|
|
2
|
+
//# sourceMappingURL=delegation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation.mjs","names":[],"sources":["../src/delegation.ts"],"sourcesContent":["import { type Static, Type } from 'typebox';\nimport { defineNotification } from './protocol.ts';\nimport { InlineAgentSchema } from './subagentTool.ts';\n\nexport const DelegationRequestSchema = Type.Object(\n {\n requestId: Type.String({ minLength: 1 }),\n taskId: Type.Union([Type.String(), Type.Number()]),\n agent: Type.String({ minLength: 1 }),\n inlineAgent: Type.Optional(InlineAgentSchema),\n prompt: Type.String({ minLength: 1 }),\n cwd: Type.String({ minLength: 1 }),\n model: Type.Optional(Type.String({ minLength: 1 })),\n context: Type.Optional(Type.Union([Type.Literal('fresh'), Type.Literal('fork')])),\n timeoutMs: Type.Optional(Type.Integer({ minimum: 1 })),\n artifacts: Type.Optional(Type.Boolean()),\n runMode: Type.Optional(Type.Union([Type.Literal('foreground'), Type.Literal('detached')])),\n teamTask: Type.Optional(\n Type.Object(\n { id: Type.String({ minLength: 1 }), subject: Type.String({ minLength: 1 }) },\n { additionalProperties: false },\n ),\n ),\n },\n { additionalProperties: false },\n);\nexport type DelegationRequest = Static<typeof DelegationRequestSchema>;\n\nexport const DelegationAcceptedSchema = Type.Object(\n { requestId: Type.String({ minLength: 1 }) },\n { additionalProperties: false },\n);\nexport type DelegationAccepted = Static<typeof DelegationAcceptedSchema>;\n\nexport const DelegationStartedSchema = Type.Object(\n { requestId: Type.String({ minLength: 1 }), runId: Type.String({ minLength: 1 }) },\n { additionalProperties: false },\n);\nexport type DelegationStarted = Static<typeof DelegationStartedSchema>;\n\nexport const DelegationUpdateSchema = Type.Object(\n {\n requestId: Type.String({ minLength: 1 }),\n runId: Type.String({ minLength: 1 }),\n status: Type.Optional(Type.String({ minLength: 1 })),\n currentTool: Type.Optional(Type.String({ minLength: 1 })),\n toolCount: Type.Optional(Type.Integer({ minimum: 0 })),\n durationMs: Type.Optional(Type.Integer({ minimum: 0 })),\n tokens: Type.Optional(Type.Integer({ minimum: 0 })),\n },\n { additionalProperties: false },\n);\nexport type DelegationUpdate = Static<typeof DelegationUpdateSchema>;\n\nexport const DelegationStatusSchema = Type.Union([\n Type.Literal('completed'),\n Type.Literal('failed'),\n Type.Literal('timed_out'),\n Type.Literal('cancelled'),\n Type.Literal('interrupted'),\n Type.Literal('turn_budget_exhausted'),\n Type.Literal('tool_budget_exhausted'),\n Type.Literal('acceptance_failed'),\n Type.Literal('invalid_request'),\n Type.Literal('unavailable_context'),\n]);\nexport type DelegationStatus = Static<typeof DelegationStatusSchema>;\n\nexport const DelegationResultSchema = Type.Object(\n {\n requestId: Type.String({ minLength: 1 }),\n runId: Type.String({ minLength: 1 }),\n status: DelegationStatusSchema,\n output: Type.Optional(Type.String()),\n error: Type.Optional(Type.String()),\n outputPath: Type.Optional(Type.String({ minLength: 1 })),\n sessionFile: Type.Optional(Type.String({ minLength: 1 })),\n durationMs: Type.Optional(Type.Integer({ minimum: 0 })),\n toolCount: Type.Optional(Type.Integer({ minimum: 0 })),\n },\n { additionalProperties: false },\n);\nexport type DelegationResult = Static<typeof DelegationResultSchema>;\n\nexport const DelegationCancelSchema = Type.Object(\n { requestId: Type.String({ minLength: 1 }), reason: Type.Optional(Type.String({ minLength: 1 })) },\n { additionalProperties: false },\n);\nexport type DelegationCancel = Static<typeof DelegationCancelSchema>;\n\nexport const DelegationRequested = defineNotification({\n channel: 'doom:team:delegation:v1:requested',\n kind: 'delegation.requested',\n payload: DelegationRequestSchema,\n});\n\nexport const DelegationAccepted = defineNotification({\n channel: 'doom:team:delegation:v1:accepted',\n kind: 'delegation.accepted',\n payload: DelegationAcceptedSchema,\n});\n\nexport const DelegationStarted = defineNotification({\n channel: 'doom:team:delegation:v1:started',\n kind: 'delegation.started',\n payload: DelegationStartedSchema,\n});\n\nexport const DelegationUpdated = defineNotification({\n channel: 'doom:team:delegation:v1:updated',\n kind: 'delegation.updated',\n payload: DelegationUpdateSchema,\n});\n\nexport const DelegationFinished = defineNotification({\n channel: 'doom:team:delegation:v1:finished',\n kind: 'delegation.finished',\n payload: DelegationResultSchema,\n});\n\nexport const DelegationCancelled = defineNotification({\n channel: 'doom:team:delegation:v1:cancelled',\n kind: 'delegation.cancelled',\n payload: DelegationCancelSchema,\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./protocol.cjs");let t=require("typebox"),n=require("typebox/value");const r=`@agimon-ai/doompi-plan`,i=`claude`,a=`fable`,o=`claude/fable-plan-v1`,s=16384,c=t.Type.String({minLength:1,maxLength:128}),l=t.Type.String({minLength:1,maxLength:128}),u=t.Type.String({minLength:1,maxLength:4096}),d=t.Type.Object({path:t.Type.String({minLength:1,maxLength:512}),finding:u},{additionalProperties:!1}),f=t.Type.Object({goal:t.Type.Array(u,{minItems:1,maxItems:8}),constraints:t.Type.Array(u,{maxItems:16}),decisions:t.Type.Array(u,{maxItems:16}),verifiedFindings:t.Type.Array(d,{maxItems:24}),inferredFindings:t.Type.Array(u,{maxItems:24}),unresolvedQuestions:t.Type.Array(u,{maxItems:16}),currentPlan:t.Type.Optional(t.Type.String({maxLength:16384}))},{additionalProperties:!1}),p=t.Type.Union([t.Type.Literal(`draft`),t.Type.Literal(`review`),t.Type.Literal(`completed`),t.Type.Literal(`failed`),t.Type.Literal(`cancelled`),t.Type.Literal(`interrupted`)]),m=t.Type.Union([t.Type.Literal(`completed`),t.Type.Literal(`failed`),t.Type.Literal(`timed_out`),t.Type.Literal(`cancelled`),t.Type.Literal(`interrupted`)]),h=t.Type.Object({requester:t.Type.Literal(r),operationId:c,runtime:t.Type.Literal(i),model:t.Type.Literal(a),profile:t.Type.Literal(o),packet:f},{additionalProperties:!1}),g=t.Type.Object({operationId:c,runId:l,stage:t.Type.Union([t.Type.Literal(`draft`),t.Type.Literal(`review`)])},{additionalProperties:!1}),_=t.Type.Object({operationId:c,runId:l,stage:t.Type.Union([t.Type.Literal(`draft`),t.Type.Literal(`review`)]),status:t.Type.String({minLength:1,maxLength:128}),durationMs:t.Type.Integer({minimum:0})},{additionalProperties:!1}),v=t.Type.Object({operationId:c,status:m,stage:p,draft:t.Type.Optional(t.Type.String({maxLength:s})),review:t.Type.Optional(t.Type.String({maxLength:s})),draftRunId:t.Type.Optional(l),reviewRunId:t.Type.Optional(l),durationMs:t.Type.Integer({minimum:0}),errorCode:t.Type.Optional(t.Type.String({minLength:1,maxLength:128}))},{additionalProperties:!1}),y=t.Type.Object({requester:t.Type.Literal(r),operationId:c,reason:t.Type.String({minLength:1,maxLength:128})},{additionalProperties:!1}),b=e.defineNotification({channel:`doom:team:fable-plan:v1:start`,kind:`fable-plan.start`,payload:h}),x=e.defineNotification({channel:`doom:team:fable-plan:v1:started`,kind:`fable-plan.started`,payload:g}),S=e.defineNotification({channel:`doom:team:fable-plan:v1:progress`,kind:`fable-plan.progress`,payload:_}),C=e.defineNotification({channel:`doom:team:fable-plan:v1:result`,kind:`fable-plan.result`,payload:v}),w=e.defineNotification({channel:`doom:team:fable-plan:v1:cancel`,kind:`fable-plan.cancel`,payload:y}),T=Symbol.for(`@agimon-ai/doompi-team.fable-plan-brokers.v2`),E=Symbol.for(`@agimon-ai/doompi-team.fable-plan-brokers.v1`);function D(){let e=globalThis,t=e[T]??e[E]??new Map;return e[T]=t,e[E]=t,t}function O(e){let t=e.trim(),n=!1;for(let e of t){let t=e.codePointAt(0);if(t!==void 0&&(t<=31||t===127)){n=!0;break}}if(!t||t.length>256||n)throw Error(`Invalid Fable broker session id.`);return t}function k(e,t){if((0,n.Check)(e,t))return;let r=(0,n.Errors)(e,t).slice(0,3).map(e=>`${e.instancePath||`/`} ${e.message}`).join(`; `);throw Error(`Invalid Fable broker payload: ${r}`)}function A(e,t){let n=O(e),r=D();if(r.has(n))throw Error(`A Fable broker is already registered for session '${n}'.`);r.set(n,t);let i=!1;return{dispose(){if(i)return;i=!0;let e=D();e.get(n)===t&&e.delete(n)}}}function j(e){let t=()=>{let t=e();if(t)return D().get(O(t))};return{isAvailable:()=>t()!==void 0,async start(e,n){k(h,e);let r=t();if(!r)throw Error(`The session-bound Fable broker is unavailable.`);return r.start(e,n)},cancel(e){k(y,e);let n=t();n&&n.cancel(e)}}}exports.FABLE_PLAN_MODEL=a,exports.FABLE_PLAN_PROFILE=o,exports.FABLE_PLAN_REQUESTER=r,exports.FABLE_PLAN_RUNTIME=i,exports.FablePlanCancel=w,exports.FablePlanCancelSchema=y,exports.FablePlanFindingSchema=d,exports.FablePlanPacketSchema=f,exports.FablePlanProgress=S,exports.FablePlanProgressSchema=_,exports.FablePlanResult=C,exports.FablePlanResultSchema=v,exports.FablePlanStageSchema=p,exports.FablePlanStart=b,exports.FablePlanStartSchema=h,exports.FablePlanStarted=x,exports.FablePlanStartedSchema=g,exports.FablePlanStatusSchema=m,exports.createFablePlanBrokerClient=j,exports.registerFablePlanBroker=A;
|
|
2
|
+
//# sourceMappingURL=fablePlan.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fablePlan.cjs","names":["Type","defineNotification","Check","Errors"],"sources":["../src/fablePlan.ts"],"sourcesContent":["import { type Static, Type } from 'typebox';\nimport { Check, Errors } from 'typebox/value';\nimport { defineNotification } from './protocol.ts';\n\nexport const FABLE_PLAN_REQUESTER = '@agimon-ai/doompi-plan' as const;\nexport const FABLE_PLAN_RUNTIME = 'claude' as const;\nexport const FABLE_PLAN_MODEL = 'fable' as const;\nexport const FABLE_PLAN_PROFILE = 'claude/fable-plan-v1' as const;\n\nconst MAX_OPERATION_ID_LENGTH = 128;\nconst MAX_RUN_ID_LENGTH = 128;\nconst MAX_SOURCE_PATH_LENGTH = 512;\nconst MAX_ITEM_LENGTH = 4_096;\nconst MAX_GOAL_ITEMS = 8;\nconst MAX_CONSTRAINT_ITEMS = 16;\nconst MAX_DECISION_ITEMS = 16;\nconst MAX_FINDING_ITEMS = 24;\nconst MAX_QUESTION_ITEMS = 16;\nconst MAX_PLAN_LENGTH = 16_384;\nconst MAX_OUTPUT_LENGTH = 16_384;\nconst MAX_ERROR_CODE_LENGTH = 128;\nconst MAX_STATUS_LENGTH = 128;\n\nconst OperationIdSchema = Type.String({ minLength: 1, maxLength: MAX_OPERATION_ID_LENGTH });\nconst RunIdSchema = Type.String({ minLength: 1, maxLength: MAX_RUN_ID_LENGTH });\nconst ItemSchema = Type.String({ minLength: 1, maxLength: MAX_ITEM_LENGTH });\n\nexport const FablePlanFindingSchema = Type.Object(\n {\n path: Type.String({ minLength: 1, maxLength: MAX_SOURCE_PATH_LENGTH }),\n finding: ItemSchema,\n },\n { additionalProperties: false },\n);\nexport type FablePlanFinding = Static<typeof FablePlanFindingSchema>;\n\nexport const FablePlanPacketSchema = Type.Object(\n {\n goal: Type.Array(ItemSchema, { minItems: 1, maxItems: MAX_GOAL_ITEMS }),\n constraints: Type.Array(ItemSchema, { maxItems: MAX_CONSTRAINT_ITEMS }),\n decisions: Type.Array(ItemSchema, { maxItems: MAX_DECISION_ITEMS }),\n verifiedFindings: Type.Array(FablePlanFindingSchema, { maxItems: MAX_FINDING_ITEMS }),\n inferredFindings: Type.Array(ItemSchema, { maxItems: MAX_FINDING_ITEMS }),\n unresolvedQuestions: Type.Array(ItemSchema, { maxItems: MAX_QUESTION_ITEMS }),\n currentPlan: Type.Optional(Type.String({ maxLength: MAX_PLAN_LENGTH })),\n },\n { additionalProperties: false },\n);\nexport type FablePlanPacket = Static<typeof FablePlanPacketSchema>;\n\nexport const FablePlanStageSchema = Type.Union([\n Type.Literal('draft'),\n Type.Literal('review'),\n Type.Literal('completed'),\n Type.Literal('failed'),\n Type.Literal('cancelled'),\n Type.Literal('interrupted'),\n]);\nexport type FablePlanStage = Static<typeof FablePlanStageSchema>;\n\nexport const FablePlanStatusSchema = Type.Union([\n Type.Literal('completed'),\n Type.Literal('failed'),\n Type.Literal('timed_out'),\n Type.Literal('cancelled'),\n Type.Literal('interrupted'),\n]);\nexport type FablePlanStatus = Static<typeof FablePlanStatusSchema>;\n\nexport const FablePlanStartSchema = Type.Object(\n {\n requester: Type.Literal(FABLE_PLAN_REQUESTER),\n operationId: OperationIdSchema,\n runtime: Type.Literal(FABLE_PLAN_RUNTIME),\n model: Type.Literal(FABLE_PLAN_MODEL),\n profile: Type.Literal(FABLE_PLAN_PROFILE),\n packet: FablePlanPacketSchema,\n },\n { additionalProperties: false },\n);\nexport type FablePlanStartPayload = Static<typeof FablePlanStartSchema>;\n\nexport const FablePlanStartedSchema = Type.Object(\n {\n operationId: OperationIdSchema,\n runId: RunIdSchema,\n stage: Type.Union([Type.Literal('draft'), Type.Literal('review')]),\n },\n { additionalProperties: false },\n);\nexport type FablePlanStartedPayload = Static<typeof FablePlanStartedSchema>;\n\nexport const FablePlanProgressSchema = Type.Object(\n {\n operationId: OperationIdSchema,\n runId: RunIdSchema,\n stage: Type.Union([Type.Literal('draft'), Type.Literal('review')]),\n status: Type.String({ minLength: 1, maxLength: MAX_STATUS_LENGTH }),\n durationMs: Type.Integer({ minimum: 0 }),\n },\n { additionalProperties: false },\n);\nexport type FablePlanProgressPayload = Static<typeof FablePlanProgressSchema>;\n\nexport const FablePlanResultSchema = Type.Object(\n {\n operationId: OperationIdSchema,\n status: FablePlanStatusSchema,\n stage: FablePlanStageSchema,\n draft: Type.Optional(Type.String({ maxLength: MAX_OUTPUT_LENGTH })),\n review: Type.Optional(Type.String({ maxLength: MAX_OUTPUT_LENGTH })),\n draftRunId: Type.Optional(RunIdSchema),\n reviewRunId: Type.Optional(RunIdSchema),\n durationMs: Type.Integer({ minimum: 0 }),\n errorCode: Type.Optional(Type.String({ minLength: 1, maxLength: MAX_ERROR_CODE_LENGTH })),\n },\n { additionalProperties: false },\n);\nexport type FablePlanResultPayload = Static<typeof FablePlanResultSchema>;\n\nexport const FablePlanCancelSchema = Type.Object(\n {\n requester: Type.Literal(FABLE_PLAN_REQUESTER),\n operationId: OperationIdSchema,\n reason: Type.String({ minLength: 1, maxLength: MAX_STATUS_LENGTH }),\n },\n { additionalProperties: false },\n);\nexport type FablePlanCancelPayload = Static<typeof FablePlanCancelSchema>;\n\nexport const FablePlanStart = defineNotification({\n channel: 'doom:team:fable-plan:v1:start',\n kind: 'fable-plan.start',\n payload: FablePlanStartSchema,\n});\n\nexport const FablePlanStarted = defineNotification({\n channel: 'doom:team:fable-plan:v1:started',\n kind: 'fable-plan.started',\n payload: FablePlanStartedSchema,\n});\n\nexport const FablePlanProgress = defineNotification({\n channel: 'doom:team:fable-plan:v1:progress',\n kind: 'fable-plan.progress',\n payload: FablePlanProgressSchema,\n});\n\nexport const FablePlanResult = defineNotification({\n channel: 'doom:team:fable-plan:v1:result',\n kind: 'fable-plan.result',\n payload: FablePlanResultSchema,\n});\n\nexport const FablePlanCancel = defineNotification({\n channel: 'doom:team:fable-plan:v1:cancel',\n kind: 'fable-plan.cancel',\n payload: FablePlanCancelSchema,\n});\n\nexport interface FablePlanBrokerProvider {\n start(request: FablePlanStartPayload, signal: AbortSignal): Promise<FablePlanResultPayload>;\n cancel(request: FablePlanCancelPayload): void;\n}\n\nexport interface FablePlanBrokerClient extends FablePlanBrokerProvider {\n isAvailable(): boolean;\n}\n\nexport interface FablePlanBrokerRegistration {\n dispose(): void;\n}\n\n// Keyed by session id alone, on `globalThis`. An earlier version also keyed on a\n// host object and took `pi.events` for it, which could never match: Pi builds a\n// separate extension API per extension and `events` is a fresh object literal in\n// each one, so the provider (doom-team) and the consumer (doom-plan) always looked\n// at different keys and the broker read as permanently unavailable. Session ids are\n// already unique per Pi session, so they are the whole key. `globalThis` is what\n// actually bridges the two extensions: Pi's jiti loader runs with `moduleCache:\n// false`, so this module may be instantiated once per extension.\nconst FABLE_BROKER_REGISTRY_KEY = Symbol.for('@agimon-ai/doompi-team.fable-plan-brokers.v2');\nconst LEGACY_FABLE_BROKER_REGISTRY_KEY = Symbol.for('@agimon-ai/doompi-team.fable-plan-brokers.v1');\nconst MAX_SESSION_ID_LENGTH = 256;\ntype BrokerRegistry = Map<string, FablePlanBrokerProvider>;\ntype BrokerRegistryRoot = typeof globalThis & {\n [FABLE_BROKER_REGISTRY_KEY]?: BrokerRegistry;\n [LEGACY_FABLE_BROKER_REGISTRY_KEY]?: BrokerRegistry;\n};\n\nfunction brokerRegistry(): BrokerRegistry {\n const root = globalThis as BrokerRegistryRoot;\n const registry = root[FABLE_BROKER_REGISTRY_KEY] ?? root[LEGACY_FABLE_BROKER_REGISTRY_KEY] ?? new Map();\n root[FABLE_BROKER_REGISTRY_KEY] = registry;\n root[LEGACY_FABLE_BROKER_REGISTRY_KEY] = registry;\n return registry;\n}\n\nfunction validSessionId(sessionId: string): string {\n const normalized = sessionId.trim();\n let hasControl = false;\n for (const character of normalized) {\n const code = character.codePointAt(0);\n if (code !== undefined && (code <= 0x1f || code === 0x7f)) {\n hasControl = true;\n break;\n }\n }\n if (!normalized || normalized.length > MAX_SESSION_ID_LENGTH || hasControl) {\n throw new Error('Invalid Fable broker session id.');\n }\n return normalized;\n}\n\nfunction assertPayload(schema: typeof FablePlanStartSchema | typeof FablePlanCancelSchema, value: unknown): void {\n if (Check(schema, value)) return;\n const details = Errors(schema, value)\n .slice(0, 3)\n .map((error) => `${error.instancePath || '/'} ${error.message}`)\n .join('; ');\n throw new Error(`Invalid Fable broker payload: ${details}`);\n}\n\nexport function registerFablePlanBroker(\n sessionId: string,\n provider: FablePlanBrokerProvider,\n): FablePlanBrokerRegistration {\n const key = validSessionId(sessionId);\n const registry = brokerRegistry();\n if (registry.has(key)) throw new Error(`A Fable broker is already registered for session '${key}'.`);\n registry.set(key, provider);\n let disposed = false;\n return {\n dispose() {\n if (disposed) return;\n disposed = true;\n // Re-read rather than close over `registry`: only ever retract this\n // registration's own entry, since a later session_start may already have\n // rebound the same id to a fresh provider.\n const current = brokerRegistry();\n if (current.get(key) === provider) current.delete(key);\n },\n };\n}\n\nexport function createFablePlanBrokerClient(sessionId: () => string | undefined): FablePlanBrokerClient {\n const provider = (): FablePlanBrokerProvider | undefined => {\n const current = sessionId();\n if (!current) return undefined;\n return brokerRegistry().get(validSessionId(current));\n };\n return {\n isAvailable: () => provider() !== undefined,\n async start(request, signal) {\n assertPayload(FablePlanStartSchema, request);\n const target = provider();\n if (!target) throw new Error('The session-bound Fable broker is unavailable.');\n return target.start(request, signal);\n },\n cancel(request) {\n assertPayload(FablePlanCancelSchema, request);\n const target = provider();\n if (!target) return;\n target.cancel(request);\n },\n };\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { NotificationDefinition } from "./protocol.cjs";
|
|
2
|
+
import { Static, Type } from "typebox";
|
|
3
|
+
//#region src/fablePlan.d.ts
|
|
4
|
+
declare const FABLE_PLAN_REQUESTER: "@agimon-ai/doompi-plan";
|
|
5
|
+
declare const FABLE_PLAN_RUNTIME: "claude";
|
|
6
|
+
declare const FABLE_PLAN_MODEL: "fable";
|
|
7
|
+
declare const FABLE_PLAN_PROFILE: "claude/fable-plan-v1";
|
|
8
|
+
declare const FablePlanFindingSchema: Type.TObject<{
|
|
9
|
+
path: Type.TString;
|
|
10
|
+
finding: Type.TString;
|
|
11
|
+
}>;
|
|
12
|
+
type FablePlanFinding = Static<typeof FablePlanFindingSchema>;
|
|
13
|
+
declare const FablePlanPacketSchema: Type.TObject<{
|
|
14
|
+
goal: Type.TArray<Type.TString>;
|
|
15
|
+
constraints: Type.TArray<Type.TString>;
|
|
16
|
+
decisions: Type.TArray<Type.TString>;
|
|
17
|
+
verifiedFindings: Type.TArray<Type.TObject<{
|
|
18
|
+
path: Type.TString;
|
|
19
|
+
finding: Type.TString;
|
|
20
|
+
}>>;
|
|
21
|
+
inferredFindings: Type.TArray<Type.TString>;
|
|
22
|
+
unresolvedQuestions: Type.TArray<Type.TString>;
|
|
23
|
+
currentPlan: Type.TOptional<Type.TString>;
|
|
24
|
+
}>;
|
|
25
|
+
type FablePlanPacket = Static<typeof FablePlanPacketSchema>;
|
|
26
|
+
declare const FablePlanStageSchema: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
27
|
+
type FablePlanStage = Static<typeof FablePlanStageSchema>;
|
|
28
|
+
declare const FablePlanStatusSchema: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
29
|
+
type FablePlanStatus = Static<typeof FablePlanStatusSchema>;
|
|
30
|
+
declare const FablePlanStartSchema: Type.TObject<{
|
|
31
|
+
requester: Type.TLiteral<"@agimon-ai/doompi-plan">;
|
|
32
|
+
operationId: Type.TString;
|
|
33
|
+
runtime: Type.TLiteral<"claude">;
|
|
34
|
+
model: Type.TLiteral<"fable">;
|
|
35
|
+
profile: Type.TLiteral<"claude/fable-plan-v1">;
|
|
36
|
+
packet: Type.TObject<{
|
|
37
|
+
goal: Type.TArray<Type.TString>;
|
|
38
|
+
constraints: Type.TArray<Type.TString>;
|
|
39
|
+
decisions: Type.TArray<Type.TString>;
|
|
40
|
+
verifiedFindings: Type.TArray<Type.TObject<{
|
|
41
|
+
path: Type.TString;
|
|
42
|
+
finding: Type.TString;
|
|
43
|
+
}>>;
|
|
44
|
+
inferredFindings: Type.TArray<Type.TString>;
|
|
45
|
+
unresolvedQuestions: Type.TArray<Type.TString>;
|
|
46
|
+
currentPlan: Type.TOptional<Type.TString>;
|
|
47
|
+
}>;
|
|
48
|
+
}>;
|
|
49
|
+
type FablePlanStartPayload = Static<typeof FablePlanStartSchema>;
|
|
50
|
+
declare const FablePlanStartedSchema: Type.TObject<{
|
|
51
|
+
operationId: Type.TString;
|
|
52
|
+
runId: Type.TString;
|
|
53
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">]>;
|
|
54
|
+
}>;
|
|
55
|
+
type FablePlanStartedPayload = Static<typeof FablePlanStartedSchema>;
|
|
56
|
+
declare const FablePlanProgressSchema: Type.TObject<{
|
|
57
|
+
operationId: Type.TString;
|
|
58
|
+
runId: Type.TString;
|
|
59
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">]>;
|
|
60
|
+
status: Type.TString;
|
|
61
|
+
durationMs: Type.TInteger;
|
|
62
|
+
}>;
|
|
63
|
+
type FablePlanProgressPayload = Static<typeof FablePlanProgressSchema>;
|
|
64
|
+
declare const FablePlanResultSchema: Type.TObject<{
|
|
65
|
+
operationId: Type.TString;
|
|
66
|
+
status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
67
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
68
|
+
draft: Type.TOptional<Type.TString>;
|
|
69
|
+
review: Type.TOptional<Type.TString>;
|
|
70
|
+
draftRunId: Type.TOptional<Type.TString>;
|
|
71
|
+
reviewRunId: Type.TOptional<Type.TString>;
|
|
72
|
+
durationMs: Type.TInteger;
|
|
73
|
+
errorCode: Type.TOptional<Type.TString>;
|
|
74
|
+
}>;
|
|
75
|
+
type FablePlanResultPayload = Static<typeof FablePlanResultSchema>;
|
|
76
|
+
declare const FablePlanCancelSchema: Type.TObject<{
|
|
77
|
+
requester: Type.TLiteral<"@agimon-ai/doompi-plan">;
|
|
78
|
+
operationId: Type.TString;
|
|
79
|
+
reason: Type.TString;
|
|
80
|
+
}>;
|
|
81
|
+
type FablePlanCancelPayload = Static<typeof FablePlanCancelSchema>;
|
|
82
|
+
declare const FablePlanStart: NotificationDefinition<Type.TObject<{
|
|
83
|
+
requester: Type.TLiteral<"@agimon-ai/doompi-plan">;
|
|
84
|
+
operationId: Type.TString;
|
|
85
|
+
runtime: Type.TLiteral<"claude">;
|
|
86
|
+
model: Type.TLiteral<"fable">;
|
|
87
|
+
profile: Type.TLiteral<"claude/fable-plan-v1">;
|
|
88
|
+
packet: Type.TObject<{
|
|
89
|
+
goal: Type.TArray<Type.TString>;
|
|
90
|
+
constraints: Type.TArray<Type.TString>;
|
|
91
|
+
decisions: Type.TArray<Type.TString>;
|
|
92
|
+
verifiedFindings: Type.TArray<Type.TObject<{
|
|
93
|
+
path: Type.TString;
|
|
94
|
+
finding: Type.TString;
|
|
95
|
+
}>>;
|
|
96
|
+
inferredFindings: Type.TArray<Type.TString>;
|
|
97
|
+
unresolvedQuestions: Type.TArray<Type.TString>;
|
|
98
|
+
currentPlan: Type.TOptional<Type.TString>;
|
|
99
|
+
}>;
|
|
100
|
+
}>>;
|
|
101
|
+
declare const FablePlanStarted: NotificationDefinition<Type.TObject<{
|
|
102
|
+
operationId: Type.TString;
|
|
103
|
+
runId: Type.TString;
|
|
104
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">]>;
|
|
105
|
+
}>>;
|
|
106
|
+
declare const FablePlanProgress: NotificationDefinition<Type.TObject<{
|
|
107
|
+
operationId: Type.TString;
|
|
108
|
+
runId: Type.TString;
|
|
109
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">]>;
|
|
110
|
+
status: Type.TString;
|
|
111
|
+
durationMs: Type.TInteger;
|
|
112
|
+
}>>;
|
|
113
|
+
declare const FablePlanResult: NotificationDefinition<Type.TObject<{
|
|
114
|
+
operationId: Type.TString;
|
|
115
|
+
status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
116
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
117
|
+
draft: Type.TOptional<Type.TString>;
|
|
118
|
+
review: Type.TOptional<Type.TString>;
|
|
119
|
+
draftRunId: Type.TOptional<Type.TString>;
|
|
120
|
+
reviewRunId: Type.TOptional<Type.TString>;
|
|
121
|
+
durationMs: Type.TInteger;
|
|
122
|
+
errorCode: Type.TOptional<Type.TString>;
|
|
123
|
+
}>>;
|
|
124
|
+
declare const FablePlanCancel: NotificationDefinition<Type.TObject<{
|
|
125
|
+
requester: Type.TLiteral<"@agimon-ai/doompi-plan">;
|
|
126
|
+
operationId: Type.TString;
|
|
127
|
+
reason: Type.TString;
|
|
128
|
+
}>>;
|
|
129
|
+
interface FablePlanBrokerProvider {
|
|
130
|
+
start(request: FablePlanStartPayload, signal: AbortSignal): Promise<FablePlanResultPayload>;
|
|
131
|
+
cancel(request: FablePlanCancelPayload): void;
|
|
132
|
+
}
|
|
133
|
+
interface FablePlanBrokerClient extends FablePlanBrokerProvider {
|
|
134
|
+
isAvailable(): boolean;
|
|
135
|
+
}
|
|
136
|
+
interface FablePlanBrokerRegistration {
|
|
137
|
+
dispose(): void;
|
|
138
|
+
}
|
|
139
|
+
declare function registerFablePlanBroker(sessionId: string, provider: FablePlanBrokerProvider): FablePlanBrokerRegistration;
|
|
140
|
+
declare function createFablePlanBrokerClient(sessionId: () => string | undefined): FablePlanBrokerClient;
|
|
141
|
+
//#endregion
|
|
142
|
+
export { FABLE_PLAN_MODEL, FABLE_PLAN_PROFILE, FABLE_PLAN_REQUESTER, FABLE_PLAN_RUNTIME, FablePlanBrokerClient, FablePlanBrokerProvider, FablePlanBrokerRegistration, FablePlanCancel, FablePlanCancelPayload, FablePlanCancelSchema, FablePlanFinding, FablePlanFindingSchema, FablePlanPacket, FablePlanPacketSchema, FablePlanProgress, FablePlanProgressPayload, FablePlanProgressSchema, FablePlanResult, FablePlanResultPayload, FablePlanResultSchema, FablePlanStage, FablePlanStageSchema, FablePlanStart, FablePlanStartPayload, FablePlanStartSchema, FablePlanStarted, FablePlanStartedPayload, FablePlanStartedSchema, FablePlanStatus, FablePlanStatusSchema, createFablePlanBrokerClient, registerFablePlanBroker };
|
|
143
|
+
//# sourceMappingURL=fablePlan.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fablePlan.d.cts","names":[],"sources":["../src/fablePlan.ts"],"mappings":";;;cAIa;cACA;cACA;cACA;cAoBA,wBAAsB,KAAA;;;;KAOvB,mBAAmB,cAAc;cAEhC,uBAAqB,KAAA;;;;;;;;;;;;KAYtB,kBAAkB,cAAc;cAE/B,sBAAoB,KAAA,QAAA,KAAA,mBAAA,KAAA,oBAAA,KAAA,uBAAA,KAAA,oBAAA,KAAA,uBAAA,KAAA;KAQrB,iBAAiB,cAAc;cAE9B,uBAAqB,KAAA,QAAA,KAAA,uBAAA,KAAA,oBAAA,KAAA,uBAAA,KAAA,uBAAA,KAAA;KAOtB,kBAAkB,cAAc;cAE/B,sBAAoB,KAAA;;;;;;;;;;;;;;;;;;;KAWrB,wBAAwB,cAAc;cAErC,wBAAsB,KAAA;;;;;KAQvB,0BAA0B,cAAc;cAEvC,yBAAuB,KAAA;;;;;;;KAUxB,2BAA2B,cAAc;cAExC,uBAAqB,KAAA;;;;;;;;;;;KActB,yBAAyB,cAAc;cAEtC,uBAAqB,KAAA;;;;;KAQtB,yBAAyB,cAAc;cAEtC,gBAAc,uBAAA,KAAA;;;;;;;;;;;;;;;;;;;cAMd,kBAAgB,uBAAA,KAAA;;;;;cAMhB,mBAAiB,uBAAA,KAAA;;;;;;;cAMjB,iBAAe,uBAAA,KAAA;;;;;;;;;;;cAMf,iBAAe,uBAAA,KAAA;;;;;UAMX;EACf,MAAM,SAAS,uBAAuB,QAAQ,cAAc,QAAQ;EACpE,OAAO,SAAS;;UAGD,8BAA8B;EAC7C;;UAGe;EACf;;iBAqDc,wBACd,mBACA,UAAU,0BACT;iBAmBa,4BAA4B,sCAAsC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { NotificationDefinition } from "./protocol.mjs";
|
|
2
|
+
import { Static, Type } from "typebox";
|
|
3
|
+
//#region src/fablePlan.d.ts
|
|
4
|
+
declare const FABLE_PLAN_REQUESTER: "@agimon-ai/doompi-plan";
|
|
5
|
+
declare const FABLE_PLAN_RUNTIME: "claude";
|
|
6
|
+
declare const FABLE_PLAN_MODEL: "fable";
|
|
7
|
+
declare const FABLE_PLAN_PROFILE: "claude/fable-plan-v1";
|
|
8
|
+
declare const FablePlanFindingSchema: Type.TObject<{
|
|
9
|
+
path: Type.TString;
|
|
10
|
+
finding: Type.TString;
|
|
11
|
+
}>;
|
|
12
|
+
type FablePlanFinding = Static<typeof FablePlanFindingSchema>;
|
|
13
|
+
declare const FablePlanPacketSchema: Type.TObject<{
|
|
14
|
+
goal: Type.TArray<Type.TString>;
|
|
15
|
+
constraints: Type.TArray<Type.TString>;
|
|
16
|
+
decisions: Type.TArray<Type.TString>;
|
|
17
|
+
verifiedFindings: Type.TArray<Type.TObject<{
|
|
18
|
+
path: Type.TString;
|
|
19
|
+
finding: Type.TString;
|
|
20
|
+
}>>;
|
|
21
|
+
inferredFindings: Type.TArray<Type.TString>;
|
|
22
|
+
unresolvedQuestions: Type.TArray<Type.TString>;
|
|
23
|
+
currentPlan: Type.TOptional<Type.TString>;
|
|
24
|
+
}>;
|
|
25
|
+
type FablePlanPacket = Static<typeof FablePlanPacketSchema>;
|
|
26
|
+
declare const FablePlanStageSchema: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
27
|
+
type FablePlanStage = Static<typeof FablePlanStageSchema>;
|
|
28
|
+
declare const FablePlanStatusSchema: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
29
|
+
type FablePlanStatus = Static<typeof FablePlanStatusSchema>;
|
|
30
|
+
declare const FablePlanStartSchema: Type.TObject<{
|
|
31
|
+
requester: Type.TLiteral<"@agimon-ai/doompi-plan">;
|
|
32
|
+
operationId: Type.TString;
|
|
33
|
+
runtime: Type.TLiteral<"claude">;
|
|
34
|
+
model: Type.TLiteral<"fable">;
|
|
35
|
+
profile: Type.TLiteral<"claude/fable-plan-v1">;
|
|
36
|
+
packet: Type.TObject<{
|
|
37
|
+
goal: Type.TArray<Type.TString>;
|
|
38
|
+
constraints: Type.TArray<Type.TString>;
|
|
39
|
+
decisions: Type.TArray<Type.TString>;
|
|
40
|
+
verifiedFindings: Type.TArray<Type.TObject<{
|
|
41
|
+
path: Type.TString;
|
|
42
|
+
finding: Type.TString;
|
|
43
|
+
}>>;
|
|
44
|
+
inferredFindings: Type.TArray<Type.TString>;
|
|
45
|
+
unresolvedQuestions: Type.TArray<Type.TString>;
|
|
46
|
+
currentPlan: Type.TOptional<Type.TString>;
|
|
47
|
+
}>;
|
|
48
|
+
}>;
|
|
49
|
+
type FablePlanStartPayload = Static<typeof FablePlanStartSchema>;
|
|
50
|
+
declare const FablePlanStartedSchema: Type.TObject<{
|
|
51
|
+
operationId: Type.TString;
|
|
52
|
+
runId: Type.TString;
|
|
53
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">]>;
|
|
54
|
+
}>;
|
|
55
|
+
type FablePlanStartedPayload = Static<typeof FablePlanStartedSchema>;
|
|
56
|
+
declare const FablePlanProgressSchema: Type.TObject<{
|
|
57
|
+
operationId: Type.TString;
|
|
58
|
+
runId: Type.TString;
|
|
59
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">]>;
|
|
60
|
+
status: Type.TString;
|
|
61
|
+
durationMs: Type.TInteger;
|
|
62
|
+
}>;
|
|
63
|
+
type FablePlanProgressPayload = Static<typeof FablePlanProgressSchema>;
|
|
64
|
+
declare const FablePlanResultSchema: Type.TObject<{
|
|
65
|
+
operationId: Type.TString;
|
|
66
|
+
status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
67
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
68
|
+
draft: Type.TOptional<Type.TString>;
|
|
69
|
+
review: Type.TOptional<Type.TString>;
|
|
70
|
+
draftRunId: Type.TOptional<Type.TString>;
|
|
71
|
+
reviewRunId: Type.TOptional<Type.TString>;
|
|
72
|
+
durationMs: Type.TInteger;
|
|
73
|
+
errorCode: Type.TOptional<Type.TString>;
|
|
74
|
+
}>;
|
|
75
|
+
type FablePlanResultPayload = Static<typeof FablePlanResultSchema>;
|
|
76
|
+
declare const FablePlanCancelSchema: Type.TObject<{
|
|
77
|
+
requester: Type.TLiteral<"@agimon-ai/doompi-plan">;
|
|
78
|
+
operationId: Type.TString;
|
|
79
|
+
reason: Type.TString;
|
|
80
|
+
}>;
|
|
81
|
+
type FablePlanCancelPayload = Static<typeof FablePlanCancelSchema>;
|
|
82
|
+
declare const FablePlanStart: NotificationDefinition<Type.TObject<{
|
|
83
|
+
requester: Type.TLiteral<"@agimon-ai/doompi-plan">;
|
|
84
|
+
operationId: Type.TString;
|
|
85
|
+
runtime: Type.TLiteral<"claude">;
|
|
86
|
+
model: Type.TLiteral<"fable">;
|
|
87
|
+
profile: Type.TLiteral<"claude/fable-plan-v1">;
|
|
88
|
+
packet: Type.TObject<{
|
|
89
|
+
goal: Type.TArray<Type.TString>;
|
|
90
|
+
constraints: Type.TArray<Type.TString>;
|
|
91
|
+
decisions: Type.TArray<Type.TString>;
|
|
92
|
+
verifiedFindings: Type.TArray<Type.TObject<{
|
|
93
|
+
path: Type.TString;
|
|
94
|
+
finding: Type.TString;
|
|
95
|
+
}>>;
|
|
96
|
+
inferredFindings: Type.TArray<Type.TString>;
|
|
97
|
+
unresolvedQuestions: Type.TArray<Type.TString>;
|
|
98
|
+
currentPlan: Type.TOptional<Type.TString>;
|
|
99
|
+
}>;
|
|
100
|
+
}>>;
|
|
101
|
+
declare const FablePlanStarted: NotificationDefinition<Type.TObject<{
|
|
102
|
+
operationId: Type.TString;
|
|
103
|
+
runId: Type.TString;
|
|
104
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">]>;
|
|
105
|
+
}>>;
|
|
106
|
+
declare const FablePlanProgress: NotificationDefinition<Type.TObject<{
|
|
107
|
+
operationId: Type.TString;
|
|
108
|
+
runId: Type.TString;
|
|
109
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">]>;
|
|
110
|
+
status: Type.TString;
|
|
111
|
+
durationMs: Type.TInteger;
|
|
112
|
+
}>>;
|
|
113
|
+
declare const FablePlanResult: NotificationDefinition<Type.TObject<{
|
|
114
|
+
operationId: Type.TString;
|
|
115
|
+
status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"timed_out">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
116
|
+
stage: Type.TUnion<[Type.TLiteral<"draft">, Type.TLiteral<"review">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"cancelled">, Type.TLiteral<"interrupted">]>;
|
|
117
|
+
draft: Type.TOptional<Type.TString>;
|
|
118
|
+
review: Type.TOptional<Type.TString>;
|
|
119
|
+
draftRunId: Type.TOptional<Type.TString>;
|
|
120
|
+
reviewRunId: Type.TOptional<Type.TString>;
|
|
121
|
+
durationMs: Type.TInteger;
|
|
122
|
+
errorCode: Type.TOptional<Type.TString>;
|
|
123
|
+
}>>;
|
|
124
|
+
declare const FablePlanCancel: NotificationDefinition<Type.TObject<{
|
|
125
|
+
requester: Type.TLiteral<"@agimon-ai/doompi-plan">;
|
|
126
|
+
operationId: Type.TString;
|
|
127
|
+
reason: Type.TString;
|
|
128
|
+
}>>;
|
|
129
|
+
interface FablePlanBrokerProvider {
|
|
130
|
+
start(request: FablePlanStartPayload, signal: AbortSignal): Promise<FablePlanResultPayload>;
|
|
131
|
+
cancel(request: FablePlanCancelPayload): void;
|
|
132
|
+
}
|
|
133
|
+
interface FablePlanBrokerClient extends FablePlanBrokerProvider {
|
|
134
|
+
isAvailable(): boolean;
|
|
135
|
+
}
|
|
136
|
+
interface FablePlanBrokerRegistration {
|
|
137
|
+
dispose(): void;
|
|
138
|
+
}
|
|
139
|
+
declare function registerFablePlanBroker(sessionId: string, provider: FablePlanBrokerProvider): FablePlanBrokerRegistration;
|
|
140
|
+
declare function createFablePlanBrokerClient(sessionId: () => string | undefined): FablePlanBrokerClient;
|
|
141
|
+
//#endregion
|
|
142
|
+
export { FABLE_PLAN_MODEL, FABLE_PLAN_PROFILE, FABLE_PLAN_REQUESTER, FABLE_PLAN_RUNTIME, FablePlanBrokerClient, FablePlanBrokerProvider, FablePlanBrokerRegistration, FablePlanCancel, FablePlanCancelPayload, FablePlanCancelSchema, FablePlanFinding, FablePlanFindingSchema, FablePlanPacket, FablePlanPacketSchema, FablePlanProgress, FablePlanProgressPayload, FablePlanProgressSchema, FablePlanResult, FablePlanResultPayload, FablePlanResultSchema, FablePlanStage, FablePlanStageSchema, FablePlanStart, FablePlanStartPayload, FablePlanStartSchema, FablePlanStarted, FablePlanStartedPayload, FablePlanStartedSchema, FablePlanStatus, FablePlanStatusSchema, createFablePlanBrokerClient, registerFablePlanBroker };
|
|
143
|
+
//# sourceMappingURL=fablePlan.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fablePlan.d.mts","names":[],"sources":["../src/fablePlan.ts"],"mappings":";;;cAIa;cACA;cACA;cACA;cAoBA,wBAAsB,KAAA;;;;KAOvB,mBAAmB,cAAc;cAEhC,uBAAqB,KAAA;;;;;;;;;;;;KAYtB,kBAAkB,cAAc;cAE/B,sBAAoB,KAAA,QAAA,KAAA,mBAAA,KAAA,oBAAA,KAAA,uBAAA,KAAA,oBAAA,KAAA,uBAAA,KAAA;KAQrB,iBAAiB,cAAc;cAE9B,uBAAqB,KAAA,QAAA,KAAA,uBAAA,KAAA,oBAAA,KAAA,uBAAA,KAAA,uBAAA,KAAA;KAOtB,kBAAkB,cAAc;cAE/B,sBAAoB,KAAA;;;;;;;;;;;;;;;;;;;KAWrB,wBAAwB,cAAc;cAErC,wBAAsB,KAAA;;;;;KAQvB,0BAA0B,cAAc;cAEvC,yBAAuB,KAAA;;;;;;;KAUxB,2BAA2B,cAAc;cAExC,uBAAqB,KAAA;;;;;;;;;;;KActB,yBAAyB,cAAc;cAEtC,uBAAqB,KAAA;;;;;KAQtB,yBAAyB,cAAc;cAEtC,gBAAc,uBAAA,KAAA;;;;;;;;;;;;;;;;;;;cAMd,kBAAgB,uBAAA,KAAA;;;;;cAMhB,mBAAiB,uBAAA,KAAA;;;;;;;cAMjB,iBAAe,uBAAA,KAAA;;;;;;;;;;;cAMf,iBAAe,uBAAA,KAAA;;;;;UAMX;EACf,MAAM,SAAS,uBAAuB,QAAQ,cAAc,QAAQ;EACpE,OAAO,SAAS;;UAGD,8BAA8B;EAC7C;;UAGe;EACf;;iBAqDc,wBACd,mBACA,UAAU,0BACT;iBAmBa,4BAA4B,sCAAsC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{defineNotification as e}from"./protocol.mjs";import{Type as t}from"typebox";import{Check as n,Errors as r}from"typebox/value";const i=`@agimon-ai/doompi-plan`,a=`claude`,o=`fable`,s=`claude/fable-plan-v1`,c=16384,l=t.String({minLength:1,maxLength:128}),u=t.String({minLength:1,maxLength:128}),d=t.String({minLength:1,maxLength:4096}),f=t.Object({path:t.String({minLength:1,maxLength:512}),finding:d},{additionalProperties:!1}),p=t.Object({goal:t.Array(d,{minItems:1,maxItems:8}),constraints:t.Array(d,{maxItems:16}),decisions:t.Array(d,{maxItems:16}),verifiedFindings:t.Array(f,{maxItems:24}),inferredFindings:t.Array(d,{maxItems:24}),unresolvedQuestions:t.Array(d,{maxItems:16}),currentPlan:t.Optional(t.String({maxLength:16384}))},{additionalProperties:!1}),m=t.Union([t.Literal(`draft`),t.Literal(`review`),t.Literal(`completed`),t.Literal(`failed`),t.Literal(`cancelled`),t.Literal(`interrupted`)]),h=t.Union([t.Literal(`completed`),t.Literal(`failed`),t.Literal(`timed_out`),t.Literal(`cancelled`),t.Literal(`interrupted`)]),g=t.Object({requester:t.Literal(i),operationId:l,runtime:t.Literal(a),model:t.Literal(o),profile:t.Literal(s),packet:p},{additionalProperties:!1}),_=t.Object({operationId:l,runId:u,stage:t.Union([t.Literal(`draft`),t.Literal(`review`)])},{additionalProperties:!1}),v=t.Object({operationId:l,runId:u,stage:t.Union([t.Literal(`draft`),t.Literal(`review`)]),status:t.String({minLength:1,maxLength:128}),durationMs:t.Integer({minimum:0})},{additionalProperties:!1}),y=t.Object({operationId:l,status:h,stage:m,draft:t.Optional(t.String({maxLength:c})),review:t.Optional(t.String({maxLength:c})),draftRunId:t.Optional(u),reviewRunId:t.Optional(u),durationMs:t.Integer({minimum:0}),errorCode:t.Optional(t.String({minLength:1,maxLength:128}))},{additionalProperties:!1}),b=t.Object({requester:t.Literal(i),operationId:l,reason:t.String({minLength:1,maxLength:128})},{additionalProperties:!1}),x=e({channel:`doom:team:fable-plan:v1:start`,kind:`fable-plan.start`,payload:g}),S=e({channel:`doom:team:fable-plan:v1:started`,kind:`fable-plan.started`,payload:_}),C=e({channel:`doom:team:fable-plan:v1:progress`,kind:`fable-plan.progress`,payload:v}),w=e({channel:`doom:team:fable-plan:v1:result`,kind:`fable-plan.result`,payload:y}),T=e({channel:`doom:team:fable-plan:v1:cancel`,kind:`fable-plan.cancel`,payload:b}),E=Symbol.for(`@agimon-ai/doompi-team.fable-plan-brokers.v2`),D=Symbol.for(`@agimon-ai/doompi-team.fable-plan-brokers.v1`);function O(){let e=globalThis,t=e[E]??e[D]??new Map;return e[E]=t,e[D]=t,t}function k(e){let t=e.trim(),n=!1;for(let e of t){let t=e.codePointAt(0);if(t!==void 0&&(t<=31||t===127)){n=!0;break}}if(!t||t.length>256||n)throw Error(`Invalid Fable broker session id.`);return t}function A(e,t){if(n(e,t))return;let i=r(e,t).slice(0,3).map(e=>`${e.instancePath||`/`} ${e.message}`).join(`; `);throw Error(`Invalid Fable broker payload: ${i}`)}function j(e,t){let n=k(e),r=O();if(r.has(n))throw Error(`A Fable broker is already registered for session '${n}'.`);r.set(n,t);let i=!1;return{dispose(){if(i)return;i=!0;let e=O();e.get(n)===t&&e.delete(n)}}}function M(e){let t=()=>{let t=e();if(t)return O().get(k(t))};return{isAvailable:()=>t()!==void 0,async start(e,n){A(g,e);let r=t();if(!r)throw Error(`The session-bound Fable broker is unavailable.`);return r.start(e,n)},cancel(e){A(b,e);let n=t();n&&n.cancel(e)}}}export{o as FABLE_PLAN_MODEL,s as FABLE_PLAN_PROFILE,i as FABLE_PLAN_REQUESTER,a as FABLE_PLAN_RUNTIME,T as FablePlanCancel,b as FablePlanCancelSchema,f as FablePlanFindingSchema,p as FablePlanPacketSchema,C as FablePlanProgress,v as FablePlanProgressSchema,w as FablePlanResult,y as FablePlanResultSchema,m as FablePlanStageSchema,x as FablePlanStart,g as FablePlanStartSchema,S as FablePlanStarted,_ as FablePlanStartedSchema,h as FablePlanStatusSchema,M as createFablePlanBrokerClient,j as registerFablePlanBroker};
|
|
2
|
+
//# sourceMappingURL=fablePlan.mjs.map
|