@bastani/atomic 0.8.28-alpha.2 → 0.8.28-alpha.3

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 (113) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/builtin/intercom/package.json +1 -1
  3. package/dist/builtin/mcp/package.json +1 -1
  4. package/dist/builtin/subagents/package.json +1 -1
  5. package/dist/builtin/web-access/package.json +1 -1
  6. package/dist/builtin/workflows/CHANGELOG.md +18 -0
  7. package/dist/builtin/workflows/README.md +1 -1
  8. package/dist/builtin/workflows/package.json +1 -1
  9. package/dist/builtin/workflows/src/authoring.d.ts +5 -2
  10. package/dist/builtin/workflows/src/extension/dispatcher.ts +2 -0
  11. package/dist/builtin/workflows/src/extension/index.ts +8 -0
  12. package/dist/builtin/workflows/src/extension/render-result.ts +5 -2
  13. package/dist/builtin/workflows/src/extension/workflow-schema.ts +18 -0
  14. package/dist/builtin/workflows/src/runs/background/status.ts +4 -0
  15. package/dist/builtin/workflows/src/runs/foreground/executor.ts +1251 -110
  16. package/dist/builtin/workflows/src/shared/authoring-contract.d.ts +34 -10
  17. package/dist/builtin/workflows/src/shared/expanded-workflow-graph.ts +10 -2
  18. package/dist/builtin/workflows/src/shared/persistence-restore.ts +28 -9
  19. package/dist/builtin/workflows/src/shared/persistence-session-entries.ts +9 -3
  20. package/dist/builtin/workflows/src/shared/store-types.ts +10 -3
  21. package/dist/builtin/workflows/src/shared/store.ts +29 -7
  22. package/dist/builtin/workflows/src/shared/types.ts +12 -10
  23. package/dist/builtin/workflows/src/tui/run-detail.ts +12 -0
  24. package/dist/builtin/workflows/src/tui/status-helpers.ts +4 -0
  25. package/dist/builtin/workflows/src/tui/status-list.ts +15 -1
  26. package/dist/builtin/workflows/src/tui/store-widget-installer.ts +1 -1
  27. package/dist/builtin/workflows/src/tui/widget.ts +12 -3
  28. package/dist/builtin/workflows/src/workflows/define-workflow.ts +3 -3
  29. package/dist/core/agent-session-services.d.ts +1 -0
  30. package/dist/core/agent-session-services.d.ts.map +1 -1
  31. package/dist/core/agent-session-services.js +1 -0
  32. package/dist/core/agent-session-services.js.map +1 -1
  33. package/dist/core/agent-session.d.ts +4 -0
  34. package/dist/core/agent-session.d.ts.map +1 -1
  35. package/dist/core/agent-session.js +12 -1
  36. package/dist/core/agent-session.js.map +1 -1
  37. package/dist/core/index.d.ts +1 -0
  38. package/dist/core/index.d.ts.map +1 -1
  39. package/dist/core/index.js +1 -0
  40. package/dist/core/index.js.map +1 -1
  41. package/dist/core/sdk.d.ts +4 -2
  42. package/dist/core/sdk.d.ts.map +1 -1
  43. package/dist/core/sdk.js +1 -0
  44. package/dist/core/sdk.js.map +1 -1
  45. package/dist/core/tools/ask-user-question/state/inline-input.d.ts +28 -0
  46. package/dist/core/tools/ask-user-question/state/inline-input.d.ts.map +1 -0
  47. package/dist/core/tools/ask-user-question/state/inline-input.js +56 -0
  48. package/dist/core/tools/ask-user-question/state/inline-input.js.map +1 -0
  49. package/dist/core/tools/ask-user-question/state/key-router.d.ts.map +1 -1
  50. package/dist/core/tools/ask-user-question/state/key-router.js +30 -4
  51. package/dist/core/tools/ask-user-question/state/key-router.js.map +1 -1
  52. package/dist/core/tools/ask-user-question/state/questionnaire-session.d.ts.map +1 -1
  53. package/dist/core/tools/ask-user-question/state/questionnaire-session.js +9 -8
  54. package/dist/core/tools/ask-user-question/state/questionnaire-session.js.map +1 -1
  55. package/dist/core/tools/ask-user-question/state/row-intent.d.ts +3 -2
  56. package/dist/core/tools/ask-user-question/state/row-intent.d.ts.map +1 -1
  57. package/dist/core/tools/ask-user-question/state/row-intent.js +1 -1
  58. package/dist/core/tools/ask-user-question/state/row-intent.js.map +1 -1
  59. package/dist/core/tools/ask-user-question/state/selectors/contract.d.ts +2 -0
  60. package/dist/core/tools/ask-user-question/state/selectors/contract.d.ts.map +1 -1
  61. package/dist/core/tools/ask-user-question/state/selectors/contract.js.map +1 -1
  62. package/dist/core/tools/ask-user-question/state/selectors/projections.d.ts.map +1 -1
  63. package/dist/core/tools/ask-user-question/state/selectors/projections.js +2 -0
  64. package/dist/core/tools/ask-user-question/state/selectors/projections.js.map +1 -1
  65. package/dist/core/tools/ask-user-question/state/state-reducer.d.ts.map +1 -1
  66. package/dist/core/tools/ask-user-question/state/state-reducer.js +36 -24
  67. package/dist/core/tools/ask-user-question/state/state-reducer.js.map +1 -1
  68. package/dist/core/tools/ask-user-question/state/state.d.ts +8 -0
  69. package/dist/core/tools/ask-user-question/state/state.d.ts.map +1 -1
  70. package/dist/core/tools/ask-user-question/state/state.js.map +1 -1
  71. package/dist/core/tools/ask-user-question/tool/format-answer.d.ts +6 -0
  72. package/dist/core/tools/ask-user-question/tool/format-answer.d.ts.map +1 -1
  73. package/dist/core/tools/ask-user-question/tool/format-answer.js +19 -1
  74. package/dist/core/tools/ask-user-question/tool/format-answer.js.map +1 -1
  75. package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts +3 -2
  76. package/dist/core/tools/ask-user-question/tool/response-envelope.d.ts.map +1 -1
  77. package/dist/core/tools/ask-user-question/tool/response-envelope.js +15 -3
  78. package/dist/core/tools/ask-user-question/tool/response-envelope.js.map +1 -1
  79. package/dist/core/tools/ask-user-question/tool/types.d.ts +2 -1
  80. package/dist/core/tools/ask-user-question/tool/types.d.ts.map +1 -1
  81. package/dist/core/tools/ask-user-question/tool/types.js.map +1 -1
  82. package/dist/core/tools/ask-user-question/view/components/chat-row-view.d.ts +5 -2
  83. package/dist/core/tools/ask-user-question/view/components/chat-row-view.d.ts.map +1 -1
  84. package/dist/core/tools/ask-user-question/view/components/chat-row-view.js +2 -0
  85. package/dist/core/tools/ask-user-question/view/components/chat-row-view.js.map +1 -1
  86. package/dist/core/tools/ask-user-question/view/components/wrapping-select.d.ts +1 -0
  87. package/dist/core/tools/ask-user-question/view/components/wrapping-select.d.ts.map +1 -1
  88. package/dist/core/tools/ask-user-question/view/components/wrapping-select.js +2 -1
  89. package/dist/core/tools/ask-user-question/view/components/wrapping-select.js.map +1 -1
  90. package/dist/core/tools/ask-user-question/view/props-adapter.d.ts +3 -3
  91. package/dist/core/tools/ask-user-question/view/props-adapter.d.ts.map +1 -1
  92. package/dist/core/tools/ask-user-question/view/props-adapter.js +11 -4
  93. package/dist/core/tools/ask-user-question/view/props-adapter.js.map +1 -1
  94. package/dist/core/tools/bash-policy.d.ts +62 -0
  95. package/dist/core/tools/bash-policy.d.ts.map +1 -0
  96. package/dist/core/tools/bash-policy.js +1069 -0
  97. package/dist/core/tools/bash-policy.js.map +1 -0
  98. package/dist/core/tools/bash.d.ts +5 -0
  99. package/dist/core/tools/bash.d.ts.map +1 -1
  100. package/dist/core/tools/bash.js +7 -0
  101. package/dist/core/tools/bash.js.map +1 -1
  102. package/dist/core/tools/index.d.ts +1 -0
  103. package/dist/core/tools/index.d.ts.map +1 -1
  104. package/dist/core/tools/index.js +1 -0
  105. package/dist/core/tools/index.js.map +1 -1
  106. package/dist/index.d.ts +2 -2
  107. package/dist/index.d.ts.map +1 -1
  108. package/dist/index.js +1 -1
  109. package/dist/index.js.map +1 -1
  110. package/docs/sdk.md +42 -0
  111. package/docs/security.md +2 -0
  112. package/docs/workflows.md +127 -15
  113. package/package.json +1 -1
