@stratusagent/cli 0.11.4 → 0.11.6

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 (72) hide show
  1. package/README.md +14 -2
  2. package/dist/commands/doctor.d.ts.map +1 -1
  3. package/dist/commands/doctor.js +39 -1
  4. package/dist/commands/doctor.js.map +1 -1
  5. package/dist/commands/grants.d.ts.map +1 -1
  6. package/dist/commands/grants.js +10 -4
  7. package/dist/commands/grants.js.map +1 -1
  8. package/dist/commands/memory.d.ts +16 -3
  9. package/dist/commands/memory.d.ts.map +1 -1
  10. package/dist/commands/memory.js +322 -16
  11. package/dist/commands/memory.js.map +1 -1
  12. package/dist/commands/plugins.d.ts.map +1 -1
  13. package/dist/commands/plugins.js +1 -5
  14. package/dist/commands/plugins.js.map +1 -1
  15. package/dist/commands/schedules.d.ts.map +1 -1
  16. package/dist/commands/schedules.js +140 -31
  17. package/dist/commands/schedules.js.map +1 -1
  18. package/dist/commands/serve.d.ts.map +1 -1
  19. package/dist/commands/serve.js +55 -3
  20. package/dist/commands/serve.js.map +1 -1
  21. package/dist/commands/setup.d.ts.map +1 -1
  22. package/dist/commands/setup.js +34 -15
  23. package/dist/commands/setup.js.map +1 -1
  24. package/dist/commands/template.d.ts.map +1 -1
  25. package/dist/commands/template.js +13 -7
  26. package/dist/commands/template.js.map +1 -1
  27. package/dist/commands/update.d.ts +0 -17
  28. package/dist/commands/update.d.ts.map +1 -1
  29. package/dist/commands/update.js +76 -32
  30. package/dist/commands/update.js.map +1 -1
  31. package/dist/companions.d.ts +34 -0
  32. package/dist/companions.d.ts.map +1 -0
  33. package/dist/companions.js +45 -0
  34. package/dist/companions.js.map +1 -0
  35. package/dist/daemon.d.ts.map +1 -1
  36. package/dist/daemon.js +3 -0
  37. package/dist/daemon.js.map +1 -1
  38. package/dist/events.d.ts.map +1 -1
  39. package/dist/events.js +27 -9
  40. package/dist/events.js.map +1 -1
  41. package/dist/help.d.ts +1 -1
  42. package/dist/help.d.ts.map +1 -1
  43. package/dist/help.js +31 -3
  44. package/dist/help.js.map +1 -1
  45. package/dist/index.d.ts +1 -1
  46. package/dist/index.d.ts.map +1 -1
  47. package/dist/index.js +1 -1
  48. package/dist/index.js.map +1 -1
  49. package/dist/main.d.ts.map +1 -1
  50. package/dist/main.js +14 -3
  51. package/dist/main.js.map +1 -1
  52. package/dist/npm.d.ts +1 -1
  53. package/dist/npm.js +1 -1
  54. package/dist/parse.d.ts +25 -2
  55. package/dist/parse.d.ts.map +1 -1
  56. package/dist/parse.js +66 -9
  57. package/dist/parse.js.map +1 -1
  58. package/dist/runtime.d.ts.map +1 -1
  59. package/dist/runtime.js +5 -4
  60. package/dist/runtime.js.map +1 -1
  61. package/dist/service.d.ts +23 -0
  62. package/dist/service.d.ts.map +1 -1
  63. package/dist/service.js +41 -2
  64. package/dist/service.js.map +1 -1
  65. package/dist/slack.d.ts.map +1 -1
  66. package/dist/slack.js +9 -0
  67. package/dist/slack.js.map +1 -1
  68. package/dist/trusted-config.d.ts +30 -1
  69. package/dist/trusted-config.d.ts.map +1 -1
  70. package/dist/trusted-config.js +53 -0
  71. package/dist/trusted-config.js.map +1 -1
  72. package/package.json +26 -25
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAUpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AA6CvD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS,GACpB,SAAS,mBAAmB,EAC5B,SAAS,UAAU,EACnB,KAAK,cAAc,KAClB,OAAO,CAAC,MAAM,CAuPhB,CAAC"}
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AASpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAwDvD,eAAO,MAAM,SAAS,GACpB,SAAS,mBAAmB,EAC5B,SAAS,UAAU,EACnB,KAAK,cAAc,KAClB,OAAO,CAAC,MAAM,CA+RhB,CAAC"}
@@ -1,37 +1,10 @@
1
1
  import { readFile, writeFile } from 'node:fs/promises';
