@bastani/atomic 0.8.19 → 0.8.20-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 (103) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/builtin/intercom/package.json +1 -1
  3. package/dist/builtin/mcp/CHANGELOG.md +5 -0
  4. package/dist/builtin/mcp/package.json +2 -2
  5. package/dist/builtin/subagents/CHANGELOG.md +12 -2
  6. package/dist/builtin/subagents/agents/code-simplifier.md +1 -1
  7. package/dist/builtin/subagents/agents/codebase-analyzer.md +1 -1
  8. package/dist/builtin/subagents/agents/codebase-online-researcher.md +1 -1
  9. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +1 -1
  10. package/dist/builtin/subagents/agents/debugger.md +1 -1
  11. package/dist/builtin/subagents/package.json +1 -1
  12. package/dist/builtin/subagents/skills/subagent/SKILL.md +12 -12
  13. package/dist/builtin/subagents/src/agents/agent-management.ts +16 -11
  14. package/dist/builtin/subagents/src/agents/skills.ts +13 -1
  15. package/dist/builtin/subagents/src/extension/index.ts +14 -3
  16. package/dist/builtin/subagents/src/runs/background/async-execution.ts +8 -0
  17. package/dist/builtin/subagents/src/runs/background/run-status.ts +2 -3
  18. package/dist/builtin/subagents/src/runs/background/subagent-runner.ts +11 -1
  19. package/dist/builtin/subagents/src/runs/foreground/chain-clarify.ts +2 -2
  20. package/dist/builtin/subagents/src/runs/foreground/chain-execution.ts +31 -23
  21. package/dist/builtin/subagents/src/runs/foreground/execution.ts +13 -7
  22. package/dist/builtin/subagents/src/runs/foreground/subagent-executor.ts +160 -93
  23. package/dist/builtin/subagents/src/runs/shared/parallel-utils.ts +1 -0
  24. package/dist/builtin/subagents/src/runs/shared/run-history.ts +1 -1
  25. package/dist/builtin/subagents/src/shared/settings.ts +1 -0
  26. package/dist/builtin/subagents/src/shared/types.ts +78 -4
  27. package/dist/builtin/subagents/src/tui/render.ts +203 -19
  28. package/dist/builtin/web-access/CHANGELOG.md +5 -0
  29. package/dist/builtin/web-access/package.json +2 -2
  30. package/dist/builtin/workflows/CHANGELOG.md +19 -0
  31. package/dist/builtin/workflows/README.md +22 -3
  32. package/dist/builtin/workflows/builtin/deep-research-codebase.ts +1 -1
  33. package/dist/builtin/workflows/builtin/open-claude-design.ts +12 -4
  34. package/dist/builtin/workflows/builtin/ralph.ts +2 -2
  35. package/dist/builtin/workflows/package.json +1 -1
  36. package/dist/builtin/workflows/src/extension/config-loader.ts +68 -0
  37. package/dist/builtin/workflows/src/extension/index.ts +246 -55
  38. package/dist/builtin/workflows/src/extension/lifecycle-notifications.ts +372 -0
  39. package/dist/builtin/workflows/src/extension/render-call.ts +1 -1
  40. package/dist/builtin/workflows/src/extension/wiring.ts +32 -3
  41. package/dist/builtin/workflows/src/runs/background/status.ts +14 -74
  42. package/dist/builtin/workflows/src/shared/persistence-restore.ts +5 -3
  43. package/dist/builtin/workflows/src/tui/chat-surface-message.ts +3 -13
  44. package/dist/builtin/workflows/src/tui/inline-form-overlay.ts +2 -10
  45. package/dist/builtin/workflows/src/tui/overlay-adapter.ts +5 -5
  46. package/dist/builtin/workflows/src/tui/session-confirm.ts +6 -7
  47. package/dist/builtin/workflows/src/tui/session-picker.ts +18 -14
  48. package/dist/builtin/workflows/src/tui/status-list.ts +2 -2
  49. package/dist/builtin/workflows/src/tui/store-widget-installer.ts +125 -30
  50. package/dist/config.d.ts +1 -0
  51. package/dist/config.d.ts.map +1 -1
  52. package/dist/config.js +1 -0
  53. package/dist/config.js.map +1 -1
  54. package/dist/core/agent-session.d.ts +4 -1
  55. package/dist/core/agent-session.d.ts.map +1 -1
  56. package/dist/core/agent-session.js +2 -1
  57. package/dist/core/agent-session.js.map +1 -1
  58. package/dist/core/atomic-guide-command.d.ts.map +1 -1
  59. package/dist/core/atomic-guide-command.js +3 -2
  60. package/dist/core/atomic-guide-command.js.map +1 -1
  61. package/dist/core/extensions/index.d.ts +1 -1
  62. package/dist/core/extensions/index.d.ts.map +1 -1
  63. package/dist/core/extensions/index.js.map +1 -1
  64. package/dist/core/extensions/runner.d.ts +3 -2
  65. package/dist/core/extensions/runner.d.ts.map +1 -1
  66. package/dist/core/extensions/runner.js +6 -1
  67. package/dist/core/extensions/runner.js.map +1 -1
  68. package/dist/core/extensions/types.d.ts +13 -0
  69. package/dist/core/extensions/types.d.ts.map +1 -1
  70. package/dist/core/extensions/types.js.map +1 -1
  71. package/dist/core/model-resolver.d.ts.map +1 -1
  72. package/dist/core/model-resolver.js +63 -17
  73. package/dist/core/model-resolver.js.map +1 -1
  74. package/dist/core/output-guard.d.ts.map +1 -1
  75. package/dist/core/output-guard.js +29 -0
  76. package/dist/core/output-guard.js.map +1 -1
  77. package/dist/core/sdk.d.ts +3 -1
  78. package/dist/core/sdk.d.ts.map +1 -1
  79. package/dist/core/sdk.js +1 -0
  80. package/dist/core/sdk.js.map +1 -1
  81. package/dist/core/system-prompt.d.ts.map +1 -1
  82. package/dist/core/system-prompt.js +1 -1
  83. package/dist/core/system-prompt.js.map +1 -1
  84. package/dist/index.d.ts +2 -2
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/index.js.map +1 -1
  88. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  89. package/dist/modes/interactive/interactive-mode.js +46 -13
  90. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  91. package/dist/utils/pi-user-agent.d.ts.map +1 -1
  92. package/dist/utils/pi-user-agent.js +2 -1
  93. package/dist/utils/pi-user-agent.js.map +1 -1
  94. package/dist/utils/syntax-highlight.d.ts.map +1 -1
  95. package/dist/utils/syntax-highlight.js +1 -1
  96. package/dist/utils/syntax-highlight.js.map +1 -1
  97. package/dist/utils/tools-manager.d.ts.map +1 -1
  98. package/dist/utils/tools-manager.js +3 -5
  99. package/dist/utils/tools-manager.js.map +1 -1
  100. package/docs/models.md +52 -52
  101. package/docs/quickstart.md +2 -2
  102. package/docs/workflows.md +22 -5
  103. package/package.json +9 -9
