@atom-workflow-agent/cli 0.1.1

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 (96) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +61 -0
  3. package/README.zh-CN.md +61 -0
  4. package/dist/app.d.ts +14 -0
  5. package/dist/app.d.ts.map +1 -0
  6. package/dist/app.js +172 -0
  7. package/dist/app.js.map +1 -0
  8. package/dist/atoms/atom-development-service.d.ts +43 -0
  9. package/dist/atoms/atom-development-service.d.ts.map +1 -0
  10. package/dist/atoms/atom-development-service.js +308 -0
  11. package/dist/atoms/atom-development-service.js.map +1 -0
  12. package/dist/atoms/atom-development-store.d.ts +70 -0
  13. package/dist/atoms/atom-development-store.d.ts.map +1 -0
  14. package/dist/atoms/atom-development-store.js +271 -0
  15. package/dist/atoms/atom-development-store.js.map +1 -0
  16. package/dist/commands/doctor.d.ts +38 -0
  17. package/dist/commands/doctor.d.ts.map +1 -0
  18. package/dist/commands/doctor.js +163 -0
  19. package/dist/commands/doctor.js.map +1 -0
  20. package/dist/commands/models.d.ts +16 -0
  21. package/dist/commands/models.d.ts.map +1 -0
  22. package/dist/commands/models.js +20 -0
  23. package/dist/commands/models.js.map +1 -0
  24. package/dist/index.d.ts +3 -0
  25. package/dist/index.d.ts.map +1 -0
  26. package/dist/index.js +19 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/local/local-project-service.d.ts +63 -0
  29. package/dist/local/local-project-service.d.ts.map +1 -0
  30. package/dist/local/local-project-service.js +327 -0
  31. package/dist/local/local-project-service.js.map +1 -0
  32. package/dist/logging/create-cli-logger.d.ts +8 -0
  33. package/dist/logging/create-cli-logger.d.ts.map +1 -0
  34. package/dist/logging/create-cli-logger.js +11 -0
  35. package/dist/logging/create-cli-logger.js.map +1 -0
  36. package/dist/logging/json-logger.d.ts +24 -0
  37. package/dist/logging/json-logger.d.ts.map +1 -0
  38. package/dist/logging/json-logger.js +29 -0
  39. package/dist/logging/json-logger.js.map +1 -0
  40. package/dist/providers/acp-planning-model-adapter.d.ts +9 -0
  41. package/dist/providers/acp-planning-model-adapter.d.ts.map +1 -0
  42. package/dist/providers/acp-planning-model-adapter.js +54 -0
  43. package/dist/providers/acp-planning-model-adapter.js.map +1 -0
  44. package/dist/providers/provider-name.d.ts +5 -0
  45. package/dist/providers/provider-name.d.ts.map +1 -0
  46. package/dist/providers/provider-name.js +4 -0
  47. package/dist/providers/provider-name.js.map +1 -0
  48. package/dist/providers/resolve-provider-config.d.ts +10 -0
  49. package/dist/providers/resolve-provider-config.d.ts.map +1 -0
  50. package/dist/providers/resolve-provider-config.js +14 -0
  51. package/dist/providers/resolve-provider-config.js.map +1 -0
  52. package/dist/providers/resolve-trae-executable.d.ts +20 -0
  53. package/dist/providers/resolve-trae-executable.d.ts.map +1 -0
  54. package/dist/providers/resolve-trae-executable.js +46 -0
  55. package/dist/providers/resolve-trae-executable.js.map +1 -0
  56. package/dist/workflow/builtin-atom-packages.d.ts +4 -0
  57. package/dist/workflow/builtin-atom-packages.d.ts.map +1 -0
  58. package/dist/workflow/builtin-atom-packages.js +39 -0
  59. package/dist/workflow/builtin-atom-packages.js.map +1 -0
  60. package/dist/workflow/planning-cli-service.d.ts +35 -0
  61. package/dist/workflow/planning-cli-service.d.ts.map +1 -0
  62. package/dist/workflow/planning-cli-service.js +97 -0
  63. package/dist/workflow/planning-cli-service.js.map +1 -0
  64. package/dist/workflow/workflow-command-input.d.ts +25 -0
  65. package/dist/workflow/workflow-command-input.d.ts.map +1 -0
  66. package/dist/workflow/workflow-command-input.js +117 -0
  67. package/dist/workflow/workflow-command-input.js.map +1 -0
  68. package/dist/workflow/workflow-command-progress.d.ts +6 -0
  69. package/dist/workflow/workflow-command-progress.d.ts.map +1 -0
  70. package/dist/workflow/workflow-command-progress.js +81 -0
  71. package/dist/workflow/workflow-command-progress.js.map +1 -0
  72. package/dist/workflow/workflow-command-service.d.ts +85 -0
  73. package/dist/workflow/workflow-command-service.d.ts.map +1 -0
  74. package/dist/workflow/workflow-command-service.js +2 -0
  75. package/dist/workflow/workflow-command-service.js.map +1 -0
  76. package/dist/workflow/workflow-command.d.ts +5 -0
  77. package/dist/workflow/workflow-command.d.ts.map +1 -0
  78. package/dist/workflow/workflow-command.js +425 -0
  79. package/dist/workflow/workflow-command.js.map +1 -0
  80. package/dist/workflow/workflow-coordinator.d.ts +25 -0
  81. package/dist/workflow/workflow-coordinator.d.ts.map +1 -0
  82. package/dist/workflow/workflow-coordinator.js +112 -0
  83. package/dist/workflow/workflow-coordinator.js.map +1 -0
  84. package/dist/workflow/workflow-output.d.ts +9 -0
  85. package/dist/workflow/workflow-output.d.ts.map +1 -0
  86. package/dist/workflow/workflow-output.js +109 -0
  87. package/dist/workflow/workflow-output.js.map +1 -0
  88. package/dist/workflow/workflow-project-config.d.ts +14 -0
  89. package/dist/workflow/workflow-project-config.d.ts.map +1 -0
  90. package/dist/workflow/workflow-project-config.js +55 -0
  91. package/dist/workflow/workflow-project-config.js.map +1 -0
  92. package/dist/workflow/workflow-service.d.ts +1237 -0
  93. package/dist/workflow/workflow-service.d.ts.map +1 -0
  94. package/dist/workflow/workflow-service.js +475 -0
  95. package/dist/workflow/workflow-service.js.map +1 -0
  96. package/package.json +65 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,61 @@
