@bastani/atomic 0.9.19-alpha.5 → 0.9.19-alpha.7

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 (209) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +2 -2
  3. package/dist/builtin/intercom/CHANGELOG.md +6 -0
  4. package/dist/builtin/intercom/broker/client.ts +19 -1
  5. package/dist/builtin/intercom/index.bundle.mjs +8 -1
  6. package/dist/builtin/intercom/package.json +1 -1
  7. package/dist/builtin/mcp/package.json +1 -1
  8. package/dist/builtin/subagents/CHANGELOG.md +6 -0
  9. package/dist/builtin/subagents/README.md +3 -1
  10. package/dist/builtin/subagents/agents/codebase-online-researcher.md +7 -7
  11. package/dist/builtin/subagents/package.json +1 -1
  12. package/dist/builtin/subagents/skills/subagent/SKILL.md +3 -1
  13. package/dist/builtin/subagents/src/extension/index.bundle.mjs +2 -1
  14. package/dist/builtin/web-access/CHANGELOG.md +13 -0
  15. package/dist/builtin/web-access/README.md +31 -24
  16. package/dist/builtin/web-access/index.bundle.mjs +16121 -80
  17. package/dist/builtin/web-access/package.json +2 -1
  18. package/dist/builtin/workflows/CHANGELOG.md +15 -0
  19. package/dist/builtin/workflows/README.md +1 -1
  20. package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
  21. package/dist/builtin/workflows/builtin/{chunk-vhmnzdj9.js → chunk-1jth021m.js} +1 -1
  22. package/dist/builtin/workflows/builtin/{chunk-p8jjwfg6.js → chunk-2377r57g.js} +4 -2
  23. package/dist/builtin/workflows/builtin/{chunk-hbnwv56f.js → chunk-31j2gs7h.js} +2 -2
  24. package/dist/builtin/workflows/builtin/{chunk-n8zysf1t.js → chunk-ngkqkzej.js} +1 -1
  25. package/dist/builtin/workflows/builtin/{chunk-1nbq96fh.js → chunk-nkrafh9s.js} +1 -1
  26. package/dist/builtin/workflows/builtin/{chunk-1kx4aggw.js → chunk-wf741bv3.js} +2 -2
  27. package/dist/builtin/workflows/builtin/{chunk-t6x2d78s.js → chunk-z29qbehr.js} +1 -1
  28. package/dist/builtin/workflows/builtin/generate-and-filter.js +2 -2
  29. package/dist/builtin/workflows/builtin/goal.js +3 -3
  30. package/dist/builtin/workflows/builtin/index.js +7 -7
  31. package/dist/builtin/workflows/builtin/ralph.js +3 -3
  32. package/dist/builtin/workflows/builtin/tournament.js +2 -2
  33. package/dist/builtin/workflows/package.json +1 -1
  34. package/dist/builtin/workflows/src/extension/index.bundle.mjs +339 -31
  35. package/dist/builtin/workflows/src/index.js +67 -19
  36. package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +2 -0
  37. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  38. package/dist/core/agent-session-tool-registry.js +10 -0
  39. package/dist/core/agent-session-tool-registry.js.map +1 -1
  40. package/dist/core/bash-executor.js.map +1 -1
  41. package/dist/core/tools/bash.d.ts +1 -1
  42. package/dist/core/tools/bash.d.ts.map +1 -1
  43. package/dist/core/tools/bash.js +3 -2
  44. package/dist/core/tools/bash.js.map +1 -1
  45. package/dist/core/tools/edit.d.ts +3 -0
  46. package/dist/core/tools/edit.d.ts.map +1 -1
  47. package/dist/core/tools/edit.js +91 -12
  48. package/dist/core/tools/edit.js.map +1 -1
  49. package/dist/core/tools/file-mutation-coordinator.d.ts +255 -0
  50. package/dist/core/tools/file-mutation-coordinator.d.ts.map +1 -0
  51. package/dist/core/tools/file-mutation-coordinator.js +300 -0
  52. package/dist/core/tools/file-mutation-coordinator.js.map +1 -0
  53. package/dist/core/tools/file-mutation-queue.d.ts +14 -1
  54. package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  55. package/dist/core/tools/file-mutation-queue.js +15 -3
  56. package/dist/core/tools/file-mutation-queue.js.map +1 -1
  57. package/dist/core/tools/hashline.d.ts +9 -0
  58. package/dist/core/tools/hashline.d.ts.map +1 -1
  59. package/dist/core/tools/hashline.js +12 -1
  60. package/dist/core/tools/hashline.js.map +1 -1
  61. package/dist/core/tools/index.d.ts +9 -1
  62. package/dist/core/tools/index.d.ts.map +1 -1
  63. package/dist/core/tools/index.js +67 -12
  64. package/dist/core/tools/index.js.map +1 -1
  65. package/dist/core/tools/non-minting-snapshot-store.d.ts +49 -0
  66. package/dist/core/tools/non-minting-snapshot-store.d.ts.map +1 -0
  67. package/dist/core/tools/non-minting-snapshot-store.js +64 -0
  68. package/dist/core/tools/non-minting-snapshot-store.js.map +1 -0
  69. package/dist/core/tools/powershell.d.ts +2 -2
  70. package/dist/core/tools/powershell.d.ts.map +1 -1
  71. package/dist/core/tools/powershell.js +2 -5
  72. package/dist/core/tools/powershell.js.map +1 -1
  73. package/dist/core/tools/read-document-extract.js.map +1 -1
  74. package/dist/core/tools/render-utils.js.map +1 -1
  75. package/dist/core/tools/write.d.ts +30 -1
  76. package/dist/core/tools/write.d.ts.map +1 -1
  77. package/dist/core/tools/write.js +97 -8
  78. package/dist/core/tools/write.js.map +1 -1
  79. package/dist/index.d.ts +1 -1
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js.map +1 -1
  82. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  83. package/dist/modes/interactive/components/task-live-transcript.d.ts +1 -1
  84. package/dist/modes/interactive/components/task-live-transcript.d.ts.map +1 -1
  85. package/dist/modes/interactive/components/task-live-transcript.js +19 -11
  86. package/dist/modes/interactive/components/task-live-transcript.js.map +1 -1
  87. package/dist/modes/interactive/interactive-mode-base.d.ts +1 -0
  88. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  89. package/dist/modes/interactive/interactive-mode-base.js +3 -1
  90. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  91. package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -1
  92. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  93. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  94. package/dist/modes/interactive/interactive-render-chat.js +28 -4
  95. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  96. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  97. package/dist/modes/interactive/interactive-startup.js +3 -0
  98. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  99. package/dist/modes/interactive-engine/activity-watchdog.d.ts +2 -2
  100. package/dist/modes/interactive-engine/activity-watchdog.d.ts.map +1 -1
  101. package/dist/modes/interactive-engine/activity-watchdog.js.map +1 -1
  102. package/dist/modes/interactive-engine/engine-diagnostic-view.d.ts +3 -1
  103. package/dist/modes/interactive-engine/engine-diagnostic-view.d.ts.map +1 -1
  104. package/dist/modes/interactive-engine/engine-diagnostic-view.js +11 -0
  105. package/dist/modes/interactive-engine/engine-diagnostic-view.js.map +1 -1
  106. package/dist/modes/interactive-engine/isolated-runtime.js +2 -1
  107. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  108. package/dist/modes/rpc/rpc-client-process.d.ts +2 -0
  109. package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
  110. package/dist/modes/rpc/rpc-client-process.js +23 -1
  111. package/dist/modes/rpc/rpc-client-process.js.map +1 -1
  112. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  113. package/dist/modes/rpc/rpc-client.js +20 -3
  114. package/dist/modes/rpc/rpc-client.js.map +1 -1
  115. package/dist/utils/markit.d.ts +2 -0
  116. package/dist/utils/markit.d.ts.map +1 -1
  117. package/dist/utils/markit.js +65 -5
  118. package/dist/utils/markit.js.map +1 -1
  119. package/docs/background-tasks.md +15 -11
  120. package/docs/build.md +51 -0
  121. package/docs/changelog.mdx +8 -8
  122. package/docs/compaction/reference.md +267 -0
  123. package/docs/compaction.md +36 -219
  124. package/docs/computer-use.md +35 -0
  125. package/docs/containerization.md +9 -5
  126. package/docs/custom-provider/api-reference.md +145 -0
  127. package/docs/custom-provider/oauth.md +131 -0
  128. package/docs/custom-provider/override.md +34 -0
  129. package/docs/custom-provider/registration.md +163 -0
  130. package/docs/custom-provider/streaming.md +214 -0
  131. package/docs/custom-provider.md +43 -607
  132. package/docs/development.md +87 -0
  133. package/docs/docs.json +199 -76
  134. package/docs/environment-variables.md +1 -1
  135. package/docs/extensions/api-reference.md +1001 -0
  136. package/docs/extensions/authoring.md +676 -0
  137. package/docs/extensions/events.md +793 -0
  138. package/docs/extensions/examples.md +94 -0
  139. package/docs/extensions/ui.md +470 -0
  140. package/docs/extensions.md +270 -2768
  141. package/docs/getting-started/authentication.md +55 -0
  142. package/docs/getting-started/first-session.md +172 -0
  143. package/docs/getting-started/installation.md +154 -0
  144. package/docs/getting-started/project-instructions.md +43 -0
  145. package/docs/guides/configuration.md +65 -0
  146. package/docs/guides/intercom.md +24 -0
  147. package/docs/guides/non-interactive.md +33 -0
  148. package/docs/guides/subagents.md +24 -0
  149. package/docs/guides/workflows.md +27 -0
  150. package/docs/guides.md +41 -0
  151. package/docs/index.md +13 -45
  152. package/docs/intercom/operations.md +178 -0
  153. package/docs/intercom/reference.md +146 -0
  154. package/docs/intercom.md +54 -259
  155. package/docs/json.md +17 -0
  156. package/docs/llama-cpp.md +5 -0
  157. package/docs/models/artificial-analysis-index.md +89 -0
  158. package/docs/models/evals.md +2 -2
  159. package/docs/models/model-selection.md +3 -3
  160. package/docs/models/pareto-efficiency.md +2 -2
  161. package/docs/models/reference.md +601 -0
  162. package/docs/models.md +45 -550
  163. package/docs/packages/authoring.md +88 -0
  164. package/docs/packages/reference.md +43 -0
  165. package/docs/packages.md +28 -107
  166. package/docs/programmatic.md +29 -0
  167. package/docs/prompt-templates.md +11 -0
  168. package/docs/providers/reference.md +23 -0
  169. package/docs/providers.md +10 -15
  170. package/docs/quickstart.md +44 -238
  171. package/docs/reference/cli.md +252 -0
  172. package/docs/reference.md +52 -0
  173. package/docs/rpc/examples.md +64 -0
  174. package/docs/rpc/extension-ui.md +198 -0
  175. package/docs/rpc/protocol.md +1341 -0
  176. package/docs/rpc.md +109 -1346
  177. package/docs/sdk/reference.md +1090 -0
  178. package/docs/sdk.md +56 -1002
  179. package/docs/session-format.md +2 -0
  180. package/docs/sessions.md +6 -10
  181. package/docs/settings.md +6 -45
  182. package/docs/skills/authoring.md +95 -0
  183. package/docs/skills/reference.md +60 -0
  184. package/docs/skills.md +20 -122
  185. package/docs/subagents/authoring.md +37 -0
  186. package/docs/subagents/reference.md +60 -0
  187. package/docs/subagents.md +42 -96
  188. package/docs/terminal-setup.md +1 -1
  189. package/docs/themes/reference.md +176 -0
  190. package/docs/themes.md +21 -135
  191. package/docs/tmux.md +5 -0
  192. package/docs/tools/edit.md +5 -0
  193. package/docs/tools.md +31 -0
  194. package/docs/tui/reference.md +343 -0
  195. package/docs/tui.md +23 -286
  196. package/docs/usage.md +26 -209
  197. package/docs/web-access.md +40 -0
  198. package/docs/windows.md +2 -1
  199. package/docs/workflows/api-reference.md +11 -4
  200. package/docs/workflows/authoring.md +4 -2
  201. package/docs/workflows/builtins.md +2 -2
  202. package/docs/workflows/operations.md +11 -7
  203. package/docs/workflows/reliable-design.md +21 -3
  204. package/docs/workflows/verification.md +8 -0
  205. package/examples/extensions/gondolin/index.ts +116 -148
  206. package/examples/extensions/gondolin/package.json +1 -1
  207. package/examples/extensions/ssh.ts +56 -34
  208. package/npm-shrinkwrap.json +33 -33
  209. package/package.json +4 -4
