@agent-relay/factory 0.0.0 → 0.1.2
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.md +182 -23
- package/bin/factory.mjs +7 -0
- package/dist/cli/fleet.d.ts +81 -0
- package/dist/cli/fleet.d.ts.map +1 -0
- package/dist/cli/fleet.js +571 -0
- package/dist/cli/fleet.js.map +1 -0
- package/dist/config/schema.d.ts +1313 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +320 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/constants/linear.d.ts +6 -0
- package/dist/constants/linear.d.ts.map +1 -0
- package/dist/constants/linear.js +21 -0
- package/dist/constants/linear.js.map +1 -0
- package/dist/constants/slack.d.ts +3 -0
- package/dist/constants/slack.d.ts.map +1 -0
- package/dist/constants/slack.js +3 -0
- package/dist/constants/slack.js.map +1 -0
- package/dist/dispatch/templates.d.ts +52 -0
- package/dist/dispatch/templates.d.ts.map +1 -0
- package/dist/dispatch/templates.js +118 -0
- package/dist/dispatch/templates.js.map +1 -0
- package/dist/fleet/create-fleet.d.ts +14 -0
- package/dist/fleet/create-fleet.d.ts.map +1 -0
- package/dist/fleet/create-fleet.js +15 -0
- package/dist/fleet/create-fleet.js.map +1 -0
- package/dist/fleet/ensure-relay-broker.d.ts +24 -0
- package/dist/fleet/ensure-relay-broker.d.ts.map +1 -0
- package/dist/fleet/ensure-relay-broker.js +56 -0
- package/dist/fleet/ensure-relay-broker.js.map +1 -0
- package/dist/fleet/internal-fleet-client.d.ts +90 -0
- package/dist/fleet/internal-fleet-client.d.ts.map +1 -0
- package/dist/fleet/internal-fleet-client.js +602 -0
- package/dist/fleet/internal-fleet-client.js.map +1 -0
- package/dist/fleet/relay-fleet-client.d.ts +105 -0
- package/dist/fleet/relay-fleet-client.d.ts.map +1 -0
- package/dist/fleet/relay-fleet-client.js +509 -0
- package/dist/fleet/relay-fleet-client.js.map +1 -0
- package/dist/github/index.d.ts +5 -0
- package/dist/github/index.d.ts.map +1 -0
- package/dist/github/index.js +3 -0
- package/dist/github/index.js.map +1 -0
- package/dist/github/merge-gate.d.ts +47 -0
- package/dist/github/merge-gate.d.ts.map +1 -0
- package/dist/github/merge-gate.js +147 -0
- package/dist/github/merge-gate.js.map +1 -0
- package/dist/github/probe-closer.d.ts +15 -0
- package/dist/github/probe-closer.d.ts.map +1 -0
- package/dist/github/probe-closer.js +67 -0
- package/dist/github/probe-closer.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/issue-key-match.d.ts +3 -0
- package/dist/issue-key-match.d.ts.map +1 -0
- package/dist/issue-key-match.js +22 -0
- package/dist/issue-key-match.js.map +1 -0
- package/dist/linear/state-resolver.d.ts +26 -0
- package/dist/linear/state-resolver.d.ts.map +1 -0
- package/dist/linear/state-resolver.js +285 -0
- package/dist/linear/state-resolver.js.map +1 -0
- package/dist/mount/local-mount-preflight.d.ts +9 -0
- package/dist/mount/local-mount-preflight.d.ts.map +1 -0
- package/dist/mount/local-mount-preflight.js +149 -0
- package/dist/mount/local-mount-preflight.js.map +1 -0
- package/dist/mount/relayfile-binary.d.ts +9 -0
- package/dist/mount/relayfile-binary.d.ts.map +1 -0
- package/dist/mount/relayfile-binary.js +177 -0
- package/dist/mount/relayfile-binary.js.map +1 -0
- package/dist/mount/relayfile-cloud-mount-client.d.ts +123 -0
- package/dist/mount/relayfile-cloud-mount-client.d.ts.map +1 -0
- package/dist/mount/relayfile-cloud-mount-client.js +427 -0
- package/dist/mount/relayfile-cloud-mount-client.js.map +1 -0
- package/dist/node/factory-node.d.ts +59 -0
- package/dist/node/factory-node.d.ts.map +1 -0
- package/dist/node/factory-node.js +351 -0
- package/dist/node/factory-node.js.map +1 -0
- package/dist/node/factory.node.d.ts +3 -0
- package/dist/node/factory.node.d.ts.map +1 -0
- package/dist/node/factory.node.js +5 -0
- package/dist/node/factory.node.js.map +1 -0
- package/dist/orchestrator/batch-tracker.d.ts +42 -0
- package/dist/orchestrator/batch-tracker.d.ts.map +1 -0
- package/dist/orchestrator/batch-tracker.js +125 -0
- package/dist/orchestrator/batch-tracker.js.map +1 -0
- package/dist/orchestrator/factory.d.ts +58 -0
- package/dist/orchestrator/factory.d.ts.map +1 -0
- package/dist/orchestrator/factory.js +4372 -0
- package/dist/orchestrator/factory.js.map +1 -0
- package/dist/orchestrator/index.d.ts +5 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +4 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/process-identity.d.ts +23 -0
- package/dist/orchestrator/process-identity.d.ts.map +1 -0
- package/dist/orchestrator/process-identity.js +122 -0
- package/dist/orchestrator/process-identity.js.map +1 -0
- package/dist/orchestrator/reaper.d.ts +60 -0
- package/dist/orchestrator/reaper.d.ts.map +1 -0
- package/dist/orchestrator/reaper.js +293 -0
- package/dist/orchestrator/reaper.js.map +1 -0
- package/dist/ports/fleet.d.ts +101 -0
- package/dist/ports/fleet.d.ts.map +1 -0
- package/dist/ports/fleet.js +2 -0
- package/dist/ports/fleet.js.map +1 -0
- package/dist/ports/index.d.ts +5 -0
- package/dist/ports/index.d.ts.map +1 -0
- package/dist/ports/index.js +2 -0
- package/dist/ports/index.js.map +1 -0
- package/dist/ports/mount.d.ts +56 -0
- package/dist/ports/mount.d.ts.map +1 -0
- package/dist/ports/mount.js +2 -0
- package/dist/ports/mount.js.map +1 -0
- package/dist/ports/state.d.ts +61 -0
- package/dist/ports/state.d.ts.map +1 -0
- package/dist/ports/state.js +2 -0
- package/dist/ports/state.js.map +1 -0
- package/dist/ports/system.d.ts +15 -0
- package/dist/ports/system.d.ts.map +1 -0
- package/dist/ports/system.js +2 -0
- package/dist/ports/system.js.map +1 -0
- package/dist/ports/writeback.d.ts +25 -0
- package/dist/ports/writeback.d.ts.map +1 -0
- package/dist/ports/writeback.js +2 -0
- package/dist/ports/writeback.js.map +1 -0
- package/dist/safety/factory-scope.d.ts +16 -0
- package/dist/safety/factory-scope.d.ts.map +1 -0
- package/dist/safety/factory-scope.js +107 -0
- package/dist/safety/factory-scope.js.map +1 -0
- package/dist/state/in-memory-state-store.d.ts +31 -0
- package/dist/state/in-memory-state-store.d.ts.map +1 -0
- package/dist/state/in-memory-state-store.js +115 -0
- package/dist/state/in-memory-state-store.js.map +1 -0
- package/dist/state/index.d.ts +3 -0
- package/dist/state/index.d.ts.map +1 -0
- package/dist/state/index.js +2 -0
- package/dist/state/index.js.map +1 -0
- package/dist/state/store.d.ts +29 -0
- package/dist/state/store.d.ts.map +1 -0
- package/dist/state/store.js +26 -0
- package/dist/state/store.js.map +1 -0
- package/dist/subscriptions/common.d.ts +7 -0
- package/dist/subscriptions/common.d.ts.map +1 -0
- package/dist/subscriptions/common.js +59 -0
- package/dist/subscriptions/common.js.map +1 -0
- package/dist/subscriptions/event-client.d.ts +40 -0
- package/dist/subscriptions/event-client.d.ts.map +1 -0
- package/dist/subscriptions/event-client.js +234 -0
- package/dist/subscriptions/event-client.js.map +1 -0
- package/dist/subscriptions/globs.d.ts +5 -0
- package/dist/subscriptions/globs.d.ts.map +1 -0
- package/dist/subscriptions/globs.js +50 -0
- package/dist/subscriptions/globs.js.map +1 -0
- package/dist/subscriptions/index.d.ts +8 -0
- package/dist/subscriptions/index.d.ts.map +1 -0
- package/dist/subscriptions/index.js +5 -0
- package/dist/subscriptions/index.js.map +1 -0
- package/dist/subscriptions/linear-filter.d.ts +26 -0
- package/dist/subscriptions/linear-filter.d.ts.map +1 -0
- package/dist/subscriptions/linear-filter.js +143 -0
- package/dist/subscriptions/linear-filter.js.map +1 -0
- package/dist/subscriptions/specs.d.ts +44 -0
- package/dist/subscriptions/specs.d.ts.map +1 -0
- package/dist/subscriptions/specs.js +195 -0
- package/dist/subscriptions/specs.js.map +1 -0
- package/dist/testing/fakes.d.ts +114 -0
- package/dist/testing/fakes.d.ts.map +1 -0
- package/dist/testing/fakes.js +219 -0
- package/dist/testing/fakes.js.map +1 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +2 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/triage/heuristic.d.ts +42 -0
- package/dist/triage/heuristic.d.ts.map +1 -0
- package/dist/triage/heuristic.js +326 -0
- package/dist/triage/heuristic.js.map +1 -0
- package/dist/triage/index.d.ts +7 -0
- package/dist/triage/index.d.ts.map +1 -0
- package/dist/triage/index.js +5 -0
- package/dist/triage/index.js.map +1 -0
- package/dist/triage/llm.d.ts +11 -0
- package/dist/triage/llm.d.ts.map +1 -0
- package/dist/triage/llm.js +48 -0
- package/dist/triage/llm.js.map +1 -0
- package/dist/triage/schema.d.ts +344 -0
- package/dist/triage/schema.d.ts.map +1 -0
- package/dist/triage/schema.js +37 -0
- package/dist/triage/schema.js.map +1 -0
- package/dist/triage/tiered.d.ts +8 -0
- package/dist/triage/tiered.d.ts.map +1 -0
- package/dist/triage/tiered.js +47 -0
- package/dist/triage/tiered.js.map +1 -0
- package/dist/types.d.ts +212 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/webhook/handler.d.ts +22 -0
- package/dist/webhook/handler.d.ts.map +1 -0
- package/dist/webhook/handler.js +57 -0
- package/dist/webhook/handler.js.map +1 -0
- package/dist/webhook/index.d.ts +5 -0
- package/dist/webhook/index.d.ts.map +1 -0
- package/dist/webhook/index.js +3 -0
- package/dist/webhook/index.js.map +1 -0
- package/dist/webhook/registrar.d.ts +16 -0
- package/dist/webhook/registrar.d.ts.map +1 -0
- package/dist/webhook/registrar.js +50 -0
- package/dist/webhook/registrar.js.map +1 -0
- package/dist/writeback/github.d.ts +6 -0
- package/dist/writeback/github.d.ts.map +1 -0
- package/dist/writeback/github.js +48 -0
- package/dist/writeback/github.js.map +1 -0
- package/dist/writeback/index.d.ts +6 -0
- package/dist/writeback/index.d.ts.map +1 -0
- package/dist/writeback/index.js +4 -0
- package/dist/writeback/index.js.map +1 -0
- package/dist/writeback/linear.d.ts +41 -0
- package/dist/writeback/linear.d.ts.map +1 -0
- package/dist/writeback/linear.js +286 -0
- package/dist/writeback/linear.js.map +1 -0
- package/dist/writeback/shared.d.ts +7 -0
- package/dist/writeback/shared.d.ts.map +1 -0
- package/dist/writeback/shared.js +29 -0
- package/dist/writeback/shared.js.map +1 -0
- package/dist/writeback/slack.d.ts +16 -0
- package/dist/writeback/slack.d.ts.map +1 -0
- package/dist/writeback/slack.js +104 -0
- package/dist/writeback/slack.js.map +1 -0
- package/package.json +54 -9
- package/scripts/com.agentrelay.factory-canary.plist.example +53 -0
- package/scripts/factory-canary.sh +89 -0
- package/index.d.ts +0 -2
- package/index.js +0 -7
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AgentSpecSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
role: z.ZodEnum<["implementer", "reviewer", "babysitter", "workflow"]>;
|
|
5
|
+
capability: z.ZodEnum<["spawn:codex", "spawn:claude", "workflow:run"]>;
|
|
6
|
+
model: z.ZodOptional<z.ZodString>;
|
|
7
|
+
task: z.ZodString;
|
|
8
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
9
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
10
|
+
repo: z.ZodString;
|
|
11
|
+
clonePath: z.ZodOptional<z.ZodString>;
|
|
12
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
13
|
+
node: z.ZodOptional<z.ZodString>;
|
|
14
|
+
sessionRef: z.ZodOptional<z.ZodString>;
|
|
15
|
+
invocationId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
restartPolicy: z.ZodOptional<z.ZodUnknown>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
repo: string;
|
|
19
|
+
name: string;
|
|
20
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
21
|
+
task: string;
|
|
22
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
23
|
+
channel?: string | undefined;
|
|
24
|
+
restartPolicy?: unknown;
|
|
25
|
+
workflow?: string | undefined;
|
|
26
|
+
model?: string | undefined;
|
|
27
|
+
inputs?: Record<string, unknown> | undefined;
|
|
28
|
+
clonePath?: string | undefined;
|
|
29
|
+
node?: string | undefined;
|
|
30
|
+
sessionRef?: string | undefined;
|
|
31
|
+
invocationId?: string | undefined;
|
|
32
|
+
}, {
|
|
33
|
+
repo: string;
|
|
34
|
+
name: string;
|
|
35
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
36
|
+
task: string;
|
|
37
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
38
|
+
channel?: string | undefined;
|
|
39
|
+
restartPolicy?: unknown;
|
|
40
|
+
workflow?: string | undefined;
|
|
41
|
+
model?: string | undefined;
|
|
42
|
+
inputs?: Record<string, unknown> | undefined;
|
|
43
|
+
clonePath?: string | undefined;
|
|
44
|
+
node?: string | undefined;
|
|
45
|
+
sessionRef?: string | undefined;
|
|
46
|
+
invocationId?: string | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const TriageDecisionSchema: z.ZodObject<{
|
|
49
|
+
issue: z.ZodObject<{
|
|
50
|
+
uuid: z.ZodString;
|
|
51
|
+
key: z.ZodString;
|
|
52
|
+
path: z.ZodString;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
path: string;
|
|
55
|
+
uuid: string;
|
|
56
|
+
key: string;
|
|
57
|
+
}, {
|
|
58
|
+
path: string;
|
|
59
|
+
uuid: string;
|
|
60
|
+
key: string;
|
|
61
|
+
}>;
|
|
62
|
+
routes: z.ZodArray<z.ZodObject<{
|
|
63
|
+
repo: z.ZodString;
|
|
64
|
+
clonePath: z.ZodOptional<z.ZodString>;
|
|
65
|
+
rationale: z.ZodString;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
repo: string;
|
|
68
|
+
rationale: string;
|
|
69
|
+
clonePath?: string | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
repo: string;
|
|
72
|
+
rationale: string;
|
|
73
|
+
clonePath?: string | undefined;
|
|
74
|
+
}>, "many">;
|
|
75
|
+
scope: z.ZodEnum<["single", "workflow", "team"]>;
|
|
76
|
+
implementers: z.ZodArray<z.ZodObject<{
|
|
77
|
+
name: z.ZodString;
|
|
78
|
+
role: z.ZodEnum<["implementer", "reviewer", "babysitter", "workflow"]>;
|
|
79
|
+
capability: z.ZodEnum<["spawn:codex", "spawn:claude", "workflow:run"]>;
|
|
80
|
+
model: z.ZodOptional<z.ZodString>;
|
|
81
|
+
task: z.ZodString;
|
|
82
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
83
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
84
|
+
repo: z.ZodString;
|
|
85
|
+
clonePath: z.ZodOptional<z.ZodString>;
|
|
86
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
87
|
+
node: z.ZodOptional<z.ZodString>;
|
|
88
|
+
sessionRef: z.ZodOptional<z.ZodString>;
|
|
89
|
+
invocationId: z.ZodOptional<z.ZodString>;
|
|
90
|
+
restartPolicy: z.ZodOptional<z.ZodUnknown>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
repo: string;
|
|
93
|
+
name: string;
|
|
94
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
95
|
+
task: string;
|
|
96
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
97
|
+
channel?: string | undefined;
|
|
98
|
+
restartPolicy?: unknown;
|
|
99
|
+
workflow?: string | undefined;
|
|
100
|
+
model?: string | undefined;
|
|
101
|
+
inputs?: Record<string, unknown> | undefined;
|
|
102
|
+
clonePath?: string | undefined;
|
|
103
|
+
node?: string | undefined;
|
|
104
|
+
sessionRef?: string | undefined;
|
|
105
|
+
invocationId?: string | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
repo: string;
|
|
108
|
+
name: string;
|
|
109
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
110
|
+
task: string;
|
|
111
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
112
|
+
channel?: string | undefined;
|
|
113
|
+
restartPolicy?: unknown;
|
|
114
|
+
workflow?: string | undefined;
|
|
115
|
+
model?: string | undefined;
|
|
116
|
+
inputs?: Record<string, unknown> | undefined;
|
|
117
|
+
clonePath?: string | undefined;
|
|
118
|
+
node?: string | undefined;
|
|
119
|
+
sessionRef?: string | undefined;
|
|
120
|
+
invocationId?: string | undefined;
|
|
121
|
+
}>, "many">;
|
|
122
|
+
workflow: z.ZodOptional<z.ZodObject<{
|
|
123
|
+
name: z.ZodString;
|
|
124
|
+
role: z.ZodEnum<["implementer", "reviewer", "babysitter", "workflow"]>;
|
|
125
|
+
capability: z.ZodEnum<["spawn:codex", "spawn:claude", "workflow:run"]>;
|
|
126
|
+
model: z.ZodOptional<z.ZodString>;
|
|
127
|
+
task: z.ZodString;
|
|
128
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
129
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
130
|
+
repo: z.ZodString;
|
|
131
|
+
clonePath: z.ZodOptional<z.ZodString>;
|
|
132
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
133
|
+
node: z.ZodOptional<z.ZodString>;
|
|
134
|
+
sessionRef: z.ZodOptional<z.ZodString>;
|
|
135
|
+
invocationId: z.ZodOptional<z.ZodString>;
|
|
136
|
+
restartPolicy: z.ZodOptional<z.ZodUnknown>;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
repo: string;
|
|
139
|
+
name: string;
|
|
140
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
141
|
+
task: string;
|
|
142
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
143
|
+
channel?: string | undefined;
|
|
144
|
+
restartPolicy?: unknown;
|
|
145
|
+
workflow?: string | undefined;
|
|
146
|
+
model?: string | undefined;
|
|
147
|
+
inputs?: Record<string, unknown> | undefined;
|
|
148
|
+
clonePath?: string | undefined;
|
|
149
|
+
node?: string | undefined;
|
|
150
|
+
sessionRef?: string | undefined;
|
|
151
|
+
invocationId?: string | undefined;
|
|
152
|
+
}, {
|
|
153
|
+
repo: string;
|
|
154
|
+
name: string;
|
|
155
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
156
|
+
task: string;
|
|
157
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
158
|
+
channel?: string | undefined;
|
|
159
|
+
restartPolicy?: unknown;
|
|
160
|
+
workflow?: string | undefined;
|
|
161
|
+
model?: string | undefined;
|
|
162
|
+
inputs?: Record<string, unknown> | undefined;
|
|
163
|
+
clonePath?: string | undefined;
|
|
164
|
+
node?: string | undefined;
|
|
165
|
+
sessionRef?: string | undefined;
|
|
166
|
+
invocationId?: string | undefined;
|
|
167
|
+
}>>;
|
|
168
|
+
reviewer: z.ZodObject<{
|
|
169
|
+
name: z.ZodString;
|
|
170
|
+
role: z.ZodEnum<["implementer", "reviewer", "babysitter", "workflow"]>;
|
|
171
|
+
capability: z.ZodEnum<["spawn:codex", "spawn:claude", "workflow:run"]>;
|
|
172
|
+
model: z.ZodOptional<z.ZodString>;
|
|
173
|
+
task: z.ZodString;
|
|
174
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
175
|
+
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
176
|
+
repo: z.ZodString;
|
|
177
|
+
clonePath: z.ZodOptional<z.ZodString>;
|
|
178
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
179
|
+
node: z.ZodOptional<z.ZodString>;
|
|
180
|
+
sessionRef: z.ZodOptional<z.ZodString>;
|
|
181
|
+
invocationId: z.ZodOptional<z.ZodString>;
|
|
182
|
+
restartPolicy: z.ZodOptional<z.ZodUnknown>;
|
|
183
|
+
}, "strip", z.ZodTypeAny, {
|
|
184
|
+
repo: string;
|
|
185
|
+
name: string;
|
|
186
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
187
|
+
task: string;
|
|
188
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
189
|
+
channel?: string | undefined;
|
|
190
|
+
restartPolicy?: unknown;
|
|
191
|
+
workflow?: string | undefined;
|
|
192
|
+
model?: string | undefined;
|
|
193
|
+
inputs?: Record<string, unknown> | undefined;
|
|
194
|
+
clonePath?: string | undefined;
|
|
195
|
+
node?: string | undefined;
|
|
196
|
+
sessionRef?: string | undefined;
|
|
197
|
+
invocationId?: string | undefined;
|
|
198
|
+
}, {
|
|
199
|
+
repo: string;
|
|
200
|
+
name: string;
|
|
201
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
202
|
+
task: string;
|
|
203
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
204
|
+
channel?: string | undefined;
|
|
205
|
+
restartPolicy?: unknown;
|
|
206
|
+
workflow?: string | undefined;
|
|
207
|
+
model?: string | undefined;
|
|
208
|
+
inputs?: Record<string, unknown> | undefined;
|
|
209
|
+
clonePath?: string | undefined;
|
|
210
|
+
node?: string | undefined;
|
|
211
|
+
sessionRef?: string | undefined;
|
|
212
|
+
invocationId?: string | undefined;
|
|
213
|
+
}>;
|
|
214
|
+
thin: z.ZodBoolean;
|
|
215
|
+
confidence: z.ZodEnum<["high", "low"]>;
|
|
216
|
+
rationale: z.ZodString;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
reviewer: {
|
|
219
|
+
repo: string;
|
|
220
|
+
name: string;
|
|
221
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
222
|
+
task: string;
|
|
223
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
224
|
+
channel?: string | undefined;
|
|
225
|
+
restartPolicy?: unknown;
|
|
226
|
+
workflow?: string | undefined;
|
|
227
|
+
model?: string | undefined;
|
|
228
|
+
inputs?: Record<string, unknown> | undefined;
|
|
229
|
+
clonePath?: string | undefined;
|
|
230
|
+
node?: string | undefined;
|
|
231
|
+
sessionRef?: string | undefined;
|
|
232
|
+
invocationId?: string | undefined;
|
|
233
|
+
};
|
|
234
|
+
routes: {
|
|
235
|
+
repo: string;
|
|
236
|
+
rationale: string;
|
|
237
|
+
clonePath?: string | undefined;
|
|
238
|
+
}[];
|
|
239
|
+
scope: "team" | "workflow" | "single";
|
|
240
|
+
issue: {
|
|
241
|
+
path: string;
|
|
242
|
+
uuid: string;
|
|
243
|
+
key: string;
|
|
244
|
+
};
|
|
245
|
+
rationale: string;
|
|
246
|
+
implementers: {
|
|
247
|
+
repo: string;
|
|
248
|
+
name: string;
|
|
249
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
250
|
+
task: string;
|
|
251
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
252
|
+
channel?: string | undefined;
|
|
253
|
+
restartPolicy?: unknown;
|
|
254
|
+
workflow?: string | undefined;
|
|
255
|
+
model?: string | undefined;
|
|
256
|
+
inputs?: Record<string, unknown> | undefined;
|
|
257
|
+
clonePath?: string | undefined;
|
|
258
|
+
node?: string | undefined;
|
|
259
|
+
sessionRef?: string | undefined;
|
|
260
|
+
invocationId?: string | undefined;
|
|
261
|
+
}[];
|
|
262
|
+
thin: boolean;
|
|
263
|
+
confidence: "high" | "low";
|
|
264
|
+
workflow?: {
|
|
265
|
+
repo: string;
|
|
266
|
+
name: string;
|
|
267
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
268
|
+
task: string;
|
|
269
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
270
|
+
channel?: string | undefined;
|
|
271
|
+
restartPolicy?: unknown;
|
|
272
|
+
workflow?: string | undefined;
|
|
273
|
+
model?: string | undefined;
|
|
274
|
+
inputs?: Record<string, unknown> | undefined;
|
|
275
|
+
clonePath?: string | undefined;
|
|
276
|
+
node?: string | undefined;
|
|
277
|
+
sessionRef?: string | undefined;
|
|
278
|
+
invocationId?: string | undefined;
|
|
279
|
+
} | undefined;
|
|
280
|
+
}, {
|
|
281
|
+
reviewer: {
|
|
282
|
+
repo: string;
|
|
283
|
+
name: string;
|
|
284
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
285
|
+
task: string;
|
|
286
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
287
|
+
channel?: string | undefined;
|
|
288
|
+
restartPolicy?: unknown;
|
|
289
|
+
workflow?: string | undefined;
|
|
290
|
+
model?: string | undefined;
|
|
291
|
+
inputs?: Record<string, unknown> | undefined;
|
|
292
|
+
clonePath?: string | undefined;
|
|
293
|
+
node?: string | undefined;
|
|
294
|
+
sessionRef?: string | undefined;
|
|
295
|
+
invocationId?: string | undefined;
|
|
296
|
+
};
|
|
297
|
+
routes: {
|
|
298
|
+
repo: string;
|
|
299
|
+
rationale: string;
|
|
300
|
+
clonePath?: string | undefined;
|
|
301
|
+
}[];
|
|
302
|
+
scope: "team" | "workflow" | "single";
|
|
303
|
+
issue: {
|
|
304
|
+
path: string;
|
|
305
|
+
uuid: string;
|
|
306
|
+
key: string;
|
|
307
|
+
};
|
|
308
|
+
rationale: string;
|
|
309
|
+
implementers: {
|
|
310
|
+
repo: string;
|
|
311
|
+
name: string;
|
|
312
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
313
|
+
task: string;
|
|
314
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
315
|
+
channel?: string | undefined;
|
|
316
|
+
restartPolicy?: unknown;
|
|
317
|
+
workflow?: string | undefined;
|
|
318
|
+
model?: string | undefined;
|
|
319
|
+
inputs?: Record<string, unknown> | undefined;
|
|
320
|
+
clonePath?: string | undefined;
|
|
321
|
+
node?: string | undefined;
|
|
322
|
+
sessionRef?: string | undefined;
|
|
323
|
+
invocationId?: string | undefined;
|
|
324
|
+
}[];
|
|
325
|
+
thin: boolean;
|
|
326
|
+
confidence: "high" | "low";
|
|
327
|
+
workflow?: {
|
|
328
|
+
repo: string;
|
|
329
|
+
name: string;
|
|
330
|
+
role: "implementer" | "reviewer" | "babysitter" | "workflow";
|
|
331
|
+
task: string;
|
|
332
|
+
capability: "spawn:codex" | "spawn:claude" | "workflow:run";
|
|
333
|
+
channel?: string | undefined;
|
|
334
|
+
restartPolicy?: unknown;
|
|
335
|
+
workflow?: string | undefined;
|
|
336
|
+
model?: string | undefined;
|
|
337
|
+
inputs?: Record<string, unknown> | undefined;
|
|
338
|
+
clonePath?: string | undefined;
|
|
339
|
+
node?: string | undefined;
|
|
340
|
+
sessionRef?: string | undefined;
|
|
341
|
+
invocationId?: string | undefined;
|
|
342
|
+
} | undefined;
|
|
343
|
+
}>;
|
|
344
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/triage/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe1B,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkB/B,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const AgentSpecSchema = z.object({
|
|
3
|
+
name: z.string(),
|
|
4
|
+
role: z.enum(['implementer', 'reviewer', 'babysitter', 'workflow']),
|
|
5
|
+
capability: z.enum(['spawn:codex', 'spawn:claude', 'workflow:run']),
|
|
6
|
+
model: z.string().optional(),
|
|
7
|
+
task: z.string(),
|
|
8
|
+
workflow: z.string().optional(),
|
|
9
|
+
inputs: z.record(z.unknown()).optional(),
|
|
10
|
+
repo: z.string(),
|
|
11
|
+
clonePath: z.string().optional(),
|
|
12
|
+
channel: z.string().optional(),
|
|
13
|
+
node: z.string().optional(),
|
|
14
|
+
sessionRef: z.string().optional(),
|
|
15
|
+
invocationId: z.string().optional(),
|
|
16
|
+
restartPolicy: z.unknown().optional(),
|
|
17
|
+
});
|
|
18
|
+
export const TriageDecisionSchema = z.object({
|
|
19
|
+
issue: z.object({
|
|
20
|
+
uuid: z.string(),
|
|
21
|
+
key: z.string(),
|
|
22
|
+
path: z.string(),
|
|
23
|
+
}),
|
|
24
|
+
routes: z.array(z.object({
|
|
25
|
+
repo: z.string(),
|
|
26
|
+
clonePath: z.string().optional(),
|
|
27
|
+
rationale: z.string(),
|
|
28
|
+
})),
|
|
29
|
+
scope: z.enum(['single', 'workflow', 'team']),
|
|
30
|
+
implementers: z.array(AgentSpecSchema),
|
|
31
|
+
workflow: AgentSpecSchema.optional(),
|
|
32
|
+
reviewer: AgentSpecSchema,
|
|
33
|
+
thin: z.boolean(),
|
|
34
|
+
confidence: z.enum(['high', 'low']),
|
|
35
|
+
rationale: z.string(),
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/triage/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;IACnE,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;IACnE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;KACtB,CAAC,CAAC;IACH,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IAC7C,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC;IACtC,QAAQ,EAAE,eAAe,CAAC,QAAQ,EAAE;IACpC,QAAQ,EAAE,eAAe;IACzB,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE;IACjB,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACnC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LinearIssue, TriageContext, TriageDecision, TriageEngine } from '../types.js';
|
|
2
|
+
export declare class TieredTriage implements TriageEngine {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(heuristic?: TriageEngine, llm?: TriageEngine);
|
|
5
|
+
triage(issue: LinearIssue, ctx: TriageContext): Promise<TriageDecision>;
|
|
6
|
+
}
|
|
7
|
+
export declare function mergeDecisions(heuristicDecision: TriageDecision, llmDecision: TriageDecision, issue: LinearIssue, ctx: TriageContext): TriageDecision;
|
|
8
|
+
//# sourceMappingURL=tiered.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiered.d.ts","sourceRoot":"","sources":["../../src/triage/tiered.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAGxF,qBAAa,YAAa,YAAW,YAAY;;gBAInC,SAAS,GAAE,YAAoC,EAAE,GAAG,CAAC,EAAE,YAAY;IAKzE,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;CAiB9E;AAED,wBAAgB,cAAc,CAC5B,iBAAiB,EAAE,cAAc,EACjC,WAAW,EAAE,cAAc,EAC3B,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,aAAa,GACjB,cAAc,CAqBhB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { buildDecision, HeuristicTriage, normalizeDecision, scopeFromLabels } from './heuristic.js';
|
|
2
|
+
export class TieredTriage {
|
|
3
|
+
#heuristic;
|
|
4
|
+
#llm;
|
|
5
|
+
constructor(heuristic = new HeuristicTriage(), llm) {
|
|
6
|
+
this.#heuristic = heuristic;
|
|
7
|
+
this.#llm = llm;
|
|
8
|
+
}
|
|
9
|
+
async triage(issue, ctx) {
|
|
10
|
+
const heuristicDecision = await this.#heuristic.triage(issue, ctx);
|
|
11
|
+
if (!heuristicDecision.thin && heuristicDecision.confidence !== 'low') {
|
|
12
|
+
return heuristicDecision;
|
|
13
|
+
}
|
|
14
|
+
if (!this.#llm) {
|
|
15
|
+
return { ...heuristicDecision, confidence: 'low' };
|
|
16
|
+
}
|
|
17
|
+
try {
|
|
18
|
+
const llmDecision = await this.#llm.triage(issue, ctx);
|
|
19
|
+
return mergeDecisions(heuristicDecision, llmDecision, issue, ctx);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return { ...heuristicDecision, confidence: 'low' };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function mergeDecisions(heuristicDecision, llmDecision, issue, ctx) {
|
|
27
|
+
const mergedRoutes = llmDecision.routes.length > 0 ? llmDecision.routes : heuristicDecision.routes;
|
|
28
|
+
const explicitScope = scopeFromLabels(issue.labels);
|
|
29
|
+
const mergedScope = explicitScope
|
|
30
|
+
?? (mergedRoutes.length >= 2 || llmDecision.scope === 'team' || heuristicDecision.scope === 'team'
|
|
31
|
+
? 'team'
|
|
32
|
+
: llmDecision.scope === 'workflow' || heuristicDecision.scope === 'workflow'
|
|
33
|
+
? 'workflow'
|
|
34
|
+
: 'single');
|
|
35
|
+
return normalizeDecision(buildDecision({
|
|
36
|
+
issue,
|
|
37
|
+
config: ctx.config,
|
|
38
|
+
routes: mergedRoutes,
|
|
39
|
+
scope: mergedScope,
|
|
40
|
+
scopeSource: explicitScope ? 'label' : 'inference',
|
|
41
|
+
thin: llmDecision.thin && heuristicDecision.thin,
|
|
42
|
+
confidence: mergedRoutes.length === 0 ? 'low' : llmDecision.confidence,
|
|
43
|
+
rationale: llmDecision.rationale || heuristicDecision.rationale,
|
|
44
|
+
scopeSlugs: llmDecision.implementers.map((implementer) => implementer.name.replace(/^ar-\d+-impl-?/, '')).filter(Boolean),
|
|
45
|
+
}), issue, ctx.config);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=tiered.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiered.js","sourceRoot":"","sources":["../../src/triage/tiered.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAEhG,MAAM,OAAO,YAAY;IACd,UAAU,CAAc;IACxB,IAAI,CAAe;IAE5B,YAAY,YAA0B,IAAI,eAAe,EAAE,EAAE,GAAkB;QAC7E,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;QAC3B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAkB,EAAE,GAAkB;QACjD,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;QAClE,IAAI,CAAC,iBAAiB,CAAC,IAAI,IAAI,iBAAiB,CAAC,UAAU,KAAK,KAAK,EAAE,CAAC;YACtE,OAAO,iBAAiB,CAAA;QAC1B,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,EAAE,GAAG,iBAAiB,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;QACpD,CAAC;QAED,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;YACtD,OAAO,cAAc,CAAC,iBAAiB,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,CAAA;QACnE,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,GAAG,iBAAiB,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;QACpD,CAAC;IACH,CAAC;CACF;AAED,MAAM,UAAU,cAAc,CAC5B,iBAAiC,EACjC,WAA2B,EAC3B,KAAkB,EAClB,GAAkB;IAElB,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAA;IAClG,MAAM,aAAa,GAAG,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IACnD,MAAM,WAAW,GAAG,aAAa;WAC5B,CAAC,YAAY,CAAC,MAAM,IAAI,CAAC,IAAI,WAAW,CAAC,KAAK,KAAK,MAAM,IAAI,iBAAiB,CAAC,KAAK,KAAK,MAAM;YAChG,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,WAAW,CAAC,KAAK,KAAK,UAAU,IAAI,iBAAiB,CAAC,KAAK,KAAK,UAAU;gBAC1E,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,QAAQ,CAAC,CAAA;IAEjB,OAAO,iBAAiB,CAAC,aAAa,CAAC;QACrC,KAAK;QACL,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,MAAM,EAAE,YAAY;QACpB,KAAK,EAAE,WAAW;QAClB,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW;QAClD,IAAI,EAAE,WAAW,CAAC,IAAI,IAAI,iBAAiB,CAAC,IAAI;QAChD,UAAU,EAAE,YAAY,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU;QACtE,SAAS,EAAE,WAAW,CAAC,SAAS,IAAI,iBAAiB,CAAC,SAAS;QAC/D,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;KAC1H,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;AACxB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import type { FactoryConfig } from './config/schema.js';
|
|
2
|
+
import type { FactoryStateResolution } from './linear/state-resolver.js';
|
|
3
|
+
import type { AgentSpec, FleetClient, GithubRead, LinearWriteback, MountClient, SlackWriteback } from './ports/index.js';
|
|
4
|
+
import type { StateStore } from './ports/state.js';
|
|
5
|
+
import type { Clock, Logger } from './ports/system.js';
|
|
6
|
+
import type { CloseProbePrInput, CloseProbePrResult } from './github/probe-closer.js';
|
|
7
|
+
import type { GhRunner, GithubMergeGate } from './github/merge-gate.js';
|
|
8
|
+
import type { AgentProcessFinder, ProcessIdentity } from './orchestrator/process-identity.js';
|
|
9
|
+
export interface FactoryPorts {
|
|
10
|
+
mount: MountClient;
|
|
11
|
+
fleet: FleetClient;
|
|
12
|
+
stateStore?: StateStore;
|
|
13
|
+
stateResolution?: FactoryStateResolution;
|
|
14
|
+
triage?: TriageEngine;
|
|
15
|
+
linear?: LinearWriteback;
|
|
16
|
+
slack?: SlackWriteback;
|
|
17
|
+
github?: GithubRead;
|
|
18
|
+
mergeGate?: GithubMergeGate;
|
|
19
|
+
probeCloser?: ProbeCloser;
|
|
20
|
+
probePrResolver?: ProbePrResolver;
|
|
21
|
+
probePrGhRunner?: GhRunner;
|
|
22
|
+
logger?: Logger;
|
|
23
|
+
clock?: Clock;
|
|
24
|
+
processIdentityReader?: (pid: number) => Promise<ProcessIdentity | undefined>;
|
|
25
|
+
processFinder?: AgentProcessFinder;
|
|
26
|
+
kill?: (pid: number, signal?: NodeJS.Signals | 0) => boolean;
|
|
27
|
+
readChildPids?: (pid: number) => Promise<number[]>;
|
|
28
|
+
terminationGraceMs?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface Factory {
|
|
31
|
+
start(opts?: FactoryStartOptions): Promise<void>;
|
|
32
|
+
stop(): Promise<void>;
|
|
33
|
+
dispose(): Promise<void>;
|
|
34
|
+
runOnce(opts?: {
|
|
35
|
+
dryRun?: boolean;
|
|
36
|
+
}): Promise<IterationReport>;
|
|
37
|
+
runLoop(opts?: FactoryLoopRunOptions): Promise<IterationReport[]>;
|
|
38
|
+
triageIssue(issue: LinearIssue): Promise<TriageDecision>;
|
|
39
|
+
dispatch(decision: TriageDecision, opts?: {
|
|
40
|
+
dryRun?: boolean;
|
|
41
|
+
}): Promise<DispatchResult>;
|
|
42
|
+
status(): FactoryStatus;
|
|
43
|
+
on(event: 'issue-queued' | 'dispatched' | 'issue-done' | 'writeback-verified' | 'error', listener: (payload: FactoryEventPayload) => void): () => void;
|
|
44
|
+
}
|
|
45
|
+
export interface FactoryStartOptions {
|
|
46
|
+
mode?: 'backfill-and-subscribe' | 'live';
|
|
47
|
+
liveSubscription?: Partial<FactoryLiveSubscriptionOptions>;
|
|
48
|
+
}
|
|
49
|
+
export interface FactoryLiveSubscriptionOptions {
|
|
50
|
+
transport: 'subscribe-and-poll' | 'subscribe' | 'poll';
|
|
51
|
+
pollIntervalMs: number;
|
|
52
|
+
eventLimit: number;
|
|
53
|
+
replaySkewMarginMs: number;
|
|
54
|
+
}
|
|
55
|
+
export interface FactoryLoopRunOptions {
|
|
56
|
+
dryRun?: boolean;
|
|
57
|
+
maxIterations?: number;
|
|
58
|
+
maxConsecutiveFailures?: number;
|
|
59
|
+
heartbeatPath?: string;
|
|
60
|
+
registryPath?: string;
|
|
61
|
+
}
|
|
62
|
+
export type FactoryLoopHeartbeatStatus = 'running' | 'idle' | 'stopping';
|
|
63
|
+
export interface FactoryLoopHeartbeat {
|
|
64
|
+
pid: number;
|
|
65
|
+
status: FactoryLoopHeartbeatStatus;
|
|
66
|
+
iteration: number;
|
|
67
|
+
maxIterations: number;
|
|
68
|
+
updatedAt: string;
|
|
69
|
+
updatedAtMs: number;
|
|
70
|
+
registryPath?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface FactoryInFlightRegistryAgent {
|
|
73
|
+
name: string;
|
|
74
|
+
role?: AgentSpec['role'];
|
|
75
|
+
issue?: IssueRef;
|
|
76
|
+
sessionRef?: string;
|
|
77
|
+
pids: number[];
|
|
78
|
+
processes?: FactoryInFlightRegistryProcess[];
|
|
79
|
+
}
|
|
80
|
+
export interface FactoryInFlightRegistryProcess {
|
|
81
|
+
pid: number;
|
|
82
|
+
agentName: string;
|
|
83
|
+
cmdline: string;
|
|
84
|
+
startTime: string;
|
|
85
|
+
}
|
|
86
|
+
export interface FactoryInFlightRegistry {
|
|
87
|
+
pid: number;
|
|
88
|
+
heartbeatPath?: string;
|
|
89
|
+
updatedAt: string;
|
|
90
|
+
updatedAtMs: number;
|
|
91
|
+
agents: FactoryInFlightRegistryAgent[];
|
|
92
|
+
}
|
|
93
|
+
export interface FactoryLoopLiveness {
|
|
94
|
+
ok: boolean;
|
|
95
|
+
stale: boolean;
|
|
96
|
+
ageMs?: number;
|
|
97
|
+
heartbeat?: FactoryLoopHeartbeat;
|
|
98
|
+
reason?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface LinearIssue {
|
|
101
|
+
uuid: string;
|
|
102
|
+
key: string;
|
|
103
|
+
title: string;
|
|
104
|
+
description: string;
|
|
105
|
+
stateId: string;
|
|
106
|
+
state?: {
|
|
107
|
+
name: string;
|
|
108
|
+
};
|
|
109
|
+
labels: string[];
|
|
110
|
+
project?: string;
|
|
111
|
+
team?: string;
|
|
112
|
+
assignee?: string;
|
|
113
|
+
path: string;
|
|
114
|
+
raw: Record<string, unknown>;
|
|
115
|
+
}
|
|
116
|
+
export interface IssueRef {
|
|
117
|
+
uuid: string;
|
|
118
|
+
key: string;
|
|
119
|
+
path: string;
|
|
120
|
+
}
|
|
121
|
+
export interface IterationReport {
|
|
122
|
+
pulled: IssueRef[];
|
|
123
|
+
triaged: TriageDecision[];
|
|
124
|
+
dispatched: DispatchResult[];
|
|
125
|
+
skipped: Array<{
|
|
126
|
+
issue: IssueRef;
|
|
127
|
+
reason: string;
|
|
128
|
+
}>;
|
|
129
|
+
dryRun: boolean;
|
|
130
|
+
slackDegraded?: boolean;
|
|
131
|
+
error?: {
|
|
132
|
+
message: string;
|
|
133
|
+
stack?: string;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
export interface DispatchResult {
|
|
137
|
+
issue: IssueRef;
|
|
138
|
+
agents: Array<{
|
|
139
|
+
name: string;
|
|
140
|
+
role: AgentSpec['role'];
|
|
141
|
+
}>;
|
|
142
|
+
comments?: string[];
|
|
143
|
+
stateId?: string;
|
|
144
|
+
dryRun: boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface FactoryStatus {
|
|
147
|
+
inFlight: IssueRef[];
|
|
148
|
+
queued: IssueRef[];
|
|
149
|
+
counters: Record<string, number>;
|
|
150
|
+
slackDegraded?: boolean;
|
|
151
|
+
slackDegradedReason?: string;
|
|
152
|
+
}
|
|
153
|
+
export type FactoryEventPayload = {
|
|
154
|
+
issue: IssueRef;
|
|
155
|
+
} | {
|
|
156
|
+
issue: IssueRef;
|
|
157
|
+
result: DispatchResult;
|
|
158
|
+
} | {
|
|
159
|
+
issue: IssueRef;
|
|
160
|
+
path: string;
|
|
161
|
+
} | {
|
|
162
|
+
error: unknown;
|
|
163
|
+
errorMessage: string;
|
|
164
|
+
errorStack?: string;
|
|
165
|
+
issue?: IssueRef;
|
|
166
|
+
};
|
|
167
|
+
export interface TriageEngine {
|
|
168
|
+
triage(issue: LinearIssue, ctx: TriageContext): Promise<TriageDecision>;
|
|
169
|
+
}
|
|
170
|
+
export interface TriageContext {
|
|
171
|
+
config: FactoryConfig;
|
|
172
|
+
repoMap: RepoMapEntry[];
|
|
173
|
+
}
|
|
174
|
+
export interface RepoMapEntry {
|
|
175
|
+
repo: string;
|
|
176
|
+
clonePath?: string;
|
|
177
|
+
source: 'label' | 'project' | 'keyword' | 'default';
|
|
178
|
+
key?: string;
|
|
179
|
+
}
|
|
180
|
+
export interface TriageDecision {
|
|
181
|
+
issue: IssueRef;
|
|
182
|
+
routes: Array<{
|
|
183
|
+
repo: string;
|
|
184
|
+
clonePath?: string;
|
|
185
|
+
rationale: string;
|
|
186
|
+
}>;
|
|
187
|
+
scope: 'single' | 'workflow' | 'team';
|
|
188
|
+
implementers: AgentSpec[];
|
|
189
|
+
workflow?: AgentSpec;
|
|
190
|
+
reviewer: AgentSpec;
|
|
191
|
+
thin: boolean;
|
|
192
|
+
confidence: 'high' | 'low';
|
|
193
|
+
rationale: string;
|
|
194
|
+
}
|
|
195
|
+
export interface PrSummary {
|
|
196
|
+
repo: string;
|
|
197
|
+
number: number;
|
|
198
|
+
title?: string;
|
|
199
|
+
url?: string;
|
|
200
|
+
/** Advisory only: mount snapshots can lag live GitHub state. Never use this for merge readiness. */
|
|
201
|
+
state?: string;
|
|
202
|
+
headRef?: string;
|
|
203
|
+
baseRef?: string;
|
|
204
|
+
author?: string;
|
|
205
|
+
filesChanged?: string[];
|
|
206
|
+
}
|
|
207
|
+
export type ProbePrRef = Pick<CloseProbePrInput, 'repo' | 'prNumber'> & {
|
|
208
|
+
draft?: boolean;
|
|
209
|
+
};
|
|
210
|
+
export type ProbePrResolver = (issue: LinearIssue) => Promise<ProbePrRef | undefined>;
|
|
211
|
+
export type ProbeCloser = (input: Pick<CloseProbePrInput, 'repo' | 'prNumber' | 'expectedIssueKey' | 'requireTitleMarker'>) => Promise<CloseProbePrResult>;
|
|
212
|
+
//# sourceMappingURL=types.d.ts.map
|