2
- import { newerStateMessage, pendingStateMigrations, readStateStamp, runStateMigrations, STATE_SCHEMA_VERSION, } from '@stratusagent/state';
2
+ import { newerStateMessage, pendingStateMigrations, readStateStamp, applyPerAgentWorkspaces, workspaceRepairPending, runStateMigrations, STATE_SCHEMA_VERSION, } from '@stratusagent/state';
3
3
  import { installService, readServiceCommand, readServiceStatus, serviceUnitPath, startService, stopService, } from "../service.js";
4
- import { serviceEnvFor } from "../daemon.js";
4
+ import { legacyDaemonServing, serviceEnvFor } from "../daemon.js";
5
5
  import { writeLine, pathExists } from "../io.js";
6
- import { defaultPackageVersionFetcher, compareVersions, defaultPackageInstaller, defaultInstalledVersionReader, CLI_VERSION, CLI_PACKAGE_NAME, } from "../npm.js";
7
- import { FIRST_PARTY_CAPABILITY_PACKAGES, FIRST_PARTY_CONTRIBUTION_PACKAGES, FIRST_PARTY_COMPANION_PACKAGES, } from "../plugin-catalog.js";
8
- /**
9
- * The first-party packages installed beside the CLI, and whether each one
10
- * lags the version the CLI is heading for.
11
- *
12
- * The gap this closes: the CLI and its companions are separate global
13
- * installs, so upgrading `@stratusagent/cli` left every one of them at
14
- * whatever version was installed the day setup first ran. A Slack adapter
15
- * two releases behind the daemon loading it is not a configuration anyone
16
- * chose, and nothing reported it — `doctor` says "installed", which was
17
- * true of the stale one too.
18
- *
19
- * Read from each package's own manifest rather than asked of npm: the
20
- * question is what this machine has, one registry round trip per package
21
- * would answer a different one, and they ship in lockstep so the CLI's
22
- * target version is theirs.
23
- */
24
- const readCompanions = async (target, env) => {
25
- const read = env.installedVersionReader ?? defaultInstalledVersionReader;
26
- const found = [];
27
- for (const name of [...FIRST_PARTY_COMPANION_PACKAGES, ...FIRST_PARTY_CAPABILITY_PACKAGES, ...FIRST_PARTY_CONTRIBUTION_PACKAGES]) {
28
- const version = await read(name);
29
- if (version !== undefined) {
30
- found.push({ name, version, stale: compareVersions(target, version) > 0 });
31
- }
32
- }
33
- return found;
34
- };
6
+ import { defaultPackageVersionFetcher, compareVersions, defaultPackageInstaller, CLI_VERSION, CLI_PACKAGE_NAME, } from "../npm.js";
7
+ import { readCompanions } from "../companions.js";
35
8
  /**
36
9
  * `stratus update` — the whole upgrade dance, in the order that cannot lose
37
10
  * data: stop the service (so no daemon holds the session database while
@@ -49,6 +22,40 @@ const readCompanions = async (target, env) => {
49
22
  * check and package upgrade but still migrates and rewrites the unit —
50
23
  * which is exactly the repair the offline case needs.
51
24
  */
25
+ /**
26
+ * Hold the home for the duration of the migration, or say why we could not.
27
+ *
28
+ * `stratus update` stops the *managed* service, which is not the same
29
+ * question as whether anything is serving: a daemon in a foreground
30
+ * `stratus serve`, or under a supervisor this command knows nothing about,
31
+ * leaves `readServiceStatus` with nothing to report and nothing to stop.
32
+ * Asserting exclusivity there would move the session database and the grant
33
+ * files out from under a daemon still writing them — losing the turns it
34
+ * saves afterwards, and reviving the grants it revokes.
35
+ *
36
+ * So the same two checks `serve` uses decide it: the home claim, and the
37
+ * probe for a daemon old enough to predate the claim. Failing either, the
38
+ * marked migrations stay pending and the operator is told what to stop —
39
+ * a deferral is recoverable, and moving live state is not.
40
+ */
41
+ const claimExclusiveHome = async (env) => {
42
+ const { claimHome, HomeClaimedError } = await import('@stratusagent/gateway');
43
+ let claim;
44
+ try {
45
+ claim = claimHome(env);
46
+ }
47
+ catch (error) {
48
+ if (error instanceof HomeClaimedError) {
49
+ return { held: false, reason: 'its lock is held', release: () => { } };
50
+ }
51
+ throw error;
52
+ }
53
+ if (await legacyDaemonServing(env)) {
54
+ claim.release();
55
+ return { held: false, reason: 'a daemon predating the lock is still answering', release: () => { } };
56
+ }
57
+ return { held: true, reason: '', release: () => claim.release() };
58
+ };
52
59
  export const runUpdate = async (command, streams, env) => {
53
60
  const serviceEnv = serviceEnvFor(env);
54
61
  const out = (line) => writeLine(streams.stdout, line);
@@ -202,11 +209,44 @@ export const runUpdate = async (command, streams, env) => {
202
209
  ? 'Skipping the package upgrade — npm did not answer.'
203
210
  : 'Package already up to date.');
204
211
  }