@@ -0,0 +1,88 @@
1
+ ---
2
+ title: Creating packages
3
+ description: Create an Atomic package, lay out its structure, and declare dependencies.
4
+ ---
5
+
6
+ # Creating packages
7
+
8
+ ## Creating an Atomic Package
9
+
10
+ Add an app manifest to `package.json` or use conventional directories. The manifest key is the configured app name (`atomic` here, from `atomicConfig.name`; legacy `piConfig.name` is also read). The legacy `pi` key remains supported as a backwards-compatible shim. Include the `atomic-package` keyword for discoverability.
11
+
12
+ ```json
13
+ {
14
+ "name": "my-package",
15
+ "keywords": ["atomic-package"],
16
+ "atomic": {
17
+ "extensions": ["./extensions"],
18
+ "skills": ["./skills"],
19
+ "prompts": ["./prompts"],
20
+ "themes": ["./themes"],
21
+ "workflows": ["./workflows"]
22
+ }
23
+ }
24
+ ```
25
+
26
+ Paths are relative to the package root. Arrays support glob patterns and `!exclusions`.
27
+
28
+ ### Gallery Metadata
29
+
30
+ The package gallery currently recognizes legacy `pi-package` metadata, while new Atomic packages should also include `atomic-package`. Add `video` or `image` fields to show a preview:
31
+
32
+ ```json
33
+ {
34
+ "name": "my-package",
35
+ "keywords": ["atomic-package", "pi-package"],
36
+ "atomic": {
37
+ "extensions": ["./extensions"],
38
+ "video": "https://example.com/demo.mp4",
39
+ "image": "https://example.com/screenshot.png"
40
+ }
41
+ }
42
+ ```
43
+
44
+ - **video**: MP4 only. On desktop, autoplays on hover. Clicking opens a fullscreen player.
45
+ - **image**: PNG, JPEG, GIF, or WebP. Displayed as a static preview.
46
+
47
+ If both are set, video takes precedence.
48
+
49
+ ## Package Structure
50
+
51
+ ### Convention Directories
52
+
53
+ If no app manifest (`atomic`, or legacy `pi`) is present, Atomic auto-discovers resources from these directories:
54
+
55
+ - `extensions/` loads `.ts` and `.js` files
56
+ - `skills/` recursively finds `SKILL.md` folders and loads top-level `.md` files as skills
57
+ - `prompts/` loads `.md` files
58
+ - `themes/` loads `.json` files
59
+ - `workflows/` loads workflow SDK files (`.ts`, `.js`, `.mjs`, `.cjs`); `workflow/` is also accepted as a singular alias. Workflow files import `workflow` from `@bastani/atomic/workflows`, import `Type` from `typebox`, and export the definition returned by `workflow({ ... })`. TypeScript resolves the published `@bastani/atomic/workflows` specifier through the `@bastani/atomic` package. Atomic resolves that workflow specifier and the supported TypeBox root, `typebox/compile`, `typebox/value`, and legacy `@sinclair/typebox` aliases to in-memory host modules when it loads the workflow at runtime. See [Programmatic usage](/workflows/api-reference#programmatic-usage).
60
+
61
+ When a package manifest exists, declared resource arrays normally define what loads. Workflows are the exception: if `atomic.workflows` / legacy `pi.workflows` is omitted, Atomic still checks conventional `workflows/` and `workflow/` directories.
62
+
63
+ ## Dependencies
64
+
65
+ Third-party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, themes, or workflows also belong in `dependencies`. When Atomic installs a package from npm or git, it runs the configured npm-compatible install command, so those dependencies are installed automatically.
66
+
67
+ Atomic bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@bastani/pi-ai`, `@earendil-works/pi-agent-core`, `@bastani/atomic`, `@earendil-works/pi-tui`, `typebox`.
68
+
69
+ Workflow packages import `workflow` from `@bastani/atomic/workflows`, import `Type` from `typebox`, and export definitions returned by `workflow({ ... })`. List `@bastani/atomic` and `typebox` in `peerDependencies` so package consumers receive the workflow SDK and schema library.
70
+
71
+ Package-authored workflows should follow the same [guiding principles](/workflows/authoring#guiding-principles) as project workflows.
72
+
73
+ Other Atomic packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Atomic loads packages with separate module roots, so separate installs do not collide or share modules.
74
+
75
+ Example:
76
+
77
+ ```json
78
+ {
79
+ "dependencies": {
80
+ "shitty-extensions": "^1.0.1"
81
+ },
82
+ "bundledDependencies": ["shitty-extensions"],
83
+ "atomic": {
84
+ "extensions": ["extensions", "node_modules/shitty-extensions/extensions"],
85
+ "skills": ["skills", "node_modules/shitty-extensions/skills"]
86
+ }
87
+ }
88
+ ```
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: Package reference
3
+ description: Package filtering, scope, and deduplication contracts.
4
+ ---
5
+
6
+ # Package reference
7
+
8
+ ## Package Filtering
9
+
10
+ Filter what a package loads using the object form in settings:
11
+
12
+ ```json
13
+ {
14
+ "packages": [
15
+ "npm:simple-pkg",
16
+ {
17
+ "source": "npm:my-package",
18
+ "extensions": ["extensions/*.ts", "!extensions/legacy.ts"],
19
+ "skills": [],
20
+ "prompts": ["prompts/review.md"],
21
+ "themes": ["+themes/legacy.json"],
22
+ "workflows": ["workflows/*.ts"]
23
+ }
24
+ ]
25
+ }
26
+ ```
27
+
28
+ `+path` and `-path` are exact paths relative to the package root.
29
+
30
+ - Omit a key to load all of that type.
31
+ - Use `[]` to load none of that type.
32
+ - `!pattern` excludes matches.
33
+ - `+path` force-includes an exact path.
34
+ - `-path` force-excludes an exact path.
35
+ - Filters layer on top of the manifest. They narrow down what is already allowed.
36
+
37
+ ## Scope and Deduplication
38
+
39
+ Packages can appear in both global and project settings. The project entry normally wins. A project entry with `autoload: false` instead acts as a delta over the global entry: it starts with no newly auto-discovered resources while explicit include/exclude patterns adjust the inherited package resources. Identity is determined by:
40
+
41
+ - npm: package name
42
+ - git: repository URL without ref
43
+ - local: resolved absolute path
package/docs/packages.md CHANGED
@@ -1,9 +1,21 @@
1
+ ---
2
+ title: "Atomic packages"
3
+ description: "Install, manage, and share Atomic packages that bundle extensions, skills, prompt templates, themes, and workflows."
4
+ ---
5
+
1
6
  > Atomic can help you create packages. Ask it to bundle your extensions, skills, prompt templates, or themes.
2
7
 
3
8
  # Atomic Packages
4
9
 
5
10
  Atomic packages bundle extensions, skills, prompt templates, themes, and workflow definitions so you can share them through npm or git. Declare resources in `package.json` under the `atomic` key, or use conventional directories.
6
11
 
12
+ ## Where to go next
13
+
14
+ Atomic packages bundle and distribute extensions, skills, prompts, themes, and workflows. Read this page to install and manage them, then continue:
15
+
16
+ - [Creating packages](/packages/authoring) — create a package, lay out its structure, and declare dependencies.
17
+ - [Package reference](/packages/reference) — filtering, scope, and deduplication contracts.
18
+
7
19
  ## Table of Contents
8
20
 
9
21
  - [Atomic Packages](#atomic-packages)
@@ -13,14 +25,14 @@ Atomic packages bundle extensions, skills, prompt templates, themes, and workflo
13
25
  - [npm](#npm)
14
26
  - [git](#git)
15
27
  - [Local Paths](#local-paths)
16
- - [Creating an Atomic Package](#creating-an-atomic-package)
17
- - [Gallery Metadata](#gallery-metadata)
18
- - [Package Structure](#package-structure)
19
- - [Convention Directories](#convention-directories)
20
- - [Dependencies](#dependencies)
21
- - [Package Filtering](#package-filtering)
28
+ - [Creating an Atomic Package](/packages/authoring#creating-an-atomic-package)
29
+ - [Gallery Metadata](/packages/authoring#gallery-metadata)
30
+ - [Package Structure](/packages/authoring#package-structure)
31
+ - [Convention Directories](/packages/authoring#convention-directories)
32
+ - [Dependencies](/packages/authoring#dependencies)
33
+ - [Package Filtering](/packages/reference#package-filtering)
22
34
  - [Enable and Disable Resources](#enable-and-disable-resources)
23
- - [Scope and Deduplication](#scope-and-deduplication)
35
+ - [Scope and Deduplication](/packages/reference#scope-and-deduplication)
24
36
 
25
37
  ## Install and Manage
26
38
 
@@ -45,7 +57,7 @@ atomic update npm:@foo/bar # update one package
45
57
  atomic update --extension npm:@foo/bar
46
58
  ```
47
59
 
48
- These commands manage Atomic packages and `atomic update` can update the Atomic CLI installation. To uninstall Atomic itself, see [Quickstart](/quickstart#uninstall).
60
+ These commands manage Atomic packages and `atomic update` can update the Atomic CLI installation. To uninstall Atomic itself, see [Quickstart](/getting-started/installation#uninstall).
49
61
 
50
62
  Self-update resolves an exact advertised package/version target and installs that pinned spec, so the update cannot drift to a newer registry release during installation. Any release note supplied by the update service is shown before installation. Atomic only updates installations it can verify are writable and managed by the detected global package manager; otherwise it prints a manual command. On Windows, loaded native dependencies are temporarily quarantined during replacement and stale quarantine directories are cleaned on later update attempts.
51
63
 
@@ -128,114 +140,27 @@ Local paths point to files or directories on disk and are added to settings with
128
140
 
129
141
  ## Creating an Atomic Package
130
142
 
131
- Add an app manifest to `package.json` or use conventional directories. The manifest key is the configured app name (`atomic` here, from `atomicConfig.name`; legacy `piConfig.name` is also read). The legacy `pi` key remains supported as a backwards-compatible shim. Include the `atomic-package` keyword for discoverability.
132
-
133
- ```json
134
- {
135
- "name": "my-package",
136
- "keywords": ["atomic-package"],
137
- "atomic": {
138
- "extensions": ["./extensions"],
139
- "skills": ["./skills"],
140
- "prompts": ["./prompts"],
141
- "themes": ["./themes"],
142
- "workflows": ["./workflows"]
143
- }
144
- }
145
- ```
146
-
147
- Paths are relative to the package root. Arrays support glob patterns and `!exclusions`.
143
+ Moved to [Creating packages](/packages/authoring#creating-an-atomic-package).
148
144
 
149
145
  ### Gallery Metadata
150
146
 
151
- The package gallery currently recognizes legacy `pi-package` metadata, while new Atomic packages should also include `atomic-package`. Add `video` or `image` fields to show a preview:
152
-
153
- ```json
154
- {
155
- "name": "my-package",
156
- "keywords": ["atomic-package", "pi-package"],
157
- "atomic": {
158
- "extensions": ["./extensions"],
159
- "video": "https://example.com/demo.mp4",
160
- "image": "https://example.com/screenshot.png"
161
- }
162
- }
163
- ```
164
-
165
- - **video**: MP4 only. On desktop, autoplays on hover. Clicking opens a fullscreen player.
166
- - **image**: PNG, JPEG, GIF, or WebP. Displayed as a static preview.
167
-
168
- If both are set, video takes precedence.
147
+ Moved to [Creating packages](/packages/authoring#gallery-metadata).
169
148
 
170
149
  ## Package Structure
171
150
 
172
- ### Convention Directories
151
+ Moved to [Creating packages](/packages/authoring#package-structure).
173
152
 
174
- If no app manifest (`atomic`, or legacy `pi`) is present, Atomic auto-discovers resources from these directories:
175
-
176
- - `extensions/` loads `.ts` and `.js` files
177
- - `skills/` recursively finds `SKILL.md` folders and loads top-level `.md` files as skills
178
- - `prompts/` loads `.md` files
179
- - `themes/` loads `.json` files
180
- - `workflows/` loads workflow SDK files (`.ts`, `.js`, `.mjs`, `.cjs`); `workflow/` is also accepted as a singular alias. Workflow files import `workflow` from `@bastani/atomic/workflows`, import `Type` from `typebox`, and export the definition returned by `workflow({ ... })`. TypeScript resolves the published `@bastani/atomic/workflows` specifier through the `@bastani/atomic` package. Atomic resolves that workflow specifier and the supported TypeBox root, `typebox/compile`, `typebox/value`, and legacy `@sinclair/typebox` aliases to in-memory host modules when it loads the workflow at runtime. See [Programmatic usage](/workflows/api-reference#programmatic-usage).
153
+ ### Convention Directories
181
154
 
182
- When a package manifest exists, declared resource arrays normally define what loads. Workflows are the exception: if `atomic.workflows` / legacy `pi.workflows` is omitted, Atomic still checks conventional `workflows/` and `workflow/` directories.
155
+ Moved to [Creating packages](/packages/authoring#convention-directories).
183
156
 
184
157
  ## Dependencies
185
158
 
186
- Third-party runtime dependencies belong in `dependencies` in `package.json`. Dependencies that do not register extensions, skills, prompt templates, themes, or workflows also belong in `dependencies`. When Atomic installs a package from npm or git, it runs the configured npm-compatible install command, so those dependencies are installed automatically.
187
-
188
- Atomic bundles core packages for extensions and skills. If you import any of these, list them in `peerDependencies` with a `"*"` range and do not bundle them: `@bastani/pi-ai`, `@earendil-works/pi-agent-core`, `@bastani/atomic`, `@earendil-works/pi-tui`, `typebox`.
189
-
190
- Workflow packages import `workflow` from `@bastani/atomic/workflows`, import `Type` from `typebox`, and export definitions returned by `workflow({ ... })`. List `@bastani/atomic` and `typebox` in `peerDependencies` so package consumers receive the workflow SDK and schema library.
191
-
192
- Package-authored workflows should follow the same [guiding principles](/workflows/authoring#guiding-principles) as project workflows.
193
-
194
- Other Atomic packages must be bundled in your tarball. Add them to `dependencies` and `bundledDependencies`, then reference their resources through `node_modules/` paths. Atomic loads packages with separate module roots, so separate installs do not collide or share modules.
195
-
196
- Example:
197
-
198
- ```json
199
- {
200
- "dependencies": {
201
- "shitty-extensions": "^1.0.1"
202
- },
203
- "bundledDependencies": ["shitty-extensions"],
204
- "atomic": {
205
- "extensions": ["extensions", "node_modules/shitty-extensions/extensions"],
206
- "skills": ["skills", "node_modules/shitty-extensions/skills"]
207
- }
208
- }
209
- ```
159
+ Moved to [Creating packages](/packages/authoring#dependencies).
210
160
 
211
161
  ## Package Filtering
212
162
 
213
- Filter what a package loads using the object form in settings:
214
-
215
- ```json
216
- {
217
- "packages": [
218
- "npm:simple-pkg",
219
- {
220
- "source": "npm:my-package",
221
- "extensions": ["extensions/*.ts", "!extensions/legacy.ts"],
222
- "skills": [],
223
- "prompts": ["prompts/review.md"],
224
- "themes": ["+themes/legacy.json"],
225
- "workflows": ["workflows/*.ts"]
226
- }
227
- ]
228
- }
229
- ```
230
-
231
- `+path` and `-path` are exact paths relative to the package root.
232
-
233
- - Omit a key to load all of that type.
234
- - Use `[]` to load none of that type.
235
- - `!pattern` excludes matches.
236
- - `+path` force-includes an exact path.
237
- - `-path` force-excludes an exact path.
238
- - Filters layer on top of the manifest. They narrow down what is already allowed.
163
+ Moved to [Package reference](/packages/reference#package-filtering).
239
164
 
240
165
  ## Enable and Disable Resources
241
166
 
@@ -243,8 +168,4 @@ Use `atomic config` to enable or disable extensions, skills, prompt templates, a
243
168
 
244
169
  ## Scope and Deduplication
245
170
 
246
- Packages can appear in both global and project settings. The project entry normally wins. A project entry with `autoload: false` instead acts as a delta over the global entry: it starts with no newly auto-discovered resources while explicit include/exclude patterns adjust the inherited package resources. Identity is determined by:
247
-
248
- - npm: package name
249
- - git: repository URL without ref
250
- - local: resolved absolute path
171
+ Moved to [Package reference](/packages/reference#scope-and-deduplication).
@@ -0,0 +1,29 @@
1
+ ---
2
+ title: Programmatic use
3
+ description: Choose between JSON event stream mode, RPC mode, the SDK, and the TUI component APIs, then follow one minimal integration.
4
+ ---
5
+
6
+ # Programmatic use
7
+
8
+ Atomic exposes three integration modes plus a component API for interactive extension interfaces. Pick one mode, complete its minimal example, then continue to its reference.
9
+
10
+ ## Choose a mode
11
+
12
+ | You want | Use | Start at |
13
+ | --- | --- | --- |
14
+ | A one-shot run whose output you parse as structured events | [JSON event stream mode](/json) | `atomic --mode json` |
15
+ | A long-lived process you drive with commands and read events from | [RPC mode](/rpc) | `atomic --mode rpc` |
16
+ | Atomic embedded inside a Node.js application, with its resources and lifecycle in-process | [SDK](/sdk) | `@bastani/atomic` |
17
+
18
+ JSON mode is the smallest surface: one process, one prompt, a stream of newline-delimited events, then exit. RPC mode keeps the process alive so you can send more input, interrupt, switch models, and answer tool permission prompts. The SDK gives you the same engine as a library, with programmatic control over extensions, skills, tools, and session storage.
19
+
20
+ ## Then continue to the contracts
21
+
22
+ - [RPC protocol](/rpc/protocol) — every command, event, and type.
23
+ - [RPC extension UI protocol](/rpc/extension-ui) — drive extension-rendered UI over RPC.
24
+ - [RPC client examples](/rpc/examples) — additional client implementations.
25
+ - [SDK API reference](/sdk/reference) — options, loaders, return values, run modes, and exports.
26
+
27
+ ## Build interactive extension interfaces
28
+
29
+ [TUI components](/tui) covers writing a first component and the common interaction patterns; [TUI API reference](/tui/reference) holds the component, focusable, input, and rendering contracts.
@@ -4,6 +4,10 @@
4
4
 
5
5
  Prompt templates are Markdown snippets that expand into full prompts. Type `/name` in the editor to invoke a template, where `name` is the filename without `.md`.
6
6
 
7
+ **Prerequisites:** Atomic installed and running in a project — see the [Quickstart](/quickstart). No code and no build step are required.
8
+
9
+ **When to use this:** prompt templates are the lightest customization mechanism Atomic ships. Reach for them when you repeat the same instructions and want a slash command for them. If the agent should decide on its own when to load the instructions, use a [skill](/skills) instead; if you need to run code, use an [extension](/extensions).
10
+
7
11
  ## Locations
8
12
 
9
13
  Atomic loads prompt templates from:
@@ -94,3 +98,10 @@ Usage: `/component Button "onClick handler" "disabled support"`
94
98
 
95
99
  - Template discovery in `prompts/` is non-recursive.
96
100
  - If you want templates in subdirectories, add them explicitly via `prompts` settings or a package manifest.
101
+
102
+ ## Next steps
103
+
104
+ - [Skills](/skills) — instructions the agent loads on its own when a task matches, instead of on an explicit slash command.
105
+ - [Subagents](/subagents) — delegate a focused, bounded task to a child agent.
106
+ - [Atomic packages](/packages) — bundle your prompt templates with skills, themes, and extensions and share them.
107
+ - [Build with Atomic](/build) — compare every customization mechanism.
@@ -0,0 +1,23 @@
1
+ ---
2
+ title: Provider reference
3
+ description: Provider stop reasons and credential resolution order.
4
+ ---
5
+
6
+ # Provider reference
7
+
8
+ ## Stop Reasons
9
+
10
+ Every provider reports why it ended a turn. Atomic stores one of `stop`, `length`, `toolUse`, `error`, or `aborted`; the provider's own string (`end_turn`, `MAX_TOKENS`, `tool_calls`, and so on) is mapped onto it.
11
+
12
+ A terminal reason the mapping does not recognise is now reported as a **provider error** naming the raw value, instead of being reported as an ordinary successful stop. The turn fails visibly rather than looking like a model that chose to stop early, which matters most for a truncation or safety stop a new provider version invents. Reasons that already mapped to a successful stop are unchanged, and a provider that stops on its own safety or refusal signal still surfaces the raw reason in the error text (for example `Provider stopped with: SAFETY`).
13
+
14
+ While a response is still streaming the partial message carries the reason `pending`. It is replaced by the terminal reason before the message is finished, so `pending` is not a state a completed turn can be left in: a stream that ends while still `pending` is a provider error. See [Custom providers](/custom-provider) for what this requires of a provider you implement yourself.
15
+
16
+ ## Resolution Order
17
+
18
+ When resolving credentials for a provider:
19
+
20
+ 1. CLI `--api-key` flag
21
+ 2. `auth.json` entry (API key or OAuth token)
22
+ 3. Environment variable
23
+ 4. Custom provider keys from `models.json`
package/docs/providers.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Atomic supports subscription-based providers via OAuth and API-key providers via environment variables or the auth file. Built-in catalogs ship with Atomic; configured and native providers may refresh newer catalogs independently and cache them in `~/.atomic/agent/models-store.json` for offline use.
4
4
 
5
+ ## On this page and its reference
6
+
7
+ This page is provider setup: subscriptions, API keys, cloud providers, and local llama.cpp. The exact contracts — provider stop reasons and credential resolution order — live in the [Provider reference](/providers/reference).
8
+
5
9
  ## Table of Contents
6
10
 
7
11
  - [Subscriptions](#subscriptions)
@@ -9,9 +13,9 @@ Atomic supports subscription-based providers via OAuth and API-key providers via
9
13
  - [API Keys](#api-keys)
10
14
  - [Auth File](#auth-file)
11
15
  - [Cloud Providers](#cloud-providers)
12
- - [llama.cpp](#llamacpp)
13
- - [Stop Reasons](#stop-reasons)
14
- - [Resolution Order](#resolution-order)
16
+ - [llama.cpp](#llama-cpp)
17
+ - [Stop Reasons](/providers/reference#stop-reasons)
18
+ - [Resolution Order](/providers/reference#resolution-order)
15
19
  - [Custom Providers](#custom-providers)
16
20
 
17
21
  ## Subscriptions
@@ -142,7 +146,7 @@ After a successful API-key or OAuth login, Atomic persists the credential and im
142
146
 
143
147
  On a remote or headless machine, paste the authorization code or final redirect URL into the login prompt when the provider offers manual entry. A completed exchange must either return to the editor or show an error; it does not require deleting `~/.atomic`. Existing OAuth credentials use the same `auth.json` schema after the pi-ai model-runtime migration and are loaded in place.
144
148
 
145
- Remote pi.dev catalogs persist their ETag and are revalidated with `If-None-Match`; an empty `304` keeps the cached models and counts as a successful check. Atomic renders the cached snapshot immediately, preserves each provider's last usable catalog on refresh failure, and prefers newer bundled data over stale remote overlays. See [Custom Models](/models#catalog-freshness-and-precedence).
149
+ Remote pi.dev catalogs persist their ETag and are revalidated with `If-None-Match`; an empty `304` keeps the cached models and counts as a successful check. Atomic renders the cached snapshot immediately, preserves each provider's last usable catalog on refresh failure, and prefers newer bundled data over stale remote overlays. See [Custom Models](/models/reference#catalog-freshness-and-precedence).
146
150
 
147
151
  | Provider | Environment Variable | `auth.json` key |
148
152
  | ---------------------------------- | ------------------------------------------------------------------------- | ---------------------------- |
@@ -481,17 +485,8 @@ For router-mode discovery, load/unload management, and Hugging Face downloads wi
481
485
 
482
486
  ## Stop Reasons
483
487
 
484
- Every provider reports why it ended a turn. Atomic stores one of `stop`, `length`, `toolUse`, `error`, or `aborted`; the provider's own string (`end_turn`, `MAX_TOKENS`, `tool_calls`, and so on) is mapped onto it.
485
-
486
- A terminal reason the mapping does not recognise is now reported as a **provider error** naming the raw value, instead of being reported as an ordinary successful stop. The turn fails visibly rather than looking like a model that chose to stop early, which matters most for a truncation or safety stop a new provider version invents. Reasons that already mapped to a successful stop are unchanged, and a provider that stops on its own safety or refusal signal still surfaces the raw reason in the error text (for example `Provider stopped with: SAFETY`).
487
-
488
- While a response is still streaming the partial message carries the reason `pending`. It is replaced by the terminal reason before the message is finished, so `pending` is not a state a completed turn can be left in: a stream that ends while still `pending` is a provider error. See [Custom providers](/custom-provider) for what this requires of a provider you implement yourself.
488
+ Moved to [Provider reference](/providers/reference#stop-reasons).
489
489
 
490
490
  ## Resolution Order
491
491
 
492
- When resolving credentials for a provider:
493
-
494
- 1. CLI `--api-key` flag
495
- 2. `auth.json` entry (API key or OAuth token)
496
- 3. Environment variable
497
- 4. Custom provider keys from `models.json`
492
+ Moved to [Provider reference](/providers/reference#resolution-order).