@@ -33,6 +33,7 @@ import { CURRENT_SESSION_VERSION, getLatestCompactionBoundaryEntry } from "./ses
33
33
  import { createSyntheticSourceInfo } from "./source-info.js";
34
34
  import { buildSystemPrompt } from "./system-prompt.js";
35
35
  import { createLocalBashOperations } from "./tools/bash.js";
36
+ import { evaluateBashCommandPolicy, formatBashCommandPolicyRejection, } from "./tools/bash-policy.js";
36
37
  import { createAllToolDefinitions, defaultToolNames } from "./tools/index.js";
37
38
  import { redirectOversizedToolResult } from "./tools/oversized-tool-result.js";
38
39
  import { createToolDefinitionFromAgentTool } from "./tools/tool-definition-wrapper.js";
@@ -187,6 +188,7 @@ export class AgentSession {
187
188
  this._scopedModels = config.scopedModels ?? [];
188
189
  this._resourceLoader = config.resourceLoader;
189
190
  this._customTools = config.customTools ?? [];
191
+ this._bashPolicy = config.bashPolicy;
190
192
  this._cwd = config.cwd;
191
193
  this._modelRegistry = config.modelRegistry;
192
194
  this._extensionRunnerRef = config.extensionRunnerRef;
@@ -2244,7 +2246,12 @@ export class AgentSession {
2244
2246
  ]))