212
+ // Stopping the *managed* service is not the same as having the home to
213
+ // ourselves, and the marked migrations are told which one this is. A
214
+ // daemon running in a foreground `stratus serve`, or under a supervisor
215
+ // this command knows nothing about, leaves `readServiceStatus` reporting
216
+ // nothing to stop — and asserting exclusivity there would move the
217
+ // session database and the grant files out from under a daemon still
218
+ // writing them. So exclusivity is *established*, the way `serve`
219
+ // establishes it, rather than assumed from the stop above.
220
+ // Inside the recovery block, not before it. Establishing exclusivity can
221
+ // fail on its own — a lock file that will not open, a home whose
222
+ // permissions changed — and this command has already stopped the managed
223
+ // service by the time it gets here. Thrown from outside, that left the
224
+ // fleet down with no restart and no unit rewrite, over an error that had
225
+ // nothing to do with the migrations.
226
+ let claim;
205
227
  let applied;
206
228
  try {
207
- applied = await runStateMigrations(env);
229
+ claim = await claimExclusiveHome(env);
230
+ if (!claim.held) {
231
+ writeLine(streams.stderr, `Another stratusd is serving this home (${claim.reason}), so the per-agent state move is left pending — `
232
+ + 'everything else still applied. Stop that daemon and run `stratus update` again to finish it.');
233
+ }
234
+ applied = await runStateMigrations(env, claim.held ? { exclusive: true } : {});
235
+ // And the workspace pass again, for the same reason `serve` runs it:
236
+ // the schema stamp is not what makes that move safe, so a workspace an
237
+ // older build left at the legacy path is folded whenever something
238
+ // holding the home comes past. This is the remedy for a home that has
239
+ // no daemon at all — `stratus run` takes no claim, so it cannot do this,
240
+ // and `stratus doctor` names it and points here.
241
+ if (claim.held && await workspaceRepairPending(env)) {
242
+ const repaired = await applyPerAgentWorkspaces(env);
243
+ if (repaired !== undefined) {
244
+ writeLine(streams.stdout, `workspace layout: ${repaired}`);
245
+ }
246
+ }
208
247
  }
209
248
  catch (error) {
249
+ claim?.release();
210
250
  // A daemon stopped for an update that then failed must not stay down:
211
251
  // the old unit is still in place (the rewrite has not happened), so
212
252
  // restarting restores the world the update found. The failure is still
@@ -223,6 +263,10 @@ export const runUpdate = async (command, streams, env) => {
223
263
  }
224
264
  return 1;
225
265
  }
266
+ // Before the restart below: the replacement claims the home next, and a
267
+ // claim this process still held would refuse it. Idempotent, so the
268
+ // failure path above having released it already costs nothing.
269
+ claim.release();
226
270
  if (applied.length === 0) {
227
271
  out('No pending state migrations.');
228
272
  }
