@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.
- package/README.md +13 -7
- package/dist/approvals.d.ts +87 -0
- package/dist/approvals.d.ts.map +1 -0
- package/dist/approvals.js +315 -0
- package/dist/approvals.js.map +1 -0
- package/dist/commands/agent-new.d.ts +22 -0
- package/dist/commands/agent-new.d.ts.map +1 -0
- package/dist/commands/agent-new.js +154 -0
- package/dist/commands/agent-new.js.map +1 -0
- package/dist/commands/agents.d.ts +4 -0
- package/dist/commands/agents.d.ts.map +1 -0
- package/dist/commands/agents.js +90 -0
- package/dist/commands/agents.js.map +1 -0
- package/dist/commands/chat.d.ts +4 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +224 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/credential.d.ts +22 -0
- package/dist/commands/credential.d.ts.map +1 -0
- package/dist/commands/credential.js +93 -0
- package/dist/commands/credential.js.map +1 -0
- package/dist/commands/dashboard.d.ts +14 -0
- package/dist/commands/dashboard.d.ts.map +1 -0
- package/dist/commands/dashboard.js +195 -0
- package/dist/commands/dashboard.js.map +1 -0
- package/dist/commands/doctor.d.ts +40 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +357 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/grants.d.ts +19 -0
- package/dist/commands/grants.d.ts.map +1 -0
- package/dist/commands/grants.js +128 -0
- package/dist/commands/grants.js.map +1 -0
- package/dist/commands/logs.d.ts +9 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +58 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/memory.d.ts +20 -0
- package/dist/commands/memory.d.ts.map +1 -0
- package/dist/commands/memory.js +110 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/plugins.d.ts +91 -0
- package/dist/commands/plugins.d.ts.map +1 -0
- package/dist/commands/plugins.js +359 -0
- package/dist/commands/plugins.js.map +1 -0
- package/dist/commands/restart.d.ts +4 -0
- package/dist/commands/restart.d.ts.map +1 -0
- package/dist/commands/restart.js +25 -0
- package/dist/commands/restart.js.map +1 -0
- package/dist/commands/schedules.d.ts +11 -0
- package/dist/commands/schedules.d.ts.map +1 -0
- package/dist/commands/schedules.js +50 -0
- package/dist/commands/schedules.js.map +1 -0
- package/dist/commands/serve.d.ts +4 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +612 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/service.d.ts +9 -0
- package/dist/commands/service.d.ts.map +1 -0
- package/dist/commands/service.js +97 -0
- package/dist/commands/service.js.map +1 -0
- package/dist/commands/session.d.ts +9 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +25 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/setup.d.ts +5 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +2412 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/skills.d.ts +15 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +272 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/template.d.ts +4 -0
- package/dist/commands/template.d.ts.map +1 -0
- package/dist/commands/template.js +575 -0
- package/dist/commands/template.js.map +1 -0
- package/dist/commands/update.d.ts +21 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +291 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/daemon.d.ts +74 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +192 -0
- package/dist/daemon.js.map +1 -0
- package/dist/environment.d.ts +108 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +2 -0
- package/dist/environment.js.map +1 -0
- package/dist/events.d.ts +17 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +87 -0
- package/dist/events.js.map +1 -0
- package/dist/help.d.ts +2 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +266 -0
- package/dist/help.js.map +1 -0
- package/dist/index.d.ts +31 -624
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -6981
- package/dist/index.js.map +1 -1
- package/dist/io.d.ts +16 -0
- package/dist/io.d.ts.map +1 -0
- package/dist/io.js +45 -0
- package/dist/io.js.map +1 -0
- package/dist/loaders.d.ts +31 -0
- package/dist/loaders.d.ts.map +1 -0
- package/dist/loaders.js +56 -0
- package/dist/loaders.js.map +1 -0
- package/dist/main.d.ts +8 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +214 -0
- package/dist/main.js.map +1 -0
- package/dist/npm.d.ts +66 -0
- package/dist/npm.d.ts.map +1 -0
- package/dist/npm.js +201 -0
- package/dist/npm.js.map +1 -0
- package/dist/parse.d.ts +231 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +1082 -0
- package/dist/parse.js.map +1 -0
- package/dist/plugin-catalog.d.ts +35 -0
- package/dist/plugin-catalog.d.ts.map +1 -0
- package/dist/plugin-catalog.js +58 -0
- package/dist/plugin-catalog.js.map +1 -0
- package/dist/preflight.d.ts +60 -0
- package/dist/preflight.d.ts.map +1 -0
- package/dist/preflight.js +102 -0
- package/dist/preflight.js.map +1 -0
- package/dist/prompter.d.ts +84 -0
- package/dist/prompter.d.ts.map +1 -0
- package/dist/prompter.js +347 -0
- package/dist/prompter.js.map +1 -0
- package/dist/roster.d.ts +57 -0
- package/dist/roster.d.ts.map +1 -0
- package/dist/roster.js +78 -0
- package/dist/roster.js.map +1 -0
- package/dist/runtime.d.ts +59 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +266 -0
- package/dist/runtime.js.map +1 -0
- package/dist/slack.d.ts +26 -0
- package/dist/slack.d.ts.map +1 -0
- package/dist/slack.js +113 -0
- package/dist/slack.js.map +1 -0
- package/dist/source.d.ts +24 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +80 -0
- package/dist/source.js.map +1 -0
- package/dist/supervisor.d.ts +69 -0
- package/dist/supervisor.d.ts.map +1 -0
- package/dist/supervisor.js +218 -0
- package/dist/supervisor.js.map +1 -0
- package/dist/trusted-config.d.ts +71 -0
- package/dist/trusted-config.d.ts.map +1 -0
- package/dist/trusted-config.js +118 -0
- package/dist/trusted-config.js.map +1 -0
- package/package.json +25 -23
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { StratusConfigFile } from '@stratusagent/state';
|
|
2
|
+
import type { ServiceRunner } from './service.ts';
|
|
3
|
+
export interface CliStreams {
|
|
4
|
+
stdout: Pick<typeof process.stdout, 'write'>;
|
|
5
|
+
stderr: Pick<typeof process.stderr, 'write'>;
|
|
6
|
+
}
|
|
7
|
+
export interface CliEnvironment {
|
|
8
|
+
stdin?: string;
|
|
9
|
+
stdinStream?: NodeJS.ReadableStream;
|
|
10
|
+
approvalInput?: NodeJS.ReadableStream;
|
|
11
|
+
setupInput?: NodeJS.ReadableStream;
|
|
12
|
+
templateInput?: NodeJS.ReadableStream;
|
|
13
|
+
processEnv?: NodeJS.ProcessEnv;
|
|
14
|
+
cwd?: string;
|
|
15
|
+
/** Home directory override (tests). Defaults to os.homedir(). */
|
|
16
|
+
homeDir?: string;
|
|
17
|
+
fetch?: typeof fetch;
|
|
18
|
+
openExternal?: (url: string) => Promise<void> | void;
|
|
19
|
+
dashboardAutoShutdownMs?: number;
|
|
20
|
+
/** Shuts down `stratus serve` the way SIGTERM would (tests). */
|
|
21
|
+
shutdownSignal?: AbortSignal;
|
|
22
|
+
/**
|
|
23
|
+
* Starts the fresh daemon an announced restart asks for and resolves
|
|
24
|
+
* with its exit code. Injected so tests never spawn a process; the
|
|
25
|
+
* default runs this CLI's own entrypoint with the serve arguments given.
|
|
26
|
+
*/
|
|
27
|
+
serveRespawn?: (argv: string[], handoff: RestartHandoff) => Promise<RespawnResult>;
|
|
28
|
+
/**
|
|
29
|
+
* The link between a supervised daemon and its supervisor (tests): what
|
|
30
|
+
* the daemon sends up — the port it bound, the dashboard sessions it
|
|
31
|
+
* hands on — and what it receives. The default is the IPC channel a
|
|
32
|
+
* supervisor opens when it spawns a daemon, and does nothing where
|
|
33
|
+
* there is none.
|
|
34
|
+
*/
|
|
35
|
+
supervisorLink?: SupervisorLink;
|
|
36
|
+
/** Ends the process at once (tests). Default `process.exit`. */
|
|
37
|
+
exitProcess?: (code: number) => void;
|
|
38
|
+
/** Runs launchctl/systemctl. Injected so tests never touch the real one. */
|
|
39
|
+
serviceRunner?: ServiceRunner;
|
|
40
|
+
/** Service-manager platform override (tests) — which unit format and manager commands apply. */
|
|
41
|
+
servicePlatform?: NodeJS.Platform;
|
|
42
|
+
/** Reports whether an optional package is installed. Injected so tests do not assert on their own node_modules. */
|
|
43
|
+
packageResolver?: PackageResolver;
|
|
44
|
+
/** Installs optional packages. Injected so tests never run npm. */
|
|
45
|
+
packageInstaller?: PackageInstaller;
|
|
46
|
+
/** Looks up a package's latest published version. Injected so tests never ask npm. */
|
|
47
|
+
packageVersionFetcher?: PackageVersionFetcher;
|
|
48
|
+
/** Reads the version an installed package declares. Injected so tests do not assert on their own node_modules. */
|
|
49
|
+
installedVersionReader?: InstalledVersionReader;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A dashboard session as it crosses the restart hand-off: structurally the
|
|
53
|
+
* control API's `DashboardSession`, declared here rather than imported.
|
|
54
|
+
* That package is an optional peer, and a type import of it is kept in
|
|
55
|
+
* this package's declarations — every TypeScript consumer of the CLI would
|
|
56
|
+
* then need the optional package installed just to type-check.
|
|
57
|
+
*/
|
|
58
|
+
export interface DashboardSession {
|
|
59
|
+
id: string;
|
|
60
|
+
/** Epoch milliseconds; a handed session keeps the expiry it was minted with. */
|
|
61
|
+
expiresAt: number;
|
|
62
|
+
/** A fingerprint of the bearer token it was minted under; the replacement adopts it only under the same one. */
|
|
63
|
+
vouchedBy: string;
|
|
64
|
+
}
|
|
65
|
+
/** What a daemon and its supervisor say to each other. See SupervisorLink. */
|
|
66
|
+
export type SupervisorMessage = {
|
|
67
|
+
type: 'stratusd.bound-api-port';
|
|
68
|
+
port: number;
|
|
69
|
+
} | {
|
|
70
|
+
type: 'stratusd.sessions';
|
|
71
|
+
sessions: DashboardSession[];
|
|
72
|
+
};
|
|
73
|
+
/** One end of the daemon–supervisor channel. */
|
|
74
|
+
export interface SupervisorLink {
|
|
75
|
+
send(message: SupervisorMessage): void;
|
|
76
|
+
receive(handler: (message: SupervisorMessage) => void): void;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* What a supervisor hands the daemon it starts: the port its predecessor
|
|
80
|
+
* bound (a hint, see BOUND_API_PORT_ENV) and the dashboard sessions the
|
|
81
|
+
* predecessor had live when it stopped, so `stratus restart` does not log
|
|
82
|
+
* a browser out. In memory end to end; nothing here is written down.
|
|
83
|
+
*/
|
|
84
|
+
export interface RestartHandoff {
|
|
85
|
+
boundApiPort?: number;
|
|
86
|
+
sessions: DashboardSession[];
|
|
87
|
+
}
|
|
88
|
+
/** How a daemon the supervisor started ended, and what it handed back before it did. */
|
|
89
|
+
export interface RespawnResult {
|
|
90
|
+
code: number;
|
|
91
|
+
boundApiPort?: number;
|
|
92
|
+
sessions?: DashboardSession[];
|
|
93
|
+
}
|
|
94
|
+
export interface PackageInstallResult {
|
|
95
|
+
ok: boolean;
|
|
96
|
+
/** Why it failed, as a line the operator can act on. Empty on success. */
|
|
97
|
+
message: string;
|
|
98
|
+
}
|
|
99
|
+
/** Installs optional packages globally. */
|
|
100
|
+
export type PackageInstaller = (packages: string[]) => Promise<PackageInstallResult>;
|
|
101
|
+
/** The latest published version of a package, or undefined when the registry did not answer. */
|
|
102
|
+
export type PackageVersionFetcher = (packageName: string) => Promise<string | undefined>;
|
|
103
|
+
/** The version an installed package declares, or undefined when it is not installed. */
|
|
104
|
+
export type InstalledVersionReader = (specifier: string) => Promise<string | undefined>;
|
|
105
|
+
export type CliConfigFile = StratusConfigFile;
|
|
106
|
+
/** Reports whether an optional package is installed. */
|
|
107
|
+
export type PackageResolver = (specifier: string) => boolean;
|
|
108
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,IAAI,CAAC,OAAO,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7C,MAAM,EAAE,IAAI,CAAC,OAAO,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9C;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACrD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,gEAAgE;IAChE,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CA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,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,OAAO,CAAC;IACZ,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,2CAA2C;AAC3C,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAErF,gGAAgG;AAChG,MAAM,MAAM,qBAAqB,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAEzF,wFAAwF;AACxF,MAAM,MAAM,sBAAsB,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAExF,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE9C,wDAAwD;AACxD,MAAM,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":""}
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StratusEvent } from '@stratusagent/core';
|
|
2
|
+
export declare const formatEvent: (event: StratusEvent) => string | null;
|
|
3
|
+
/**
|
|
4
|
+
* The fields worth keeping per event type. Tool inputs and message text
|
|
5
|
+
* are deliberately excluded: the log is a trace of what happened, not a
|
|
6
|
+
* second copy of the transcript.
|
|
7
|
+
*
|
|
8
|
+
* The approval pair is the one place the trace carries a person's id, and
|
|
9
|
+
* it earns it: `always` widens what an agent may do unattended for the rest
|
|
10
|
+
* of the session, and "who decided that" is unanswerable afterwards from
|
|
11
|
+
* anything else. The refusal path is warned about by `onDecision`, but an
|
|
12
|
+
* *approval* produces no warning at all — without these two records a
|
|
13
|
+
* granted permission leaves no trace whatsoever. Still no tool input: what
|
|
14
|
+
* was asked is here, what it was asked with is not.
|
|
15
|
+
*/
|
|
16
|
+
export declare const eventDetail: (event: StratusEvent) => Record<string, unknown> | undefined;
|
|
17
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +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"}
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { FORGET_TOOL_NAME, MEMORY_TOOL_NAME } from '@stratusagent/agents';
|
|
2
|
+
export const formatEvent = (event) => {
|
|
3
|
+
switch (event.type) {
|
|
4
|
+
case 'session.created':
|
|
5
|
+
return `• session.created ${event.sessionId}`;
|
|
6
|
+
case 'session.updated':
|
|
7
|
+
return `• session.updated ${event.status}`;
|
|
8
|
+
case 'session.observed':
|
|
9
|
+
return `• session.observed ${event.sessionId}`;
|
|
10
|
+
case 'provider.response':
|
|
11
|
+
return `• provider.response ${event.parts.length} part(s)`;
|
|
12
|
+
case 'tool.called':
|
|
13
|
+
return `• tool.called ${event.call.toolName}`;
|
|
14
|
+
case 'tool.completed':
|
|
15
|
+
return `• tool.completed ${event.result.toolName} ok=${String(event.result.ok)}`;
|
|
16
|
+
case 'tool.denied':
|
|
17
|
+
return `• tool.denied ${event.call.toolName}`;
|
|
18
|
+
case 'tool.approval-requested':
|
|
19
|
+
return `• tool.approval-requested ${event.call.toolName} (${event.risk}) for ${event.agentId}`;
|
|
20
|
+
case 'tool.approval-resolved':
|
|
21
|
+
return `• tool.approval-resolved ${event.answer} (${event.reason})${event.actor ? ` by ${event.actor}` : ''}`;
|
|
22
|
+
case 'session.completed':
|
|
23
|
+
return `• session.completed ${event.sessionId}`;
|
|
24
|
+
case 'session.failed':
|
|
25
|
+
return `• session.failed ${event.error}`;
|
|
26
|
+
case 'session.tainted':
|
|
27
|
+
return `• session.tainted ${event.trust} (${event.source})`;
|
|
28
|
+
default:
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The fields worth keeping per event type. Tool inputs and message text
|
|
34
|
+
* are deliberately excluded: the log is a trace of what happened, not a
|
|
35
|
+
* second copy of the transcript.
|
|
36
|
+
*
|
|
37
|
+
* The approval pair is the one place the trace carries a person's id, and
|
|
38
|
+
* it earns it: `always` widens what an agent may do unattended for the rest
|
|
39
|
+
* of the session, and "who decided that" is unanswerable afterwards from
|
|
40
|
+
* anything else. The refusal path is warned about by `onDecision`, but an
|
|
41
|
+
* *approval* produces no warning at all — without these two records a
|
|
42
|
+
* granted permission leaves no trace whatsoever. Still no tool input: what
|
|
43
|
+
* was asked is here, what it was asked with is not.
|
|
44
|
+
*/
|
|
45
|
+
export const eventDetail = (event) => {
|
|
46
|
+
switch (event.type) {
|
|
47
|
+
case 'session.updated':
|
|
48
|
+
return { status: event.status };
|
|
49
|
+
case 'provider.response':
|
|
50
|
+
return { parts: event.parts.length };
|
|
51
|
+
case 'tool.called':
|
|
52
|
+
case 'tool.denied':
|
|
53
|
+
return { tool: event.call.toolName };
|
|
54
|
+
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.
|
|
59
|
+
const output = event.result.output;
|
|
60
|
+
const entry = (event.result.toolName === MEMORY_TOOL_NAME || event.result.toolName === FORGET_TOOL_NAME)
|
|
61
|
+
&& event.result.ok && typeof output === 'object' && output !== null && !Array.isArray(output)
|
|
62
|
+
&& typeof output.id === 'string'
|
|
63
|
+
? output.id
|
|
64
|
+
: undefined;
|
|
65
|
+
return { tool: event.result.toolName, ok: event.result.ok, ...(entry !== undefined ? { entry } : {}) };
|
|
66
|
+
}
|
|
67
|
+
case 'tool.approval-requested':
|
|
68
|
+
return { tool: event.call.toolName, risk: event.risk, requestId: event.requestId };
|
|
69
|
+
case 'tool.approval-resolved':
|
|
70
|
+
return {
|
|
71
|
+
requestId: event.requestId,
|
|
72
|
+
answer: event.answer,
|
|
73
|
+
reason: event.reason,
|
|
74
|
+
...(event.actor ? { actor: event.actor } : {}),
|
|
75
|
+
};
|
|
76
|
+
case 'session.failed':
|
|
77
|
+
return { error: event.error };
|
|
78
|
+
case 'session.tainted':
|
|
79
|
+
// The label and what lowered it — a tool's name, or `memory`,
|
|
80
|
+
// `sender`, `legacy`. Never the content that did: same rule as every
|
|
81
|
+
// other event here.
|
|
82
|
+
return { trust: event.trust, source: event.source };
|
|
83
|
+
default:
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +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,OA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E,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;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC,CAAC"}
|
package/dist/help.d.ts
ADDED
|
@@ -0,0 +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, 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 -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.\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";
|
|
2
|
+
//# sourceMappingURL=help.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,irgBAsQrB,CAAC"}
|
package/dist/help.js
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { DEFAULT_ANTHROPIC_MODEL } from '@stratusagent/provider-anthropic';
|
|
2
|
+
import { DEFAULT_CODEX_MODEL } from '@stratusagent/provider-codex';
|
|
3
|
+
export const HELP_TEXT = `Stratus Agent CLI
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
stratus setup
|
|
7
|
+
stratus chat
|
|
8
|
+
stratus chat --soul ./examples/souls/ava.md
|
|
9
|
+
stratus run --prompt "Use the demo tool"
|
|
10
|
+
stratus run "Say hello"
|
|
11
|
+
ANTHROPIC_API_KEY=... stratus run --provider anthropic "Say hello"
|
|
12
|
+
stratus run --soul ./examples/souls/ava.md "Say hello"
|
|
13
|
+
echo "Use the echo tool" | stratus run --stdin
|
|
14
|
+
STRATUS_PROVIDER=openai OPENAI_API_KEY=... stratus run "Say hello"
|
|
15
|
+
stratus run --config ./stratus.config.json --provider openai "Say hello"
|
|
16
|
+
stratus agents
|
|
17
|
+
stratus agents --gateway http://127.0.0.1:4123
|
|
18
|
+
stratus template add ./examples/templates/example
|
|
19
|
+
stratus template add stratuslabs/template-oncall --yes
|
|
20
|
+
stratus skill add stratuslabs/skill-code-review
|
|
21
|
+
stratus skill add ./my-skills --skill code-review --agent ava
|
|
22
|
+
stratus skill validate ./my-skill
|
|
23
|
+
stratus skills
|
|
24
|
+
stratus plugins
|
|
25
|
+
stratus plugins --format json
|
|
26
|
+
stratus skill reload
|
|
27
|
+
stratus restart
|
|
28
|
+
stratus schedules
|
|
29
|
+
stratus schedules cancel <id>
|
|
30
|
+
stratus grants ava
|
|
31
|
+
stratus grants revoke ava --tool web.fetch
|
|
32
|
+
stratus memory list ava
|
|
33
|
+
stratus memory reassert ava --trust user --all-unknown
|
|
34
|
+
stratus session rollover slack:ava:T01ABCDEF:D07GHIJKL
|
|
35
|
+
printf %s "$BRAVE_KEY" | stratus credential set search.apiKey
|
|
36
|
+
stratus credentials
|
|
37
|
+
stratus doctor
|
|
38
|
+
stratus update
|
|
39
|
+
stratus update --check
|
|
40
|
+
stratus --version
|
|
41
|
+
stratus service install
|
|
42
|
+
stratus service status
|
|
43
|
+
stratus logs -f
|
|
44
|
+
stratus logs --agent ava -n 200
|
|
45
|
+
stratus dashboard
|
|
46
|
+
stratus dashboard --port 4123 --host 0.0.0.0 --no-open
|
|
47
|
+
|
|
48
|
+
Commands:
|
|
49
|
+
setup Menu-driven onboarding: pick a provider, sign in (Claude
|
|
50
|
+
subscription or API key), create your agent, enable the
|
|
51
|
+
plugins it may use, connect it to Slack, choose who
|
|
52
|
+
approves gated calls unattended, and test it — settings
|
|
53
|
+
go to ~/.stratus/config.json,
|
|
54
|
+
sign-ins and channel tokens to ~/.stratus/credentials.json
|
|
55
|
+
(0600). Save & finish offers to install any optional
|
|
56
|
+
package your answers imply (the Slack channel, the control
|
|
57
|
+
API and dashboard) before it starts the daemon
|
|
58
|
+
chat Talk with your agent — the conversation persists across turns
|
|
59
|
+
and remembered facts accumulate; /exit or Ctrl+C to leave
|
|
60
|
+
run Execute one local Stratus Agent session
|
|
61
|
+
serve Run stratusd, the always-on gateway: durable sessions, the
|
|
62
|
+
whole roster live at once (each agent on its own provider),
|
|
63
|
+
delegation, and a watchdog — one per home (it refuses to
|
|
64
|
+
start over a daemon already serving ~/.stratus), and
|
|
65
|
+
Ctrl+C / SIGTERM drains cleanly
|
|
66
|
+
(--idle-timeout <seconds>, --approvals <headless|remote>,
|
|
67
|
+
--no-events, --no-log-file, --config <path>); everything it
|
|
68
|
+
says is also written to ~/.stratus/logs, which
|
|
69
|
+
"stratus logs" reads. With @stratusagent/control-api
|
|
70
|
+
installed it also serves the HTTP + WebSocket control API
|
|
71
|
+
on 127.0.0.1:4123 (--no-api, --api-host, --api-port, or
|
|
72
|
+
the config file's "api" block)
|
|
73
|
+
service Keep stratusd running under launchd (macOS) or systemd
|
|
74
|
+
(Linux): install, uninstall, status, start, stop.
|
|
75
|
+
Installing starts it now and at every login
|
|
76
|
+
(--no-login installs without the login trigger,
|
|
77
|
+
--config <path> pins the daemon to one config file)
|
|
78
|
+
logs Read the daemon's log from any terminal: -f to follow,
|
|
79
|
+
-n <count> for backlog, --agent / --session to filter,
|
|
80
|
+
--format json for the raw records
|
|
81
|
+
template add Install a template — a folder (or GitHub repo) holding
|
|
82
|
+
soul files, skills, and the plugin config they need. Prints
|
|
83
|
+
every agent, skill, plugin package and config key it would
|
|
84
|
+
add, then asks; --yes installs without asking, --force
|
|
85
|
+
replaces an agent or skill already installed under the same
|
|
86
|
+
name. Plugin packages the template's config.json names are
|
|
87
|
+
installed with npm install -g and enabled in
|
|
88
|
+
~/.stratus/config.json, which needs a restart to take
|
|
89
|
+
effect. See docs/guides/templates.md for the layout
|
|
90
|
+
skill add Install skills from a GitHub repo (owner/repo or URL) or a
|
|
91
|
+
local path into ~/.stratus/skills — whole directories, one
|
|
92
|
+
per skill; works with skills published for other agents
|
|
93
|
+
(skills.sh-style repos). Installed is not enabled: a soul
|
|
94
|
+
opts in via skills:, or pass --agent <id> to enable now.
|
|
95
|
+
--skill <id> picks from a multi-skill repo (repeatable),
|
|
96
|
+
--force replaces an already-installed id. A skill that
|
|
97
|
+
does not conform to the Agent Skills spec is refused,
|
|
98
|
+
naming what is wrong; one that installs with caveats
|
|
99
|
+
(fields another host owns, a bundled scripts/) says so.
|
|
100
|
+
A running daemon reloads its skills afterwards, no
|
|
101
|
+
restart (--no-reload skips that)
|
|
102
|
+
skill validate Check a skill directory, a directory of skills, or an
|
|
103
|
+
installed skill id against the Agent Skills spec — the
|
|
104
|
+
same check "skill add" runs, so what validates installs.
|
|
105
|
+
Exit 1 if anything would be refused
|
|
106
|
+
skills List installed skills and which agents enable each
|
|
107
|
+
(also: stratus skill list)
|
|
108
|
+
plugins What this machine's plugins are, and where the chain from
|
|
109
|
+
installed to callable breaks: whether the package resolves,
|
|
110
|
+
whether a trusted config enables it, which agents' tools:
|
|
111
|
+
lists select each tool it declares, and what the approval
|
|
112
|
+
policy does with a gated call. Read from each package's
|
|
113
|
+
manifest, so nothing is imported and no plugin's setup runs
|
|
114
|
+
(--format json, --config <path>; also: stratus plugin list)
|
|
115
|
+
skill reload Ask the running daemon to re-read ~/.stratus/skills — for a
|
|
116
|
+
skill edited or removed by hand. A skill that will not
|
|
117
|
+
load refuses the whole reload and the previous set keeps
|
|
118
|
+
serving; nothing becomes reachable to an agent whose soul
|
|
119
|
+
does not list it
|
|
120
|
+
restart Ask the running daemon for an announced restart — what a
|
|
121
|
+
plugin change needs: it refuses new turns, lets in-flight
|
|
122
|
+
ones finish for up to --drain-timeout <seconds> (default
|
|
123
|
+
30), then comes back with sessions, schedules, and
|
|
124
|
+
channels intact, under the service manager or not
|
|
125
|
+
credential set Store a named credential an agent can resolve — a search
|
|
126
|
+
backend asks for search.apiKey. The value is read from
|
|
127
|
+
stdin, never from a flag, so it stays out of your shell
|
|
128
|
+
history: printf %s "$KEY" | stratus credential set
|
|
129
|
+
search.apiKey. --agent <id> stores one agent's own key,
|
|
130
|
+
which outranks the shared entry for that agent. Storing
|
|
131
|
+
grants nothing: the soul still needs credentials: [name]
|
|
132
|
+
credentials List stored credential names and which agents have their
|
|
133
|
+
own — names only, never values (also: credential list)
|
|
134
|
+
credential remove
|
|
135
|
+
Forget one (--agent <id> for that agent's own entry)
|
|
136
|
+
schedules List every schedule the fleet has set — cadence, prompt,
|
|
137
|
+
pre-authorized destination, next firing — straight from the
|
|
138
|
+
daemon's database (--format json). "stratus schedules
|
|
139
|
+
cancel <id>" stops the next firing and revokes the
|
|
140
|
+
destination that was approved with it
|
|
141
|
+
(also: stratus schedule list / schedule cancel <id>)
|
|
142
|
+
grants What an agent may do unattended beyond the built-in safe
|
|
143
|
+
list — its standing tool grants, command scopes, and
|
|
144
|
+
sites, each an "always allow" somebody answered. From the
|
|
145
|
+
running daemon when one is serving (--gateway, --token),
|
|
146
|
+
else from ~/.stratus/agents/<id>.whitelist.json; --format
|
|
147
|
+
json. "stratus grants revoke <agent> --tool <name> |
|
|
148
|
+
--scope "<command>" | --origin <origin>" takes one back,
|
|
149
|
+
and a running daemon stops honouring it at once
|
|
150
|
+
memory list Show an agent's live memory with the trust label each
|
|
151
|
+
entry carries — user, agent, unknown (no recorded origin,
|
|
152
|
+
or written in a conversation with someone not configured
|
|
153
|
+
as a principal), external (recorded after reading content
|
|
154
|
+
from outside). --trust <level> filters; --format json
|
|
155
|
+
memory reassert Re-label entries as an operator: stratus memory reassert
|
|
156
|
+
<agent> --trust user <id>..., or --all-unknown for every
|
|
157
|
+
entry with no recorded origin (the upgrade case; an
|
|
158
|
+
entry recorded unknown — a stranger's message, a shell
|
|
159
|
+
command — is left for you to name by id). Appends
|
|
160
|
+
a record to ~/.stratus/memory.jsonl; a running daemon
|
|
161
|
+
sees it on its next turn. The only way a label ever
|
|
162
|
+
rises — no tool can do this
|
|
163
|
+
session rollover Start a conversation over under the same session id,
|
|
164
|
+
archiving its transcript so far — for a long-lived
|
|
165
|
+
session (a Slack DM) that predates provenance tracking
|
|
166
|
+
and would otherwise write unknown forever. Asks the
|
|
167
|
+
running daemon (--gateway, --token)
|
|
168
|
+
agent new Create an agent identity (generates a human-ish name + avatar theme)
|
|
169
|
+
agents List your agents: who they are, where their souls live, what
|
|
170
|
+
they run on, what they remember (also: stratus agent list).
|
|
171
|
+
--gateway <url> asks a running daemon instead of resolving
|
|
172
|
+
locally, authenticating with ~/.stratus/gateway-token
|
|
173
|
+
(override with --token or STRATUS_GATEWAY_TOKEN)
|
|
174
|
+
doctor Show what a run would use right now — provider, model, soul —
|
|
175
|
+
and which file or environment variable decided each, then
|
|
176
|
+
flag anything that would surprise you (--format json)
|
|
177
|
+
update The whole upgrade dance, in the order that cannot lose
|
|
178
|
+
data: stop stratusd, upgrade the package from npm —
|
|
179
|
+
together with every optional first-party package this
|
|
180
|
+
machine has, which ship in lockstep with it — run
|
|
181
|
+
pending state migrations, rewrite the service unit with
|
|
182
|
+
current node/entrypoint paths, restart. --check reports
|
|
183
|
+
what it would do without doing any of it (exits 1 when
|
|
184
|
+
something is actionable, a companion left behind
|
|
185
|
+
included). Works offline too — an unreachable npm skips
|
|
186
|
+
the upgrade but still migrates and repairs the unit
|
|
187
|
+
dashboard Open the web dashboard: finds a running daemon (or starts one),
|
|
188
|
+
mints a single-use sign-in link, and opens your browser at it.
|
|
189
|
+
Needs @stratusagent/control-api and @stratusagent/dashboard
|
|
190
|
+
help Show this help message
|
|
191
|
+
version Print this build's version (also: --version, -v)
|
|
192
|
+
|
|
193
|
+
Agent options:
|
|
194
|
+
--name Agent name (omit to have one generated)
|
|
195
|
+
--instructions The agent's persona/instructions
|
|
196
|
+
--format Output format for agent new: text, json, or soul (a ready-to-edit soul file)
|
|
197
|
+
|
|
198
|
+
Options:
|
|
199
|
+
--prompt, -p Prompt to send to the local agent loop
|
|
200
|
+
--stdin Read the prompt from stdin
|
|
201
|
+
--provider Provider to use: anthropic, openai, codex, or demo
|
|
202
|
+
--model Model name for real providers (anthropic default: ${DEFAULT_ANTHROPIC_MODEL}, openai default: gpt-4.1-mini, codex default: ${DEFAULT_CODEX_MODEL})
|
|
203
|
+
--base-url Override the provider API base URL
|
|
204
|
+
--soul Run as the agent defined by a soul file (markdown + frontmatter, see examples/souls)
|
|
205
|
+
--config Config file path (run: load settings from it, setup: write it)
|
|
206
|
+
--format Output format: text or json (default: text)
|
|
207
|
+
--no-events Hide event-by-event progress lines in text mode
|
|
208
|
+
--approvals run/chat: tool approval mode — always, ask, or never (default: always)
|
|
209
|
+
serve: how the daemon reaches a human — headless (refuse every
|
|
210
|
+
gated call) or remote (ask in Slack). Default headless, or
|
|
211
|
+
the config file's "approvals.mode"
|
|
212
|
+
--max-turns Maximum provider turns per run (default: 8)
|
|
213
|
+
--port dashboard: port for a daemon it starts (default: 4123)
|
|
214
|
+
--host dashboard: host for a daemon it starts (default: 127.0.0.1)
|
|
215
|
+
--no-open Do not open the browser automatically
|
|
216
|
+
--gateway agents / skill reload / restart / session rollover: a running
|
|
217
|
+
daemon's control API (all but agents default to the daemon
|
|
218
|
+
~/.stratus/gateway.json names)
|
|
219
|
+
--trust memory list: show only this label; memory reassert: the
|
|
220
|
+
label to record (user, agent, unknown, external)
|
|
221
|
+
--all-unknown memory reassert: every live entry with no recorded origin
|
|
222
|
+
--token Bearer token for --gateway (default: ~/.stratus/gateway-token)
|
|
223
|
+
--no-reload skill add: install without reloading a running daemon
|
|
224
|
+
-y, --yes template add: install without the review prompt
|
|
225
|
+
--reason restart: why, for the daemon's log
|
|
226
|
+
--drain-timeout restart: seconds the daemon lets in-flight turns finish
|
|
227
|
+
before aborting them (default: 30)
|
|
228
|
+
--no-api serve: do not serve the control API
|
|
229
|
+
--api serve: serve it even where the config says api.enabled: false
|
|
230
|
+
--api-host serve: control API interface (default: 127.0.0.1)
|
|
231
|
+
--api-port serve: control API port (default: 4123, 0 for any free port)
|
|
232
|
+
--help, -h Show this help message
|
|
233
|
+
--version, -v Print this build's version and exit
|
|
234
|
+
|
|
235
|
+
Config file:
|
|
236
|
+
The CLI looks for ./stratus.config.json first, then a path from --config / STRATUS_CONFIG,
|
|
237
|
+
then the global ~/.stratus/config.json written by \`stratus setup\`.
|
|
238
|
+
A "soul" key (or STRATUS_SOUL) points at a soul file so every run uses that agent.
|
|
239
|
+
|
|
240
|
+
Plugins (tools):
|
|
241
|
+
Capability is optional: install a package, then list it under "plugins" in a
|
|
242
|
+
TRUSTED config (--config, STRATUS_CONFIG, or ~/.stratus/config.json), keyed by
|
|
243
|
+
package name. A plugin runs inside this process, so an auto-discovered
|
|
244
|
+
project-local stratus.config.json may not enable one.
|
|
245
|
+
|
|
246
|
+
"plugins": {
|
|
247
|
+
"@stratusagent/tool-fs": { "enabled": true, "roots": ["~/notes"],
|
|
248
|
+
"agents": { "ava": { "roots": ["~/work/ava"] } } },
|
|
249
|
+
"@stratusagent/tool-web": { "enabled": true }
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
Available: @stratusagent/tool-fs (fs.read/list/search/write),
|
|
253
|
+
@stratusagent/tool-shell (shell.run), @stratusagent/tool-web (web.fetch),
|
|
254
|
+
@stratusagent/tool-browser (browser.goto/read/screenshot/act).
|
|
255
|
+
Installing one grants no agent anything — each soul lists what it may call.
|
|
256
|
+
|
|
257
|
+
Soul files:
|
|
258
|
+
A soul file is markdown with frontmatter (name, provider, model, tools, skills, credentials)
|
|
259
|
+
followed by the agent's persona in prose. See examples/souls/ava.md.
|
|
260
|
+
"tools" takes exact names or a whole toolset: tools: [fs.read, fs.search] or
|
|
261
|
+
tools: [fs.*]. Omitted means every registered tool.
|
|
262
|
+
"skills" is the same allowlist shape over installed skills (see stratus
|
|
263
|
+
skills), except omitted means none — a skill is enabled per agent, never
|
|
264
|
+
by being installed.
|
|
265
|
+
`;
|
|
266
|
+
//# sourceMappingURL=help.js.map
|
package/dist/help.js.map
ADDED
|
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+DlK,CAAC"}
|