@glrs-dev/cli 2.4.0 → 2.6.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/{chunk-HQUCVJ4G.js → chunk-FBXSGZAA.js} +4 -0
  3. package/dist/chunk-J3FXSHMA.js +263 -0
  4. package/dist/{chunk-5ZVUFNCP.js → chunk-S6N5E2GG.js} +8 -1
  5. package/dist/{chunk-2VMFXAJH.js → chunk-UO7WHIKY.js} +18 -5
  6. package/dist/cli.js +10 -3
  7. package/dist/commands/autopilot-tui.d.ts +11 -1
  8. package/dist/commands/autopilot-tui.js +2 -1
  9. package/dist/commands/autopilot.d.ts +2 -0
  10. package/dist/commands/autopilot.js +62 -21
  11. package/dist/commands/debrief.d.ts +2 -0
  12. package/dist/commands/debrief.js +1 -1
  13. package/dist/commands/loop.d.ts +2 -0
  14. package/dist/commands/loop.js +33 -12
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/node_modules/@glrs-dev/adapter-opencode/dist/index.d.ts +270 -0
  18. package/dist/node_modules/@glrs-dev/adapter-opencode/dist/index.js +506 -0
  19. package/dist/node_modules/@glrs-dev/adapter-opencode/package.json +8 -0
  20. package/dist/node_modules/@glrs-dev/autopilot/dist/auto-ship-EVLBKHUZ.js +7 -0
  21. package/dist/node_modules/@glrs-dev/autopilot/dist/changeset-generator-HAHYSSUR.js +15 -0
  22. package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-2X3CWH47.js +3288 -0
  23. package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-2ZQ6SBV3.js +70 -0
  24. package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-6JZQLIRP.js +781 -0
  25. package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-AWRK6S6G.js +91 -0
  26. package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-BLEIZHET.js +101 -0
  27. package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-GXXCEGDD.js +251 -0
  28. package/dist/node_modules/@glrs-dev/autopilot/dist/chunk-S34HOCZ4.js +44 -0
  29. package/dist/node_modules/@glrs-dev/autopilot/dist/index.d.ts +1915 -0
  30. package/dist/node_modules/@glrs-dev/autopilot/dist/index.js +768 -0
  31. package/dist/node_modules/@glrs-dev/autopilot/dist/logger-3XLFMXLN.js +8 -0
  32. package/dist/node_modules/@glrs-dev/autopilot/dist/loop-session-YLCVJGPV.js +9 -0
  33. package/dist/node_modules/@glrs-dev/autopilot/dist/plan-enrichment-4SQYV5FC.js +17 -0
  34. package/dist/node_modules/@glrs-dev/autopilot/package.json +8 -0
  35. package/dist/vendor/harness-opencode/dist/agents/prompts/agents-md-writer.md +1 -1
  36. package/dist/vendor/harness-opencode/dist/agents/prompts/architecture-advisor.md +1 -1
  37. package/dist/vendor/harness-opencode/dist/agents/prompts/code-searcher.md +1 -1
  38. package/dist/vendor/harness-opencode/dist/agents/prompts/docs-maintainer.md +0 -8
  39. package/dist/vendor/harness-opencode/dist/agents/prompts/gap-analyzer.md +1 -3
  40. package/dist/vendor/harness-opencode/dist/agents/prompts/lib-reader.md +1 -1
  41. package/dist/vendor/harness-opencode/dist/agents/prompts/plan-reviewer.md +0 -2
  42. package/dist/vendor/harness-opencode/dist/agents/prompts/plan.md +1 -1
  43. package/dist/vendor/harness-opencode/dist/agents/prompts/prime.md +78 -262
  44. package/dist/vendor/harness-opencode/dist/agents/prompts/research.md +5 -14
  45. package/dist/vendor/harness-opencode/dist/agents/prompts/scoper.md +7 -2
  46. package/dist/vendor/harness-opencode/dist/autopilot/strategies/default.md +29 -0
  47. package/dist/vendor/harness-opencode/dist/index.js +112 -82
  48. package/dist/vendor/harness-opencode/package.json +1 -1
  49. package/package.json +9 -7
@@ -0,0 +1,70 @@
1
+ // src/lib/logger.ts
2
+ import pino from "pino";
3
+ import { existsSync, mkdirSync } from "fs";
4
+ import { dirname, join } from "path";
5
+ function resolveLogFilePath(cwd) {
6
+ const env = process.env["GLRS_AUTOPILOT_LOG_FILE"];
7
+ if (env === "off") return null;
8
+ if (env) return env;
9
+ const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
10
+ return join(cwd, ".agent", "autopilot-logs", `${timestamp}.log`);
11
+ }
12
+ function buildFileStream(cwd) {
13
+ const filePath = resolveLogFilePath(cwd);
14
+ if (!filePath) return null;
15
+ const parent = dirname(filePath);
16
+ if (!existsSync(parent)) {
17
+ mkdirSync(parent, { recursive: true });
18
+ }
19
+ return {
20
+ path: filePath,
21
+ entry: {
22
+ level: "trace",
23
+ // sync: true gives deterministic flushSync semantics so the file
24
+ // log is safe to read immediately after flush() returns (critical
25
+ // for tests and for reliable postmortem after a crash). Autopilot
26
+ // runs are long-lived enough that sync writes aren't a bottleneck.
27
+ stream: pino.destination({ dest: filePath, sync: true, mkdir: true })
28
+ }
29
+ };
30
+ }
31
+ function createAutopilotLogger(opts) {
32
+ const fileSink = buildFileStream(opts.cwd);
33
+ const streams = [];
34
+ if (fileSink) streams.push(fileSink.entry);
35
+ const explicitLevel = opts.level;
36
+ const envLevel = process.env["GLRS_AUTOPILOT_LOG_LEVEL"];
37
+ const resolvedLevel = explicitLevel || envLevel || "trace";
38
+ if (streams.length === 0) {
39
+ const root2 = pino({ level: "silent" });
40
+ return { root: root2, logFilePath: null, flush: async () => {
41
+ } };
42
+ }
43
+ const ms = pino.multistream(streams);
44
+ const root = pino(
45
+ {
46
+ level: resolvedLevel,
47
+ timestamp: pino.stdTimeFunctions.isoTime
48
+ },
49
+ ms
50
+ );
51
+ const flush = async () => {
52
+ try {
53
+ ms.flushSync();
54
+ } catch {
55
+ }
56
+ };
57
+ return {
58
+ root,
59
+ logFilePath: fileSink?.path ?? null,
60
+ flush
61
+ };
62
+ }
63
+ function childLogger(root, component) {
64
+ return root.child({ component });
65
+ }
66
+
67
+ export {
68
+ createAutopilotLogger,
69
+ childLogger
70
+ };