2245
2247
  : createAllToolDefinitions(this._cwd, {
2246
2248
  read: { autoResizeImages },
2247
- bash: { commandPrefix: shellCommandPrefix, shellPath },
2249
+ bash: {
2250
+ commandPrefix: shellCommandPrefix,
2251
+ shellPath,
2252
+ policy: this._bashPolicy,
2253
+ policyLabel: "session bash policy",
2254
+ },
2248
2255
  });
2249
2256
  this._baseToolDefinitions = new Map(Object.entries(baseToolDefinitions).map(([name, tool]) => [name, tool]));
2250
2257
  const extensionsResult = this._resourceLoader.getExtensions();
@@ -2422,6 +2429,10 @@ export class AgentSession {
2422
2429
  * @param options.operations Custom BashOperations for remote execution
2423
2430
  */
2424
2431
  async executeBash(command, onChunk, options) {
2432
+ const policyDecision = evaluateBashCommandPolicy(command, this._bashPolicy);
2433
+ if (!policyDecision.allowed) {
2434
+ throw new Error(formatBashCommandPolicyRejection(policyDecision, "session bash policy"));
2435
+ }
2425
2436
  this._bashAbortController = new AbortController();
2426
2437
  // Apply command prefix if configured (e.g., "shopt -s expand_aliases" for alias support)
2427
2438
  const prefix = this.settingsManager.getShellCommandPrefix();