@stigmer/cli 3.1.7 → 3.1.9
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/commands/share.d.ts +3 -0
- package/commands/share.d.ts.map +1 -0
- package/commands/share.js +75 -0
- package/commands/share.js.map +1 -0
- package/config/index.d.ts +1 -1
- package/config/index.d.ts.map +1 -1
- package/config/index.js +1 -1
- package/config/index.js.map +1 -1
- package/config/resolve.d.ts +19 -2
- package/config/resolve.d.ts.map +1 -1
- package/config/resolve.js +40 -2
- package/config/resolve.js.map +1 -1
- package/local/runtime/node.d.ts +9 -2
- package/local/runtime/node.d.ts.map +1 -1
- package/local/runtime/node.js +38 -23
- package/local/runtime/node.js.map +1 -1
- package/package.json +6 -6
- package/program.d.ts.map +1 -1
- package/program.js +2 -0
- package/program.js.map +1 -1
- package/registry/metadata.d.ts.map +1 -1
- package/registry/metadata.js +2 -0
- package/registry/metadata.js.map +1 -1
- package/registry/verb-support.d.ts.map +1 -1
- package/registry/verb-support.js +3 -0
- package/registry/verb-support.js.map +1 -1
- package/resources/apply/apply.d.ts.map +1 -1
- package/resources/apply/apply.js +2 -0
- package/resources/apply/apply.js.map +1 -1
- package/resources/apply/handlers.d.ts.map +1 -1
- package/resources/apply/handlers.js +11 -0
- package/resources/apply/handlers.js.map +1 -1
- package/resources/connect/oauth.d.ts +0 -9
- package/resources/connect/oauth.d.ts.map +1 -1
- package/resources/connect/oauth.js +1 -17
- package/resources/connect/oauth.js.map +1 -1
- package/resources/share.d.ts +38 -0
- package/resources/share.d.ts.map +1 -0
- package/resources/share.js +188 -0
- package/resources/share.js.map +1 -0
- package/resources/stream/convert.d.ts +6 -2
- package/resources/stream/convert.d.ts.map +1 -1
- package/resources/stream/convert.js +8 -2
- package/resources/stream/convert.js.map +1 -1
- package/resources/stream/events.d.ts +14 -2
- package/resources/stream/events.d.ts.map +1 -1
- package/resources/stream/events.js.map +1 -1
- package/resources/stream/render-ndjson.js +2 -0
- package/resources/stream/render-ndjson.js.map +1 -1
- package/resources/stream/render-plaintext.d.ts.map +1 -1
- package/resources/stream/render-plaintext.js +3 -0
- package/resources/stream/render-plaintext.js.map +1 -1
- package/resources/stream/snapshot.js +6 -1
- package/resources/stream/snapshot.js.map +1 -1
- package/resources/stream/tool-state.d.ts +1 -1
- package/resources/stream/tool-state.d.ts.map +1 -1
- package/resources/stream/tool-state.js +13 -4
- package/resources/stream/tool-state.js.map +1 -1
- package/src/commands/connect.test.ts +26 -4
- package/src/commands/share.ts +99 -0
- package/src/config/index.ts +2 -0
- package/src/config/resolve.test.ts +38 -0
- package/src/config/resolve.ts +42 -3
- package/src/local/runtime/node.ts +43 -25
- package/src/local/runtime/runtime.test.ts +5 -4
- package/src/program.test.ts +7 -0
- package/src/program.ts +2 -0
- package/src/registry/metadata.ts +2 -0
- package/src/registry/verb-support.ts +3 -0
- package/src/resources/apply/apply.ts +2 -0
- package/src/resources/apply/handlers.ts +11 -0
- package/src/resources/connect/oauth.test.ts +1 -24
- package/src/resources/connect/oauth.ts +1 -17
- package/src/resources/read-verbs.integration.test.ts +1 -1
- package/src/resources/share.test.ts +498 -0
- package/src/resources/share.ts +287 -0
- package/src/resources/stream/convert.ts +17 -3
- package/src/resources/stream/diff.test.ts +22 -0
- package/src/resources/stream/events.ts +15 -1
- package/src/resources/stream/render-ndjson.test.ts +10 -0
- package/src/resources/stream/render-ndjson.ts +2 -0
- package/src/resources/stream/render-plaintext.test.ts +8 -0
- package/src/resources/stream/render-plaintext.ts +3 -0
- package/src/resources/stream/snapshot.test.ts +14 -0
- package/src/resources/stream/snapshot.ts +5 -1
- package/src/resources/stream/tool-state.ts +13 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../../src/resources/stream/snapshot.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,gEAAgE;AAChE,+EAA+E;AAC/E,iFAAiF;AACjF,wDAAwD;AACxD,EAAE;AACF,6EA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AA8E;AAC9E,8CAA8C;AAC9C,SAAS,eAAe,CAAC,SAAqB;IAC5C,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAClC,IAAI,CAAC,CAAC,SAAS,KAAK,EAAE;YAAE,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,CAAC,SAAS,KAAK,EAAE;YAAE,OAAO,CAAC,CAAC,CAAC;QAClC,OAAO,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -22,7 +22,7 @@ export declare class ToolStateTracker {
|
|
|
22
22
|
has(id: string): boolean;
|
|
23
23
|
private running;
|
|
24
24
|
private waiting;
|
|
25
|
-
private
|
|
25
|
+
private terminal;
|
|
26
26
|
}
|
|
27
27
|
/** The tool-call ID carried by a tool-lifecycle event, or "" otherwise. Mirrors Go's toolEventID. */
|
|
28
28
|
export declare function toolEventId(event: StreamEvent): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-state.d.ts","sourceRoot":"","sources":["../../../src/resources/stream/tool-state.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iEAAiE,CAAC;AAEhG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,qBAAa,gBAAgB;IAE3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IAEpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IAErD;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,EAAE;IAqExE;;;;OAIG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,OAAO;
|
|
1
|
+
{"version":3,"file":"tool-state.d.ts","sourceRoot":"","sources":["../../../src/resources/stream/tool-state.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iEAAiE,CAAC;AAEhG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,qBAAa,gBAAgB;IAE3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;IAEpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6B;IAErD;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,EAAE;IAqExE;;;;OAIG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAIxB,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,QAAQ;CAQjB;AAED,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAWtD;AAED,wGAAwG;AACxG,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAO1F"}
|
|
@@ -46,13 +46,13 @@ export class ToolStateTracker {
|
|
|
46
46
|
// First sight, already terminal (e.g. re-attach): synthesize completion so
|
|
47
47
|
// the block exists — otherwise its MESSAGE_TOOL is suppressed and it vanishes.
|
|
48
48
|
if (!seen && isTerminalToolStatus(current)) {
|
|
49
|
-
pending.push(this.
|
|
49
|
+
pending.push(this.terminal(tc, current, subAgentId));
|
|
50
50
|
this.states.set(tc.id, current);
|
|
51
51
|
continue;
|
|
52
52
|
}
|
|
53
53
|
// running/waiting -> terminal: close the block.
|
|
54
54
|
if (seen && (prev === "running" || prev === "waiting_approval") && isTerminalToolStatus(current)) {
|
|
55
|
-
pending.push(this.
|
|
55
|
+
pending.push(this.terminal(tc, current, subAgentId));
|
|
56
56
|
this.states.set(tc.id, current);
|
|
57
57
|
this.results.delete(tc.id);
|
|
58
58
|
continue;
|
|
@@ -97,8 +97,16 @@ export class ToolStateTracker {
|
|
|
97
97
|
waiting(tc, subAgentId) {
|
|
98
98
|
return { kind: "toolWaitingApproval", toolCallId: tc.id, toolCall: convertToolCall(tc), subAgentId };
|
|
99
99
|
}
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
// The terminal-close event for a settled status: interrupted gets its own
|
|
101
|
+
// kind (issue #207) so renderers never print a checkmark for a tool the
|
|
102
|
+
// platform cut short; every other terminal status closes as completed.
|
|
103
|
+
terminal(tc, status, subAgentId) {
|
|
104
|
+
return {
|
|
105
|
+
kind: status === "interrupted" ? "toolInterrupted" : "toolCompleted",
|
|
106
|
+
toolCallId: tc.id,
|
|
107
|
+
toolCall: convertToolCall(tc),
|
|
108
|
+
subAgentId,
|
|
109
|
+
};
|
|
102
110
|
}
|
|
103
111
|
}
|
|
104
112
|
/** The tool-call ID carried by a tool-lifecycle event, or "" otherwise. Mirrors Go's toolEventID. */
|
|
@@ -106,6 +114,7 @@ export function toolEventId(event) {
|
|
|
106
114
|
switch (event.kind) {
|
|
107
115
|
case "toolRunning":
|
|
108
116
|
case "toolCompleted":
|
|
117
|
+
case "toolInterrupted":
|
|
109
118
|
case "toolWaitingApproval":
|
|
110
119
|
case "toolStreamDelta":
|
|
111
120
|
return event.toolCallId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-state.js","sourceRoot":"","sources":["../../../src/resources/stream/tool-state.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAC7E,iFAAiF;AACjF,+EAA+E;AAC/E,+BAA+B;AAG/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CAAC,EAAE,CAAC,CAAC;QAC3B,IAAI,EAAE,KAAK,EAAE;YAAE,CAAC,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -6,14 +6,34 @@
|
|
|
6
6
|
// only when it is actually going to push. `--dry-run` discovers locally and must
|
|
7
7
|
// stay usable with no org configured.
|
|
8
8
|
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
9
|
+
// Local mode always resolves an org (the single-tenant DEFAULT_LOCAL_ORG
|
|
10
|
+
// fallback in resolveOrganization), so the guard can only fire in cloud mode
|
|
11
|
+
// with no org selected. The guard test injects that shape by overriding
|
|
12
|
+
// `load()`; everything else stays real. The guard runs before any network
|
|
13
|
+
// call, so both cases are fully deterministic and offline.
|
|
12
14
|
|
|
13
15
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
16
|
+
import type { Config } from "../config/index.js";
|
|
14
17
|
import { classify, ExitCode } from "../errors/index.js";
|
|
15
18
|
import { buildProgram } from "../program.js";
|
|
16
19
|
|
|
20
|
+
// When set, `load()` returns this config instead of reading disk/defaults.
|
|
21
|
+
// Reset in beforeEach so each test opts in explicitly.
|
|
22
|
+
let configOverride: Config | undefined;
|
|
23
|
+
|
|
24
|
+
vi.mock("../config/index.js", async (importOriginal) => {
|
|
25
|
+
const actual = await importOriginal<typeof import("../config/index.js")>();
|
|
26
|
+
return {
|
|
27
|
+
...actual,
|
|
28
|
+
load: (path?: string) => configOverride ?? actual.load(path),
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/** An authenticated cloud config with no org selected — the guard's target shape. */
|
|
33
|
+
function cloudConfigWithoutOrg(): Config {
|
|
34
|
+
return { backend: { type: "cloud", cloud: { token: "test-token" } } };
|
|
35
|
+
}
|
|
36
|
+
|
|
17
37
|
interface RunOutcome {
|
|
18
38
|
readonly exitCode: number;
|
|
19
39
|
readonly message: string;
|
|
@@ -43,6 +63,7 @@ let savedOrg: string | undefined;
|
|
|
43
63
|
let savedApiKey: string | undefined;
|
|
44
64
|
|
|
45
65
|
beforeEach(() => {
|
|
66
|
+
configOverride = undefined;
|
|
46
67
|
savedOrg = process.env.STIGMER_ORG_ID;
|
|
47
68
|
savedApiKey = process.env.STIGMER_API_KEY;
|
|
48
69
|
delete process.env.STIGMER_ORG_ID;
|
|
@@ -57,7 +78,8 @@ afterEach(() => {
|
|
|
57
78
|
});
|
|
58
79
|
|
|
59
80
|
describe("connect mcp-server org guard", () => {
|
|
60
|
-
it("fails fast with actionable guidance when no org
|
|
81
|
+
it("fails fast with actionable guidance when cloud mode has no org (non-dry-run)", async () => {
|
|
82
|
+
configOverride = cloudConfigWithoutOrg();
|
|
61
83
|
const outcome = await runConnect("mcp_test");
|
|
62
84
|
expect(outcome.message).toContain("organization not set");
|
|
63
85
|
expect(outcome.exitCode).toBe(ExitCode.Usage);
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// `stigmer share agent <ref>` — enable (default) or disable (--off) public
|
|
2
|
+
// sharing for an agent, printing the hosted chat link and embed snippet.
|
|
3
|
+
//
|
|
4
|
+
// Thin handler: resolve credentials/org and the console origin, delegate the
|
|
5
|
+
// merge-preserving toggle to resources/share, render the result. `--open` is a
|
|
6
|
+
// best-effort browser launch after render (mirrors auth login: the URL is
|
|
7
|
+
// already on screen, so a failed launch costs nothing). Heavy modules are
|
|
8
|
+
// lazy-imported so `--help` stays fast (DD-001).
|
|
9
|
+
|
|
10
|
+
import type { Command } from "commander";
|
|
11
|
+
import { ensureAuthenticated, resolveConsoleURL, resolveOrganization } from "../config/index.js";
|
|
12
|
+
import { UsageError } from "../errors/index.js";
|
|
13
|
+
import type { OutputFlags } from "../output/index.js";
|
|
14
|
+
import type { ShareAudience } from "../resources/share.js";
|
|
15
|
+
import { addResultFlags, globalOrg, resultFormat } from "./shared.js";
|
|
16
|
+
|
|
17
|
+
interface ShareAgentFlags extends OutputFlags {
|
|
18
|
+
off?: boolean;
|
|
19
|
+
open?: boolean;
|
|
20
|
+
audience?: string;
|
|
21
|
+
resetLink?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function registerShare(program: Command): void {
|
|
25
|
+
const share = program.command("share").description("share resources via a hosted link");
|
|
26
|
+
|
|
27
|
+
const agent = share
|
|
28
|
+
.command("agent <ref>")
|
|
29
|
+
.description("enable sharing for an agent and print its chat link and embed snippet")
|
|
30
|
+
.option("--off", "disable sharing (the link stops working immediately)")
|
|
31
|
+
.option(
|
|
32
|
+
"--audience <audience>",
|
|
33
|
+
"who can chat: 'public' (anyone with the link) or 'org' (signed-in organization members only); omit to keep the current audience",
|
|
34
|
+
)
|
|
35
|
+
.option(
|
|
36
|
+
"--reset-link",
|
|
37
|
+
"generate a new share link and kill the current one immediately (public audience)",
|
|
38
|
+
)
|
|
39
|
+
.option("--open", "open the chat link in your browser")
|
|
40
|
+
.action((ref: string, options: ShareAgentFlags, command: Command) => runShareAgent(ref, options, command));
|
|
41
|
+
addResultFlags(agent);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Validates --audience before any network work; omitted means "preserve".
|
|
45
|
+
function parseAudience(value: string | undefined): ShareAudience | undefined {
|
|
46
|
+
if (value === undefined) return undefined;
|
|
47
|
+
if (value === "public" || value === "org") return value;
|
|
48
|
+
throw new UsageError(`invalid --audience '${value}'\n\nExpected 'public' or 'org'.`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function runShareAgent(ref: string, options: ShareAgentFlags, command: Command): Promise<void> {
|
|
52
|
+
const format = resultFormat(options);
|
|
53
|
+
|
|
54
|
+
const [{ connectBackend }, { shareAgent }, { renderResult }] = await Promise.all([
|
|
55
|
+
import("../backend.js"),
|
|
56
|
+
import("../resources/share.js"),
|
|
57
|
+
import("../output/command-result.js"),
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
const client = connectBackend();
|
|
61
|
+
ensureAuthenticated(client.config);
|
|
62
|
+
const org = resolveOrganization(client.config, globalOrg(command));
|
|
63
|
+
|
|
64
|
+
const backendType = client.config.backend.type;
|
|
65
|
+
const appOrigin = resolveConsoleURL(backendType);
|
|
66
|
+
const enabled = options.off !== true;
|
|
67
|
+
const audience = parseAudience(options.audience);
|
|
68
|
+
const resetLink = options.resetLink === true;
|
|
69
|
+
if (resetLink && !enabled) {
|
|
70
|
+
throw new UsageError(
|
|
71
|
+
"--reset-link cannot be combined with --off\n\n" +
|
|
72
|
+
"Disabling sharing already kills the link. Reset is for keeping\n" +
|
|
73
|
+
"sharing on while invalidating the current URL.",
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const result = await shareAgent(client.stigmer, ref, org, {
|
|
78
|
+
enabled,
|
|
79
|
+
...(audience !== undefined ? { audience } : {}),
|
|
80
|
+
resetLink,
|
|
81
|
+
appOrigin,
|
|
82
|
+
isLocal: backendType === "local",
|
|
83
|
+
});
|
|
84
|
+
renderResult(result, format);
|
|
85
|
+
|
|
86
|
+
if (options.open === true && enabled) {
|
|
87
|
+
// Best-effort: the link is already rendered above, so a launch failure
|
|
88
|
+
// only needs a nudge, never an error exit (mirrors auth login).
|
|
89
|
+
const url = result.sections.find((s) => s.title.endsWith("chat link"))?.items[0];
|
|
90
|
+
if (url !== undefined) {
|
|
91
|
+
try {
|
|
92
|
+
const { default: open } = await import("open");
|
|
93
|
+
await open(url);
|
|
94
|
+
} catch {
|
|
95
|
+
process.stderr.write("Could not open the browser automatically. Please open the link above.\n");
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
package/src/config/index.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { afterEach, describe, expect, it } from "vitest";
|
|
|
2
2
|
import { CliExitError } from "../errors/index.js";
|
|
3
3
|
import type { Config } from "./config.js";
|
|
4
4
|
import {
|
|
5
|
+
DEFAULT_CLOUD_CONSOLE_URL,
|
|
5
6
|
ensureAuthenticated,
|
|
7
|
+
resolveConsoleURL,
|
|
6
8
|
resolveContextOrganization,
|
|
7
9
|
resolveEndpoint,
|
|
8
10
|
resolveOrganization,
|
|
@@ -77,6 +79,42 @@ describe("resolveOrganization", () => {
|
|
|
77
79
|
it("falls back to legacy cloud org_id", () => {
|
|
78
80
|
expect(resolveContextOrganization(cloudConfig({ org_id: "legacy" }))).toBe("legacy");
|
|
79
81
|
});
|
|
82
|
+
|
|
83
|
+
it("defaults to the seedpack org in local mode when nothing is configured", () => {
|
|
84
|
+
expect(resolveOrganization({ backend: { type: "local" } })).toBe("stigmer");
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("prefers an explicit context org over the local default", () => {
|
|
88
|
+
const config: Config = { backend: { type: "local" }, context: { organization: "my-local-org" } };
|
|
89
|
+
expect(resolveOrganization(config)).toBe("my-local-org");
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it("does not apply the local default in cloud mode (org stays empty)", () => {
|
|
93
|
+
expect(resolveOrganization({ backend: { type: "cloud" } })).toBe("");
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("reports an unset local org as empty via resolveContextOrganization (no implicit default)", () => {
|
|
97
|
+
// The implicit local default lives only in resolveOrganization (effective
|
|
98
|
+
// org for operations); the context query must stay faithful so config/context
|
|
99
|
+
// display can show "(not set)".
|
|
100
|
+
expect(resolveContextOrganization({ backend: { type: "local" } })).toBe("");
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
describe("resolveConsoleURL", () => {
|
|
105
|
+
it("prefers the STIGMER_CONSOLE_URL override", () => {
|
|
106
|
+
expect(resolveConsoleURL("cloud", { STIGMER_CONSOLE_URL: "https://console.example" } as NodeJS.ProcessEnv)).toBe(
|
|
107
|
+
"https://console.example",
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it("uses the local web-console port for the local backend", () => {
|
|
112
|
+
expect(resolveConsoleURL("local", {} as NodeJS.ProcessEnv)).toBe("http://localhost:8234");
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("uses the cloud console URL for the cloud backend", () => {
|
|
116
|
+
expect(resolveConsoleURL("cloud", {} as NodeJS.ProcessEnv)).toBe(DEFAULT_CLOUD_CONSOLE_URL);
|
|
117
|
+
});
|
|
80
118
|
});
|
|
81
119
|
|
|
82
120
|
describe("ensureAuthenticated", () => {
|
package/src/config/resolve.ts
CHANGED
|
@@ -3,11 +3,22 @@
|
|
|
3
3
|
// precedence keeps every call site consistent (mirrors the Go CLI's Resolve*).
|
|
4
4
|
|
|
5
5
|
import { CliExitError, ExitCode } from "../errors/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { WEB_CONSOLE_PORT } from "../local/constants.js";
|
|
7
|
+
import { type BackendType, type Config, isCloudMode } from "./config.js";
|
|
7
8
|
|
|
8
9
|
const DEFAULT_CLOUD_ENDPOINT = "api.stigmer.ai:443";
|
|
9
10
|
const DEFAULT_LOCAL_ENDPOINT = "localhost:7234";
|
|
10
11
|
|
|
12
|
+
/** Well-known URL for the Stigmer Cloud web console. */
|
|
13
|
+
export const DEFAULT_CLOUD_CONSOLE_URL = "https://app.stigmer.ai";
|
|
14
|
+
|
|
15
|
+
// Local mode is single-tenant: the seedpack bootstraps resources into the
|
|
16
|
+
// "stigmer" org (see client-apps/cli/src/local/seedpack/apply.ts DEFAULT_ORG).
|
|
17
|
+
// Org-scoped getByReference now requires an org, so bare-slug `get`/`run`/`apply`
|
|
18
|
+
// in local mode fall back to this default when nothing else is configured. Cloud
|
|
19
|
+
// mode has no implicit org — the caller must select one (flag/env/context/login).
|
|
20
|
+
const DEFAULT_LOCAL_ORG = "stigmer";
|
|
21
|
+
|
|
11
22
|
/**
|
|
12
23
|
* Resolve the server endpoint.
|
|
13
24
|
* STIGMER_SERVER_ADDRESS (explicit override, either backend)
|
|
@@ -52,10 +63,38 @@ export function resolveOrganization(config: Config, flagOrg?: string): string {
|
|
|
52
63
|
if (env !== undefined && env !== "") {
|
|
53
64
|
return env;
|
|
54
65
|
}
|
|
55
|
-
|
|
66
|
+
const context = resolveContextOrganization(config);
|
|
67
|
+
if (context !== "") {
|
|
68
|
+
return context;
|
|
69
|
+
}
|
|
70
|
+
// Nothing configured: local mode falls back to its single-tenant default org
|
|
71
|
+
// so bare-slug operations resolve without ceremony; cloud stays empty (the
|
|
72
|
+
// caller must select an org, e.g. apply raises a clear "organization not set").
|
|
73
|
+
return isCloudMode(config) ? "" : DEFAULT_LOCAL_ORG;
|
|
56
74
|
}
|
|
57
75
|
|
|
58
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Resolve the web console URL:
|
|
78
|
+
* 1. `STIGMER_CONSOLE_URL` (explicit override)
|
|
79
|
+
* 2. local backend → `http://localhost:{WEB_CONSOLE_PORT}`
|
|
80
|
+
* 3. cloud backend → {@link DEFAULT_CLOUD_CONSOLE_URL}
|
|
81
|
+
*
|
|
82
|
+
* The console origin is also the app origin that serves the hosted chat
|
|
83
|
+
* page (`/chat/<org>/<slug>`) and the embed loader (`/embed.js`), so
|
|
84
|
+
* share-link builders use this same resolver.
|
|
85
|
+
*/
|
|
86
|
+
export function resolveConsoleURL(backendType: BackendType, env: NodeJS.ProcessEnv = process.env): string {
|
|
87
|
+
const override = env.STIGMER_CONSOLE_URL;
|
|
88
|
+
if (override !== undefined && override !== "") return override;
|
|
89
|
+
if (backendType === "local") return `http://localhost:${WEB_CONSOLE_PORT}`;
|
|
90
|
+
return DEFAULT_CLOUD_CONSOLE_URL;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The configured organization, with the legacy cloud.org_id fallback. Reports
|
|
95
|
+
* only what is explicitly set (no implicit local default) so config/context
|
|
96
|
+
* display can faithfully show "(not set)".
|
|
97
|
+
*/
|
|
59
98
|
export function resolveContextOrganization(config: Config): string {
|
|
60
99
|
if (config.context?.organization !== undefined && config.context.organization !== "") {
|
|
61
100
|
return config.context.organization;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Resolution of the Node.js runtime used to launch the runner subprocess.
|
|
2
2
|
//
|
|
3
3
|
// We reuse the very Node that is running the CLI (process.execPath). The CLI is
|
|
4
|
-
// itself an npm package with `engines: node >=
|
|
5
|
-
// present by construction — there is deliberately no hermetic Node
|
|
6
|
-
// (DD-002: keep the base install lean; nothing to acquire that the host
|
|
7
|
-
// guarantees). This is exactly what the conformance harness does
|
|
4
|
+
// itself an npm package with `engines: node >= 22.13`, so a suitable Node is
|
|
5
|
+
// always present by construction — there is deliberately no hermetic Node
|
|
6
|
+
// download (DD-002: keep the base install lean; nothing to acquire that the host
|
|
7
|
+
// already guarantees). This is exactly what the conformance harness does
|
|
8
8
|
// (`spawn(process.execPath, ...)`). An explicit STIGMER_NODE_BIN override is
|
|
9
9
|
// honored and version-checked for advanced/multi-runtime setups.
|
|
10
10
|
|
|
@@ -12,8 +12,20 @@ import { execFileSync } from "node:child_process";
|
|
|
12
12
|
import { CliExitError } from "../../errors/cli-exit-error.js";
|
|
13
13
|
import { ExitCode } from "../../errors/exit-codes.js";
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Minimum Node version the runner requires: 22.13. The runner's durable local
|
|
17
|
+
* checkpointer imports Node's built-in `node:sqlite`, which is only available
|
|
18
|
+
* WITHOUT the --experimental-sqlite flag from v22.13 (and v23.4) onward. A
|
|
19
|
+
* major-only gate would let 22.0-22.12 pass and then crash at checkpointer
|
|
20
|
+
* creation, so the minor is enforced when the major is exactly 22.
|
|
21
|
+
*/
|
|
22
|
+
export const MIN_NODE_MAJOR = 22;
|
|
23
|
+
export const MIN_NODE_MINOR_ON_MAJOR = 13;
|
|
24
|
+
|
|
25
|
+
interface NodeVersion {
|
|
26
|
+
major: number;
|
|
27
|
+
minor: number;
|
|
28
|
+
}
|
|
17
29
|
|
|
18
30
|
/**
|
|
19
31
|
* Resolve the Node binary to launch the runner with. Honors STIGMER_NODE_BIN
|
|
@@ -22,46 +34,52 @@ export const MIN_NODE_MAJOR = 20;
|
|
|
22
34
|
export function resolveNode(): string {
|
|
23
35
|
const override = process.env.STIGMER_NODE_BIN;
|
|
24
36
|
if (override !== undefined && override !== "") {
|
|
25
|
-
assertVersion(override,
|
|
37
|
+
assertVersion(override, probeNodeVersion(override));
|
|
26
38
|
return override;
|
|
27
39
|
}
|
|
28
|
-
// The CLI's own runtime:
|
|
29
|
-
assertVersion(process.execPath,
|
|
40
|
+
// The CLI's own runtime: version is readable directly, no subprocess needed.
|
|
41
|
+
assertVersion(process.execPath, parseVersion(process.versions.node));
|
|
30
42
|
return process.execPath;
|
|
31
43
|
}
|
|
32
44
|
|
|
33
|
-
function
|
|
34
|
-
return parseMajor(process.versions.node);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function probeNodeMajor(bin: string): number | null {
|
|
45
|
+
function probeNodeVersion(bin: string): NodeVersion | null {
|
|
38
46
|
try {
|
|
39
47
|
const out = execFileSync(bin, ["--version"], { encoding: "utf8" });
|
|
40
|
-
return
|
|
48
|
+
return parseVersion(out.trim());
|
|
41
49
|
} catch {
|
|
42
50
|
return null;
|
|
43
51
|
}
|
|
44
52
|
}
|
|
45
53
|
|
|
46
|
-
// Parses "v22.22.2" or "22.22.2" to its major
|
|
47
|
-
function
|
|
48
|
-
const match = /^v?(\d+)\./.exec(version.trim());
|
|
54
|
+
// Parses "v22.22.2" or "22.22.2" to its major/minor numbers.
|
|
55
|
+
function parseVersion(version: string): NodeVersion | null {
|
|
56
|
+
const match = /^v?(\d+)\.(\d+)\./.exec(version.trim());
|
|
49
57
|
if (match === null) return null;
|
|
50
58
|
const major = Number.parseInt(match[1], 10);
|
|
51
|
-
|
|
59
|
+
const minor = Number.parseInt(match[2], 10);
|
|
60
|
+
if (!Number.isInteger(major) || !Number.isInteger(minor)) return null;
|
|
61
|
+
return { major, minor };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// True when the version is at or above the 22.13 floor.
|
|
65
|
+
function meetsFloor(v: NodeVersion): boolean {
|
|
66
|
+
if (v.major > MIN_NODE_MAJOR) return true;
|
|
67
|
+
return v.major === MIN_NODE_MAJOR && v.minor >= MIN_NODE_MINOR_ON_MAJOR;
|
|
52
68
|
}
|
|
53
69
|
|
|
54
|
-
function assertVersion(bin: string,
|
|
55
|
-
|
|
70
|
+
function assertVersion(bin: string, version: NodeVersion | null): void {
|
|
71
|
+
const floor = `${MIN_NODE_MAJOR}.${MIN_NODE_MINOR_ON_MAJOR}`;
|
|
72
|
+
if (version === null) {
|
|
56
73
|
throw new CliExitError(`could not determine the Node version of ${bin}`, ExitCode.General, [
|
|
57
|
-
`Ensure ${bin} is a working Node >= ${
|
|
74
|
+
`Ensure ${bin} is a working Node >= ${floor} runtime.`,
|
|
58
75
|
]);
|
|
59
76
|
}
|
|
60
|
-
if (
|
|
77
|
+
if (!meetsFloor(version)) {
|
|
61
78
|
throw new CliExitError(
|
|
62
|
-
`Node >= ${
|
|
79
|
+
`Node >= ${floor} is required to run the runner ` +
|
|
80
|
+
`(found ${version.major}.${version.minor} at ${bin})`,
|
|
63
81
|
ExitCode.General,
|
|
64
|
-
[`Upgrade Node to ${
|
|
82
|
+
[`Upgrade Node to ${floor} or newer, or point STIGMER_NODE_BIN at one.`],
|
|
65
83
|
);
|
|
66
84
|
}
|
|
67
85
|
}
|
|
@@ -3,7 +3,7 @@ import { tmpdir } from "node:os";
|
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
5
|
import { CliExitError } from "../../errors/cli-exit-error.js";
|
|
6
|
-
import { MIN_NODE_MAJOR, resolveNode } from "./node.js";
|
|
6
|
+
import { MIN_NODE_MAJOR, MIN_NODE_MINOR_ON_MAJOR, resolveNode } from "./node.js";
|
|
7
7
|
import { acquireRunner, resolveRunner } from "./runner.js";
|
|
8
8
|
import { resolveServerBinary } from "./server.js";
|
|
9
9
|
import { which } from "./which.js";
|
|
@@ -57,7 +57,7 @@ describe("resolveNode", () => {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
it("honors a valid override", () => {
|
|
60
|
-
process.env.STIGMER_NODE_BIN = process.execPath; // a real Node >=
|
|
60
|
+
process.env.STIGMER_NODE_BIN = process.execPath; // a real Node >= 22.13
|
|
61
61
|
expect(resolveNode()).toBe(process.execPath);
|
|
62
62
|
});
|
|
63
63
|
|
|
@@ -66,8 +66,9 @@ describe("resolveNode", () => {
|
|
|
66
66
|
expect(() => resolveNode()).toThrow(CliExitError);
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
it("requires Node >=
|
|
70
|
-
expect(MIN_NODE_MAJOR).toBe(
|
|
69
|
+
it("requires Node >= 22.13 (the node:sqlite floor)", () => {
|
|
70
|
+
expect(MIN_NODE_MAJOR).toBe(22);
|
|
71
|
+
expect(MIN_NODE_MINOR_ON_MAJOR).toBe(13);
|
|
71
72
|
});
|
|
72
73
|
});
|
|
73
74
|
|
package/src/program.test.ts
CHANGED
|
@@ -43,6 +43,13 @@ describe("buildProgram", () => {
|
|
|
43
43
|
expect(message?.required).toBe(true);
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
+
it("exposes the share subcommands", () => {
|
|
47
|
+
const program = buildProgram();
|
|
48
|
+
const share = program.commands.find((command) => command.name() === "share");
|
|
49
|
+
const subs = share?.commands.map((command) => command.name());
|
|
50
|
+
expect(subs).toEqual(["agent"]);
|
|
51
|
+
});
|
|
52
|
+
|
|
46
53
|
it("exposes the usage subcommands", () => {
|
|
47
54
|
const program = buildProgram();
|
|
48
55
|
const usage = program.commands.find((command) => command.name() === "usage");
|
package/src/program.ts
CHANGED
|
@@ -31,6 +31,7 @@ import { registerRun } from "./commands/run.js";
|
|
|
31
31
|
import { registerSearch } from "./commands/search.js";
|
|
32
32
|
import { registerSeedpack } from "./commands/seedpack.js";
|
|
33
33
|
import { registerSetup } from "./commands/setup.js";
|
|
34
|
+
import { registerShare } from "./commands/share.js";
|
|
34
35
|
import { registerStatus } from "./commands/status.js";
|
|
35
36
|
import { registerTag } from "./commands/tag.js";
|
|
36
37
|
import { registerUp } from "./commands/up.js";
|
|
@@ -76,6 +77,7 @@ export function buildProgram(): Command {
|
|
|
76
77
|
registerValidate(program);
|
|
77
78
|
registerDelete(program);
|
|
78
79
|
registerTag(program);
|
|
80
|
+
registerShare(program);
|
|
79
81
|
registerDiff(program);
|
|
80
82
|
registerUsage(program);
|
|
81
83
|
registerPush(program);
|
package/src/registry/metadata.ts
CHANGED
|
@@ -32,6 +32,7 @@ export const KIND_META: ReadonlyMap<ApiResourceKind, KindMeta> = new Map([
|
|
|
32
32
|
[ApiResourceKind.identity_provider, { name: "IdentityProvider", displayName: "Identity Provider", idPrefix: "idp" }],
|
|
33
33
|
[ApiResourceKind.oauth_app, { name: "OAuthApp", displayName: "OAuth App", idPrefix: "oapp" }],
|
|
34
34
|
[ApiResourceKind.environment, { name: "Environment", displayName: "Environment", idPrefix: "env" }],
|
|
35
|
+
[ApiResourceKind.agent_share, { name: "AgentShare", displayName: "Agent Share", idPrefix: "ash" }],
|
|
35
36
|
[ApiResourceKind.agent_instance, { name: "AgentInstance", displayName: "Agent Instance", idPrefix: "ain" }],
|
|
36
37
|
[ApiResourceKind.workflow_instance, { name: "WorkflowInstance", displayName: "Workflow Instance", idPrefix: "win" }],
|
|
37
38
|
[ApiResourceKind.session, { name: "Session", displayName: "Session", idPrefix: "ses" }],
|
|
@@ -54,6 +55,7 @@ export const CLI_RELEVANT_KINDS: readonly ApiResourceKind[] = [
|
|
|
54
55
|
ApiResourceKind.identity_provider,
|
|
55
56
|
ApiResourceKind.oauth_app,
|
|
56
57
|
ApiResourceKind.environment,
|
|
58
|
+
ApiResourceKind.agent_share,
|
|
57
59
|
ApiResourceKind.agent_instance,
|
|
58
60
|
ApiResourceKind.workflow_instance,
|
|
59
61
|
ApiResourceKind.session,
|
|
@@ -39,6 +39,9 @@ export const VERB_SUPPORT: ReadonlyMap<ApiResourceKind, ReadonlySet<Verb>> = new
|
|
|
39
39
|
[ApiResourceKind.identity_provider, new Set<Verb>([Verb.Apply, Verb.Get, Verb.List, Verb.Delete])],
|
|
40
40
|
[ApiResourceKind.oauth_app, new Set<Verb>([Verb.Apply, Verb.Get, Verb.List, Verb.Delete])],
|
|
41
41
|
[ApiResourceKind.environment, new Set<Verb>([Verb.Apply, Verb.Get, Verb.List, Verb.Delete])],
|
|
42
|
+
// Enable/disable flows through `stigmer share agent`; the generic verbs
|
|
43
|
+
// cover the declarative path (apply a manifest, inspect, tear down).
|
|
44
|
+
[ApiResourceKind.agent_share, new Set<Verb>([Verb.Apply, Verb.Get, Verb.List, Verb.Delete])],
|
|
42
45
|
[ApiResourceKind.agent_instance, new Set<Verb>([Verb.Apply, Verb.Get, Verb.List, Verb.Delete])],
|
|
43
46
|
// No list: proto exposes getByWorkflow (requires workflow_id), not a generic list.
|
|
44
47
|
[ApiResourceKind.workflow_instance, new Set<Verb>([Verb.Apply, Verb.Get, Verb.Delete])],
|
|
@@ -52,6 +52,8 @@ const APPLY_ORDER: ReadonlyMap<ApiResourceKind, number> = new Map([
|
|
|
52
52
|
[ApiResourceKind.agent_instance, 7],
|
|
53
53
|
[ApiResourceKind.workflow_instance, 8],
|
|
54
54
|
[ApiResourceKind.session, 9],
|
|
55
|
+
// After agent (2) and environment (4): a share references both.
|
|
56
|
+
[ApiResourceKind.agent_share, 10],
|
|
55
57
|
]);
|
|
56
58
|
|
|
57
59
|
/** Expand a path into ordered, kind-resolved apply items (strict YAML parse). */
|
|
@@ -19,6 +19,8 @@ import { type Agent, AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agen
|
|
|
19
19
|
import { AgentCommandController } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/command_pb";
|
|
20
20
|
import { type AgentInstance, AgentInstanceSchema } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/api_pb";
|
|
21
21
|
import { AgentInstanceCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentinstance/v1/command_pb";
|
|
22
|
+
import { type AgentShare, AgentShareSchema } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/api_pb";
|
|
23
|
+
import { AgentShareCommandController } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/command_pb";
|
|
22
24
|
import { type Environment, EnvironmentSchema } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/api_pb";
|
|
23
25
|
import { EnvironmentCommandController } from "@stigmer/protos/ai/stigmer/agentic/environment/v1/command_pb";
|
|
24
26
|
import { type McpServer, McpServerSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
@@ -115,6 +117,15 @@ export const APPLY_HANDLERS: ReadonlyMap<ApiResourceKind, ApplyHandler> = new Ma
|
|
|
115
117
|
apply: (c, m) => c(OAuthAppCommandController).apply(m as OAuthApp),
|
|
116
118
|
},
|
|
117
119
|
],
|
|
120
|
+
[
|
|
121
|
+
ApiResourceKind.agent_share,
|
|
122
|
+
{
|
|
123
|
+
kind: ApiResourceKind.agent_share,
|
|
124
|
+
displayName: "Agent Share",
|
|
125
|
+
schema: AgentShareSchema,
|
|
126
|
+
apply: (c, m) => c(AgentShareCommandController).apply(m as AgentShare),
|
|
127
|
+
},
|
|
128
|
+
],
|
|
118
129
|
[
|
|
119
130
|
ApiResourceKind.agent_instance,
|
|
120
131
|
{
|