@stratusagent/cli 0.11.2 → 0.11.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 (158) hide show
  1. package/README.md +13 -7
  2. package/dist/approvals.d.ts +87 -0
  3. package/dist/approvals.d.ts.map +1 -0
  4. package/dist/approvals.js +315 -0
  5. package/dist/approvals.js.map +1 -0
  6. package/dist/commands/agent-new.d.ts +22 -0
  7. package/dist/commands/agent-new.d.ts.map +1 -0
  8. package/dist/commands/agent-new.js +154 -0
  9. package/dist/commands/agent-new.js.map +1 -0
  10. package/dist/commands/agents.d.ts +4 -0
  11. package/dist/commands/agents.d.ts.map +1 -0
  12. package/dist/commands/agents.js +90 -0
  13. package/dist/commands/agents.js.map +1 -0
  14. package/dist/commands/chat.d.ts +4 -0
  15. package/dist/commands/chat.d.ts.map +1 -0
  16. package/dist/commands/chat.js +224 -0
  17. package/dist/commands/chat.js.map +1 -0
  18. package/dist/commands/credential.d.ts +22 -0
  19. package/dist/commands/credential.d.ts.map +1 -0
  20. package/dist/commands/credential.js +93 -0
  21. package/dist/commands/credential.js.map +1 -0
  22. package/dist/commands/dashboard.d.ts +14 -0
  23. package/dist/commands/dashboard.d.ts.map +1 -0
  24. package/dist/commands/dashboard.js +195 -0
  25. package/dist/commands/dashboard.js.map +1 -0
  26. package/dist/commands/doctor.d.ts +40 -0
  27. package/dist/commands/doctor.d.ts.map +1 -0
  28. package/dist/commands/doctor.js +357 -0
  29. package/dist/commands/doctor.js.map +1 -0
  30. package/dist/commands/grants.d.ts +19 -0
  31. package/dist/commands/grants.d.ts.map +1 -0
  32. package/dist/commands/grants.js +128 -0
  33. package/dist/commands/grants.js.map +1 -0
  34. package/dist/commands/logs.d.ts +9 -0
  35. package/dist/commands/logs.d.ts.map +1 -0
  36. package/dist/commands/logs.js +58 -0
  37. package/dist/commands/logs.js.map +1 -0
  38. package/dist/commands/memory.d.ts +20 -0
  39. package/dist/commands/memory.d.ts.map +1 -0
  40. package/dist/commands/memory.js +110 -0
  41. package/dist/commands/memory.js.map +1 -0
  42. package/dist/commands/plugins.d.ts +91 -0
  43. package/dist/commands/plugins.d.ts.map +1 -0
  44. package/dist/commands/plugins.js +359 -0
  45. package/dist/commands/plugins.js.map +1 -0
  46. package/dist/commands/restart.d.ts +4 -0
  47. package/dist/commands/restart.d.ts.map +1 -0
  48. package/dist/commands/restart.js +25 -0
  49. package/dist/commands/restart.js.map +1 -0
  50. package/dist/commands/schedules.d.ts +11 -0
  51. package/dist/commands/schedules.d.ts.map +1 -0
  52. package/dist/commands/schedules.js +50 -0
  53. package/dist/commands/schedules.js.map +1 -0
  54. package/dist/commands/serve.d.ts +4 -0
  55. package/dist/commands/serve.d.ts.map +1 -0
  56. package/dist/commands/serve.js +612 -0
  57. package/dist/commands/serve.js.map +1 -0
  58. package/dist/commands/service.d.ts +9 -0
  59. package/dist/commands/service.d.ts.map +1 -0
  60. package/dist/commands/service.js +97 -0
  61. package/dist/commands/service.js.map +1 -0
  62. package/dist/commands/session.d.ts +9 -0
  63. package/dist/commands/session.d.ts.map +1 -0
  64. package/dist/commands/session.js +25 -0
  65. package/dist/commands/session.js.map +1 -0
  66. package/dist/commands/setup.d.ts +5 -0
  67. package/dist/commands/setup.d.ts.map +1 -0
  68. package/dist/commands/setup.js +2412 -0
  69. package/dist/commands/setup.js.map +1 -0
  70. package/dist/commands/skills.d.ts +15 -0
  71. package/dist/commands/skills.d.ts.map +1 -0
  72. package/dist/commands/skills.js +272 -0
  73. package/dist/commands/skills.js.map +1 -0
  74. package/dist/commands/template.d.ts +4 -0
  75. package/dist/commands/template.d.ts.map +1 -0
  76. package/dist/commands/template.js +575 -0
  77. package/dist/commands/template.js.map +1 -0
  78. package/dist/commands/update.d.ts +21 -0
  79. package/dist/commands/update.d.ts.map +1 -0
  80. package/dist/commands/update.js +291 -0
  81. package/dist/commands/update.js.map +1 -0
  82. package/dist/daemon.d.ts +74 -0
  83. package/dist/daemon.d.ts.map +1 -0
  84. package/dist/daemon.js +192 -0
  85. package/dist/daemon.js.map +1 -0
  86. package/dist/environment.d.ts +108 -0
  87. package/dist/environment.d.ts.map +1 -0
  88. package/dist/environment.js +2 -0
  89. package/dist/environment.js.map +1 -0
  90. package/dist/events.d.ts +17 -0
  91. package/dist/events.d.ts.map +1 -0
  92. package/dist/events.js +87 -0
  93. package/dist/events.js.map +1 -0
  94. package/dist/help.d.ts +2 -0
  95. package/dist/help.d.ts.map +1 -0
  96. package/dist/help.js +266 -0
  97. package/dist/help.js.map +1 -0
  98. package/dist/index.d.ts +31 -624
  99. package/dist/index.d.ts.map +1 -1
  100. package/dist/index.js +38 -6981
  101. package/dist/index.js.map +1 -1
  102. package/dist/io.d.ts +16 -0
  103. package/dist/io.d.ts.map +1 -0
  104. package/dist/io.js +45 -0
  105. package/dist/io.js.map +1 -0
  106. package/dist/loaders.d.ts +31 -0
  107. package/dist/loaders.d.ts.map +1 -0
  108. package/dist/loaders.js +56 -0
  109. package/dist/loaders.js.map +1 -0
  110. package/dist/main.d.ts +8 -0
  111. package/dist/main.d.ts.map +1 -0
  112. package/dist/main.js +214 -0
  113. package/dist/main.js.map +1 -0
  114. package/dist/npm.d.ts +66 -0
  115. package/dist/npm.d.ts.map +1 -0
  116. package/dist/npm.js +201 -0
  117. package/dist/npm.js.map +1 -0
  118. package/dist/parse.d.ts +231 -0
  119. package/dist/parse.d.ts.map +1 -0
  120. package/dist/parse.js +1082 -0
  121. package/dist/parse.js.map +1 -0
  122. package/dist/plugin-catalog.d.ts +35 -0
  123. package/dist/plugin-catalog.d.ts.map +1 -0
  124. package/dist/plugin-catalog.js +58 -0
  125. package/dist/plugin-catalog.js.map +1 -0
  126. package/dist/preflight.d.ts +60 -0
  127. package/dist/preflight.d.ts.map +1 -0
  128. package/dist/preflight.js +102 -0
  129. package/dist/preflight.js.map +1 -0
  130. package/dist/prompter.d.ts +84 -0
  131. package/dist/prompter.d.ts.map +1 -0
  132. package/dist/prompter.js +347 -0
  133. package/dist/prompter.js.map +1 -0
  134. package/dist/roster.d.ts +57 -0
  135. package/dist/roster.d.ts.map +1 -0
  136. package/dist/roster.js +78 -0
  137. package/dist/roster.js.map +1 -0
  138. package/dist/runtime.d.ts +59 -0
  139. package/dist/runtime.d.ts.map +1 -0
  140. package/dist/runtime.js +266 -0
  141. package/dist/runtime.js.map +1 -0
  142. package/dist/slack.d.ts +26 -0
  143. package/dist/slack.d.ts.map +1 -0
  144. package/dist/slack.js +113 -0
  145. package/dist/slack.js.map +1 -0
  146. package/dist/source.d.ts +24 -0
  147. package/dist/source.d.ts.map +1 -0
  148. package/dist/source.js +80 -0
  149. package/dist/source.js.map +1 -0
  150. package/dist/supervisor.d.ts +69 -0
  151. package/dist/supervisor.d.ts.map +1 -0
  152. package/dist/supervisor.js +218 -0
  153. package/dist/supervisor.js.map +1 -0
  154. package/dist/trusted-config.d.ts +71 -0
  155. package/dist/trusted-config.d.ts.map +1 -0
  156. package/dist/trusted-config.js +118 -0
  157. package/dist/trusted-config.js.map +1 -0
  158. package/package.json +25 -23