@@ -19,6 +19,12 @@
19
19
  import { join, isAbsolute } from "node:path";
20
20
  import { homedir } from "node:os";
21
21
  import { CONFIG_DIR_NAME, CONFIG_DIR_NAMES, getProjectConfigPaths } from "@bastani/atomic";
22
+ import {
23
+ WORKFLOW_LIFECYCLE_NOTICE_KINDS,
24
+ type WorkflowLifecycleNoticeKind,
25
+ } from "./lifecycle-notifications.js";
26
+
27
+ const WORKFLOW_LIFECYCLE_NOTICE_KIND_SET = new Set<string>(WORKFLOW_LIFECYCLE_NOTICE_KINDS);
22
28
 
23
29
  // ---------------------------------------------------------------------------
24
30
  // Public types
@@ -34,6 +40,13 @@ export interface WorkflowConfigEntry {
34
40
  * The parsed shape of a workflow extension config file.
35
41
  * All fields optional; absence means "use default".
36
42
  */
43
+ export interface WorkflowNotificationsConfig {
44
+ /** Emit lifecycle notices into the main chat. Default: true. */
45
+ readonly enabled?: boolean;
46
+ /** Lifecycle states that should create chat notices. */
47
+ readonly notifyOn?: readonly WorkflowLifecycleNoticeKind[];
48
+ }
49
+
37
50
  export interface WorkflowExtensionConfig {
38
51
  /** Explicit named workflows to register by module path. */
39
52
  readonly workflows?: Readonly<Record<string, WorkflowConfigEntry>>;
@@ -47,6 +60,8 @@ export interface WorkflowExtensionConfig {
47
60
  readonly statusFile?: boolean;
48
61
  /** Behaviour on session_start for in-flight runs. Default: "ask". */
49
62
  readonly resumeInFlight?: "ask" | "auto" | "never";
63
+ /** Main-chat workflow lifecycle notices. */
64
+ readonly workflowNotifications?: WorkflowNotificationsConfig;
50
65
  }
51
66
 
52
67
  /** Severity of a config diagnostic. */
@@ -126,6 +141,10 @@ async function tryReadFile(filePath: string): Promise<string | null> {
126
141
  * Validate a parsed JSON value as a WorkflowExtensionConfig.
127
142
  * Returns null when valid, or a human-readable rejection reason.
128
143
  */
144
+ function isWorkflowLifecycleNoticeKind(value: unknown): value is WorkflowLifecycleNoticeKind {
145
+ return typeof value === "string" && WORKFLOW_LIFECYCLE_NOTICE_KIND_SET.has(value);
146
+ }
147
+
129
148
  function validateConfig(value: unknown): string | null {
130
149
  if (value === null || typeof value !== "object" || Array.isArray(value)) {
131
150
  return "config must be a JSON object";
@@ -155,6 +174,31 @@ function validateConfig(value: unknown): string | null {
155
174
  }
156
175
  }
157
176
 
177
+ if ("workflowNotifications" in c) {
178
+ const value = c["workflowNotifications"];
179
+ if (value === null || typeof value !== "object" || Array.isArray(value)) {
180
+ return `"workflowNotifications" must be a JSON object, got ${JSON.stringify(typeof value)}`;
181
+ }
182
+ const notifications = value as Record<string, unknown>;
183
+ if ("enabled" in notifications && typeof notifications["enabled"] !== "boolean") {
184
+ return `"workflowNotifications.enabled" must be a boolean, got ${JSON.stringify(notifications["enabled"])}`;
185
+ }
186
+ if ("notifyOn" in notifications) {
187
+ const notifyOn = notifications["notifyOn"];
188
+ if (!Array.isArray(notifyOn)) {
189
+ return `"workflowNotifications.notifyOn" must be an array, got ${JSON.stringify(typeof notifyOn)}`;
190
+ }
191
+ if (notifyOn.length === 0) {
192
+ return `"workflowNotifications.notifyOn" must be a non-empty array`;
193
+ }
194
+ for (const item of notifyOn) {
195
+ if (!isWorkflowLifecycleNoticeKind(item)) {
196
+ return `"workflowNotifications.notifyOn" entries must be "completed", "failed", or "awaiting_input", got ${JSON.stringify(item)}`;
197
+ }
198
+ }
199
+ }
200
+ }
201
+
158
202
  if ("workflows" in c) {
159
203
  if (c["workflows"] === null || typeof c["workflows"] !== "object" || Array.isArray(c["workflows"])) {
160
204
  return `"workflows" must be a JSON object, got ${JSON.stringify(typeof c["workflows"])}`;
@@ -268,6 +312,14 @@ function mergeConfigs(
268
312
  ...(base.resumeInFlight !== undefined || override.resumeInFlight !== undefined
269
313
  ? { resumeInFlight: override.resumeInFlight ?? base.resumeInFlight }
270
314
  : {}),
315
+ ...(base.workflowNotifications !== undefined || override.workflowNotifications !== undefined
316
+ ? {
317
+ workflowNotifications: {
318
+ ...(base.workflowNotifications ?? {}),
319
+ ...(override.workflowNotifications ?? {}),
320
+ },
321
+ }
322
+ : {}),
271
323
  ...(workflows !== undefined ? { workflows } : {}),
272
324
  };
273
325
  }
@@ -289,6 +341,10 @@ export const WORKFLOW_CONFIG_DEFAULTS = {
289
341
  persistRuns: true,
290
342
  statusFile: false,
291
343
  resumeInFlight: "ask" as const,
344
+ workflowNotifications: {
345
+ enabled: true,
346
+ notifyOn: ["completed", "failed", "awaiting_input"] as const,
347
+ },
292
348
  } as const;
293
349
 
294
350
  /**
@@ -301,6 +357,10 @@ export interface WorkflowEffectiveConfig {
301
357
  readonly persistRuns: boolean;
302
358
  readonly statusFile: boolean;
303
359
  readonly resumeInFlight: "ask" | "auto" | "never";
360
+ readonly workflowNotifications: {
361
+ readonly enabled: boolean;
362
+ readonly notifyOn: readonly WorkflowLifecycleNoticeKind[];
363
+ };
304
364
  readonly workflows?: Readonly<Record<string, WorkflowConfigEntry>>;
305
365
  }
306
366
 
@@ -321,6 +381,14 @@ export function withWorkflowDefaults(
321
381
  statusFile: config.statusFile ?? WORKFLOW_CONFIG_DEFAULTS.statusFile,
322
382
  resumeInFlight:
323
383
  config.resumeInFlight ?? WORKFLOW_CONFIG_DEFAULTS.resumeInFlight,
384
+ workflowNotifications: {
385
+ enabled:
386
+ config.workflowNotifications?.enabled
387
+ ?? WORKFLOW_CONFIG_DEFAULTS.workflowNotifications.enabled,
388
+ notifyOn:
389
+ config.workflowNotifications?.notifyOn
390
+ ?? WORKFLOW_CONFIG_DEFAULTS.workflowNotifications.notifyOn,
391
+ },
324
392
  ...(config.workflows !== undefined ? { workflows: config.workflows } : {}),
325
393
  };
326
394
  }