@@ -1 +1 @@
1
- {"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,cAAc,EACd,kBAAkB,EAClB,oBAAoB,GAErB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,uBAAuB,EACvB,6BAA6B,EAC7B,WAAW,EACX,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,+BAA+B,EAC/B,iCAAiC,EACjC,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAS9B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,cAAc,GAAG,KAAK,EAC1B,MAAc,EACd,GAAmB,EACU,EAAE;IAC/B,MAAM,IAAI,GAAG,GAAG,CAAC,sBAAsB,IAAI,6BAA6B,CAAC;IACzE,MAAM,KAAK,G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AAC,CAAC;IAC3F,CAAC;IAED,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { CliEnvironment } from './environment.ts';
2
+ /** One first-party package this machine has, and how it compares to a target version. */
3
+ export interface CompanionPackage {
4
+ name: string;
5
+ version: string;
6
+ stale: boolean;
7
+ }
8
+ /**
9
+ * The first-party packages installed beside the CLI, and whether each one
10
+ * lags `target`.
11
+ *
12
+ * The gap this closes: the CLI and its companions are separate global
13
+ * installs, so upgrading `@stratusagent/cli` left every one of them at
14
+ * whatever version was installed the day setup first ran. A Slack adapter
15
+ * two releases behind the daemon loading it is not a configuration anyone
16
+ * chose, and nothing reported it — `doctor` said "installed", which was
17
+ * true of the stale one too.
18
+ *
19
+ * Read from each package's own manifest rather than asked of npm: the
20
+ * question is what this machine has, one registry round trip per package
21
+ * would answer a different one, and they ship in lockstep so the CLI's
22
+ * version is theirs.
23
+ */
24
+ export declare const readCompanions: (target: string, env: CliEnvironment) => Promise<CompanionPackage[]>;
25
+ /**
26
+ * The sentence `doctor` and `serve` both say about companions this build
27
+ * has outgrown. `stratus update` is the only upgrade path that brings them
28
+ * along, and one that predates it — an update run by a CLI older than
29
+ * 0.11.3, or a plain `npm install -g @stratusagent/cli` — left a Slack
30
+ * adapter at 0.6.0 under a 0.11.4 daemon, missing every thread feature
31
+ * shipped in between while `doctor` reported it installed.
32
+ */
33
+ export declare const companionsBehindMessage: (stale: readonly CompanionPackage[]) => string;
34
+ //# sourceMappingURL=companions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"companions.d.ts","sourceRoot":"","sources":["../src/companions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAQvD,yFAAyF;AACzF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,GACzB,QAAQ,MAAM,EACd,KAAK,cAAc,KAClB,OAAO,CAAC,gBAAgB,EAAE,CAU5B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,SAAS,gBAAgB,EAAE,KAAG,MAM5E,CAAC"}
@@ -0,0 +1,45 @@
1
+ import { compareVersions, defaultInstalledVersionReader, CLI_VERSION } from "./npm.js";
2
+ import { FIRST_PARTY_CAPABILITY_PACKAGES, FIRST_PARTY_CONTRIBUTION_PACKAGES, FIRST_PARTY_COMPANION_PACKAGES, } from "./plugin-catalog.js";
3
+ /**
4
+ * The first-party packages installed beside the CLI, and whether each one
5
+ * lags `target`.
6
+ *
7
+ * The gap this closes: the CLI and its companions are separate global
8
+ * installs, so upgrading `@stratusagent/cli` left every one of them at
9
+ * whatever version was installed the day setup first ran. A Slack adapter
10
+ * two releases behind the daemon loading it is not a configuration anyone
11
+ * chose, and nothing reported it — `doctor` said "installed", which was
12
+ * true of the stale one too.
13
+ *
14
+ * Read from each package's own manifest rather than asked of npm: the
15
+ * question is what this machine has, one registry round trip per package
16
+ * would answer a different one, and they ship in lockstep so the CLI's
17
+ * version is theirs.
18
+ */
19
+ export const readCompanions = async (target, env) => {
20
+ const read = env.installedVersionReader ?? defaultInstalledVersionReader;
21
+ const found = [];
22
+ for (const name of [...FIRST_PARTY_COMPANION_PACKAGES, ...FIRST_PARTY_CAPABILITY_PACKAGES, ...FIRST_PARTY_CONTRIBUTION_PACKAGES]) {
23
+ const version = await read(name);
24
+ if (version !== undefined) {
25
+ found.push({ name, version, stale: compareVersions(target, version) > 0 });
26
+ }
27
+ }
28
+ return found;
29
+ };
30
+ /**
31
+ * The sentence `doctor` and `serve` both say about companions this build
32
+ * has outgrown. `stratus update` is the only upgrade path that brings them
33
+ * along, and one that predates it — an update run by a CLI older than
34
+ * 0.11.3, or a plain `npm install -g @stratusagent/cli` — left a Slack
35
+ * adapter at 0.6.0 under a 0.11.4 daemon, missing every thread feature
36
+ * shipped in between while `doctor` reported it installed.
37
+ */
38
+ export const companionsBehindMessage = (stale) => {
39
+ const names = stale.map((entry) => `${entry.name} ${entry.version}`).join(', ');
40
+ const one = stale.length === 1;
41
+ return `${names} ${one ? 'is' : 'are'} older than this CLI (${CLI_VERSION}). `
42
+ + `They ship as one release, and the daemon runs whatever version is installed, so features and fixes after ${one ? 'that version are' : 'those versions are'} missing. `
43
+ + `Run \`stratus update\` to bring ${one ? 'it' : 'them'} level.`;
44
+ };
45
+ //# sourceMappingURL=companions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"companions.js","sourceRoot":"","sources":["../src/companions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvF,OAAO,EACL,+BAA+B,EAC/B,iCAAiC,EACjC,8BAA8B,GAC/B,MAAM,qBAAqB,CAAC;AAS7B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,MAAc,EACd,GAAmB,EACU,EAAE;IAC/B,MAAM,IAAI,GAAG,GAAG,CAAC,sBAAsB,IAAI,6BAA6B,CAAC;IACzE,MAAM,KAAK,GAAuB,EAAE,CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,8BAA8B,EAAE,GAAG,+BAA+B,EAAE,GAAG,iCAAiC,CAAC,EAAE,CAAC;QACjI,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC7E,CAAC;IACH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CAAC;AAeF;;;;;;;;;;;GAWG;AACH;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mBAAmB,GAAU,KAAK,cAAc,KAAG,OAAO,CAAC,OAAO,CAmB9E,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,KAAK,cAAc,KAAG,OAAO,CAAC,MAAM,CAS1E,CAAC"}
package/dist/daemon.js CHANGED
@@ -28,6 +28,9 @@ export const gatewayToken = async (env, explicit) => {
28
28
  export const serviceEnvFor = (env) => ({
29
29
  ...(env.homeDir !== undefined ? { homeDir: env.homeDir } : {}),
30
30
  cwd: readWorkingDirectory(env),
31
+ // The shell this was typed in, so an injected processEnv (tests, the
32
+ // control API) decides the unit's PATH rather than this process.
33
+ ...(readProcessEnv(env).PATH !== undefined ? { path: String(readProcessEnv(env).PATH) } : {}),
31
34
  ...(env.serviceRunner !== undefined ? { run: env.serviceRunner } : {}),
32
35
  ...(env.servicePlatform !== undefined ? { platform: env.servicePlatform } : {}),
33
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"daemon.js","sourceRoot":"","sources":["../src/daemon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAI7B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAC/B,GAAmB,EACnB,QAA4B,EACX,EAAE;IACnB,MAAM,OAAO,GAAG,kBAAkB,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,qBAAqB,CAAC,CAAC;IAC9E,IAAI,QAAQ,IAAI,OAAO,EAAE,CAAC;QACxB,OAAO,MAAM,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC;IACrC,CAAC;IACD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aAAa,EAAE,UAAU,KAAK,EAAE,EAAE;YAC7C,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC;SACnC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,EAAE,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,GAAmB,EAAmB,EAAE;IAC7E,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,IAAI,EAAE,GAAG,KAAK,SAAS,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;QAC9D,CAAC,CAAC,SAAS,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,GAAG;QACnC,CAAC,CAAC,iEAAiE,CAAC;IACtE,OAAO,4CAA4C,MAAM,kCAAkC;UACvF,yGAAyG;UACzG,8GAA8G;UAC9G,2BAA2B,CAAC;AAClC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,eAAO,MAAM,WAAW,GAAI,OAAO,YAAY,KAAG,MAAM,GAAG,IA6B1D,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,YAAY,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAyC3E,CAAC"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,eAAO,MAAM,WAAW,GAAI,OAAO,YAAY,KAAG,MAAM,GAAG,IA+B1D,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,YAAY,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAyD3E,CAAC"}
package/dist/events.js CHANGED
@@ -1,4 +1,4 @@
1
- import { FORGET_TOOL_NAME, MEMORY_TOOL_NAME } from '@stratusagent/agents';
1
+ import { FORGET_TOOL_NAME, MEMORY_TOOL_NAME, PIN_TOOL_NAME } from '@stratusagent/agents';
2
2
  export const formatEvent = (event) => {
3
3
  switch (event.type) {
4
4
  case 'session.created':
@@ -25,6 +25,8 @@ export const formatEvent = (event) => {
25
25
  return `• session.failed ${event.error}`;
26
26
  case 'session.tainted':
27
27
  return `• session.tainted ${event.trust} (${event.source})`;
28
+ case 'session.context-trimmed':
29
+ return `• session.context-trimmed dropped=${event.droppedMessages} floor=${event.floor}`;
28
30
  default:
29
31
  return null;
30
32
  }
@@ -52,17 +54,29 @@ export const eventDetail = (event) => {
52
54
  case 'tool.denied':
53
55
  return { tool: event.call.toolName };
54
56
  case 'tool.completed': {
55
- // A memory write or retirement names the entry it touched — the id
56
- // is a reference, not content, and "when did the agent learn/drop
57
- // this" is unanswerable later without it. The fact itself stays out
58
- // of the trace, like every other tool input and output.
57
+ // A memory write, retirement, supersession, or pin names the entry it
58
+ // touched — the id is a reference, not content, and "when did the
59
+ // agent learn, drop, replace, or pin this" is unanswerable later
60
+ // without it. The fact itself stays out of the trace, like every
61
+ // other tool input and output.
59
62
  const output = event.result.output;
60
- const entry = (event.result.toolName === MEMORY_TOOL_NAME || event.result.toolName === FORGET_TOOL_NAME)
63
+ const fields = (event.result.toolName === MEMORY_TOOL_NAME || event.result.toolName === FORGET_TOOL_NAME
64
+ || event.result.toolName === PIN_TOOL_NAME)
61
65
  && event.result.ok && typeof output === 'object' && output !== null && !Array.isArray(output)
62
- && typeof output.id === 'string'
63
- ? output.id
66
+ ? output
64
67
  : undefined;
65
- return { tool: event.result.toolName, ok: event.result.ok, ...(entry !== undefined ? { entry } : {}) };
68
+ const entry = typeof fields?.id === 'string' ? fields.id : undefined;
69
+ const supersedes = typeof fields?.supersedes === 'string' ? fields.supersedes : undefined;
70
+ const pinned = event.result.toolName === PIN_TOOL_NAME && typeof fields?.pinned === 'boolean'
71
+ ? fields.pinned
72
+ : undefined;
73
+ return {
74
+ tool: event.result.toolName,
75
+ ok: event.result.ok,
76
+ ...(entry !== undefined ? { entry } : {}),
77
+ ...(supersedes !== undefined ? { supersedes } : {}),
78
+ ...(pinned !== undefined ? { pinned } : {}),
79
+ };
66
80
  }
67
81
  case 'tool.approval-requested':
68
82
  return { tool: event.call.toolName, risk: event.risk, requestId: event.requestId };
@@ -80,6 +94,10 @@ export const eventDetail = (event) => {
80
94
  // `sender`, `legacy`. Never the content that did: same rule as every
81
95
  // other event here.
82
96
  return { trust: event.trust, source: event.source };
97
+ case 'session.context-trimmed':
98
+ // Counts, never the messages: the conversation that fell out of the
99
+ // window is exactly the kind of thing the log does not carry.
100
+ return { droppedMessages: event.droppedMessages, floor: event.floor };
83
101
  default:
84
102
  return undefined;
85
103
  }
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE1E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAmB,EAAiB,EAAE;IAChE,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,iBAAiB;YACpB,OAAO,qBAAqB,KAAK,CAAC,SAAS,EAAE,CAAC;QAChD,KAAK,iBAAiB;YACpB,OAAO,qBAAqB,KAAK,CAAC,MAAM,EAAE,CAAC;QAC7C,KAAK,kBAAkB;YACrB,OAAO,sBAAsB,KAAK,CAAC,SAAS,EAAE,CAAC;QACjD,KAAK,mBAAmB;YACtB,OAAO,uBAAuB,KAAK,CAAC,KAAK,CAAC,MAAM,UAAU,CAAC;QAC7D,KAAK,aAAa;YAChB,OAAO,iBA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AAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC5C,CAAC;QACJ,CAAC;QACD,KAAK,yBAAyB;YAC5B,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC;QACrF,KAAK,wBAAwB;YAC3B,OAAO;gBACL,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC/C,CAAC;QACJ,KAAK,gBAAgB;YACnB,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;QAChC,KAAK,iBAAiB;YACpB,8DAA8D;YAC9D,qEAAqE;YACrE,oBAAoB;YACpB,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;QACtD,KAAK,yBAAyB;YAC5B,oEAAoE;YACpE,8DAA8D;YAC9D,OAAO,EAAE,eAAe,EAAE,KAAK,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;QACxE;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC,CAAC"}
package/dist/help.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export 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 template add ./examples/templates/example\n stratus template add stratuslabs/template-oncall --yes\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 plugins\n stratus plugins --format json\n stratus skill reload\n stratus restart\n stratus schedules\n stratus schedules cancel <id>\n stratus grants ava\n stratus grants revoke ava --tool web.fetch\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 --version\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, enable the\n plugins it may use, connect it to Slack, choose who\n approves gated calls unattended, and test it \u2014 settings\n 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 template add Install a template \u2014 a folder (or GitHub repo) holding\n soul files, skills, and the plugin config they need. Prints\n every agent, skill, plugin package and config key it would\n add, then asks; --yes installs without asking, --force\n replaces an agent or skill already installed under the same\n name. Plugin packages the template's config.json names are\n installed with npm install -g and enabled in\n ~/.stratus/config.json, which needs a restart to take\n effect. See docs/guides/templates.md for the layout\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 plugins What this machine's plugins are, and where the chain from\n installed to callable breaks: whether the package resolves,\n whether a trusted config enables it, which agents' tools:\n lists select each tool it declares, and what the approval\n policy does with a gated call. Read from each package's\n manifest, so nothing is imported and no plugin's setup runs\n (--format json, --config <path>; also: stratus plugin 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 grants What an agent may do unattended beyond the built-in safe\n list \u2014 its standing tool grants, command scopes, and\n sites, each an \"always allow\" somebody answered. From the\n running daemon when one is serving (--gateway, --token),\n else from ~/.stratus/agents/<id>.whitelist.json; --format\n json. \"stratus grants revoke <agent> --tool <name> |\n --scope \"<command>\" | --origin <origin>\" takes one back,\n and a running daemon stops honouring it at once\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 \u2014\n together with every optional first-party package this\n machine has, which ship in lockstep with it \u2014 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, a companion left behind\n included). Works offline too \u2014 an unreachable npm skips\n the upgrade but still migrates and 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 version Print this build's version (also: --version, -v)\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, demo, or the name a plugin registers\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 (every call), gated (safe tools\n run, the rest ask), or never. Default: gated at a terminal; always\n otherwise, said once on stderr the first time a gated tool runs\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 -y, --yes template add: install without the review prompt\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 --version, -v Print this build's version and exit\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 \u2014\n from ~/.stratus/config.json or a file named with --config; an auto-discovered\n ./stratus.config.json does not get to choose a soul or a systemPrompt.\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, delegates)\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 \"delegates\" lists the agent ids this agent may hand work to with agent.delegate,\n or ['*'] for anyone on the roster; omitted means nobody.\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";
1
+ export 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 template add ./examples/templates/example\n stratus template add stratuslabs/template-oncall --yes\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 plugins\n stratus plugins --format json\n stratus skill reload\n stratus restart\n stratus schedules\n stratus schedules cancel <id>\n stratus grants ava\n stratus grants revoke ava --tool web.fetch\n stratus memory list ava\n stratus memory search ava deploy pipeline\n stratus memory pin ava ava:memory:...\n stratus memory export ava --file ava-memory.jsonl\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 --version\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, enable the\n plugins it may use, connect it to Slack, choose who\n approves gated calls unattended, and test it \u2014 settings\n 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 template add Install a template \u2014 a folder (or GitHub repo) holding\n soul files, skills, and the plugin config they need. Prints\n every agent, skill, plugin package and config key it would\n add, then asks; --yes installs without asking, --force\n replaces an agent or skill already installed under the same\n name. Plugin packages the template's config.json names are\n installed with npm install -g and enabled in\n ~/.stratus/config.json, which needs a restart to take\n effect. See docs/guides/templates.md for the layout\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 plugins What this machine's plugins are, and where the chain from\n installed to callable breaks: whether the package resolves,\n whether a trusted config enables it, which agents' tools:\n lists select each tool it declares, and what the approval\n policy does with a gated call. Read from each package's\n manifest, so nothing is imported and no plugin's setup runs\n (--format json, --config <path>; also: stratus plugin 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 grants What an agent may do unattended beyond the built-in safe\n list \u2014 its standing tool grants, command scopes, and\n sites, each an \"always allow\" somebody answered. From the\n running daemon when one is serving (--gateway, --token),\n else from ~/.stratus/agents/<id>/whitelist.json; --format\n json. \"stratus grants revoke <agent> --tool <name> |\n --scope \"<command>\" | --origin <origin>\" takes one back,\n and a running daemon stops honouring it at once\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) \u2014 plus what is pinned and what is outside\n its validity window. --trust <level> filters; --format json\n memory search Search one agent's memory the way the agent does: plain\n words, every one of which must appear in a fact or in\n what the fact is about. Expired facts are found and\n marked. --limit <n>; --format json\n memory forget Retire entries by id. They leave the prompt and recall\n and stay in the record, where audit still shows them\n memory audit Every entry the agent ever wrote, forgotten ones\n included, with which entry replaced which\n memory pin Keep entries in the agent's prompt every turn:\n stratus memory pin <agent> <id>.... The pinned core is\n capped at 2 KiB of content and refuses rather than\n evicting, so nothing already pinned is ever dropped.\n \"memory unpin\" takes one back\n memory export Write an agent's entries to JSONL (--file <path>, else\n stdout) \u2014 for moving an agent to another machine\n memory import Read that JSONL back into an agent (--file <path>).\n Imported entries land external, because a file from\n elsewhere may repeat what a stranger wrote;\n --preserve-trust keeps each recorded label instead, for\n a file you vouch for\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 \u2014\n together with every optional first-party package this\n machine has, which ship in lockstep with it \u2014 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, a companion left behind\n included). Works offline too \u2014 an unreachable npm skips\n the upgrade but still migrates and 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 version Print this build's version (also: --version, -v)\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, demo, or the name a plugin registers\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 (every call), gated (safe tools\n run, the rest ask), or never. Default: gated at a terminal; always\n otherwise, said once on stderr the first time a gated tool runs\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 tool turns per run before it wraps up (default: 40)\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 --limit memory search: maximum hits (the store bounds it too)\n --file memory export / import: the JSONL path\n --preserve-trust memory import: keep each entry's recorded trust label\n instead of landing it external\n --token Bearer token for --gateway (default: ~/.stratus/gateway-token)\n --no-reload skill add: install without reloading a running daemon\n -y, --yes template add: install without the review prompt\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 --version, -v Print this build's version and exit\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 \u2014\n from ~/.stratus/config.json or a file named with --config; an auto-discovered\n ./stratus.config.json does not get to choose a soul or a systemPrompt.\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, delegates)\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 \"delegates\" lists the agent ids this agent may hand work to with agent.delegate,\n or ['*'] for anyone on the roster; omitted means nobody.\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";
2
2
  //# sourceMappingURL=help.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,2rhBA4QrB,CAAC"}
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,uglBAwSrB,CAAC"}
package/dist/help.js CHANGED
@@ -30,6 +30,9 @@ Usage:
30
30
  stratus grants ava
31
31
  stratus grants revoke ava --tool web.fetch
32
32
  stratus memory list ava
33
+ stratus memory search ava deploy pipeline
34
+ stratus memory pin ava ava:memory:...
35
+ stratus memory export ava --file ava-memory.jsonl
33
36
  stratus memory reassert ava --trust user --all-unknown
34
37
  stratus session rollover slack:ava:T01ABCDEF:D07GHIJKL
35
38
  printf %s "$BRAVE_KEY" | stratus credential set search.apiKey
@@ -143,7 +146,7 @@ Commands:
143
146
  list — its standing tool grants, command scopes, and
144
147
  sites, each an "always allow" somebody answered. From the
145
148
  running daemon when one is serving (--gateway, --token),
146
- else from ~/.stratus/agents/<id>.whitelist.json; --format
149
+ else from ~/.stratus/agents/<id>/whitelist.json; --format
147
150
  json. "stratus grants revoke <agent> --tool <name> |
148
151
  --scope "<command>" | --origin <origin>" takes one back,
149
152
  and a running daemon stops honouring it at once
@@ -151,7 +154,28 @@ Commands:
151
154
  entry carries — user, agent, unknown (no recorded origin,
152
155
  or written in a conversation with someone not configured
153
156
  as a principal), external (recorded after reading content
154
- from outside). --trust <level> filters; --format json
157
+ from outside) — plus what is pinned and what is outside
158
+ its validity window. --trust <level> filters; --format json
159
+ memory search Search one agent's memory the way the agent does: plain
160
+ words, every one of which must appear in a fact or in
161
+ what the fact is about. Expired facts are found and
162
+ marked. --limit <n>; --format json
163
+ memory forget Retire entries by id. They leave the prompt and recall
164
+ and stay in the record, where audit still shows them
165
+ memory audit Every entry the agent ever wrote, forgotten ones
166
+ included, with which entry replaced which
167
+ memory pin Keep entries in the agent's prompt every turn:
168
+ stratus memory pin <agent> <id>.... The pinned core is
169
+ capped at 2 KiB of content and refuses rather than
170
+ evicting, so nothing already pinned is ever dropped.
171
+ "memory unpin" takes one back
172
+ memory export Write an agent's entries to JSONL (--file <path>, else
173
+ stdout) — for moving an agent to another machine
174
+ memory import Read that JSONL back into an agent (--file <path>).
175
+ Imported entries land external, because a file from
176
+ elsewhere may repeat what a stranger wrote;
177
+ --preserve-trust keeps each recorded label instead, for
178
+ a file you vouch for
155
179
  memory reassert Re-label entries as an operator: stratus memory reassert
156
180
  <agent> --trust user <id>..., or --all-unknown for every
157
181
  entry with no recorded origin (the upgrade case; an
@@ -211,7 +235,7 @@ Options:
211
235
  serve: how the daemon reaches a human — headless (refuse every
212
236
  gated call) or remote (ask in Slack). Default headless, or
213
237
  the config file's "approvals.mode"
214
- --max-turns Maximum provider turns per run (default: 8)
238
+ --max-turns Maximum tool turns per run before it wraps up (default: 40)
215
239
  --port dashboard: port for a daemon it starts (default: 4123)
216
240
  --host dashboard: host for a daemon it starts (default: 127.0.0.1)
217
241
  --no-open Do not open the browser automatically
@@ -221,6 +245,10 @@ Options:
221
245
  --trust memory list: show only this label; memory reassert: the
222
246
  label to record (user, agent, unknown, external)
223
247
  --all-unknown memory reassert: every live entry with no recorded origin
248
+ --limit memory search: maximum hits (the store bounds it too)
249
+ --file memory export / import: the JSONL path
250
+ --preserve-trust memory import: keep each entry's recorded trust label
251
+ instead of landing it external
224
252
  --token Bearer token for --gateway (default: ~/.stratus/gateway-token)
225
253
  --no-reload skill add: install without reloading a running daemon
226
254
  -y, --yes template add: install without the review prompt
package/dist/help.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uEAuM8C,uBAAuB,kDAAkD,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqElK,CAAC"}
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uEA+N8C,uBAAuB,kDAAkD,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyElK,CAAC"}
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export { HELP_TEXT } from './help.ts';
10
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, defaultApprovalMode, } from './parse.ts';
11
11
  export { formatEvent, eventDetail } from './events.ts';
12
12
  export { describeApprovalCall, createApprovalPolicy, describePrincipals } from './approvals.ts';
13
- export { loadServePrincipals } from './trusted-config.ts';
13
+ export { loadServePrincipals, loadServeSlack } from './trusted-config.ts';
14
14
  export { resolveRuntimeConfig, warnOnCredentialOverride, warnOnUntrustedConfig, runSingleLoop, printSessionSummary, } from './runtime.ts';
15
15
  export { menuPrefixWidth } from './prompter.ts';
16
16
  export { slackAppManifest } from './slack.ts';