package/dist/index.d.ts CHANGED
@@ -1,629 +1,36 @@
1
- import { type ApprovalContext, type ApprovalPolicy, type JsonValue, type Session, type StratusEvent, type TrustLevel } from '@stratusagent/core';
2
- import { type CredentialProviderName, type RuntimeSelection, type RuntimeConfig, type StratusConfigFile, type StratusProviderName } from '@stratusagent/state';
3
- import { type ServiceRunner } from './service.ts';
4
1
  export { installService, launchdPlist, readServiceCommand, readServiceStatus, servicePlatform, serviceUnitPath, startService, stopService, systemdUnit, uninstallService, SERVICE_LABEL, type ServiceRunner, type ServiceStatus, } from './service.ts';
5
2
  export { createLogWriter, currentLogPosition, truncateRedirectLogs, formatLogRecord, parseLogLines, readRecentRecords, tailLog, type LogRecord, } from './logs.ts';
6
3
  export { createFileMemoryStore } from '@stratusagent/state';
7
4
  export type { StoredCredential, RuntimeConfig } from '@stratusagent/state';
8
- export interface CliStreams {
9
- stdout: Pick<typeof process.stdout, 'write'>;
10
- stderr: Pick<typeof process.stderr, 'write'>;
11
- }
12
- export interface CliEnvironment {
13
- stdin?: string;
14
- stdinStream?: NodeJS.ReadableStream;
15
- approvalInput?: NodeJS.ReadableStream;
16
- setupInput?: NodeJS.ReadableStream;
17
- processEnv?: NodeJS.ProcessEnv;
18
- cwd?: string;
19
- /** Home directory override (tests). Defaults to os.homedir(). */
20
- homeDir?: string;
21
- fetch?: typeof fetch;
22
- openExternal?: (url: string) => Promise<void> | void;
23
- dashboardAutoShutdownMs?: number;
24
- /** Shuts down `stratus serve` the way SIGTERM would (tests). */
25
- shutdownSignal?: AbortSignal;
26
- /**
27
- * Starts the fresh daemon an announced restart asks for and resolves
28
- * with its exit code. Injected so tests never spawn a process; the
29
- * default runs this CLI's own entrypoint with the serve arguments given.
30
- */
31
- serveRespawn?: (argv: string[], handoff: RestartHandoff) => Promise<RespawnResult>;
32
- /**
33
- * The link between a supervised daemon and its supervisor (tests): what
34
- * the daemon sends up — the port it bound, the dashboard sessions it
35
- * hands on — and what it receives. The default is the IPC channel a
36
- * supervisor opens when it spawns a daemon, and does nothing where
37
- * there is none.
38
- */
39
- supervisorLink?: SupervisorLink;
40
- /** Ends the process at once (tests). Default `process.exit`. */
41
- exitProcess?: (code: number) => void;
42
- /** Runs launchctl/systemctl. Injected so tests never touch the real one. */
43
- serviceRunner?: ServiceRunner;
44
- /** Service-manager platform override (tests) — which unit format and manager commands apply. */
45
- servicePlatform?: NodeJS.Platform;
46
- /** Reports whether an optional package is installed. Injected so tests do not assert on their own node_modules. */
47
- packageResolver?: PackageResolver;
48
- /** Installs optional packages. Injected so tests never run npm. */
49
- packageInstaller?: PackageInstaller;
50
- /** Looks up a package's latest published version. Injected so tests never ask npm. */
51
- packageVersionFetcher?: PackageVersionFetcher;
52
- }
53
- /**
54
- * A dashboard session as it crosses the restart hand-off: structurally the
55
- * control API's `DashboardSession`, declared here rather than imported.
56
- * That package is an optional peer, and a type import of it is kept in
57
- * this package's declarations — every TypeScript consumer of the CLI would
58
- * then need the optional package installed just to type-check.
59
- */
60
- export interface DashboardSession {
61
- id: string;
62
- /** Epoch milliseconds; a handed session keeps the expiry it was minted with. */
63
- expiresAt: number;
64
- /** A fingerprint of the bearer token it was minted under; the replacement adopts it only under the same one. */
65
- vouchedBy: string;
66
- }
67
- /** What a daemon and its supervisor say to each other. See SupervisorLink. */
68
- export type SupervisorMessage = {
69
- type: 'stratusd.bound-api-port';
70
- port: number;
71
- } | {
72
- type: 'stratusd.sessions';
73
- sessions: DashboardSession[];
74
- };
75
- /** One end of the daemon–supervisor channel. */
76
- export interface SupervisorLink {
77
- send(message: SupervisorMessage): void;
78
- receive(handler: (message: SupervisorMessage) => void): void;
79
- }
80
- /**
81
- * What a supervisor hands the daemon it starts: the port its predecessor
82
- * bound (a hint, see BOUND_API_PORT_ENV) and the dashboard sessions the
83
- * predecessor had live when it stopped, so `stratus restart` does not log
84
- * a browser out. In memory end to end; nothing here is written down.
85
- */
86
- export interface RestartHandoff {
87
- boundApiPort?: number;
88
- sessions: DashboardSession[];
89
- }
90
- /** How a daemon the supervisor started ended, and what it handed back before it did. */
91
- export interface RespawnResult {
92
- code: number;
93
- boundApiPort?: number;
94
- sessions?: DashboardSession[];
95
- }
96
- export interface PackageInstallResult {
97
- ok: boolean;
98
- /** Why it failed, as a line the operator can act on. Empty on success. */
99
- message: string;
100
- }
101
- /** Installs optional packages globally. */
102
- export type PackageInstaller = (packages: string[]) => Promise<PackageInstallResult>;
103
- /** The latest published version of a package, or undefined when the registry did not answer. */
104
- export type PackageVersionFetcher = (packageName: string) => Promise<string | undefined>;
105
- /** How long `stratus update` waits for npm to answer a version lookup. */
106
- export declare const VERSION_LOOKUP_TIMEOUT_MS = 15000;
107
- /**
108
- * Dotted-numeric comparison, enough for this package's own versions:
109
- * positive when `a` is newer than `b`. Anything unparseable in a segment
110
- * counts as zero rather than throwing — a weird registry answer must not
111
- * crash the update that would fix things.
112
- */
113
- export declare const compareVersions: (a: string, b: string) => number;
114
- /**
115
- * Whether spawning npm needs a shell on this platform.
116
- *
117
- * On Windows npm is `npm.cmd`, a batch file: a bare `npm` does not exist as
118
- * an executable there (PATHEXT is a shell's job, not spawn's), and naming
119
- * the `.cmd` directly has thrown EINVAL since the fix for CVE-2024-27980 —
120
- * both land in the caller's error handler, so a Windows setup would report
121
- * that it could not install and leave Slack and the dashboard missing.
122
- *
123
- * Every package name reaching the shell is a constant in this file, so
124
- * there is nothing user-supplied here for it to re-parse.
125
- */
126
- export declare const npmNeedsShell: (platform: NodeJS.Platform) => boolean;
127
- export interface CliRunOptions {
128
- argv: string[];
129
- streams?: CliStreams;
130
- env?: CliEnvironment;
131
- }
132
- export type CliProviderName = StratusProviderName;
133
- export type CliApprovalMode = 'always' | 'ask' | 'never';
134
- export interface ParsedRunCommand {
135
- command: 'run';
136
- prompt: string;
137
- provider?: CliProviderName;
138
- model?: string;
139
- baseUrl?: string;
140
- configPath?: string;
141
- /** Path to a soul file defining the agent to run as. */
142
- soul?: string;
143
- format: 'text' | 'json';
144
- events: boolean;
145
- approvals: CliApprovalMode;
146
- maxTurns?: number;
147
- }
148
- export interface ParsedDashboardCommand {
149
- command: 'dashboard';
150
- port?: number;
151
- /**
152
- * Present only when `--host` was actually given.
153
- *
154
- * A defaulted string here would be indistinguishable from an explicit
155
- * `--host 127.0.0.1`, and the two mean opposite things when a trusted
156
- * config says `api.host: "0.0.0.0"`: absent means "let the config decide",
157
- * while explicit means "bind loopback, whatever the config says". Collapsing
158
- * them exposed the API on every interface to an operator who had just asked
159
- * for the opposite.
160
- */
161
- host?: string;
162
- openBrowser: boolean;
163
- }
164
- export interface ParsedSetupCommand {
165
- command: 'setup';
166
- configPath?: string;
167
- }
168
- export interface ParsedAgentNewCommand {
169
- command: 'agent-new';
170
- name?: string;
171
- instructions?: string;
172
- format: 'text' | 'json' | 'soul';
173
- }
174
- export interface ParsedChatCommand {
175
- command: 'chat';
176
- provider?: CliProviderName;
177
- model?: string;
178
- baseUrl?: string;
179
- configPath?: string;
180
- /** Path to a soul file defining the agent to chat with. */
181
- soul?: string;
182
- events: boolean;
183
- approvals: CliApprovalMode;
184
- maxTurns?: number;
185
- }
186
- export interface ParsedSkillAddCommand {
187
- command: 'skill-add';
188
- /** A GitHub `owner/repo`, a git URL, or a local path. */
189
- source: string;
190
- /** Install only these ids (repeatable --skill). */
191
- skillIds?: string[];
192
- /** Replace an already-installed id instead of refusing it. */
193
- force?: boolean;
194
- /** Enable the installed skills in this agent's soul afterwards. */
195
- agentId?: string;
196
- /** Tell a running daemon to reload its skills afterwards. Default true; `--no-reload` sets false. */
197
- reload?: boolean;
198
- }
199
- export interface ParsedSkillValidateCommand {
200
- command: 'skill-validate';
201
- /** A skill directory, a directory of skills, or an installed skill's id. */
202
- target: string;
203
- }
204
- export interface ParsedSkillsCommand {
205
- command: 'skills';
206
- }
207
- /**
208
- * What a credential name may be: the two conventions in use, and nothing
209
- * that would be awkward in a soul's `credentials:` list — `search.apiKey`
210
- * and environment-style `SLACK_TOKEN`. Leading letter required, which also
211
- * happens to exclude `__proto__`; the store does not *rely* on that (it
212
- * keys prototype-free maps), because a credentials file can be written by
213
- * something other than this command.
214
- */
215
- export declare const CREDENTIAL_NAME_PATTERN: RegExp;
216
- export interface ParsedCredentialCommand {
217
- command: 'credential';
218
- action: 'set' | 'list' | 'remove';
219
- /** The credential name — `search.apiKey` and whatever the ecosystem asks for next. */
220
- name?: string;
221
- /** Store or remove this agent's own entry rather than the fleet's shared one. */
222
- agentId?: string;
223
- }
224
- export interface ParsedSkillReloadCommand {
225
- command: 'skill-reload';
226
- /** A daemon's control API URL; default: the one `~/.stratus/gateway.json` names. */
227
- gateway?: string;
228
- token?: string;
229
- }
230
- export interface ParsedRestartCommand {
231
- command: 'restart';
232
- /** For the daemon's log. */
233
- reason?: string;
234
- /** How long the daemon lets in-flight turns finish, in milliseconds. */
235
- drainTimeoutMs?: number;
236
- gateway?: string;
237
- token?: string;
238
- }
239
- export interface ParsedAgentsCommand {
240
- command: 'agents';
241
- format: 'text' | 'json';
242
- /**
243
- * Ask a running gateway instead of resolving locally. The first
244
- * remote-consuming command: the same listing, rendered from the control
245
- * API's answer rather than from this machine's files.
246
- */
247
- gateway?: string;
248
- /** Bearer token override, for a gateway whose token file is not local. */
249
- token?: string;
250
- }
251
- export interface ParsedSchedulesCommand {
252
- command: 'schedules';
253
- action: 'list' | 'cancel';
254
- /** cancel only: which schedule. */
255
- scheduleId?: string;
256
- format: 'text' | 'json';
257
- }
258
- export interface ParsedMemoryCommand {
259
- command: 'memory';
260
- action: 'list' | 'reassert';
261
- agentId: string;
262
- /** list: show only entries at this label. reassert: the label to record. */
263
- trust?: TrustLevel;
264
- /** reassert: the entries to re-label, by id. */
265
- ids: string[];
266
- /** reassert: every live entry currently reading `unknown` — the upgrade case. */
267
- allUnknown: boolean;
268
- format: 'text' | 'json';
269
- }
270
- export interface ParsedSessionCommand {
271
- command: 'session';
272
- action: 'rollover';
273
- sessionId: string;
274
- gateway?: string;
275
- token?: string;
276
- }
277
- export interface ParsedDoctorCommand {
278
- command: 'doctor';
279
- format: 'text' | 'json';
280
- configPath?: string;
281
- }
282
- export interface ParsedUpdateCommand {
283
- command: 'update';
284
- /** Report what an update would do — version, migrations, unit health — without doing any of it. */
285
- check: boolean;
286
- }
287
- export interface ParsedServiceCommand {
288
- command: 'service';
289
- action: 'install' | 'uninstall' | 'status' | 'start' | 'stop';
290
- /** install only: start automatically at login. Defaults to true. */
291
- runAtLogin?: boolean;
292
- /** install only: the config the managed daemon should load. */
293
- configPath?: string;
294
- }
295
- export interface ParsedLogsCommand {
296
- command: 'logs';
297
- /** Keep streaming new records instead of exiting after the backlog. */
298
- follow: boolean;
299
- /** How many recent records to show before following. */
300
- limit: number;
301
- agentId?: string;
302
- sessionId?: string;
303
- format: 'text' | 'json';
304
- }
305
- export type ServeApprovalMode = 'headless' | 'remote';
306
- export interface ParsedServeCommand {
307
- command: 'serve';
308
- configPath?: string;
309
- /** Overrides `approvals.mode` in the config file. */
310
- approvals?: ServeApprovalMode;
311
- /** Watchdog idle timeout in milliseconds. 0 disables. */
312
- idleTimeoutMs?: number;
313
- events: boolean;
314
- /** Write the structured log to ~/.stratus/logs. Defaults to true. */
315
- logToFile?: boolean;
316
- /** Serve the control API. Defaults to true when the package is installed. */
317
- api?: boolean;
318
- /** Overrides `api.port` in the config file. */
319
- apiPort?: number;
320
- /** Overrides `api.host` in the config file. */
321
- apiHost?: string;
322
- }
323
- export interface ParsedHelpCommand {
324
- command: 'help';
325
- }
326
- export type ParsedCommand = ParsedRunCommand | ParsedChatCommand | ParsedDashboardCommand | ParsedSetupCommand | ParsedAgentNewCommand | ParsedAgentsCommand | ParsedSkillAddCommand | ParsedSkillValidateCommand | ParsedSkillsCommand | ParsedSkillReloadCommand | ParsedCredentialCommand | ParsedRestartCommand | ParsedSchedulesCommand | ParsedMemoryCommand | ParsedSessionCommand | ParsedDoctorCommand | ParsedLogsCommand | ParsedUpdateCommand | ParsedServiceCommand | ParsedServeCommand | ParsedHelpCommand;
327
- export declare const CLI_VERSION = "0.11.2";
328
- /**
329
- * The range every package declares in its `engines` field. Two floors, not
330
- * one: `node:sqlite` was unflagged in 22.13.0 on the LTS line and in 23.4.0
331
- * on the 23.x line, so 23.0 through 23.3 are NEWER than the 22.x floor and
332
- * still ship it behind `--experimental-sqlite`. A plain `>=22.13` admits
333
- * exactly those releases.
334
- */
335
- export declare const SUPPORTED_NODE_RANGE = ">=22.13 <23 || >=23.4";
336
- /**
337
- * Why the CLI checks a version its manifests already declare: `engines` is
338
- * advisory. npm and pnpm print EBADENGINE and carry on unless the user has
339
- * turned on engine-strict, so an install on Node 20 succeeds and the floor
340
- * is discovered later as an ERR_UNKNOWN_BUILTIN_MODULE for `node:sqlite`,
341
- * thrown from a lazy import inside whichever command first needed the
342
- * session store. That error names neither Node nor the version required.
343
- *
344
- * Returns the message to print, or undefined when the version is fine —
345
- * including when it cannot be parsed at all, since an unrecognized build
346
- * string is a bad reason to refuse to run.
347
- */
348
- export declare const unsupportedNodeMessage: (version: string) => string | undefined;
349
- /**
350
- * The warning listeners to install in place of Node's default one, so the
351
- * `node:sqlite` ExperimentalWarning stops being the first thing the CLI
352
- * prints.
353
- *
354
- * The session store imports `node:sqlite`, which is experimental on every
355
- * Node release this supports — that is exactly why
356
- * {@link SUPPORTED_NODE_RANGE} is written the way it is — so the warning
357
- * announces a dependency the project chose deliberately and a user can do
358
- * nothing about. It landed above `stratusd ready` on every `stratus serve`,
359
- * and on `stratus schedules`.
360
- *
361
- * Filtered rather than silenced wholesale (`--no-warnings` would be the
362
- * blunt version): every other warning still reaches stderr through the
363
- * listeners passed in, because a deprecation in our own dependencies is
364
- * ours to act on.
365
- */
366
- export declare const withoutSqliteExperimentalWarning: (listeners: readonly ((warning: Error) => void)[]) => ((warning: Error) => void);
367
- /**
368
- * Swap Node's default warning printer for the filtered one above.
369
- *
370
- * Node installs its printer as an ordinary `warning` listener, so adding one
371
- * alongside it would print twice rather than filter; the default has to come
372
- * off and be handed to the replacement.
373
- *
374
- * **Only ever Node's own printer.** Wrapping a listener somebody else
375
- * registered changes it in two ways that are not ours to change: `listeners()`
376
- * hands back the *unwrapped* function for a `once` listener, so re-registering
377
- * it makes it permanent — it then runs for every later warning instead of one
378
- * — and a caller that keeps a reference can no longer `process.off('warning',
379
- * theirs)`, because what is registered is this wrapper. So when anything other
380
- * than the default is present — a `--require` preload, an embedding host — this
381
- * does nothing at all and the warning stays. A host that took an interest in
382
- * warnings owns them.
383
- *
384
- * Called once from the binary, before anything imports the session store.
385
- */
386
- export declare const filterSqliteExperimentalWarning: (process_?: NodeJS.EventEmitter) => void;
387
- declare const HELP_TEXT = "Stratus Agent CLI\n\nUsage:\n stratus setup\n stratus chat\n stratus chat --soul ./examples/souls/ava.md\n stratus run --prompt \"Use the demo tool\"\n stratus run \"Say hello\"\n ANTHROPIC_API_KEY=... stratus run --provider anthropic \"Say hello\"\n stratus run --soul ./examples/souls/ava.md \"Say hello\"\n echo \"Use the echo tool\" | stratus run --stdin\n STRATUS_PROVIDER=openai OPENAI_API_KEY=... stratus run \"Say hello\"\n stratus run --config ./stratus.config.json --provider openai \"Say hello\"\n stratus agents\n stratus agents --gateway http://127.0.0.1:4123\n stratus skill add stratuslabs/skill-code-review\n stratus skill add ./my-skills --skill code-review --agent ava\n stratus skill validate ./my-skill\n stratus skills\n stratus skill reload\n stratus restart\n stratus schedules\n stratus schedules cancel <id>\n stratus memory list ava\n stratus memory reassert ava --trust user --all-unknown\n stratus session rollover slack:ava:T01ABCDEF:D07GHIJKL\n printf %s \"$BRAVE_KEY\" | stratus credential set search.apiKey\n stratus credentials\n stratus doctor\n stratus update\n stratus update --check\n stratus service install\n stratus service status\n stratus logs -f\n stratus logs --agent ava -n 200\n stratus dashboard\n stratus dashboard --port 4123 --host 0.0.0.0 --no-open\n\nCommands:\n setup Menu-driven onboarding: pick a provider, sign in (Claude\n subscription or API key), create your agent, connect it to\n Slack, and test it \u2014 settings go to ~/.stratus/config.json,\n sign-ins and channel tokens to ~/.stratus/credentials.json\n (0600). Save & finish offers to install any optional\n package your answers imply (the Slack channel, the control\n API and dashboard) before it starts the daemon\n chat Talk with your agent \u2014 the conversation persists across turns\n and remembered facts accumulate; /exit or Ctrl+C to leave\n run Execute one local Stratus Agent session\n serve Run stratusd, the always-on gateway: durable sessions, the\n whole roster live at once (each agent on its own provider),\n delegation, and a watchdog \u2014 one per home (it refuses to\n start over a daemon already serving ~/.stratus), and\n Ctrl+C / SIGTERM drains cleanly\n (--idle-timeout <seconds>, --approvals <headless|remote>,\n --no-events, --no-log-file, --config <path>); everything it\n says is also written to ~/.stratus/logs, which\n \"stratus logs\" reads. With @stratusagent/control-api\n installed it also serves the HTTP + WebSocket control API\n on 127.0.0.1:4123 (--no-api, --api-host, --api-port, or\n the config file's \"api\" block)\n service Keep stratusd running under launchd (macOS) or systemd\n (Linux): install, uninstall, status, start, stop.\n Installing starts it now and at every login\n (--no-login installs without the login trigger,\n --config <path> pins the daemon to one config file)\n logs Read the daemon's log from any terminal: -f to follow,\n -n <count> for backlog, --agent / --session to filter,\n --format json for the raw records\n skill add Install skills from a GitHub repo (owner/repo or URL) or a\n local path into ~/.stratus/skills \u2014 whole directories, one\n per skill; works with skills published for other agents\n (skills.sh-style repos). Installed is not enabled: a soul\n opts in via skills:, or pass --agent <id> to enable now.\n --skill <id> picks from a multi-skill repo (repeatable),\n --force replaces an already-installed id. A skill that\n does not conform to the Agent Skills spec is refused,\n naming what is wrong; one that installs with caveats\n (fields another host owns, a bundled scripts/) says so.\n A running daemon reloads its skills afterwards, no\n restart (--no-reload skips that)\n skill validate Check a skill directory, a directory of skills, or an\n installed skill id against the Agent Skills spec \u2014 the\n same check \"skill add\" runs, so what validates installs.\n Exit 1 if anything would be refused\n skills List installed skills and which agents enable each\n (also: stratus skill list)\n skill reload Ask the running daemon to re-read ~/.stratus/skills \u2014 for a\n skill edited or removed by hand. A skill that will not\n load refuses the whole reload and the previous set keeps\n serving; nothing becomes reachable to an agent whose soul\n does not list it\n restart Ask the running daemon for an announced restart \u2014 what a\n plugin change needs: it refuses new turns, lets in-flight\n ones finish for up to --drain-timeout <seconds> (default\n 30), then comes back with sessions, schedules, and\n channels intact, under the service manager or not\n credential set Store a named credential an agent can resolve \u2014 a search\n backend asks for search.apiKey. The value is read from\n stdin, never from a flag, so it stays out of your shell\n history: printf %s \"$KEY\" | stratus credential set\n search.apiKey. --agent <id> stores one agent's own key,\n which outranks the shared entry for that agent. Storing\n grants nothing: the soul still needs credentials: [name]\n credentials List stored credential names and which agents have their\n own \u2014 names only, never values (also: credential list)\n credential remove\n Forget one (--agent <id> for that agent's own entry)\n schedules List every schedule the fleet has set \u2014 cadence, prompt,\n pre-authorized destination, next firing \u2014 straight from the\n daemon's database (--format json). \"stratus schedules\n cancel <id>\" stops the next firing and revokes the\n destination that was approved with it\n (also: stratus schedule list / schedule cancel <id>)\n memory list Show an agent's live memory with the trust label each\n entry carries \u2014 user, agent, unknown (no recorded origin,\n or written in a conversation with someone not configured\n as a principal), external (recorded after reading content\n from outside). --trust <level> filters; --format json\n memory reassert Re-label entries as an operator: stratus memory reassert\n <agent> --trust user <id>..., or --all-unknown for every\n entry with no recorded origin (the upgrade case; an\n entry recorded unknown \u2014 a stranger's message, a shell\n command \u2014 is left for you to name by id). Appends\n a record to ~/.stratus/memory.jsonl; a running daemon\n sees it on its next turn. The only way a label ever\n rises \u2014 no tool can do this\n session rollover Start a conversation over under the same session id,\n archiving its transcript so far \u2014 for a long-lived\n session (a Slack DM) that predates provenance tracking\n and would otherwise write unknown forever. Asks the\n running daemon (--gateway, --token)\n agent new Create an agent identity (generates a human-ish name + avatar theme)\n agents List your agents: who they are, where their souls live, what\n they run on, what they remember (also: stratus agent list).\n --gateway <url> asks a running daemon instead of resolving\n locally, authenticating with ~/.stratus/gateway-token\n (override with --token or STRATUS_GATEWAY_TOKEN)\n doctor Show what a run would use right now \u2014 provider, model, soul \u2014\n and which file or environment variable decided each, then\n flag anything that would surprise you (--format json)\n update The whole upgrade dance, in the order that cannot lose\n data: stop stratusd, upgrade the package from npm, run\n pending state migrations, rewrite the service unit with\n current node/entrypoint paths, restart. --check reports\n what it would do without doing any of it (exits 1 when\n something is actionable). Works offline too \u2014 an\n unreachable npm skips the upgrade but still migrates and\n repairs the unit\n dashboard Open the web dashboard: finds a running daemon (or starts one),\n mints a single-use sign-in link, and opens your browser at it.\n Needs @stratusagent/control-api and @stratusagent/dashboard\n help Show this help message\n\nAgent options:\n --name Agent name (omit to have one generated)\n --instructions The agent's persona/instructions\n --format Output format for agent new: text, json, or soul (a ready-to-edit soul file)\n\nOptions:\n --prompt, -p Prompt to send to the local agent loop\n --stdin Read the prompt from stdin\n --provider Provider to use: anthropic, openai, codex, or demo\n --model Model name for real providers (anthropic default: claude-opus-5, openai default: gpt-4.1-mini, codex default: gpt-5.5)\n --base-url Override the provider API base URL\n --soul Run as the agent defined by a soul file (markdown + frontmatter, see examples/souls)\n --config Config file path (run: load settings from it, setup: write it)\n --format Output format: text or json (default: text)\n --no-events Hide event-by-event progress lines in text mode\n --approvals run/chat: tool approval mode \u2014 always, ask, or never (default: always)\n serve: how the daemon reaches a human \u2014 headless (refuse every\n gated call) or remote (ask in Slack). Default headless, or\n the config file's \"approvals.mode\"\n --max-turns Maximum provider turns per run (default: 8)\n --port dashboard: port for a daemon it starts (default: 4123)\n --host dashboard: host for a daemon it starts (default: 127.0.0.1)\n --no-open Do not open the browser automatically\n --gateway agents / skill reload / restart / session rollover: a running\n daemon's control API (all but agents default to the daemon\n ~/.stratus/gateway.json names)\n --trust memory list: show only this label; memory reassert: the\n label to record (user, agent, unknown, external)\n --all-unknown memory reassert: every live entry with no recorded origin\n --token Bearer token for --gateway (default: ~/.stratus/gateway-token)\n --no-reload skill add: install without reloading a running daemon\n --reason restart: why, for the daemon's log\n --drain-timeout restart: seconds the daemon lets in-flight turns finish\n before aborting them (default: 30)\n --no-api serve: do not serve the control API\n --api serve: serve it even where the config says api.enabled: false\n --api-host serve: control API interface (default: 127.0.0.1)\n --api-port serve: control API port (default: 4123, 0 for any free port)\n --help, -h Show this help message\n\nConfig file:\n The CLI looks for ./stratus.config.json first, then a path from --config / STRATUS_CONFIG,\n then the global ~/.stratus/config.json written by `stratus setup`.\n A \"soul\" key (or STRATUS_SOUL) points at a soul file so every run uses that agent.\n\nPlugins (tools):\n Capability is optional: install a package, then list it under \"plugins\" in a\n TRUSTED config (--config, STRATUS_CONFIG, or ~/.stratus/config.json), keyed by\n package name. A plugin runs inside this process, so an auto-discovered\n project-local stratus.config.json may not enable one.\n\n \"plugins\": {\n \"@stratusagent/tool-fs\": { \"enabled\": true, \"roots\": [\"~/notes\"],\n \"agents\": { \"ava\": { \"roots\": [\"~/work/ava\"] } } },\n \"@stratusagent/tool-web\": { \"enabled\": true }\n }\n\n Available: @stratusagent/tool-fs (fs.read/list/search/write),\n @stratusagent/tool-shell (shell.run), @stratusagent/tool-web (web.fetch),\n @stratusagent/tool-browser (browser.goto/read/screenshot/act).\n Installing one grants no agent anything \u2014 each soul lists what it may call.\n\nSoul files:\n A soul file is markdown with frontmatter (name, provider, model, tools, skills, credentials)\n followed by the agent's persona in prose. See examples/souls/ava.md.\n \"tools\" takes exact names or a whole toolset: tools: [fs.read, fs.search] or\n tools: [fs.*]. Omitted means every registered tool.\n \"skills\" is the same allowlist shape over installed skills (see stratus\n skills), except omitted means none \u2014 a skill is enabled per agent, never\n by being installed.\n";
388
- declare const stringifyValue: (value: JsonValue) => string;
389
- export declare const parseCommand: (argv: string[], env?: CliEnvironment) => ParsedCommand;
390
- export declare const formatEvent: (event: StratusEvent) => string | null;
391
- /**
392
- * The fields worth keeping per event type. Tool inputs and message text
393
- * are deliberately excluded: the log is a trace of what happened, not a
394
- * second copy of the transcript.
395
- *
396
- * The approval pair is the one place the trace carries a person's id, and
397
- * it earns it: `always` widens what an agent may do unattended for the rest
398
- * of the session, and "who decided that" is unanswerable afterwards from
399
- * anything else. The refusal path is warned about by `onDecision`, but an
400
- * *approval* produces no warning at all — without these two records a
401
- * granted permission leaves no trace whatsoever. Still no tool input: what
402
- * was asked is here, what it was asked with is not.
403
- */
404
- export declare const eventDetail: (event: StratusEvent) => Record<string, unknown> | undefined;
405
- /**
406
- * Kept with its historical CLI signature: a parsed run command is a
407
- * RuntimeSelection plus CLI-only fields the resolver ignores.
408
- *
409
- * Those fields are *permitted*, not required. Demanding a whole
410
- * `ParsedRunCommand` made the type claim the resolver cared about
411
- * `approvals`, `format`, and `events` — it reads none of them — so every
412
- * caller with a selection in hand had to invent values to get past it.
413
- */
414
- export declare const resolveRuntimeConfig: (command: RuntimeSelection & Partial<Omit<ParsedRunCommand, keyof RuntimeSelection>>, env?: CliEnvironment) => Promise<RuntimeConfig>;
415
- /**
416
- * A saved subscription sign-in silently demoted to per-token billing is the
417
- * one config surprise that costs money — an API key in the environment
418
- * outranks the stored credential, and the run otherwise looks identical.
419
- * Detected from the resolved config: an apiKey where the stored credential
420
- * is a subscription token means the environment won.
421
- */
422
- export declare const warnOnCredentialOverride: (runtime: RuntimeConfig, streams: CliStreams, env?: CliEnvironment) => Promise<void>;
423
- /**
424
- * What a local prompt asks about: the tool, where it would act when that is
425
- * a question at all, and the arguments.
426
- *
427
- * The origin is not in the arguments and cannot be — a `browser.act` call
428
- * carries a CSS selector, and `#submit` is equally "load more results" and
429
- * "confirm purchase". A prompt that showed only the selector would be
430
- * asking someone to authorize an effect whose location it withheld, which
431
- * is the same reason the daemon's prompt and the Slack request name it.
432
- */
433
- export declare const describeApprovalCall: (context: ApprovalContext) => string;
434
- export declare const createApprovalPolicy: (mode: CliApprovalMode, streams: CliStreams, env: CliEnvironment, ask?: (prompt: string) => Promise<string>) => ApprovalPolicy;
435
- export declare const runSingleLoop: (prompt: string, streams: CliStreams, options: {
436
- events?: boolean;
437
- runtime: RuntimeConfig;
438
- approvals?: CliApprovalMode;
439
- maxTurns?: number;
440
- env?: CliEnvironment;
441
- configPath?: string;
442
- }) => Promise<Session>;
443
- export declare const printSessionSummary: (session: Session, streams: CliStreams) => void;
444
- export declare const runChat: (command: ParsedChatCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
445
- export declare const openExternalUrl: (url: string) => Promise<void>;
446
- export declare const slackAppManifest: (agentName: string) => string;
447
- export declare const runSetup: (command: ParsedSetupCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
448
- export declare const runAgents: (command: ParsedAgentsCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
449
- /** One resolved setting, with the thing that decided it. */
450
- interface DoctorSetting {
451
- value: string;
452
- source: string;
453
- }
454
- export interface DoctorReport {
455
- configInUse?: string;
456
- /** Config files that exist but lost to `configInUse`, nearest first. */
457
- configShadowed: string[];
458
- provider: DoctorSetting;
459
- model?: DoctorSetting;
460
- soul?: DoctorSetting;
461
- agent?: string;
462
- /** The model a failing run retries on, when one is configured. */
463
- fallback?: {
464
- provider: string;
465
- model: string;
466
- };
467
- signIns: Array<{
468
- provider: CredentialProviderName;
469
- status: string;
470
- }>;
471
- slackAgents: string[];
472
- slackPackageInstalled: boolean;
473
- rosterCount: number;
474
- problems: string[];
475
- }
476
- /**
477
- * `stratus doctor` — what a run would resolve to right now, and which file
478
- * or variable decided each part. Every "why is it using X" question needs
479
- * the precedence chain, and reading it out of the source is not something
480
- * anyone should have to do.
481
- */
482
- export declare const collectDoctorReport: (command: ParsedDoctorCommand, warn: (message: string) => void, env?: CliEnvironment) => Promise<DoctorReport>;
483
- export declare const runDoctor: (command: ParsedDoctorCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
484
- /**
485
- * `stratus logs` — the daemon's structured log, filtered. `serve` streams
486
- * to its own stdout, which is gone the moment it runs under a service
487
- * manager; this reads the file it also writes, from any terminal.
488
- */
489
- export declare const runLogs: (command: ParsedLogsCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
490
- /**
491
- * `stratus service` — run the daemon under launchd or systemd, so it
492
- * survives logout, crashes, and reboots. `serve` itself stays a plain
493
- * foreground process; this only tells the platform how to keep it up.
494
- */
495
- export declare const runService: (command: ParsedServiceCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
496
- export declare const runSkillAdd: (command: ParsedSkillAddCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
497
- /**
498
- * List and cancel what the fleet has scheduled — against the daemon's own
499
- * database, the way `stratus logs` reads the daemon's own log. WAL makes a
500
- * second process on the file routine; a running daemon re-reads due rows
501
- * every tick and the destination grant on every send, so a cancel from
502
- * here takes effect without asking it anything.
503
- */
504
- export declare const runSchedules: (command: ParsedSchedulesCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
505
- /**
506
- * `stratus credential set|list|remove`: the place a named credential goes.
507
- *
508
- * A credential nobody can add is a credential nobody has, which is why this
509
- * exists at all — a search backend asks for `search.apiKey` and until now
510
- * there was nowhere to put one. Three rules it keeps, all of them
511
- * deliberate:
512
- *
513
- * The value is read from **stdin, never from a flag**. A secret in argv is
514
- * a secret in shell history and in every `ps` on the machine.
515
- *
516
- * Nothing here ever prints a value back. `list` reports names and which
517
- * agents have their own, the same posture the control API's credential read
518
- * already keeps.
519
- *
520
- * And storing one grants no agent anything: the agent's soul still has to
521
- * list the name under `credentials:`, which is the per-identity gate.
522
- */
523
- export declare const runCredential: (command: ParsedCredentialCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
524
- /**
525
- * `stratus skill validate <target>`: the install-time check, run without
526
- * installing — for an author about to publish a skill, or an operator
527
- * asking why one was refused. A local path is a skill directory or a
528
- * directory of skills, discovered exactly as `skill add` would; a bare id
529
- * names an installed skill under `~/.stratus/skills/`. Exit 1 when
530
- * anything would be refused, so a publish step can gate on it.
531
- */
532
- export declare const runSkillValidate: (command: ParsedSkillValidateCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
533
- export declare const runSkillReload: (command: ParsedSkillReloadCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
534
- /**
535
- * `stratus memory list|reassert` — the operator's half of provenance.
536
- *
537
- * `list` shows what an agent's store holds with the label each entry
538
- * carries, because an operator cannot re-assert what they cannot see.
539
- * `reassert` is the one way a label ever rises: it appends a re-assertion
540
- * record to the JSONL (never rewrites a line), so a running daemon — which
541
- * re-reads the file on every read — sees it at once. Operator only, on
542
- * purpose: no tool exposes this, because an agent re-labelling its own
543
- * memory as trusted is the attack writing its own permission slip.
544
- *
545
- * `--all-unknown` exists for the upgrade: every entry written before labels
546
- * existed reads `unknown`, and the injected slice of such a store makes
547
- * every session `unknown` on its first turn. Re-asserting the entries the
548
- * agent actually surfaces, once, is the bounded work that drains it.
549
- */
550
- export declare const runMemory: (command: ParsedMemoryCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
551
- /**
552
- * `stratus session rollover <id>` — start a conversation over under the
553
- * same id, archiving its transcript so far. The daemon does the work, on
554
- * the session's own chain, so a turn cannot interleave; this only asks.
555
- */
556
- export declare const runSessionRollover: (command: ParsedSessionCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
557
- export declare const runRestart: (command: ParsedRestartCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
558
- export declare const runSkills: (streams: CliStreams, env?: CliEnvironment) => Promise<number>;
559
- /**
560
- * The provider/model a newly created soul pins. Frontmatter pins what a run
561
- * from this directory would actually use: env vars outrank the active
562
- * config file (project-local or explicit first, global otherwise), and no
563
- * provider anywhere falls back to demo — the exact precedence of stratus
564
- * run. Demo produces no model at all: the soul keeps following the
565
- * machine's configuration instead of demanding credentials nothing has
566
- * signed in for. The active config's model was written for the provider
567
- * named in that config, so it only travels into the soul when they still
568
- * match; otherwise the selected provider's own default model stands in.
569
- *
570
- * Exported for tests: the interactive path that consumes it needs a TTY.
571
- */
572
- export declare const soulPinForNewAgent: (activeConfig: StratusConfigFile, processEnv: NodeJS.ProcessEnv) => {
573
- provider: StratusProviderName;
574
- model?: string;
575
- };
576
- export declare const runAgentNew: (command: ParsedAgentNewCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
577
- /**
578
- * `stratus dashboard` — open the web UI against a running daemon, starting
579
- * one in the foreground when there is none.
580
- *
581
- * The daemon is started by calling `runServe`, not by rebuilding its wiring:
582
- * channels, approvals, the credential preflight, and the log writer are all
583
- * decisions `serve` already makes, and a second copy of them here would drift
584
- * the first time either side gained a rule.
585
- */
586
- export declare const runDashboard: (command: ParsedDashboardCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
587
- /** Reports whether an optional package is installed. */
588
- export type PackageResolver = (specifier: string) => boolean;
589
- /**
590
- * `stratus serve` — run the gateway (stratusd) in the foreground: load the
591
- * roster, accept dispatches, print events, and drain cleanly on SIGTERM,
592
- * SIGINT, or the injected shutdown signal.
593
- */
594
- /**
595
- * What a daemon exits with to ask for a fresh process. Only ever seen by the
596
- * supervisor below, which is the only thing that starts a daemon with the
597
- * environment marker that makes it exit this way instead of supervising.
598
- */
599
- export declare const RESTART_EXIT_CODE = 75;
600
- /**
601
- * What a daemon exits with when a restart could not drain — a turn that
602
- * ignored its abort, a plugin or channel that did not let go. Distinct from
603
- * the restart status on purpose: the supervisor answers this one by
604
- * exiting with it too, so the process the service manager started ends
605
- * and the manager restarts the whole unit — under systemd, cleaning the
606
- * cgroup of whatever the plugin left running. A supervisor that started
607
- * another daemon instead would keep that cgroup, and its leaks, alive.
608
- */
609
- export declare const UNDRAINED_RESTART_EXIT_CODE = 76;
610
- /**
611
- * The parsed serve command as arguments again — what the fresh daemon is
612
- * started with. From the command, not from `process.argv`: `stratus
613
- * dashboard` runs the daemon through `runServe` with a command it built,
614
- * and the process's own arguments would start a second dashboard.
615
- */
616
- export declare const serveArgv: (command: ParsedServeCommand) => string[];
617
- /**
618
- * The `bin` beside the module at `moduleUrl`, with that module's own
619
- * extension: `dist/index.js` respawns `dist/bin.js`, and a source checkout
620
- * running `src/index.ts` under type stripping respawns `src/bin.ts` — the
621
- * flags that made that possible travel in `process.execArgv`. Assuming
622
- * compiled output would hand a source checkout a file that does not exist,
623
- * and a daemon that never comes back.
624
- */
625
- export declare const restartEntrypoint: (moduleUrl: string) => string;
626
- export declare const runServe: (command: ParsedServeCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
627
- export declare const runCli: ({ argv, streams, env }: CliRunOptions) => Promise<number>;
628
- export { HELP_TEXT, stringifyValue };
5
+ export { type CliStreams, type CliEnvironment, type DashboardSession, type SupervisorMessage, type SupervisorLink, type RestartHandoff, type RespawnResult, type PackageInstallResult, type PackageInstaller, type PackageVersionFetcher, type PackageResolver, } from './environment.ts';
6
+ export { SUPPORTED_NODE_RANGE, unsupportedNodeMessage, withoutSqliteExperimentalWarning, filterSqliteExperimentalWarning, } from './preflight.ts';
7
+ export { VERSION_LOOKUP_TIMEOUT_MS, compareVersions, npmNeedsShell, isPackageName, isInstallableSpecifier, CLI_VERSION, } from './npm.ts';
8
+ export { stringifyValue } from './io.ts';
9
+ export { HELP_TEXT } from './help.ts';
10
+ export { type CliProviderName, type CliApprovalMode, type ParsedRunCommand, type ParsedDashboardCommand, type ParsedSetupCommand, type ParsedAgentNewCommand, type ParsedChatCommand, type ParsedTemplateAddCommand, type ParsedSkillAddCommand, type ParsedSkillValidateCommand, type ParsedPluginsCommand, type ParsedSkillsCommand, CREDENTIAL_NAME_PATTERN, type ParsedCredentialCommand, type ParsedSkillReloadCommand, type ParsedRestartCommand, type ParsedAgentsCommand, type ParsedSchedulesCommand, type ParsedGrantsCommand, type ParsedMemoryCommand, type ParsedSessionCommand, type ParsedDoctorCommand, type ParsedUpdateCommand, type ParsedServiceCommand, type ParsedLogsCommand, type ServeApprovalMode, type ParsedServeCommand, type ParsedHelpCommand, type ParsedCommand, parseCommand, } from './parse.ts';
11
+ export { formatEvent, eventDetail } from './events.ts';
12
+ export { describeApprovalCall, createApprovalPolicy } from './approvals.ts';
13
+ export { resolveRuntimeConfig, warnOnCredentialOverride, runSingleLoop, printSessionSummary, } from './runtime.ts';
14
+ export { menuPrefixWidth } from './prompter.ts';
15
+ export { slackAppManifest } from './slack.ts';
16
+ export { RESTART_EXIT_CODE, UNDRAINED_RESTART_EXIT_CODE, serveArgv, restartEntrypoint, } from './supervisor.ts';
17
+ export { runChat } from './commands/chat.ts';
18
+ export { runSetup } from './commands/setup.ts';
19
+ export { runAgents } from './commands/agents.ts';
20
+ export { type DoctorReport, collectDoctorReport, runDoctor } from './commands/doctor.ts';
21
+ export { runLogs } from './commands/logs.ts';
22
+ export { runService } from './commands/service.ts';
23
+ export { runTemplateAdd } from './commands/template.ts';
24
+ export { runSkillAdd, runSkillValidate, runSkillReload, runSkills } from './commands/skills.ts';
25
+ export { type PluginToolReport, type PluginReport, type PluginsReport, collectPluginsReport, runPlugins, } from './commands/plugins.ts';
26
+ export { runGrants } from './commands/grants.ts';
27
+ export { runSchedules } from './commands/schedules.ts';
28
+ export { runCredential } from './commands/credential.ts';
29
+ export { runMemory } from './commands/memory.ts';
30
+ export { runSessionRollover } from './commands/session.ts';
31
+ export { runRestart } from './commands/restart.ts';
32
+ export { soulPinForNewAgent, runAgentNew } from './commands/agent-new.ts';
33
+ export { openExternalUrl, runDashboard } from './commands/dashboard.ts';
34
+ export { runServe } from './commands/serve.ts';
35
+ export { type CliRunOptions, runCli } from './main.ts';
629
36
  //# sourceMappingURL=index.d.ts.map