1
+ # `@atom-workflow-agent/cli`
2
+
3
+ [English](README.md) | [简体中文](README.zh-CN.md)
4
+
5
+ The CLI is the local application composition root and the stable machine-facing protocol used by people, Host skills, and automation.
6
+
7
+ ## Use it for
8
+
9
+ - discovering and independently running Atoms;
10
+ - initializing local projects and scaffolding fixture-backed Atom packages;
11
+ - planning, validating, saving, verifying, and running Workflow Revisions;
12
+ - inspecting, following, pausing, resuming, retrying, and cancelling Runs;
13
+ - probing Codex/Trae ACP providers and models;
14
+ - starting the local read-only Inspector.
15
+
16
+ Install the user-facing package with `npm install --global @atom-workflow-agent/cli`, then run `atomflow --help` for the authoritative command list. Common entry points are:
17
+
18
+ ```bash
19
+ atomflow project init
20
+ atomflow atom create --id <namespace.name>
21
+ atomflow atom check --atom <id@version>
22
+ atomflow atom dev --atom <id@version> --fixture <file>
23
+ atomflow workflow validate --file <workflow.json>
24
+ atomflow workflow save --file <workflow.json> --source host
25
+ atomflow workflow graph --workflow <name>
26
+ atomflow workflow run --workflow <name@revision> --input '<json>'
27
+ atomflow run diagnose --run-id <run-id>
28
+ ```
29
+
30
+ ## Output contract
31
+
32
+ - stdout contains one versioned JSON result envelope;
33
+ - progress and diagnostics go to stderr;
34
+ - `--quiet` suppresses non-error progress;
35
+ - file arguments that accept `-` read JSON from stdin;
36
+ - cancellation exits with code `130`; invalid usage exits with code `2`.
37
+
38
+ Do not parse human progress messages. Consumers should use the JSON envelope, persisted IDs, and explicit commands.
39
+
40
+ ## Maintainer guide
41
+
42
+ The following section applies to contributors working in the monorepo.
43
+
44
+ - `src/app.ts` owns top-level argument dispatch and help text.
45
+ - `src/local/local-project-service.ts` owns idempotent setup, Atom scaffolding, storage reporting, and safe retention previews.
46
+ - `src/workflow/workflow-command.ts` dispatches commands; domain service contracts live in `workflow-command-service.ts`.
47
+ - `workflow-command-input.ts` owns JSON/stdin option parsing; `workflow-command-progress.ts` owns human-readable stderr progress.
48
+ - `src/workflow/workflow-project-config.ts` owns project config and default Planner model resolution.
49
+ - `src/workflow/planning-cli-service.ts` is a small Catalog/Workspace service for Planner tool subprocesses and never creates Runtime.
50
+ - `src/providers/acp-planning-model-adapter.ts` adapts ACP to Planner's generic model port.
51
+ - provider diagnostics live under `src/commands/` and `src/providers/`.
52
+ - new command behavior needs CLI tests under `tests/`, including stdout/stderr and exit-code assertions.
53
+
54
+ The CLI composes lower-level packages; it must not implement domain Atom behavior or duplicate compiler/engine rules.
55
+
56
+ ```bash
57
+ pnpm --filter @atom-workflow-agent/cli typecheck
58
+ pnpm --filter @atom-workflow-agent/cli test
59
+ ```
60
+
61
+ See the [CLI reference](../../docs/cli.md) for complete flows and the [architecture](../../docs/architecture.md) for package boundaries.
@@ -0,0 +1,61 @@
1
+ # `@atom-workflow-agent/cli`
2
+
3
+ [English](README.md) | [简体中文](README.zh-CN.md)
4
+
5
+ CLI 是本地应用的组合根,也是用户、Host Skill 和自动化共用的稳定机器协议。
6
+
7
+ ## 适用场景
8
+
9
+ - 发现 Atom 并独立运行;
10
+ - 初始化本地项目并生成带 fixture 的 Atom Package;
11
+ - 规划、校验、保存、验证和执行 Workflow Revision;
12
+ - 查看、跟随、暂停、恢复、重试和取消 Run;
13
+ - 探测 Codex/Trae ACP Provider 与模型;
14
+ - 启动本地只读 Inspector。
15
+
16
+ 先通过 `npm install --global @atom-workflow-agent/cli` 安装用户入口,再运行 `atomflow --help` 查看权威命令列表。常用入口:
17
+
18
+ ```bash
19
+ atomflow project init
20
+ atomflow atom create --id <namespace.name>
21
+ atomflow atom check --atom <id@version>
22
+ atomflow atom dev --atom <id@version> --fixture <file>
23
+ atomflow workflow validate --file <workflow.json>
24
+ atomflow workflow save --file <workflow.json> --source host
25
+ atomflow workflow graph --workflow <名称>
26
+ atomflow workflow run --workflow <名称@版本> --input '<json>'
27
+ atomflow run diagnose --run-id <run-id>
28
+ ```
29
+
30
+ ## 输出协议
31
+
32
+ - stdout 只输出一个带版本的 JSON 结果信封;
33
+ - 进度和诊断写入 stderr;
34
+ - `--quiet` 会隐藏非错误进度;
35
+ - 支持 `-` 的文件参数会从 stdin 读取 JSON;
36
+ - 取消操作退出码为 `130`,用法错误退出码为 `2`。
37
+
38
+ 调用方不应解析人类可读的进度文本,应使用 JSON 信封、持久化 ID 和明确的后续命令。
39
+
40
+ ## 维护者指南
41
+
42
+ 以下内容面向在 Monorepo 中开发的贡献者。
43
+
44
+ - `src/app.ts` 负责顶层参数分发和帮助文本;
45
+ - `src/local/local-project-service.ts` 负责幂等初始化、Atom 脚手架、状态占用统计和安全清理预览;
46
+ - `src/workflow/workflow-command.ts` 负责命令分发,分域服务契约位于 `workflow-command-service.ts`;
47
+ - `workflow-command-input.ts` 负责 JSON/stdin 参数解析,`workflow-command-progress.ts` 负责人类可读的 stderr 进度;
48
+ - `src/workflow/workflow-project-config.ts` 只负责项目配置与默认 Planner 模型解析;
49
+ - `src/workflow/planning-cli-service.ts` 是 Planner 工具子进程的 Catalog/Workspace 小服务,不创建 Runtime;
50
+ - `src/providers/acp-planning-model-adapter.ts` 将 ACP 适配为 Planner 的通用模型端口;
51
+ - Provider 诊断位于 `src/commands/` 和 `src/providers/`;
52
+ - 新命令必须在 `tests/` 增加 CLI 测试,包括 stdout/stderr 和退出码断言。
53
+
54
+ CLI 只组合底层 Package,不应实现领域 Atom 行为,也不应复制 Compiler 或 Engine 规则。
55
+
56
+ ```bash
57
+ pnpm --filter @atom-workflow-agent/cli typecheck
58
+ pnpm --filter @atom-workflow-agent/cli test
59
+ ```
60
+
61
+ 完整流程见 [CLI 参考](../../docs/cli.zh-CN.md),包边界见[架构文档](../../docs/architecture.zh-CN.md)。
package/dist/app.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { runModelsCommand } from "./commands/models.js";
2
+ import { type WorkflowCommandDependencies } from "./workflow/workflow-command.js";
3
+ export interface CliIo {
4
+ stdout: (text: string) => void;
5
+ stderr: (text: string) => void;
6
+ }
7
+ export interface CliDependencies {
8
+ cwd?: string;
9
+ signal?: AbortSignal;
10
+ models?: typeof runModelsCommand;
11
+ workflow?: Omit<WorkflowCommandDependencies, "cwd" | "signal">;
12
+ }
13
+ export declare function runCli(argv: string[], io?: CliIo, dependencies?: CliDependencies): Promise<number>;
14
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAStE,OAAO,EAAsB,KAAK,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAoDtG,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,gBAAgB,CAAC;IACjC,QAAQ,CAAC,EAAE,IAAI,CAAC,2BAA2B,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;CAChE;AAQD,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,GAAE,KAGhD,EAAE,YAAY,GAAE,eAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAyGtD"}
package/dist/app.js ADDED
@@ -0,0 +1,172 @@
1
+ import { createRequire } from "node:module";
2
+ import { toAtomWorkflowError } from "@atom-workflow-agent/contracts";
3
+ import { renderDoctor, runDoctor } from "./commands/doctor.js";
4
+ import { renderModels, runModelsCommand } from "./commands/models.js";
5
+ import { isLocalProviderName } from "./providers/provider-name.js";
6
+ import { createLocalAtom, initializeLocalProject, inspectLocalProject, inspectLocalStorage, pruneLocalStorage, } from "./local/local-project-service.js";
7
+ import { runWorkflowCommand } from "./workflow/workflow-command.js";
8
+ const VERSION = createRequire(import.meta.url)("../package.json").version;
9
+ const HELP = `Atom Workflow Agent ${VERSION}
10
+
11
+ Usage:
12
+ atomflow project init|status
13
+ atomflow storage status
14
+ atomflow storage prune --older-than-days <n> [--apply]
15
+ atomflow atom create --id <namespace.name> [--description <text>] [--directory <path>]
16
+ atomflow models --provider traex|codex|claude-code|pi [--json]
17
+ atomflow doctor [--provider traex|codex|claude-code|pi] [--handshake] [--json]
18
+ atomflow workflow start --request <json> [--include-events|--full] [--quiet]
19
+ atomflow workflow start --request-file <file|-> [--include-events|--full] [--quiet]
20
+ atomflow workflow start --goal <text> [--input <json>] [--planner-provider traex|codex|claude-code|pi] [--planner-model <id>] [--include-events|--full] [--quiet]
21
+ atomflow plan start --request-file <file|->
22
+ atomflow plan list|inspect|resume|cancel [--plan-id <id>]
23
+ atomflow workflow validate|save --file <file|-> [--completion-mode outputs|side-effect-only] [--source file|host]
24
+ atomflow workflow list
25
+ atomflow workflow inspect|verify|topology|graph|run --workflow <name|id|revision>
26
+ atomflow workflow export --workflow <name|id|revision> [--output <file>]
27
+ atomflow workflow diff --from <name|id|revision> --to <name|id|revision>
28
+ atomflow planning workspace-inspect|workspace-frontier|workspace-validate --plan-id <id>
29
+ atomflow planning workspace-apply --plan-id <id> --transaction-file <file|->
30
+ atomflow planning workspace-finalize --plan-id <id> --revision <n> --draft-hash <sha256:...>
31
+ atomflow planning workspace-report-gap --plan-id <id> --report-file <file|->
32
+ atomflow planning catalog-search --plan-id <id> [--query <text>]
33
+ atomflow planning catalog-describe --plan-id <id> --atom <id@version>
34
+ atomflow run list
35
+ atomflow run diagnose|artifacts --run-id <id>
36
+ atomflow run logs --run-id <id> [--node-id <id>] [--limit <n>]
37
+ atomflow run inspect --run-id <id> [--level summary|timeline|evidence] [--cursor <cursor>] [--limit <n>]
38
+ atomflow run graph --run-id <id>
39
+ atomflow run follow --run-id <id> [--after <sequence>] [--jsonl]
40
+ atomflow run signal --run-id <id> --signal-id <id> --response <json>|--response-file <file|->
41
+ atomflow run list-resumable [--project-scope <scope>] [--host-scope codex|trae]
42
+ atomflow run inspect-handoff --run-id <id> --host-task-id <id>
43
+ atomflow run resume-host --run-id <id> --result <json>|--result-file <file|->
44
+ atomflow run retry|resume|cancel --run-id <id>
45
+ atomflow atoms list
46
+ atomflow atoms sources
47
+ atomflow atoms describe --atom <id@version>
48
+ atomflow atom check --atom <id@version>
49
+ atomflow atom dev --atom <id@version> --fixture <file|->
50
+ atomflow atom run --atom <id@version> [--input <json>|--input-file <file|->]
51
+ atomflow atom resume --attempt-id <id> --response <json>|--result <json>
52
+ atomflow atom inspect --attempt-id <id>
53
+ atomflow atom events --attempt-id <id> [--after <sequence>] [--limit <1..1000>]
54
+ atomflow inspector start (--run-id <id>|--workflow <name|id|revision>|--workflow-revision <id>) [--port 4317]
55
+ atomflow --help
56
+ atomflow --version`;
57
+ function optionValue(args, name) {
58
+ const index = args.indexOf(name);
59
+ const value = index >= 0 ? args[index + 1] : undefined;
60
+ return value && !value.startsWith("--") ? value : undefined;
61
+ }
62
+ export async function runCli(argv, io = {
63
+ stdout: (text) => process.stdout.write(`${text}\n`),
64
+ stderr: (text) => process.stderr.write(`${text}\n`),
65
+ }, dependencies = {}) {
66
+ const [command, ...args] = argv;
67
+ if (!command || command === "--help" || command === "-h" || command === "help") {
68
+ io.stdout(HELP);
69
+ return 0;
70
+ }
71
+ if (command === "--version" || command === "-v" || command === "version") {
72
+ io.stdout(VERSION);
73
+ return 0;
74
+ }
75
+ const json = args.includes("--json");
76
+ const cwd = dependencies.cwd ?? process.env.INIT_CWD ?? process.cwd();
77
+ if (command === "project" || command === "storage" || (command === "atom" && args[0] === "create")) {
78
+ try {
79
+ const action = args[0];
80
+ let data;
81
+ if (command === "project" && action === "init")
82
+ data = await initializeLocalProject(cwd);
83
+ else if (command === "project" && action === "status")
84
+ data = await inspectLocalProject(cwd);
85
+ else if (command === "storage" && action === "status")
86
+ data = await inspectLocalStorage(cwd);
87
+ else if (command === "storage" && action === "prune") {
88
+ const rawDays = optionValue(args, "--older-than-days");
89
+ const olderThanDays = rawDays ? Number(rawDays) : Number.NaN;
90
+ if (!Number.isInteger(olderThanDays) || olderThanDays < 1) {
91
+ throw Object.assign(new Error("--older-than-days must be an integer greater than or equal to 1"), { code: "CLI_INPUT_INVALID" });
92
+ }
93
+ data = await pruneLocalStorage(cwd, { olderThanDays, apply: args.includes("--apply") });
94
+ }
95
+ else if (command === "atom" && action === "create") {
96
+ const atomId = optionValue(args, "--id");
97
+ if (!atomId)
98
+ throw Object.assign(new Error("Missing required option: --id"), { code: "CLI_INPUT_INVALID" });
99
+ data = await createLocalAtom(cwd, {
100
+ atomId,
101
+ ...(optionValue(args, "--description") ? { description: optionValue(args, "--description") } : {}),
102
+ ...(optionValue(args, "--directory") ? { directory: optionValue(args, "--directory") } : {}),
103
+ });
104
+ }
105
+ else {
106
+ throw Object.assign(new Error(`Unknown ${command} command: ${action ?? ""}`), { code: "CLI_INPUT_INVALID" });
107
+ }
108
+ io.stdout(JSON.stringify({ schemaVersion: "1.0", ok: true, command: `${command}.${action}`, data }));
109
+ return 0;
110
+ }
111
+ catch (error) {
112
+ const normalized = toAtomWorkflowError(error, "CLI_COMMAND_FAILED");
113
+ io.stderr(JSON.stringify({ schemaVersion: "1.0", ok: false, command: `${command}.${args[0] ?? "unknown"}`, error: {
114
+ code: normalized.code, message: normalized.message, retryable: normalized.retryable,
115
+ } }));
116
+ return normalized.code.startsWith("CLI_") || normalized.code === "PROJECT_CONFIG_INVALID" ? 2 : 1;
117
+ }
118
+ }
119
+ if (command === "workflow" || command === "plan" || command === "run" || command === "atom" || command === "atoms" || command === "planning" || command === "inspector") {
120
+ return runWorkflowCommand(command, args, io, {
121
+ cwd,
122
+ ...(dependencies.signal ? { signal: dependencies.signal } : {}),
123
+ ...dependencies.workflow,
124
+ });
125
+ }
126
+ if (command === "models") {
127
+ const providerValue = optionValue(args, "--provider");
128
+ if (!providerValue) {
129
+ io.stderr("Missing required option: --provider");
130
+ return 2;
131
+ }
132
+ if (!isLocalProviderName(providerValue)) {
133
+ io.stderr(`Unknown provider: ${providerValue}`);
134
+ return 2;
135
+ }
136
+ try {
137
+ const models = dependencies.models ?? runModelsCommand;
138
+ const catalog = await models({
139
+ providerId: providerValue,
140
+ cwd,
141
+ json,
142
+ ...(dependencies.signal ? { signal: dependencies.signal } : {}),
143
+ });
144
+ io.stdout(renderModels(catalog, json));
145
+ return 0;
146
+ }
147
+ catch (error) {
148
+ const normalized = toAtomWorkflowError(error);
149
+ io.stderr(json
150
+ ? JSON.stringify({ error: { code: normalized.code, message: normalized.message } }, null, 2)
151
+ : `[${normalized.code}] ${normalized.message}`);
152
+ return normalized.code === "CANCELLED" ? 130 : 1;
153
+ }
154
+ }
155
+ if (command === "doctor") {
156
+ const providerValue = optionValue(args, "--provider");
157
+ if (providerValue && !isLocalProviderName(providerValue)) {
158
+ io.stderr(`Unknown provider: ${providerValue}`);
159
+ return 2;
160
+ }
161
+ const result = await runDoctor({
162
+ json,
163
+ handshake: args.includes("--handshake"),
164
+ ...(providerValue ? { provider: providerValue } : {}),
165
+ }, { cwd });
166
+ io.stdout(renderDoctor(result, json));
167
+ return result.ok ? 0 : 1;
168
+ }
169
+ io.stderr(`Unknown command: ${command}\n\n${HELP}`);
170
+ return 2;
171
+ }
172
+ //# sourceMappingURL=app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAqB,MAAM,sBAAsB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAoC,MAAM,gCAAgC,CAAC;AAEtG,MAAM,OAAO,GAAI,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAAyB,CAAC,OAAO,CAAC;AACnG,MAAM,IAAI,GAAG,uBAAuB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA+CtB,CAAC;AActB,SAAS,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M,CAAC,qBAAqB,aAAa,EAAE,CAAC,CAAC;YAChD,OAAO,CAAC,CAAC;QACX,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,SAAS,CAC5B;YACE,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;YACvC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,aAA6B,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACtE,EACD,EAAE,GAAG,EAAE,CACR,CAAC;QACF,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,EAAE,CAAC,MAAM,CAAC,oBAAoB,OAAO,OAAO,IAAI,EAAE,CAAC,CAAC;IACpD,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { type JsonValue } from "@atom-workflow-agent/contracts";
2
+ import type { AtomRegistry } from "@atom-workflow-agent/atom-catalog";
3
+ import { type AtomProcessEvent } from "@atom-workflow-agent/atom-executor";
4
+ import { LocalAtomDevelopmentStore, type AtomDevelopmentAttemptRecord, type AtomDevelopmentEvent } from "./atom-development-store.js";
5
+ export interface AtomDevelopmentExecutionOptions {
6
+ readonly maxLifecycleTicks?: number;
7
+ readonly onEvent?: (event: AtomDevelopmentEvent | AtomProcessEvent) => void;
8
+ }
9
+ export interface AtomDevelopmentServiceOptions {
10
+ readonly cwd: string;
11
+ readonly registry: AtomRegistry;
12
+ readonly store: LocalAtomDevelopmentStore;
13
+ readonly signal?: AbortSignal;
14
+ readonly now?: () => Date;
15
+ }
16
+ export interface AtomDevelopmentResult {
17
+ readonly attemptId: string;
18
+ readonly atom: string;
19
+ readonly status: AtomDevelopmentAttemptRecord["state"];
20
+ readonly output?: JsonValue;
21
+ readonly artifacts: AtomDevelopmentAttemptRecord["artifacts"];
22
+ readonly waiting?: JsonValue;
23
+ readonly recordDirectory: string;
24
+ readonly error?: AtomDevelopmentAttemptRecord["error"];
25
+ }
26
+ /** Standalone Atom development facade backed by the same Attempt Runner used by Workflow Runtime. */
27
+ export declare class AtomDevelopmentService {
28
+ private readonly options;
29
+ constructor(options: AtomDevelopmentServiceOptions);
30
+ run(atomKey: string, input: JsonValue, execution?: AtomDevelopmentExecutionOptions): Promise<AtomDevelopmentResult>;
31
+ resume(attemptId: string, value: JsonValue, execution?: AtomDevelopmentExecutionOptions): Promise<AtomDevelopmentResult>;
32
+ private resumeLocked;
33
+ inspect(attemptId: string): Promise<JsonValue>;
34
+ events(attemptId: string, after?: number, limit?: number): Promise<readonly AtomDevelopmentEvent[]>;
35
+ private runtime;
36
+ private drive;
37
+ private persistSnapshot;
38
+ private resumePayload;
39
+ private result;
40
+ private publicRecord;
41
+ private now;
42
+ }
43
+ //# sourceMappingURL=atom-development-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atom-development-service.d.ts","sourceRoot":"","sources":["../../src/atoms/atom-development-service.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAIL,KAAK,gBAAgB,EAItB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EACL,yBAAyB,EACzB,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EAC1B,MAAM,6BAA6B,CAAC;AAKrC,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,GAAG,gBAAgB,KAAK,IAAI,CAAC;CAC7E;AAED,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC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