@stratusagent/cli 0.12.1 → 0.12.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 +1 -1
- package/dist/commands/agent-new.d.ts +17 -7
- package/dist/commands/agent-new.d.ts.map +1 -1
- package/dist/commands/agent-new.js +34 -17
- package/dist/commands/agent-new.js.map +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +5 -1
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/doctor.d.ts +37 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +165 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +15 -1
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +54 -8
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/template.d.ts.map +1 -1
- package/dist/commands/template.js +34 -4
- package/dist/commands/template.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +41 -2
- package/dist/commands/update.js.map +1 -1
- package/dist/harness-packages.d.ts +31 -0
- package/dist/harness-packages.d.ts.map +1 -0
- package/dist/harness-packages.js +73 -0
- package/dist/harness-packages.js.map +1 -0
- package/dist/help.d.ts +1 -1
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +7 -5
- package/dist/help.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -3
- package/dist/main.js.map +1 -1
- package/dist/npm.d.ts +1 -1
- package/dist/npm.js +1 -1
- package/dist/parse.d.ts +2 -0
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +6 -1
- package/dist/parse.js.map +1 -1
- package/dist/plugin-catalog.d.ts.map +1 -1
- package/dist/plugin-catalog.js +4 -0
- package/dist/plugin-catalog.js.map +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +4 -0
- package/dist/runtime.js.map +1 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +15 -1
- package/dist/service.js.map +1 -1
- package/package.json +25 -25
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ edit, no env vars to export. Walkthrough:
|
|
|
35
35
|
```bash
|
|
36
36
|
stratus setup # onboarding menu: providers, models, agent, plugins, channels, approvals
|
|
37
37
|
stratus chat # talk — the conversation persists
|
|
38
|
-
stratus run "say hello"
|
|
38
|
+
stratus run --provider demo "say hello" # one-shot run, offline on the demo model
|
|
39
39
|
stratus serve # stratusd: the whole roster, always on
|
|
40
40
|
stratus serve --approvals remote # ask a human in Slack instead of refusing
|
|
41
41
|
stratus service install # keep stratusd running under launchd/systemd
|
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
import { type StratusConfigFile, type StratusProviderName } from '@stratusagent/state';
|
|
2
|
-
import type { CliStreams, CliEnvironment } from '../environment.ts';
|
|
2
|
+
import type { CliStreams, CliEnvironment, CliConfigFile } from '../environment.ts';
|
|
3
3
|
import type { ParsedAgentNewCommand } from '../parse.ts';
|
|
4
4
|
/**
|
|
5
5
|
* The provider/model a newly created soul pins. Frontmatter pins what a run
|
|
6
6
|
* from this directory would actually use: env vars outrank the active
|
|
7
|
-
* config file (project-local or explicit first, global otherwise)
|
|
8
|
-
* provider
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* config file (project-local or explicit first, global otherwise). When
|
|
8
|
+
* nothing names a provider the soul pins none, so a run infers the one
|
|
9
|
+
* signed-in provider exactly as `stratus run` does; demo is pinned only when
|
|
10
|
+
* something names it. Demo produces no model at all: the soul keeps
|
|
11
|
+
* following the machine's configuration instead of demanding credentials
|
|
12
|
+
* nothing has signed in for. The active config's model was written for the provider
|
|
12
13
|
* named in that config, so it only travels into the soul when they still
|
|
13
14
|
* match; otherwise the selected provider's own default model stands in.
|
|
14
15
|
*
|
|
15
16
|
* Exported for tests: the interactive path that consumes it needs a TTY.
|
|
16
17
|
*/
|
|
17
18
|
export declare const soulPinForNewAgent: (activeConfig: StratusConfigFile, processEnv: NodeJS.ProcessEnv) => {
|
|
18
|
-
provider
|
|
19
|
+
provider?: StratusProviderName;
|
|
19
20
|
model?: string;
|
|
20
21
|
};
|
|
22
|
+
/**
|
|
23
|
+
* The global config after making a new agent the default. A provider is
|
|
24
|
+
* written only when the config has none and something named one: with
|
|
25
|
+
* nothing named, runs infer the signed-in provider, and writing a fallback
|
|
26
|
+
* here would silently pin every later run to it.
|
|
27
|
+
*
|
|
28
|
+
* Exported for tests: the interactive path that consumes it needs a TTY.
|
|
29
|
+
*/
|
|
30
|
+
export declare const defaultAgentConfig: (globalConfig: CliConfigFile, soulProvider: StratusProviderName | undefined, soulPath: string) => CliConfigFile;
|
|
21
31
|
export declare const runAgentNew: (command: ParsedAgentNewCommand, streams: CliStreams, env?: CliEnvironment) => Promise<number>;
|
|
22
32
|
//# sourceMappingURL=agent-new.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-new.d.ts","sourceRoot":"","sources":["../../src/commands/agent-new.ts"],"names":[],"mappings":"AAGA,OAAO,EAWL,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"agent-new.d.ts","sourceRoot":"","sources":["../../src/commands/agent-new.ts"],"names":[],"mappings":"AAGA,OAAO,EAWL,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAIzD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAC7B,cAAc,iBAAiB,EAC/B,YAAY,MAAM,CAAC,UAAU,KAC5B;IAAE,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CA4BlD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,cAAc,aAAa,EAC3B,cAAc,mBAAmB,GAAG,SAAS,EAC7C,UAAU,MAAM,KACf,aAYF,CAAC;AAEF,eAAO,MAAM,WAAW,GACtB,SAAS,qBAAqB,EAC9B,SAAS,UAAU,EACnB,MAAK,cAAmB,KACvB,OAAO,CAAC,MAAM,CA4HhB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_ANTHROPIC_MODEL } from '@stratusagent/provider-anthropic';
|
|
2
|
-
import { DEFAULT_CODEX_MODEL } from '@stratusagent/
|
|
2
|
+
import { DEFAULT_CODEX_MODEL } from '@stratusagent/providers';
|
|
3
3
|
import { defineAgent, formatSoul, generateAgentName } from '@stratusagent/agents';
|
|
4
4
|
import { claimSoulFile, DEFAULT_OPENAI_MODEL, discoverActiveConfig, globalConfigPath, isRegisteredProviderName, parseProviderName, readNonEmptyString, readProcessEnv, loadConfigFile, saveConfigFile, } from '@stratusagent/state';
|
|
5
5
|
import { writeLine } from "../io.js";
|
|
@@ -8,11 +8,12 @@ import { DEFAULT_SOUL_STARTER } from "./setup.js";
|
|
|
8
8
|
/**
|
|
9
9
|
* The provider/model a newly created soul pins. Frontmatter pins what a run
|
|
10
10
|
* from this directory would actually use: env vars outrank the active
|
|
11
|
-
* config file (project-local or explicit first, global otherwise)
|
|
12
|
-
* provider
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* config file (project-local or explicit first, global otherwise). When
|
|
12
|
+
* nothing names a provider the soul pins none, so a run infers the one
|
|
13
|
+
* signed-in provider exactly as `stratus run` does; demo is pinned only when
|
|
14
|
+
* something names it. Demo produces no model at all: the soul keeps
|
|
15
|
+
* following the machine's configuration instead of demanding credentials
|
|
16
|
+
* nothing has signed in for. The active config's model was written for the provider
|
|
16
17
|
* named in that config, so it only travels into the soul when they still
|
|
17
18
|
* match; otherwise the selected provider's own default model stands in.
|
|
18
19
|
*
|
|
@@ -22,7 +23,10 @@ export const soulPinForNewAgent = (activeConfig, processEnv) => {
|
|
|
22
23
|
// The map already validates, so the value is a provider name; the cast
|
|
23
24
|
// only undoes `readNonEmptyString`'s widening to `string`.
|
|
24
25
|
const envProvider = readNonEmptyString(processEnv.STRATUS_PROVIDER, (value) => parseProviderName(value, 'STRATUS_PROVIDER'));
|
|
25
|
-
const provider = envProvider ?? activeConfig.provider
|
|
26
|
+
const provider = envProvider ?? activeConfig.provider;
|
|
27
|
+
if (provider === undefined) {
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
26
30
|
if (provider === 'demo') {
|
|
27
31
|
return { provider };
|
|
28
32
|
}
|
|
@@ -41,6 +45,27 @@ export const soulPinForNewAgent = (activeConfig, processEnv) => {
|
|
|
41
45
|
: DEFAULT_ANTHROPIC_MODEL);
|
|
42
46
|
return model !== undefined ? { provider, model } : { provider };
|
|
43
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* The global config after making a new agent the default. A provider is
|
|
50
|
+
* written only when the config has none and something named one: with
|
|
51
|
+
* nothing named, runs infer the signed-in provider, and writing a fallback
|
|
52
|
+
* here would silently pin every later run to it.
|
|
53
|
+
*
|
|
54
|
+
* Exported for tests: the interactive path that consumes it needs a TTY.
|
|
55
|
+
*/
|
|
56
|
+
export const defaultAgentConfig = (globalConfig, soulProvider, soulPath) => {
|
|
57
|
+
// Re-validated rather than cast: `readNonEmptyString` widens to `string`,
|
|
58
|
+
// and the shared parser is what says which strings are provider names.
|
|
59
|
+
// Every source feeding soulProvider is already one, so this narrows
|
|
60
|
+
// without being able to throw.
|
|
61
|
+
const provider = globalConfig.provider
|
|
62
|
+
?? (soulProvider !== undefined ? parseProviderName(soulProvider, 'provider') : undefined);
|
|
63
|
+
return {
|
|
64
|
+
...globalConfig,
|
|
65
|
+
...(provider !== undefined ? { provider } : {}),
|
|
66
|
+
soul: soulPath,
|
|
67
|
+
};
|
|
68
|
+
};
|
|
44
69
|
export const runAgentNew = async (command, streams, env = {}) => {
|
|
45
70
|
// On a real terminal, creating an agent is the same guided experience as
|
|
46
71
|
// setup: a headed screen, a prefilled (editable) name, a personality, and
|
|
@@ -71,7 +96,7 @@ export const runAgentNew = async (command, streams, env = {}) => {
|
|
|
71
96
|
writeLine(streams.stdout, `Note: ${message}.`);
|
|
72
97
|
});
|
|
73
98
|
const { provider: soulProvider, model: soulModel } = soulPinForNewAgent(activeConfig, processEnv);
|
|
74
|
-
const soulPin = soulProvider !== 'demo' && soulModel !== undefined
|
|
99
|
+
const soulPin = soulProvider !== undefined && soulProvider !== 'demo' && soulModel !== undefined
|
|
75
100
|
? { provider: soulProvider, model: soulModel }
|
|
76
101
|
: {};
|
|
77
102
|
const claimed = await claimSoulFile(env, { name, instructions: persona }, (candidate) => formatSoul({ agent: candidate, ...soulPin }), (message) => writeLine(streams.stdout, message));
|
|
@@ -98,15 +123,7 @@ export const runAgentNew = async (command, streams, env = {}) => {
|
|
|
98
123
|
}
|
|
99
124
|
}
|
|
100
125
|
if (globalConfig !== undefined) {
|
|
101
|
-
|
|
102
|
-
// `string`, and the shared parser is what says which strings are
|
|
103
|
-
// provider names. Every source feeding soulProvider is already one,
|
|
104
|
-
// so this narrows without being able to throw.
|
|
105
|
-
const config = {
|
|
106
|
-
...globalConfig,
|
|
107
|
-
provider: globalConfig.provider ?? parseProviderName(soulProvider, 'provider'),
|
|
108
|
-
soul: soulPath,
|
|
109
|
-
};
|
|
126
|
+
const config = defaultAgentConfig(globalConfig, soulProvider, soulPath);
|
|
110
127
|
await saveConfigFile(globalConfigPath(env), config);
|
|
111
128
|
madeDefault = true;
|
|
112
129
|
if (configLocation && configLocation.path !== globalConfigPath(env)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-new.js","sourceRoot":"","sources":["../../src/commands/agent-new.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"agent-new.js","sourceRoot":"","sources":["../../src/commands/agent-new.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,GAGf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,YAA+B,EAC/B,UAA6B,EACuB,EAAE;IACtD,uEAAuE;IACvE,2DAA2D;IAC3D,MAAM,WAAW,GAAG,kBAAkB,CACpC,UAAU,CAAC,gBAAgB,EAC3B,CAAC,KAAK,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,CAAC,CACrB,CAAC;IACrC,MAAM,QAAQ,GAAG,WAAW,IAAI,YAAY,CAAC,QAAQ,CAAC;IACtD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC;I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":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAmCvD,eAAO,MAAM,SAAS,GACpB,SAAS,mBAAmB,EAC5B,SAAS,UAAU,EACnB,MAAK,cAAmB,KACvB,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAmCvD,eAAO,MAAM,SAAS,GACpB,SAAS,mBAAmB,EAC5B,SAAS,UAAU,EACnB,MAAK,cAAmB,KACvB,OAAO,CAAC,MAAM,CAmEhB,CAAC"}
|
package/dist/commands/agents.js
CHANGED
|
@@ -59,7 +59,11 @@ export const runAgents = async (command, streams, env = {}) => {
|
|
|
59
59
|
}, null, 2));
|
|
60
60
|
return 0;
|
|
61
61
|
}
|
|
62
|
-
const describeRunsOn = (runsOn) => (runsOn.provider === 'demo'
|
|
62
|
+
const describeRunsOn = (runsOn) => (runsOn.provider === 'demo'
|
|
63
|
+
? 'demo (offline)'
|
|
64
|
+
: runsOn.provider === 'none'
|
|
65
|
+
? 'no provider — run `stratus setup`'
|
|
66
|
+
: `${runsOn.provider}${runsOn.model ? ` · ${runsOn.model}` : ''}`);
|
|
63
67
|
writeLine(streams.stdout, command.gateway ? `Agents on ${command.gateway}` : 'Agents');
|
|
64
68
|
for (const agent of listings) {
|
|
65
69
|
const labels = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/commands/agents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAqB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,QAAQ,mBAAmB,KAAK,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC3J,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAClB,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,iBAAiB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9D,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACjB,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,iBAAiB,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;IACD,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1B,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC;QAC7C,CAAC,CAAC,6EAA6E;QAC/E,CAAC,CAAC,oFAAoF,CAAC,CAAC;IAC1F,OAAO,CAAC,CAAC;AACX,CAAC,CAAC"}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { type CredentialProviderName } from '@stratusagent/state';
|
|
2
2
|
import type { CliStreams, CliEnvironment } from '../environment.ts';
|
|
3
3
|
import type { ParsedDoctorCommand } from '../parse.ts';
|
|
4
|
+
export interface DoctorKeyCheck {
|
|
5
|
+
provider: CredentialProviderName;
|
|
6
|
+
role: 'default' | 'fallback';
|
|
7
|
+
status: 'accepted' | 'rejected' | 'unreachable' | 'not checked';
|
|
8
|
+
detail?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Once the key is accepted: what the run's model said to a one-token call.
|
|
11
|
+
* `refused` is the provider declining it (unknown model, no credit);
|
|
12
|
+
* `no answer` is offline, rate-limited or overloaded and judges nothing.
|
|
13
|
+
*/
|
|
14
|
+
model?: {
|
|
15
|
+
id: string;
|
|
16
|
+
status: 'answered' | 'refused' | 'no answer' | 'not checked';
|
|
17
|
+
detail?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
4
20
|
/** One resolved setting, with the thing that decided it. */
|
|
5
21
|
interface DoctorSetting {
|
|
6
22
|
value: string;
|
|
@@ -23,9 +39,30 @@ export interface DoctorReport {
|
|
|
23
39
|
provider: CredentialProviderName;
|
|
24
40
|
status: string;
|
|
25
41
|
}>;
|
|
42
|
+
/**
|
|
43
|
+
* With `--live` only: what each provider a run uses said about its key.
|
|
44
|
+
* `accepted`/`rejected` are the provider's answer; `unreachable` means no
|
|
45
|
+
* answer (offline, or an endpoint with no key check); `not checked` is a
|
|
46
|
+
* sign-in with no key to send, such as a subscription.
|
|
47
|
+
*/
|
|
48
|
+
keyChecks?: DoctorKeyCheck[];
|
|
26
49
|
slackAgents: string[];
|
|
27
50
|
slackPackageInstalled: boolean;
|
|
28
51
|
rosterCount: number;
|
|
52
|
+
/**
|
|
53
|
+
* The visible folder souls and workspaces live in (`~/Agents`, or
|
|
54
|
+
* `~/Stratus` when `~/Agents` belongs to something else, or what
|
|
55
|
+
* `STRATUS_AGENTS_DIR` names), as `planAgentsHome` decides it for `serve`
|
|
56
|
+
* too. `claimed` is false for a folder the next start would create.
|
|
57
|
+
* Absent when there is none, with the reason.
|
|
58
|
+
*/
|
|
59
|
+
agentsFolder?: {
|
|
60
|
+
path: string;
|
|
61
|
+
claimed: boolean;
|
|
62
|
+
pending: number;
|
|
63
|
+
} | {
|
|
64
|
+
reason: string;
|
|
65
|
+
};
|
|
29
66
|
/** The running daemon, as it reports itself. */
|
|
30
67
|
daemon: DoctorDaemon;
|
|
31
68
|
problems: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAEA,OAAO,EAsBL,KAAK,sBAAsB,EAW5B,MAAM,q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CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACxF,gDAAgD;IAChD,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,KAAK,EAAE,QAAQ,CAAA;CAAE,GACnB;IAAE,KAAK,EAAE,aAAa,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA4HjG;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,mBAAmB,EAC5B,MAAM,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EAC/B,MAAK,cAAmB,KACvB,OAAO,CAAC,YAAY,CAydtB,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,SAAS,mBAAmB,EAC5B,SAAS,UAAU,EACnB,MAAK,cAAmB,KACvB,OAAO,CAAC,MAAM,CA4HhB,CAAC"}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { agentsDirPath, defaultApiKeyEnvName, DEFAULT_STRATUS_AGENT, globalConfigPath, loadChannelCredentials, loadCredentials, loadRosterSouls, loadSoulFile, isSignedInRuntime, parseProviderName, readNonEmptyString, readProcessEnv, readWorkingDirectory, DEFAULT_CONFIG_FILENAME, loadConfigFile, gatewayInfoPath, gatewayTokenPath, resolveRuntimeConfig as resolveStateRuntimeConfig, CREDENTIAL_PROVIDER_NAMES, ignoredUntrustedConfigKeys, legacyWorkspacesDirPath, surveyLegacyWorkspaces, quoteShellArg, } from '@stratusagent/state';
|
|
3
|
+
import { agentsDirPath, planAgentsHome, defaultApiKeyEnvName, DEFAULT_STRATUS_AGENT, globalConfigPath, loadChannelCredentials, loadCredentials, loadRosterSouls, loadSoulFile, isSignedInRuntime, parseProviderName, readNonEmptyString, readProcessEnv, readWorkingDirectory, DEFAULT_CONFIG_FILENAME, loadConfigFile, gatewayInfoPath, gatewayTokenPath, resolveRuntimeConfig as resolveStateRuntimeConfig, signedInProviders, CREDENTIAL_PROVIDER_NAMES, ignoredUntrustedConfigKeys, legacyWorkspacesDirPath, surveyLegacyWorkspaces, quoteShellArg, verifyProviderKey, probeProviderModel, } from '@stratusagent/state';
|
|
4
4
|
import { readServiceCommand } from "../service.js";
|
|
5
5
|
import { callRunningGateway, gatewayErrorMessage, serviceEnvFor } from "../daemon.js";
|
|
6
6
|
import { configDigest } from "../config-digest.js";
|
|
@@ -8,7 +8,94 @@ import { writeLine, pathExists } from "../io.js";
|
|
|
8
8
|
import { ignoredConfigRemedy } from "../runtime.js";
|
|
9
9
|
import { loadSlackAdapter } from "../loaders.js";
|
|
10
10
|
import { companionsBehindMessage, readCompanions } from "../companions.js";
|
|
11
|
+
import { harnessesMissingMessage, missingHarnessPackages } from "../harness-packages.js";
|
|
11
12
|
import { CLI_VERSION } from "../npm.js";
|
|
13
|
+
/** The key and endpoint a run would send, or why there is none to check. */
|
|
14
|
+
const keyToCheck = (provider, runtime) => {
|
|
15
|
+
if (runtime.apiKey) {
|
|
16
|
+
// codex verifies against OpenAI's default endpoint; its baseUrl is not a key endpoint.
|
|
17
|
+
return { key: runtime.apiKey, ...(provider !== 'codex' && runtime.baseUrl ? { baseUrl: runtime.baseUrl } : {}) };
|
|
18
|
+
}
|
|
19
|
+
if (runtime.authToken || provider === 'codex') {
|
|
20
|
+
return { skip: 'subscription sign-in, which has no key to check' };
|
|
21
|
+
}
|
|
22
|
+
return { skip: 'no key' };
|
|
23
|
+
};
|
|
24
|
+
/** A provider's models list or a one-token reply comes back in seconds; past this, doctor reports no answer instead of hanging. */
|
|
25
|
+
const KEY_CHECK_TIMEOUT_MS = 10_000;
|
|
26
|
+
/**
|
|
27
|
+
* `fetchImpl` with a deadline. The signal stops a real request; the race
|
|
28
|
+
* also covers a transport that ignores it, so doctor always finishes.
|
|
29
|
+
*/
|
|
30
|
+
const withDeadline = (fetchImpl) => (async (input, init) => {
|
|
31
|
+
const controller = new AbortController();
|
|
32
|
+
let timer;
|
|
33
|
+
const expired = new Promise((_, reject) => {
|
|
34
|
+
timer = setTimeout(() => {
|
|
35
|
+
controller.abort();
|
|
36
|
+
reject(new Error(`no answer within ${KEY_CHECK_TIMEOUT_MS / 1000}s`));
|
|
37
|
+
}, KEY_CHECK_TIMEOUT_MS);
|
|
38
|
+
});
|
|
39
|
+
try {
|
|
40
|
+
const response = await Promise.race([fetchImpl(input, { ...init, signal: controller.signal }), expired]);
|
|
41
|
+
// Read the body under the same deadline, so a reply that stalls
|
|
42
|
+
// mid-body cannot hang doctor either.
|
|
43
|
+
const body = await Promise.race([response.text(), expired]);
|
|
44
|
+
return new Response(body, { status: response.status, statusText: response.statusText, headers: response.headers });
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
clearTimeout(timer);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* `--live`: the one part of doctor that leaves the machine. Each provider a
|
|
52
|
+
* run consults is asked whether it accepts the key that run would send —
|
|
53
|
+
* the same free models-list call setup makes when the key is entered. An
|
|
54
|
+
* accepted key is then used for a one-token call to the run's model, which
|
|
55
|
+
* catches an unknown model or an account the provider will not bill. Only
|
|
56
|
+
* a refusal is a problem: no answer says nothing about the key or model.
|
|
57
|
+
*/
|
|
58
|
+
const checkKeys = async (resolved, env, problems) => {
|
|
59
|
+
const targets = [];
|
|
60
|
+
if (isSignedInRuntime(resolved)) {
|
|
61
|
+
targets.push({ provider: resolved.provider, role: 'default', model: resolved.model, runtime: resolved });
|
|
62
|
+
}
|
|
63
|
+
const fallback = resolved.provider !== 'demo' ? resolved.fallback : undefined;
|
|
64
|
+
if (fallback && CREDENTIAL_PROVIDER_NAMES.includes(fallback.provider)) {
|
|
65
|
+
targets.push({ provider: fallback.provider, role: 'fallback', model: fallback.model, runtime: fallback });
|
|
66
|
+
}
|
|
67
|
+
const fetchImpl = withDeadline(env.fetch ?? globalThis.fetch);
|
|
68
|
+
const checks = [];
|
|
69
|
+
for (const target of targets) {
|
|
70
|
+
const plan = keyToCheck(target.provider, target.runtime);
|
|
71
|
+
if ('skip' in plan) {
|
|
72
|
+
checks.push({ provider: target.provider, role: target.role, status: 'not checked', detail: plan.skip });
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const verdict = await verifyProviderKey(target.provider, plan.key, plan.baseUrl, fetchImpl);
|
|
76
|
+
const status = verdict.status === 'ok' ? 'accepted' : verdict.status;
|
|
77
|
+
const check = { provider: target.provider, role: target.role, status, ...(verdict.detail ? { detail: verdict.detail } : {}) };
|
|
78
|
+
checks.push(check);
|
|
79
|
+
if (status === 'accepted') {
|
|
80
|
+
if (target.provider === 'codex') {
|
|
81
|
+
check.model = { id: target.model, status: 'not checked', detail: 'codex runs it through its own harness' };
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const reply = await probeProviderModel(target.provider, plan.key, target.model, plan.baseUrl, fetchImpl);
|
|
85
|
+
check.model = { id: target.model, status: reply.status, ...(reply.detail ? { detail: reply.detail } : {}) };
|
|
86
|
+
if (reply.status === 'refused') {
|
|
87
|
+
problems.push(`${target.provider} accepted the key but would not run ${target.model} (${reply.detail ?? 'refused'}), so every such run fails. `
|
|
88
|
+
+ 'Choose a model the account can use with `stratus setup` → Model, or check the account\'s billing.');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (status === 'rejected') {
|
|
93
|
+
problems.push(`${target.provider} refused the key ${target.role === 'default' ? 'your runs' : 'fallback runs'} send (${verdict.detail ?? 'auth failed'}), so every such run fails. `
|
|
94
|
+
+ 'Sign in again with `stratus setup` → Providers, or fix the environment variable that supplies it.');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return checks;
|
|
98
|
+
};
|
|
12
99
|
/** Long enough for a busy daemon on loopback, short enough that doctor never hangs on a wedged one. */
|
|
13
100
|
const DAEMON_TIMEOUT_MS = 3_000;
|
|
14
101
|
/** What a daemon's /health said about each config file at start, keeping only well-formed entries. */
|
|
@@ -300,17 +387,27 @@ export const collectDoctorReport = async (command, warn, env = {}) => {
|
|
|
300
387
|
+ ignoredConfigRemedy(refusedByTrust, false));
|
|
301
388
|
}
|
|
302
389
|
const envProviderPick = envPick('STRATUS_PROVIDER');
|
|
390
|
+
// Nothing named a provider: the resolver takes the only stored sign-in.
|
|
391
|
+
// Worked out here too, so a run that picked it and then failed still
|
|
392
|
+
// reports it rather than "none".
|
|
393
|
+
const namedProvider = envProviderPick?.value ?? soul?.provider ?? fileConfig.provider;
|
|
394
|
+
const soleSignIn = resolved?.inferredProvider
|
|
395
|
+
?? (!resolved && namedProvider === undefined
|
|
396
|
+
? await signedInProviders(env).then((names) => (names.length === 1 ? names[0] : undefined)).catch(() => undefined)
|
|
397
|
+
: undefined);
|
|
303
398
|
const providerSource = envProviderPick
|
|
304
399
|
? envProviderPick.name
|
|
305
400
|
: soul?.provider
|
|
306
401
|
? `${soulPath} (soul frontmatter)`
|
|
307
402
|
: fileConfig.provider
|
|
308
403
|
? (winner?.path ?? 'config')
|
|
309
|
-
:
|
|
404
|
+
: soleSignIn !== undefined
|
|
405
|
+
? 'the only provider signed in — nothing set one'
|
|
406
|
+
: 'nothing set a provider';
|
|
310
407
|
// When resolution fails the intended provider is still worth reporting:
|
|
311
408
|
// "why is it anthropic" is exactly the question, and the problems below
|
|
312
409
|
// already say no run can start.
|
|
313
|
-
const intendedProvider =
|
|
410
|
+
const intendedProvider = namedProvider ?? soleSignIn ?? 'none';
|
|
314
411
|
const provider = resolved
|
|
315
412
|
? { value: resolved.provider, source: providerSource }
|
|
316
413
|
: { value: `${intendedProvider} (unreachable)`, source: providerSource };
|
|
@@ -413,6 +510,10 @@ export const collectDoctorReport = async (command, warn, env = {}) => {
|
|
|
413
510
|
if (behind.length > 0) {
|
|
414
511
|
problems.push(companionsBehindMessage(behind));
|
|
415
512
|
}
|
|
513
|
+
const missingHarnesses = await missingHarnessPackages(env, command.configPath);
|
|
514
|
+
if (missingHarnesses.length > 0) {
|
|
515
|
+
problems.push(harnessesMissingMessage(missingHarnesses));
|
|
516
|
+
}
|
|
416
517
|
let rosterCount = 0;
|
|
417
518
|
try {
|
|
418
519
|
rosterCount = (await readdir(agentsDirPath(env))).filter((file) => file.endsWith('.md')).length;
|
|
@@ -450,6 +551,30 @@ export const collectDoctorReport = async (command, warn, env = {}) => {
|
|
|
450
551
|
problems.push(`Slack tokens are stored for ${orphans.join(', ')}, which no agent matches — \`stratus serve\` skips them. `
|
|
451
552
|
+ 'Clear them from `stratus setup` → Channels.');
|
|
452
553
|
}
|
|
554
|
+
// The same plan `serve` acts on: where the folder is (or why there is
|
|
555
|
+
// none here), what the next start would move, and what is broken. A soul
|
|
556
|
+
// or workspace link whose folder was deleted or renamed: the soul drops
|
|
557
|
+
// out of the roster with a warning, and a missing workspace only comes
|
|
558
|
+
// back empty on the next write, so say which. And a soul in the folder
|
|
559
|
+
// nothing links to, which the roster never reads.
|
|
560
|
+
let agentsFolder;
|
|
561
|
+
try {
|
|
562
|
+
const plan = await planAgentsHome(env);
|
|
563
|
+
agentsFolder = plan.agentsHome !== undefined
|
|
564
|
+
? { path: plan.agentsHome, claimed: plan.claimed, pending: plan.souls.length + plan.workspaces.length }
|
|
565
|
+
: { reason: plan.reason ?? 'none available' };
|
|
566
|
+
if (plan.dangling.length > 0) {
|
|
567
|
+
problems.push(`These link into the agents folder, but what they point at is gone: ${plan.dangling.join(', ')}. `
|
|
568
|
+
+ 'Put the agent\'s folder back (or rename it back) to restore it; a missing workspace is recreated empty on the next write.');
|
|
569
|
+
}
|
|
570
|
+
if (plan.unlinked.length > 0) {
|
|
571
|
+
problems.push(`These souls are in the agents folder but no agent reads them: ${plan.unlinked.join(', ')}. `
|
|
572
|
+
+ 'Probably left by an `agent new` or `template add` that was stopped partway: run it again, or delete the folder if you don\'t want the agent.');
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
catch (error) {
|
|
576
|
+
problems.push(error instanceof Error ? error.message : String(error));
|
|
577
|
+
}
|
|
453
578
|
// The invisible failure doctor exists to surface: the service unit embeds
|
|
454
579
|
// absolute node and entrypoint paths, and upgrading node (an nvm version
|
|
455
580
|
// directory, say) leaves the unit pointing at an interpreter that no
|
|
@@ -494,6 +619,7 @@ export const collectDoctorReport = async (command, warn, env = {}) => {
|
|
|
494
619
|
+ 'delete them yourself once you are done with them.');
|
|
495
620
|
}
|
|
496
621
|
const daemon = await inspectDaemon(env, problems);
|
|
622
|
+
const keyChecks = command.live && resolved ? await checkKeys(resolved, env, problems) : undefined;
|
|
497
623
|
return {
|
|
498
624
|
...(winner ? { configInUse: winner.path } : {}),
|
|
499
625
|
configShadowed: shadowed.map((entry) => entry.path),
|
|
@@ -503,9 +629,11 @@ export const collectDoctorReport = async (command, warn, env = {}) => {
|
|
|
503
629
|
...(soul ? { agent: `${soul.agent.name} (${soul.agent.id})` } : {}),
|
|
504
630
|
...(fallback ? { fallback: { provider: fallback.provider, model: fallback.model } } : {}),
|
|
505
631
|
signIns,
|
|
632
|
+
...(keyChecks ? { keyChecks } : {}),
|
|
506
633
|
slackAgents,
|
|
507
634
|
slackPackageInstalled,
|
|
508
635
|
rosterCount,
|
|
636
|
+
...(agentsFolder !== undefined ? { agentsFolder } : {}),
|
|
509
637
|
daemon,
|
|
510
638
|
problems,
|
|
511
639
|
};
|
|
@@ -548,6 +676,14 @@ export const runDoctor = async (command, streams, env = {}) => {
|
|
|
548
676
|
writeLine(streams.stdout, ` (${shadowedPath} exists but is outranked)`);
|
|
549
677
|
}
|
|
550
678
|
writeLine(streams.stdout, ` agents ${report.rosterCount} soul file${report.rosterCount === 1 ? '' : 's'}`);
|
|
679
|
+
const folder = report.agentsFolder;
|
|
680
|
+
writeLine(streams.stdout, ` ${folder === undefined
|
|
681
|
+
? 'agents folder unknown'
|
|
682
|
+
: 'reason' in folder
|
|
683
|
+
? `no visible agents folder (${folder.reason}), so souls and workspaces stay in ~/.stratus/agents`
|
|
684
|
+
: folder.claimed
|
|
685
|
+
? `in ${folder.path}${folder.pending > 0 ? ` (${folder.pending} more to move there on the next start)` : ''}`
|
|
686
|
+
: `${folder.path} is created on the next start${folder.pending > 0 ? `, and ${folder.pending} soul(s) or workspace(s) move there` : ''}`}`);
|
|
551
687
|
if (report.fallback) {
|
|
552
688
|
writeLine(streams.stdout, ` ${'fallback'.padEnd(10)}${report.fallback.provider} · ${report.fallback.model}`);
|
|
553
689
|
writeLine(streams.stdout, ` ${''.padEnd(10)}used when the default model errors mid-run`);
|
|
@@ -557,6 +693,32 @@ export const runDoctor = async (command, streams, env = {}) => {
|
|
|
557
693
|
for (const entry of report.signIns) {
|
|
558
694
|
writeLine(streams.stdout, ` ${entry.provider.padEnd(10)}${entry.status}`);
|
|
559
695
|
}
|
|
696
|
+
if (report.keyChecks) {
|
|
697
|
+
writeLine(streams.stdout);
|
|
698
|
+
writeLine(streams.stdout, 'Live check');
|
|
699
|
+
if (report.keyChecks.length === 0) {
|
|
700
|
+
writeLine(streams.stdout, ' no provider sign-in to check');
|
|
701
|
+
}
|
|
702
|
+
for (const check of report.keyChecks) {
|
|
703
|
+
const what = check.status === 'accepted'
|
|
704
|
+
? 'key accepted'
|
|
705
|
+
: check.status === 'rejected'
|
|
706
|
+
? `key refused (${check.detail ?? 'auth failed'})`
|
|
707
|
+
: check.status === 'unreachable'
|
|
708
|
+
? `no answer (${check.detail ?? 'unreachable'}); the key was not judged`
|
|
709
|
+
: `not checked: ${check.detail ?? ''}`;
|
|
710
|
+
const model = check.model === undefined
|
|
711
|
+
? ''
|
|
712
|
+
: check.model.status === 'answered'
|
|
713
|
+
? ` · ${check.model.id} answered`
|
|
714
|
+
: check.model.status === 'refused'
|
|
715
|
+
? ` · ${check.model.id} refused (${check.model.detail ?? 'refused'})`
|
|
716
|
+
: check.model.status === 'no answer'
|
|
717
|
+
? ` · ${check.model.id} did not answer (${check.model.detail ?? 'unreachable'}); the model was not judged`
|
|
718
|
+
: ` · ${check.model.id} not checked: ${check.model.detail ?? ''}`;
|
|
719
|
+
writeLine(streams.stdout, ` ${check.provider.padEnd(10)}${what}${model}${check.role === 'fallback' ? ' (fallback)' : ''}`);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
560
722
|
writeLine(streams.stdout);
|
|
561
723
|
writeLine(streams.stdout, 'Channels');
|
|
562
724
|
writeLine(streams.stdout, ` slack ${report.slackAgents.length === 0
|