@neotx/cli 0.1.0-alpha.24 → 0.1.0-alpha.25
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/dist/child-5X5IHAKS.js +92 -0
- package/dist/child-5X5IHAKS.js.map +1 -0
- package/dist/child-mode-IB3XSUHD.js +8 -0
- package/dist/child-mode-IB3XSUHD.js.map +1 -0
- package/dist/chunk-4TQ3Q6IE.js +43 -0
- package/dist/chunk-4TQ3Q6IE.js.map +1 -0
- package/dist/chunk-6PSXZ3UV.js +46 -0
- package/dist/chunk-6PSXZ3UV.js.map +1 -0
- package/dist/chunk-V5SN5F73.js +54 -0
- package/dist/chunk-V5SN5F73.js.map +1 -0
- package/dist/daemon/child-supervisor-worker.js +136 -0
- package/dist/daemon/child-supervisor-worker.js.map +1 -0
- package/dist/daemon/supervisor-worker.js +9 -1
- package/dist/daemon/supervisor-worker.js.map +1 -1
- package/dist/daemon/worker.js +16 -3
- package/dist/daemon/worker.js.map +1 -1
- package/dist/directive-7WM2Q2UW.js +259 -0
- package/dist/directive-7WM2Q2UW.js.map +1 -0
- package/dist/do-F5XW2ELZ.js +83 -0
- package/dist/do-F5XW2ELZ.js.map +1 -0
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/{log-PTHLI7ZN.js → log-ZLIAIBZQ.js} +64 -9
- package/dist/log-ZLIAIBZQ.js.map +1 -0
- package/dist/{memory-SDZ57W2S.js → memory-CW6E65SQ.js} +112 -62
- package/dist/memory-CW6E65SQ.js.map +1 -0
- package/dist/{run-MWHIQUSY.js → run-NV762V5B.js} +56 -22
- package/dist/run-NV762V5B.js.map +1 -0
- package/dist/{supervise-XMZRNODO.js → supervise-BWIKWNHH.js} +68 -41
- package/dist/supervise-BWIKWNHH.js.map +1 -0
- package/dist/{supervisor-3RUX5SPH.js → supervisor-N4D5EWCC.js} +1 -1
- package/dist/tui-LSW7VVK6.js +1319 -0
- package/dist/tui-LSW7VVK6.js.map +1 -0
- package/package.json +4 -4
- package/dist/log-PTHLI7ZN.js.map +0 -1
- package/dist/memory-SDZ57W2S.js.map +0 -1
- package/dist/run-MWHIQUSY.js.map +0 -1
- package/dist/supervise-XMZRNODO.js.map +0 -1
- package/dist/tui-67VJ5VBA.js +0 -842
- package/dist/tui-67VJ5VBA.js.map +0 -1
- /package/dist/{supervisor-3RUX5SPH.js.map → supervisor-N4D5EWCC.js.map} +0 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import {
|
|
2
|
+
printError,
|
|
3
|
+
printSuccess,
|
|
4
|
+
printTable
|
|
5
|
+
} from "./chunk-YQIWMDXL.js";
|
|
6
|
+
|
|
7
|
+
// src/commands/directive.ts
|
|
8
|
+
import path from "path";
|
|
9
|
+
import {
|
|
10
|
+
DirectiveStore,
|
|
11
|
+
getSupervisorDir,
|
|
12
|
+
parseDirectiveDuration
|
|
13
|
+
} from "@neotx/core";
|
|
14
|
+
import { defineCommand } from "citty";
|
|
15
|
+
var VALID_TRIGGERS = ["idle", "startup", "shutdown"];
|
|
16
|
+
function openStore(name) {
|
|
17
|
+
const dir = getSupervisorDir(name);
|
|
18
|
+
return new DirectiveStore(path.join(dir, "directives.jsonl"));
|
|
19
|
+
}
|
|
20
|
+
function formatExpiry(expiresAt) {
|
|
21
|
+
if (!expiresAt) return "\u221E";
|
|
22
|
+
const date = new Date(expiresAt);
|
|
23
|
+
const now = /* @__PURE__ */ new Date();
|
|
24
|
+
if (date < now) return "expired";
|
|
25
|
+
const diffMs = date.getTime() - now.getTime();
|
|
26
|
+
const hours = Math.floor(diffMs / (60 * 60 * 1e3));
|
|
27
|
+
const minutes = Math.floor(diffMs % (60 * 60 * 1e3) / (60 * 1e3));
|
|
28
|
+
if (hours > 24) {
|
|
29
|
+
const days = Math.floor(hours / 24);
|
|
30
|
+
return `${days}d ${hours % 24}h`;
|
|
31
|
+
}
|
|
32
|
+
if (hours > 0) {
|
|
33
|
+
return `${hours}h ${minutes}m`;
|
|
34
|
+
}
|
|
35
|
+
return `${minutes}m`;
|
|
36
|
+
}
|
|
37
|
+
async function handleCreate(args) {
|
|
38
|
+
if (!args.value) {
|
|
39
|
+
printError('Usage: neo directive create "<action>" [--trigger idle] [--duration "2h"]');
|
|
40
|
+
process.exitCode = 1;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const trigger = args.trigger;
|
|
44
|
+
if (!VALID_TRIGGERS.includes(trigger)) {
|
|
45
|
+
printError(`Invalid trigger "${trigger}". Must be one of: ${VALID_TRIGGERS.join(", ")}`);
|
|
46
|
+
process.exitCode = 1;
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let expiresAt;
|
|
50
|
+
if (args.duration) {
|
|
51
|
+
expiresAt = parseDirectiveDuration(args.duration);
|
|
52
|
+
const isIndefinite = ["indefinitely", "forever", ""].includes(
|
|
53
|
+
args.duration.toLowerCase().trim()
|
|
54
|
+
);
|
|
55
|
+
if (expiresAt === void 0 && !isIndefinite) {
|
|
56
|
+
printError(
|
|
57
|
+
`Invalid --duration format "${args.duration}". Use: "2h", "30m", "for 2 hours", "until midnight", "until 18:00", or "indefinitely"`
|
|
58
|
+
);
|
|
59
|
+
process.exitCode = 1;
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const store = openStore(args.name);
|
|
64
|
+
const input = {
|
|
65
|
+
trigger,
|
|
66
|
+
action: args.value
|
|
67
|
+
};
|
|
68
|
+
if (args.description) {
|
|
69
|
+
input.description = args.description;
|
|
70
|
+
}
|
|
71
|
+
if (args.priority) {
|
|
72
|
+
input.priority = Number(args.priority);
|
|
73
|
+
}
|
|
74
|
+
if (expiresAt) {
|
|
75
|
+
input.expiresAt = expiresAt;
|
|
76
|
+
}
|
|
77
|
+
const id = await store.create(input);
|
|
78
|
+
const expiryLabel = expiresAt ? formatExpiry(expiresAt) : "indefinitely";
|
|
79
|
+
printSuccess(`Directive created: ${id}`);
|
|
80
|
+
console.log(` Trigger: ${trigger}`);
|
|
81
|
+
console.log(` Action: ${args.value}`);
|
|
82
|
+
console.log(` Duration: ${expiryLabel}`);
|
|
83
|
+
}
|
|
84
|
+
async function handleList(args) {
|
|
85
|
+
const store = openStore(args.name);
|
|
86
|
+
const directives = await store.list();
|
|
87
|
+
if (directives.length === 0) {
|
|
88
|
+
console.log("No directives found.");
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
printTable(
|
|
92
|
+
["ID", "TRIGGER", "STATUS", "EXPIRES", "PRIORITY", "ACTION"],
|
|
93
|
+
directives.map((d) => {
|
|
94
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
95
|
+
let status = d.enabled ? "active" : "disabled";
|
|
96
|
+
if (d.expiresAt && d.expiresAt < now) {
|
|
97
|
+
status = "expired";
|
|
98
|
+
}
|
|
99
|
+
return [
|
|
100
|
+
d.id,
|
|
101
|
+
d.trigger,
|
|
102
|
+
status,
|
|
103
|
+
formatExpiry(d.expiresAt),
|
|
104
|
+
String(d.priority),
|
|
105
|
+
d.action.length > 40 ? `${d.action.slice(0, 37)}...` : d.action
|
|
106
|
+
];
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
async function handleDelete(args) {
|
|
111
|
+
if (!args.value) {
|
|
112
|
+
printError("Usage: neo directive delete <id>");
|
|
113
|
+
process.exitCode = 1;
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const store = openStore(args.name);
|
|
117
|
+
try {
|
|
118
|
+
await store.delete(args.value);
|
|
119
|
+
printSuccess(`Directive deleted: ${args.value}`);
|
|
120
|
+
} catch (err) {
|
|
121
|
+
printError(err instanceof Error ? err.message : String(err));
|
|
122
|
+
process.exitCode = 1;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
async function handleToggle(args) {
|
|
126
|
+
if (!args.value) {
|
|
127
|
+
printError("Usage: neo directive toggle <id>");
|
|
128
|
+
process.exitCode = 1;
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const store = openStore(args.name);
|
|
132
|
+
try {
|
|
133
|
+
const directive = await store.get(args.value);
|
|
134
|
+
if (!directive) {
|
|
135
|
+
printError(`Directive not found: ${args.value}`);
|
|
136
|
+
process.exitCode = 1;
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const newState = !directive.enabled;
|
|
140
|
+
await store.toggle(args.value, newState);
|
|
141
|
+
printSuccess(`Directive ${args.value} ${newState ? "enabled" : "disabled"}`);
|
|
142
|
+
} catch (err) {
|
|
143
|
+
printError(err instanceof Error ? err.message : String(err));
|
|
144
|
+
process.exitCode = 1;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
async function handleShow(args) {
|
|
148
|
+
if (!args.value) {
|
|
149
|
+
printError("Usage: neo directive show <id>");
|
|
150
|
+
process.exitCode = 1;
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const store = openStore(args.name);
|
|
154
|
+
const directive = await store.get(args.value);
|
|
155
|
+
if (!directive) {
|
|
156
|
+
printError(`Directive not found: ${args.value}`);
|
|
157
|
+
process.exitCode = 1;
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
161
|
+
let status = directive.enabled ? "active" : "disabled";
|
|
162
|
+
if (directive.expiresAt && directive.expiresAt < now) {
|
|
163
|
+
status = "expired";
|
|
164
|
+
}
|
|
165
|
+
console.log(`ID: ${directive.id}`);
|
|
166
|
+
console.log(`Trigger: ${directive.trigger}`);
|
|
167
|
+
console.log(`Status: ${status}`);
|
|
168
|
+
console.log(`Priority: ${directive.priority}`);
|
|
169
|
+
console.log(`Action: ${directive.action}`);
|
|
170
|
+
if (directive.description) {
|
|
171
|
+
console.log(`Description: ${directive.description}`);
|
|
172
|
+
}
|
|
173
|
+
console.log(`Created: ${directive.createdAt}`);
|
|
174
|
+
if (directive.expiresAt) {
|
|
175
|
+
console.log(`Expires: ${directive.expiresAt} (${formatExpiry(directive.expiresAt)})`);
|
|
176
|
+
} else {
|
|
177
|
+
console.log(`Expires: never (indefinite)`);
|
|
178
|
+
}
|
|
179
|
+
if (directive.lastTriggeredAt) {
|
|
180
|
+
console.log(`Last triggered: ${directive.lastTriggeredAt}`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
var directive_default = defineCommand({
|
|
184
|
+
meta: {
|
|
185
|
+
name: "directive",
|
|
186
|
+
description: "Manage persistent supervisor directives"
|
|
187
|
+
},
|
|
188
|
+
args: {
|
|
189
|
+
action: {
|
|
190
|
+
type: "positional",
|
|
191
|
+
description: "Action: create, list, delete, toggle, show",
|
|
192
|
+
required: true
|
|
193
|
+
},
|
|
194
|
+
value: {
|
|
195
|
+
type: "positional",
|
|
196
|
+
description: "Action text or directive ID",
|
|
197
|
+
required: false
|
|
198
|
+
},
|
|
199
|
+
trigger: {
|
|
200
|
+
type: "string",
|
|
201
|
+
alias: "t",
|
|
202
|
+
description: "Trigger type: idle, startup, shutdown",
|
|
203
|
+
default: "idle"
|
|
204
|
+
},
|
|
205
|
+
duration: {
|
|
206
|
+
type: "string",
|
|
207
|
+
alias: "d",
|
|
208
|
+
description: 'Duration: "2h", "until midnight", "for 2 hours", "indefinitely"'
|
|
209
|
+
},
|
|
210
|
+
priority: {
|
|
211
|
+
type: "string",
|
|
212
|
+
alias: "p",
|
|
213
|
+
description: "Priority (higher = execute first)",
|
|
214
|
+
default: "0"
|
|
215
|
+
},
|
|
216
|
+
description: {
|
|
217
|
+
type: "string",
|
|
218
|
+
description: "Human-readable description"
|
|
219
|
+
},
|
|
220
|
+
name: {
|
|
221
|
+
type: "string",
|
|
222
|
+
description: "Supervisor name",
|
|
223
|
+
default: "supervisor"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
async run({ args }) {
|
|
227
|
+
const action = args.action;
|
|
228
|
+
const parsed = {
|
|
229
|
+
action,
|
|
230
|
+
value: args.value,
|
|
231
|
+
trigger: args.trigger,
|
|
232
|
+
duration: args.duration,
|
|
233
|
+
priority: args.priority,
|
|
234
|
+
description: args.description,
|
|
235
|
+
name: args.name
|
|
236
|
+
};
|
|
237
|
+
switch (action) {
|
|
238
|
+
case "create":
|
|
239
|
+
return handleCreate(parsed);
|
|
240
|
+
case "list":
|
|
241
|
+
return handleList(parsed);
|
|
242
|
+
case "delete":
|
|
243
|
+
return handleDelete(parsed);
|
|
244
|
+
case "toggle":
|
|
245
|
+
return handleToggle(parsed);
|
|
246
|
+
case "show":
|
|
247
|
+
return handleShow(parsed);
|
|
248
|
+
default:
|
|
249
|
+
printError(
|
|
250
|
+
`Unknown action "${action}". Must be one of: create, list, delete, toggle, show`
|
|
251
|
+
);
|
|
252
|
+
process.exitCode = 1;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
export {
|
|
257
|
+
directive_default as default
|
|
258
|
+
};
|
|
259
|
+
//# sourceMappingURL=directive-7WM2Q2UW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/directive.ts"],"sourcesContent":["import path from \"node:path\";\nimport {\n DirectiveStore,\n type DirectiveTrigger,\n getSupervisorDir,\n parseDirectiveDuration,\n} from \"@neotx/core\";\nimport { defineCommand } from \"citty\";\nimport { printError, printSuccess, printTable } from \"../output.js\";\n\nconst VALID_TRIGGERS = [\"idle\", \"startup\", \"shutdown\"] as const;\n\ninterface ParsedArgs {\n action: string;\n value: string | undefined;\n trigger: string;\n duration: string | undefined;\n priority: string | undefined;\n description: string | undefined;\n name: string;\n}\n\nfunction openStore(name: string): DirectiveStore {\n const dir = getSupervisorDir(name);\n return new DirectiveStore(path.join(dir, \"directives.jsonl\"));\n}\n\nfunction formatExpiry(expiresAt: string | undefined): string {\n if (!expiresAt) return \"∞\";\n const date = new Date(expiresAt);\n const now = new Date();\n if (date < now) return \"expired\";\n\n const diffMs = date.getTime() - now.getTime();\n const hours = Math.floor(diffMs / (60 * 60 * 1000));\n const minutes = Math.floor((diffMs % (60 * 60 * 1000)) / (60 * 1000));\n\n if (hours > 24) {\n const days = Math.floor(hours / 24);\n return `${days}d ${hours % 24}h`;\n }\n if (hours > 0) {\n return `${hours}h ${minutes}m`;\n }\n return `${minutes}m`;\n}\n\nasync function handleCreate(args: ParsedArgs): Promise<void> {\n if (!args.value) {\n printError('Usage: neo directive create \"<action>\" [--trigger idle] [--duration \"2h\"]');\n process.exitCode = 1;\n return;\n }\n\n const trigger = args.trigger as DirectiveTrigger;\n if (!VALID_TRIGGERS.includes(trigger)) {\n printError(`Invalid trigger \"${trigger}\". Must be one of: ${VALID_TRIGGERS.join(\", \")}`);\n process.exitCode = 1;\n return;\n }\n\n let expiresAt: string | undefined;\n if (args.duration) {\n expiresAt = parseDirectiveDuration(args.duration);\n // parseDirectiveDuration returns undefined for \"indefinitely\" which is valid\n // But if user provided something and we got undefined, it might be invalid format\n // Check against known indefinite keywords\n const isIndefinite = [\"indefinitely\", \"forever\", \"\"].includes(\n args.duration.toLowerCase().trim(),\n );\n if (expiresAt === undefined && !isIndefinite) {\n printError(\n `Invalid --duration format \"${args.duration}\". Use: \"2h\", \"30m\", \"for 2 hours\", \"until midnight\", \"until 18:00\", or \"indefinitely\"`,\n );\n process.exitCode = 1;\n return;\n }\n }\n\n const store = openStore(args.name);\n const input: Parameters<typeof store.create>[0] = {\n trigger,\n action: args.value,\n };\n if (args.description) {\n input.description = args.description;\n }\n if (args.priority) {\n input.priority = Number(args.priority);\n }\n if (expiresAt) {\n input.expiresAt = expiresAt;\n }\n const id = await store.create(input);\n\n const expiryLabel = expiresAt ? formatExpiry(expiresAt) : \"indefinitely\";\n printSuccess(`Directive created: ${id}`);\n console.log(` Trigger: ${trigger}`);\n console.log(` Action: ${args.value}`);\n console.log(` Duration: ${expiryLabel}`);\n}\n\nasync function handleList(args: ParsedArgs): Promise<void> {\n const store = openStore(args.name);\n const directives = await store.list();\n\n if (directives.length === 0) {\n console.log(\"No directives found.\");\n return;\n }\n\n printTable(\n [\"ID\", \"TRIGGER\", \"STATUS\", \"EXPIRES\", \"PRIORITY\", \"ACTION\"],\n directives.map((d) => {\n const now = new Date().toISOString();\n let status = d.enabled ? \"active\" : \"disabled\";\n if (d.expiresAt && d.expiresAt < now) {\n status = \"expired\";\n }\n\n return [\n d.id,\n d.trigger,\n status,\n formatExpiry(d.expiresAt),\n String(d.priority),\n d.action.length > 40 ? `${d.action.slice(0, 37)}...` : d.action,\n ];\n }),\n );\n}\n\nasync function handleDelete(args: ParsedArgs): Promise<void> {\n if (!args.value) {\n printError(\"Usage: neo directive delete <id>\");\n process.exitCode = 1;\n return;\n }\n\n const store = openStore(args.name);\n try {\n await store.delete(args.value);\n printSuccess(`Directive deleted: ${args.value}`);\n } catch (err) {\n printError(err instanceof Error ? err.message : String(err));\n process.exitCode = 1;\n }\n}\n\nasync function handleToggle(args: ParsedArgs): Promise<void> {\n if (!args.value) {\n printError(\"Usage: neo directive toggle <id>\");\n process.exitCode = 1;\n return;\n }\n\n const store = openStore(args.name);\n try {\n const directive = await store.get(args.value);\n if (!directive) {\n printError(`Directive not found: ${args.value}`);\n process.exitCode = 1;\n return;\n }\n\n const newState = !directive.enabled;\n await store.toggle(args.value, newState);\n printSuccess(`Directive ${args.value} ${newState ? \"enabled\" : \"disabled\"}`);\n } catch (err) {\n printError(err instanceof Error ? err.message : String(err));\n process.exitCode = 1;\n }\n}\n\nasync function handleShow(args: ParsedArgs): Promise<void> {\n if (!args.value) {\n printError(\"Usage: neo directive show <id>\");\n process.exitCode = 1;\n return;\n }\n\n const store = openStore(args.name);\n const directive = await store.get(args.value);\n\n if (!directive) {\n printError(`Directive not found: ${args.value}`);\n process.exitCode = 1;\n return;\n }\n\n const now = new Date().toISOString();\n let status = directive.enabled ? \"active\" : \"disabled\";\n if (directive.expiresAt && directive.expiresAt < now) {\n status = \"expired\";\n }\n\n console.log(`ID: ${directive.id}`);\n console.log(`Trigger: ${directive.trigger}`);\n console.log(`Status: ${status}`);\n console.log(`Priority: ${directive.priority}`);\n console.log(`Action: ${directive.action}`);\n if (directive.description) {\n console.log(`Description: ${directive.description}`);\n }\n console.log(`Created: ${directive.createdAt}`);\n if (directive.expiresAt) {\n console.log(`Expires: ${directive.expiresAt} (${formatExpiry(directive.expiresAt)})`);\n } else {\n console.log(`Expires: never (indefinite)`);\n }\n if (directive.lastTriggeredAt) {\n console.log(`Last triggered: ${directive.lastTriggeredAt}`);\n }\n}\n\nexport default defineCommand({\n meta: {\n name: \"directive\",\n description: \"Manage persistent supervisor directives\",\n },\n args: {\n action: {\n type: \"positional\",\n description: \"Action: create, list, delete, toggle, show\",\n required: true,\n },\n value: {\n type: \"positional\",\n description: \"Action text or directive ID\",\n required: false,\n },\n trigger: {\n type: \"string\",\n alias: \"t\",\n description: \"Trigger type: idle, startup, shutdown\",\n default: \"idle\",\n },\n duration: {\n type: \"string\",\n alias: \"d\",\n description: 'Duration: \"2h\", \"until midnight\", \"for 2 hours\", \"indefinitely\"',\n },\n priority: {\n type: \"string\",\n alias: \"p\",\n description: \"Priority (higher = execute first)\",\n default: \"0\",\n },\n description: {\n type: \"string\",\n description: \"Human-readable description\",\n },\n name: {\n type: \"string\",\n description: \"Supervisor name\",\n default: \"supervisor\",\n },\n },\n async run({ args }) {\n const action = args.action as string;\n const parsed: ParsedArgs = {\n action,\n value: args.value as string | undefined,\n trigger: args.trigger as string,\n duration: args.duration as string | undefined,\n priority: args.priority as string | undefined,\n description: args.description as string | undefined,\n name: args.name as string,\n };\n\n switch (action) {\n case \"create\":\n return handleCreate(parsed);\n case \"list\":\n return handleList(parsed);\n case \"delete\":\n return handleDelete(parsed);\n case \"toggle\":\n return handleToggle(parsed);\n case \"show\":\n return handleShow(parsed);\n default:\n printError(\n `Unknown action \"${action}\". Must be one of: create, list, delete, toggle, show`,\n );\n process.exitCode = 1;\n }\n },\n});\n"],"mappings":";;;;;;;AAAA,OAAO,UAAU;AACjB;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,OACK;AACP,SAAS,qBAAqB;AAG9B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AU;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA,aAAa;AAAA,MACX,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,MAAM,IAAI,EAAE,KAAK,GAAG;AAClB,UAAM,SAAS,KAAK;AACpB,UAAM,SAAqB;AAAA,MACzB;AAAA,MACA,OAAO,KAAK;AAAA,MACZ,SAAS,KAAK;AAAA,MACd,UAAU,KAAK;AAAA,MACf,UAAU,KAAK;AAAA,MACf,aAAa,KAAK;AAAA,MAClB,MAAM,KAAK;AAAA,IACb;AAEA,YAAQ,QAAQ;AAAA,MACd,KAAK;AACH,eAAO,aAAa,MAAM;AAAA,MAC5B,KAAK;AACH,eAAO,WAAW,MAAM;AAAA,MAC1B,KAAK;AACH,eAAO,aAAa,MAAM;AAAA,MAC5B,KAAK;AACH,eAAO,aAAa,MAAM;AAAA,MAC5B,KAAK;AACH,eAAO,WAAW,MAAM;AAAA,MAC1B;AACE;AAAA,UACE,mBAAmB,MAAM;AAAA,QAC3B;AACA,gBAAQ,WAAW;AAAA,IACvB;AAAA,EACF;AACF,CAAC;","names":[]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isDaemonRunning,
|
|
3
|
+
startDaemonDetached
|
|
4
|
+
} from "./chunk-V5SN5F73.js";
|
|
5
|
+
import "./chunk-6PSXZ3UV.js";
|
|
6
|
+
import {
|
|
7
|
+
printError,
|
|
8
|
+
printSuccess
|
|
9
|
+
} from "./chunk-YQIWMDXL.js";
|
|
10
|
+
|
|
11
|
+
// src/commands/do.ts
|
|
12
|
+
import { randomUUID } from "crypto";
|
|
13
|
+
import { appendFile } from "fs/promises";
|
|
14
|
+
import { getSupervisorActivityPath, getSupervisorInboxPath } from "@neotx/core";
|
|
15
|
+
import { defineCommand } from "citty";
|
|
16
|
+
var DEFAULT_NAME = "supervisor";
|
|
17
|
+
var do_default = defineCommand({
|
|
18
|
+
meta: {
|
|
19
|
+
name: "do",
|
|
20
|
+
description: "Send a task to the supervisor (alias for neo supervise --message)"
|
|
21
|
+
},
|
|
22
|
+
args: {
|
|
23
|
+
task: {
|
|
24
|
+
type: "positional",
|
|
25
|
+
description: "Task description to send to the supervisor",
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
name: {
|
|
29
|
+
type: "string",
|
|
30
|
+
description: "Supervisor instance name",
|
|
31
|
+
default: DEFAULT_NAME
|
|
32
|
+
},
|
|
33
|
+
detach: {
|
|
34
|
+
type: "boolean",
|
|
35
|
+
alias: "d",
|
|
36
|
+
description: "Start supervisor in background if not running",
|
|
37
|
+
default: false
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
async run({ args }) {
|
|
41
|
+
const name = args.name;
|
|
42
|
+
const task = args.task;
|
|
43
|
+
let running = await isDaemonRunning(name);
|
|
44
|
+
if (!running) {
|
|
45
|
+
if (args.detach) {
|
|
46
|
+
const result = await startDaemonDetached(name);
|
|
47
|
+
if (result.error) {
|
|
48
|
+
printError(`Failed to start supervisor daemon: ${result.error}`);
|
|
49
|
+
process.exitCode = 1;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
printSuccess(`Supervisor "${name}" started (PID ${result.pid})`);
|
|
53
|
+
await new Promise((r) => setTimeout(r, 1500));
|
|
54
|
+
running = await isDaemonRunning(name);
|
|
55
|
+
} else {
|
|
56
|
+
printError(`No supervisor daemon running (name: ${name}).`);
|
|
57
|
+
printError("Use --detach to start one, or run: neo supervise");
|
|
58
|
+
process.exitCode = 1;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const id = randomUUID();
|
|
63
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
64
|
+
const message = { id, from: "api", text: task, timestamp };
|
|
65
|
+
await appendFile(getSupervisorInboxPath(name), `${JSON.stringify(message)}
|
|
66
|
+
`, "utf-8");
|
|
67
|
+
const activityEntry = { id, type: "message", summary: task, timestamp };
|
|
68
|
+
await appendFile(
|
|
69
|
+
getSupervisorActivityPath(name),
|
|
70
|
+
`${JSON.stringify(activityEntry)}
|
|
71
|
+
`,
|
|
72
|
+
"utf-8"
|
|
73
|
+
);
|
|
74
|
+
printSuccess(`Task sent to supervisor "${name}"`);
|
|
75
|
+
console.log(` Task: ${task.slice(0, 80)}${task.length > 80 ? "..." : ""}`);
|
|
76
|
+
console.log(` Status: neo supervise --status`);
|
|
77
|
+
console.log(` TUI: neo supervise`);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
do_default as default
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=do-F5XW2ELZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/do.ts"],"sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { appendFile } from \"node:fs/promises\";\nimport { getSupervisorActivityPath, getSupervisorInboxPath } from \"@neotx/core\";\nimport { defineCommand } from \"citty\";\nimport { isDaemonRunning, startDaemonDetached } from \"../daemon-utils.js\";\nimport { printError, printSuccess } from \"../output.js\";\n\nconst DEFAULT_NAME = \"supervisor\";\n\nexport default defineCommand({\n meta: {\n name: \"do\",\n description: \"Send a task to the supervisor (alias for neo supervise --message)\",\n },\n args: {\n task: {\n type: \"positional\",\n description: \"Task description to send to the supervisor\",\n required: true,\n },\n name: {\n type: \"string\",\n description: \"Supervisor instance name\",\n default: DEFAULT_NAME,\n },\n detach: {\n type: \"boolean\",\n alias: \"d\",\n description: \"Start supervisor in background if not running\",\n default: false,\n },\n },\n async run({ args }) {\n const name = args.name as string;\n const task = args.task as string;\n\n let running = await isDaemonRunning(name);\n\n if (!running) {\n if (args.detach) {\n const result = await startDaemonDetached(name);\n if (result.error) {\n printError(`Failed to start supervisor daemon: ${result.error}`);\n process.exitCode = 1;\n return;\n }\n printSuccess(`Supervisor \"${name}\" started (PID ${result.pid})`);\n // Wait briefly for daemon to initialize\n await new Promise((r) => setTimeout(r, 1500));\n running = await isDaemonRunning(name);\n } else {\n printError(`No supervisor daemon running (name: ${name}).`);\n printError(\"Use --detach to start one, or run: neo supervise\");\n process.exitCode = 1;\n return;\n }\n }\n\n // Send message to inbox\n const id = randomUUID();\n const timestamp = new Date().toISOString();\n const message = { id, from: \"api\" as const, text: task, timestamp };\n\n await appendFile(getSupervisorInboxPath(name), `${JSON.stringify(message)}\\n`, \"utf-8\");\n\n // Also write to activity.jsonl for TUI visibility\n const activityEntry = { id, type: \"message\", summary: task, timestamp };\n await appendFile(\n getSupervisorActivityPath(name),\n `${JSON.stringify(activityEntry)}\\n`,\n \"utf-8\",\n );\n\n printSuccess(`Task sent to supervisor \"${name}\"`);\n console.log(` Task: ${task.slice(0, 80)}${task.length > 80 ? \"...\" : \"\"}`);\n console.log(` Status: neo supervise --status`);\n console.log(` TUI: neo supervise`);\n },\n});\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B,8BAA8B;AAClE,SAAS,qBAAqB;AAI9B,IAAM,eAAe;AAErB,IAAO,aAAQ,cAAc;AAAA,EAC3B,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA,MAAM;AAAA,IACJ,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,MAAM,IAAI,EAAE,KAAK,GAAG;AAClB,UAAM,OAAO,KAAK;A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11
|
init: () => import("./init-OE4LAB6S.js").then((m) => m.default),
|
|
12
|
-
run: () => import("./run-
|
|
12
|
+
run: () => import("./run-NV762V5B.js").then((m) => m.default),
|
|
13
|
+
do: () => import("./do-F5XW2ELZ.js").then((m) => m.default),
|
|
13
14
|
decision: () => import("./decision-T2526ITK.js").then((m) => m.default),
|
|
15
|
+
directive: () => import("./directive-7WM2Q2UW.js").then((m) => m.default),
|
|
14
16
|
runs: () => import("./runs-CMLDYH7M.js").then((m) => m.default),
|
|
15
|
-
log: () => import("./log-
|
|
17
|
+
log: () => import("./log-ZLIAIBZQ.js").then((m) => m.default),
|
|
16
18
|
logs: () => import("./logs-AWNAMMJC.js").then((m) => m.default),
|
|
17
19
|
cost: () => import("./cost-IH37SMPY.js").then((m) => m.default),
|
|
18
20
|
config: () => import("./config-NYF6AJXU.js").then((m) => m.default),
|
|
19
21
|
repos: () => import("./repos-PWRYO4II.js").then((m) => m.default),
|
|
20
22
|
agents: () => import("./agents-PH3P7G7E.js").then((m) => m.default),
|
|
21
|
-
supervise: () => import("./supervise-
|
|
22
|
-
supervisor: () => import("./supervisor-
|
|
23
|
-
|
|
23
|
+
supervise: () => import("./supervise-BWIKWNHH.js").then((m) => m.default),
|
|
24
|
+
supervisor: () => import("./supervisor-N4D5EWCC.js").then((m) => m.default),
|
|
25
|
+
child: () => import("./child-5X5IHAKS.js").then((m) => m.default),
|
|
26
|
+
memory: () => import("./memory-CW6E65SQ.js").then((m) => m.default),
|
|
24
27
|
mcp: () => import("./mcp-XHZND5A4.js").then((m) => m.default),
|
|
25
28
|
guide: () => import("./guide-UQRNA3FC.js").then((m) => m.default),
|
|
26
29
|
health: () => import("./health-SWQ6V4H5.js").then((m) => m.default),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { defineCommand, runMain } from \"citty\";\n\nconst main = defineCommand({\n meta: {\n name: \"neo\",\n version: \"0.1.0\",\n description:\n \"Orchestrate autonomous developer agents with clone isolation, budget guards, and 3-level recovery. Run 'neo init' to get started.\",\n },\n subCommands: {\n init: () => import(\"./commands/init.js\").then((m) => m.default),\n run: () => import(\"./commands/run.js\").then((m) => m.default),\n decision: () => import(\"./commands/decision.js\").then((m) => m.default),\n runs: () => import(\"./commands/runs.js\").then((m) => m.default),\n log: () => import(\"./commands/log.js\").then((m) => m.default),\n logs: () => import(\"./commands/logs.js\").then((m) => m.default),\n cost: () => import(\"./commands/cost.js\").then((m) => m.default),\n config: () => import(\"./commands/config.js\").then((m) => m.default),\n repos: () => import(\"./commands/repos.js\").then((m) => m.default),\n agents: () => import(\"./commands/agents.js\").then((m) => m.default),\n supervise: () => import(\"./commands/supervise.js\").then((m) => m.default),\n supervisor: () => import(\"./commands/supervisor/index.js\").then((m) => m.default),\n memory: () => import(\"./commands/memory.js\").then((m) => m.default),\n mcp: () => import(\"./commands/mcp.js\").then((m) => m.default),\n guide: () => import(\"./commands/guide.js\").then((m) => m.default),\n health: () => import(\"./commands/health.js\").then((m) => m.default),\n doctor: () => import(\"./commands/doctor.js\").then((m) => m.default),\n version: () => import(\"./commands/version.js\").then((m) => m.default),\n webhooks: () => import(\"./commands/webhooks.js\").then((m) => m.default),\n },\n});\n\nrunMain(main);\n"],"mappings":";AAAA,SAAS,eAAe,eAAe;AAEvC,IAAM,OAAO,cAAc;AAAA,EACzB,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACE;AAAA,EACJ;AAAA,EACA,aAAa;AAAA,IACX,MAAM,MAAM,OAAO,oBAAoB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAC9D,KAAK,MAAM,OAAO,mBAAmB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAC5D,UAAU,MAAM,OAAO,wBAAwB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IACtE,MAAM,MAAM,OAAO,oBAAoB,EAAE,KAAK,CAAC,MAA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sourcesContent":["import { defineCommand, runMain } from \"citty\";\n\nconst main = defineCommand({\n meta: {\n name: \"neo\",\n version: \"0.1.0\",\n description:\n \"Orchestrate autonomous developer agents with clone isolation, budget guards, and 3-level recovery. Run 'neo init' to get started.\",\n },\n subCommands: {\n init: () => import(\"./commands/init.js\").then((m) => m.default),\n run: () => import(\"./commands/run.js\").then((m) => m.default),\n do: () => import(\"./commands/do.js\").then((m) => m.default),\n decision: () => import(\"./commands/decision.js\").then((m) => m.default),\n directive: () => import(\"./commands/directive.js\").then((m) => m.default),\n runs: () => import(\"./commands/runs.js\").then((m) => m.default),\n log: () => import(\"./commands/log.js\").then((m) => m.default),\n logs: () => import(\"./commands/logs.js\").then((m) => m.default),\n cost: () => import(\"./commands/cost.js\").then((m) => m.default),\n config: () => import(\"./commands/config.js\").then((m) => m.default),\n repos: () => import(\"./commands/repos.js\").then((m) => m.default),\n agents: () => import(\"./commands/agents.js\").then((m) => m.default),\n supervise: () => import(\"./commands/supervise.js\").then((m) => m.default),\n supervisor: () => import(\"./commands/supervisor/index.js\").then((m) => m.default),\n child: () => import(\"./commands/child.js\").then((m) => m.default),\n memory: () => import(\"./commands/memory.js\").then((m) => m.default),\n mcp: () => import(\"./commands/mcp.js\").then((m) => m.default),\n guide: () => import(\"./commands/guide.js\").then((m) => m.default),\n health: () => import(\"./commands/health.js\").then((m) => m.default),\n doctor: () => import(\"./commands/doctor.js\").then((m) => m.default),\n version: () => import(\"./commands/version.js\").then((m) => m.default),\n webhooks: () => import(\"./commands/webhooks.js\").then((m) => m.default),\n },\n});\n\nrunMain(main);\n"],"mappings":";AAAA,SAAS,eAAe,eAAe;AAEvC,IAAM,OAAO,cAAc;AAAA,EACzB,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACE;AAAA,EACJ;AAAA,EACA,aAAa;AAAA,IACX,MAAM,MAAM,OAAO,oBAAoB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAC9D,KAAK,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KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAChE,QAAQ,MAAM,OAAO,sBAAsB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAClE,QAAQ,MAAM,OAAO,sBAAsB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IAClE,SAAS,MAAM,OAAO,uBAAuB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,IACpE,UAAU,MAAM,OAAO,wBAAwB,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO;AAAA,EACxE;AACF,CAAC;AAED,QAAQ,IAAI;","names":[]}
|
|
@@ -1,14 +1,41 @@
|
|
|
1
1
|
import {
|
|
2
2
|
printError,
|
|
3
|
-
printSuccess
|
|
3
|
+
printSuccess,
|
|
4
|
+
printTable
|
|
4
5
|
} from "./chunk-YQIWMDXL.js";
|
|
5
6
|
|
|
6
7
|
// src/commands/log.ts
|
|
7
8
|
import { randomUUID } from "crypto";
|
|
8
9
|
import { appendFile } from "fs/promises";
|
|
9
10
|
import path from "path";
|
|
10
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
appendLogBuffer,
|
|
13
|
+
getSupervisorDir,
|
|
14
|
+
MemoryStore,
|
|
15
|
+
readLogBuffer
|
|
16
|
+
} from "@neotx/core";
|
|
11
17
|
import { defineCommand } from "citty";
|
|
18
|
+
function truncate(text, max) {
|
|
19
|
+
return text.length > max ? `${text.slice(0, max - 1)}...` : text;
|
|
20
|
+
}
|
|
21
|
+
async function handleListRecent(name, limit = 20) {
|
|
22
|
+
const dir = getSupervisorDir(name);
|
|
23
|
+
const entries = await readLogBuffer(dir);
|
|
24
|
+
const recent = entries.slice(-limit).reverse();
|
|
25
|
+
if (recent.length === 0) {
|
|
26
|
+
console.log("No log entries found.");
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
printTable(
|
|
30
|
+
["TIME", "TYPE", "AGENT", "MESSAGE"],
|
|
31
|
+
recent.map((e) => [
|
|
32
|
+
new Date(e.timestamp).toLocaleTimeString(),
|
|
33
|
+
e.type,
|
|
34
|
+
e.agent ?? "-",
|
|
35
|
+
truncate(e.message, 60)
|
|
36
|
+
])
|
|
37
|
+
);
|
|
38
|
+
}
|
|
12
39
|
var VALID_TYPES = [
|
|
13
40
|
"progress",
|
|
14
41
|
"action",
|
|
@@ -41,13 +68,13 @@ var log_default = defineCommand({
|
|
|
41
68
|
args: {
|
|
42
69
|
type: {
|
|
43
70
|
type: "positional",
|
|
44
|
-
description: "Report type: progress, action, decision, blocker, milestone, discovery",
|
|
45
|
-
required:
|
|
71
|
+
description: "Report type: progress, action, decision, blocker, milestone, discovery (or omit to list recent)",
|
|
72
|
+
required: false
|
|
46
73
|
},
|
|
47
74
|
message: {
|
|
48
75
|
type: "positional",
|
|
49
|
-
description: "Message to log",
|
|
50
|
-
required:
|
|
76
|
+
description: "Message to log (required when type is provided)",
|
|
77
|
+
required: false
|
|
51
78
|
},
|
|
52
79
|
name: {
|
|
53
80
|
type: "string",
|
|
@@ -68,25 +95,44 @@ var log_default = defineCommand({
|
|
|
68
95
|
type: "string",
|
|
69
96
|
description: "Repository path"
|
|
70
97
|
},
|
|
98
|
+
scope: {
|
|
99
|
+
type: "string",
|
|
100
|
+
description: "Repository scope for discovery entries (alias for --repo)"
|
|
101
|
+
},
|
|
71
102
|
procedure: {
|
|
72
103
|
type: "boolean",
|
|
73
104
|
description: "Also write as a procedure memory entry",
|
|
74
105
|
default: false
|
|
106
|
+
},
|
|
107
|
+
preview: {
|
|
108
|
+
type: "boolean",
|
|
109
|
+
description: "Preview the formatted inbox message before writing (for blocker type)",
|
|
110
|
+
default: false
|
|
75
111
|
}
|
|
76
112
|
},
|
|
113
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: CLI command handler with multiple type-specific branches; extracting would obscure flow
|
|
77
114
|
async run({ args }) {
|
|
78
115
|
const type = args.type;
|
|
116
|
+
if (!type) {
|
|
117
|
+
await handleListRecent(args.name);
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
79
120
|
if (!VALID_TYPES.includes(type)) {
|
|
80
121
|
printError(`Invalid type "${type}". Must be one of: ${VALID_TYPES.join(", ")}`);
|
|
81
122
|
process.exitCode = 1;
|
|
82
123
|
return;
|
|
83
124
|
}
|
|
125
|
+
if (!args.message) {
|
|
126
|
+
printError(`Usage: neo log ${type} <message>`);
|
|
127
|
+
process.exitCode = 1;
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
84
130
|
const dir = getSupervisorDir(args.name);
|
|
85
131
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
86
132
|
const id = randomUUID();
|
|
87
133
|
const agent = process.env.NEO_AGENT_NAME ?? void 0;
|
|
88
134
|
const runId = process.env.NEO_RUN_ID ?? void 0;
|
|
89
|
-
const repo = args.repo ?? process.env.NEO_REPOSITORY ?? void 0;
|
|
135
|
+
const repo = args.repo ?? args.scope ?? process.env.NEO_REPOSITORY ?? void 0;
|
|
90
136
|
let target = TARGET_MAP[type] ?? "digest";
|
|
91
137
|
if (args.memory) target = "memory";
|
|
92
138
|
if (args.knowledge) target = "knowledge";
|
|
@@ -112,7 +158,8 @@ var log_default = defineCommand({
|
|
|
112
158
|
try {
|
|
113
159
|
const store = new MemoryStore(path.join(dir, "memory.sqlite"));
|
|
114
160
|
await store.write({
|
|
115
|
-
type:
|
|
161
|
+
type: "knowledge",
|
|
162
|
+
subtype: args.procedure ? "procedure" : "fact",
|
|
116
163
|
scope: repo ?? "global",
|
|
117
164
|
content: args.message,
|
|
118
165
|
source: agent ?? "user",
|
|
@@ -129,6 +176,14 @@ var log_default = defineCommand({
|
|
|
129
176
|
text: `[BLOCKER]${agent ? ` (${agent})` : ""} ${args.message}`,
|
|
130
177
|
timestamp: now
|
|
131
178
|
};
|
|
179
|
+
if (args.preview) {
|
|
180
|
+
console.log("\nPreview of inbox message:");
|
|
181
|
+
console.log("\u2500".repeat(60));
|
|
182
|
+
console.log(JSON.stringify(inboxMessage, null, 2));
|
|
183
|
+
console.log("\u2500".repeat(60));
|
|
184
|
+
console.log("\nUse without --preview to write to inbox.");
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
132
187
|
await appendFile(`${dir}/inbox.jsonl`, `${JSON.stringify(inboxMessage)}
|
|
133
188
|
`, "utf-8");
|
|
134
189
|
}
|
|
@@ -138,4 +193,4 @@ var log_default = defineCommand({
|
|
|
138
193
|
export {
|
|
139
194
|
log_default as default
|
|
140
195
|
};
|
|
141
|
-
//# sourceMappingURL=log-
|
|
196
|
+
//# sourceMappingURL=log-ZLIAIBZQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/log.ts"],"sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport { appendFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport {\n appendLogBuffer,\n getSupervisorDir,\n type LogBufferEntry,\n MemoryStore,\n readLogBuffer,\n} from \"@neotx/core\";\nimport { defineCommand } from \"citty\";\nimport { printError, printSuccess, printTable } from \"../output.js\";\n\nfunction truncate(text: string, max: number): string {\n return text.length > max ? `${text.slice(0, max - 1)}...` : text;\n}\n\nasync function handleListRecent(name: string, limit = 20): Promise<void> {\n const dir = getSupervisorDir(name);\n\n const entries = await readLogBuffer(dir);\n const recent = entries.slice(-limit).reverse();\n\n if (recent.length === 0) {\n console.log(\"No log entries found.\");\n return;\n }\n\n printTable(\n [\"TIME\", \"TYPE\", \"AGENT\", \"MESSAGE\"],\n recent.map((e: LogBufferEntry) => [\n new Date(e.timestamp).toLocaleTimeString(),\n e.type,\n e.agent ?? \"-\",\n truncate(e.message, 60),\n ]),\n );\n}\n\nconst VALID_TYPES = [\n \"progress\",\n \"action\",\n \"decision\",\n \"blocker\",\n \"milestone\",\n \"discovery\",\n] as const;\ntype LogType = (typeof VALID_TYPES)[number];\n\n// Map log types to activity.jsonl entry types (preserve existing behavior)\nconst TYPE_MAP: Record<string, string> = {\n decision: \"decision\",\n action: \"action\",\n blocker: \"error\",\n progress: \"event\",\n milestone: \"event\",\n discovery: \"event\",\n};\n\n// Implicit routing: which target each type gets by default\nconst TARGET_MAP: Record<string, \"memory\" | \"knowledge\" | \"digest\"> = {\n progress: \"digest\",\n action: \"digest\",\n decision: \"memory\",\n milestone: \"memory\",\n blocker: \"memory\",\n discovery: \"knowledge\",\n};\n\nexport default defineCommand({\n meta: {\n name: \"log\",\n description: \"Log a structured progress report to the supervisor activity log\",\n },\n args: {\n type: {\n type: \"positional\",\n description:\n \"Report type: progress, action, decision, blocker, milestone, discovery (or omit to list recent)\",\n required: false,\n },\n message: {\n type: \"positional\",\n description: \"Message to log (required when type is provided)\",\n required: false,\n },\n name: {\n type: \"string\",\n description: \"Supervisor instance name\",\n default: \"supervisor\",\n },\n memory: {\n type: \"boolean\",\n description: \"Override routing: send to memory target\",\n default: false,\n },\n knowledge: {\n type: \"boolean\",\n description: \"Override routing: send to knowledge target\",\n default: false,\n },\n repo: {\n type: \"string\",\n description: \"Repository path\",\n },\n scope: {\n type: \"string\",\n description: \"Repository scope for discovery entries (alias for --repo)\",\n },\n procedure: {\n type: \"boolean\",\n description: \"Also write as a procedure memory entry\",\n default: false,\n },\n preview: {\n type: \"boolean\",\n description: \"Preview the formatted inbox message before writing (for blocker type)\",\n default: false,\n },\n },\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: CLI command handler with multiple type-specific branches; extracting would obscure flow\n async run({ args }) {\n const type = args.type as string | undefined;\n\n // No type = list recent logs\n if (!type) {\n await handleListRecent(args.name);\n return;\n }\n\n if (!VALID_TYPES.includes(type as LogType)) {\n printError(`Invalid type \"${type}\". Must be one of: ${VALID_TYPES.join(\", \")}`);\n process.exitCode = 1;\n return;\n }\n\n if (!args.message) {\n printError(`Usage: neo log ${type} <message>`);\n process.exitCode = 1;\n return;\n }\n\n const dir = getSupervisorDir(args.name);\n const now = new Date().toISOString();\n const id = randomUUID();\n\n // Resolve agent/run from env vars or flags\n const agent = process.env.NEO_AGENT_NAME ?? undefined;\n const runId = process.env.NEO_RUN_ID ?? undefined;\n const repo =\n (args.repo as string | undefined) ??\n (args.scope as string | undefined) ??\n process.env.NEO_REPOSITORY ??\n undefined;\n\n // Resolve target with flag overrides\n let target: \"memory\" | \"knowledge\" | \"digest\" = TARGET_MAP[type] ?? \"digest\";\n if (args.memory) target = \"memory\";\n if (args.knowledge) target = \"knowledge\";\n\n // 1. Always: append to activity.jsonl (existing behavior)\n const activityEntry = {\n id,\n type: TYPE_MAP[type] ?? \"event\",\n summary: args.message,\n timestamp: now,\n };\n await appendFile(`${dir}/activity.jsonl`, `${JSON.stringify(activityEntry)}\\n`, \"utf-8\");\n\n // 2. Always: append to log-buffer.jsonl via shared helper\n await appendLogBuffer(dir, {\n id,\n type: type as \"progress\" | \"action\" | \"decision\" | \"blocker\" | \"milestone\" | \"discovery\",\n message: args.message,\n agent,\n runId,\n repo,\n target,\n timestamp: now,\n });\n\n // 3. Write to memory store for knowledge entries (facts or procedures)\n if (target === \"knowledge\" || args.procedure) {\n try {\n const store = new MemoryStore(path.join(dir, \"memory.sqlite\"));\n await store.write({\n type: \"knowledge\",\n subtype: args.procedure ? \"procedure\" : \"fact\",\n scope: repo ?? \"global\",\n content: args.message,\n source: agent ?? \"user\",\n runId,\n });\n store.close();\n } catch {\n // Best-effort — don't crash CLI if store write fails\n }\n }\n\n // 4. If blocker: also append to inbox.jsonl (wake up heartbeat)\n if (type === \"blocker\") {\n const inboxMessage = {\n id: randomUUID(),\n from: \"agent\" as const,\n text: `[BLOCKER]${agent ? ` (${agent})` : \"\"} ${args.message}`,\n timestamp: now,\n };\n\n if (args.preview) {\n console.log(\"\\nPreview of inbox message:\");\n console.log(\"─\".repeat(60));\n console.log(JSON.stringify(inboxMessage, null, 2));\n console.log(\"─\".repeat(60));\n console.log(\"\\nUse without --preview to write to inbox.\");\n return;\n }\n\n await appendFile(`${dir}/inbox.jsonl`, `${JSON.stringify(inboxMessage)}\\n`, \"utf-8\");\n }\n\n printSuccess(`Logged: [${type}] ${args.message.slice(0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