@stigmer/cli 3.23.0 → 3.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/commands/bootstrap.d.ts.map +1 -1
  2. package/commands/bootstrap.js +16 -57
  3. package/commands/bootstrap.js.map +1 -1
  4. package/commands/config/context.d.ts.map +1 -1
  5. package/commands/config/context.js +41 -5
  6. package/commands/config/context.js.map +1 -1
  7. package/commands/install.js +1 -1
  8. package/commands/install.js.map +1 -1
  9. package/commands/push.js +1 -1
  10. package/commands/push.js.map +1 -1
  11. package/commands/search.d.ts.map +1 -1
  12. package/commands/search.js +0 -2
  13. package/commands/search.js.map +1 -1
  14. package/commands/up.js +1 -1
  15. package/commands/up.js.map +1 -1
  16. package/config/index.d.ts +1 -1
  17. package/config/index.d.ts.map +1 -1
  18. package/config/index.js +1 -1
  19. package/config/index.js.map +1 -1
  20. package/config/resolve.d.ts +8 -0
  21. package/config/resolve.d.ts.map +1 -1
  22. package/config/resolve.js +8 -8
  23. package/config/resolve.js.map +1 -1
  24. package/local/bootstrap.d.ts +9 -29
  25. package/local/bootstrap.d.ts.map +1 -1
  26. package/local/bootstrap.js +61 -69
  27. package/local/bootstrap.js.map +1 -1
  28. package/local/daemon/launch.d.ts +2 -2
  29. package/local/daemon/launch.d.ts.map +1 -1
  30. package/marketplace/official.d.ts.map +1 -1
  31. package/marketplace/official.js +6 -5
  32. package/marketplace/official.js.map +1 -1
  33. package/marketplace/render.d.ts.map +1 -1
  34. package/marketplace/render.js +0 -3
  35. package/marketplace/render.js.map +1 -1
  36. package/package.json +7 -7
  37. package/resources/search.d.ts +1 -3
  38. package/resources/search.d.ts.map +1 -1
  39. package/resources/search.js +0 -1
  40. package/resources/search.js.map +1 -1
  41. package/resources/share.d.ts.map +1 -1
  42. package/resources/share.js +20 -24
  43. package/resources/share.js.map +1 -1
  44. package/resources/skill.d.ts +2 -2
  45. package/resources/skill.d.ts.map +1 -1
  46. package/resources/skill.js +19 -10
  47. package/resources/skill.js.map +1 -1
  48. package/src/commands/bootstrap.test.ts +19 -75
  49. package/src/commands/bootstrap.ts +19 -68
  50. package/src/commands/config/context.test.ts +171 -0
  51. package/src/commands/config/context.ts +50 -5
  52. package/src/commands/install.ts +1 -1
  53. package/src/commands/marketplace.test.ts +2 -2
  54. package/src/commands/push.ts +1 -1
  55. package/src/commands/search.ts +0 -3
  56. package/src/commands/up.ts +1 -1
  57. package/src/config/index.ts +1 -0
  58. package/src/config/resolve.test.ts +2 -2
  59. package/src/config/resolve.ts +8 -8
  60. package/src/local/bootstrap.test.ts +132 -65
  61. package/src/local/bootstrap.ts +64 -139
  62. package/src/local/daemon/launch.ts +2 -2
  63. package/src/marketplace/official.ts +6 -5
  64. package/src/marketplace/read.test.ts +2 -3
  65. package/src/marketplace/render.ts +0 -3
  66. package/src/resources/apply/apply.test.ts +10 -10
  67. package/src/resources/read-completion.integration.test.ts +0 -2
  68. package/src/resources/search.ts +1 -4
  69. package/src/resources/share.test.ts +7 -60
  70. package/src/resources/share.ts +22 -27
  71. package/src/resources/skill.test.ts +20 -13
  72. package/src/resources/skill.ts +25 -14
  73. package/local/plugins/defaults.d.ts +0 -55
  74. package/local/plugins/defaults.d.ts.map +0 -1
  75. package/local/plugins/defaults.js +0 -111
  76. package/local/plugins/defaults.js.map +0 -1
  77. package/local/system-org.d.ts +0 -15
  78. package/local/system-org.d.ts.map +0 -1
  79. package/local/system-org.js +0 -57
  80. package/local/system-org.js.map +0 -1
  81. package/src/local/plugins/defaults.test.ts +0 -271
  82. package/src/local/plugins/defaults.ts +0 -179
  83. package/src/local/system-org.test.ts +0 -124
  84. package/src/local/system-org.ts +0 -63
@@ -1 +1 @@
1
- {"version":3,"file":"skill.js","sourceRoot":"","sources":["../../src/resources/skill.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,EAAE;AACF,gFAAgF;AAChF,iFAAiF;AACjF,wEAAwE;AACxE,uEAAuE;AAEvE,OAAO,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U,SAAS,CAAC,IAAY;IACpC,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,eAAe,CAAC;IACxC,OAAO,UAAU,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACjE,CAAC"}
@@ -1,16 +1,11 @@
1
1
  // Command-level contract for `stigmer bootstrap`: against the configured
2
- // backend it ensures the system org and installs the official defaults (the
3
- // repo tree's catalogue in dev), whose list is EMPTY — a fresh install needs
4
- // no default content because a session with no agent runs the built-in
5
- // assistant — so the command creates the organization, pushes nothing, and
6
- // renders both outcomes; a second run over a converged backend reports the
7
- // org present and still pushes nothing. The failing-default arm is pinned at
8
- // the function level (local/bootstrap.test.ts), where a synthetic list can
9
- // stage it. A real Connect backend over h2c serves the org and plugin
10
- // controllers; the config file (HOME redirected) points a selfhost backend
11
- // at it.
2
+ // backend it ensures the organization the CLI falls back to (`stigmer`) and
3
+ // installs nothing, so the command creates the organization and renders one
4
+ // Organization section; a second run over a ready backend reports the org
5
+ // present and creates nothing. A real Connect backend over h2c serves the org
6
+ // controllers; the config file (HOME redirected) points a selfhost backend at
7
+ // it.
12
8
 
13
- import { createHash } from "node:crypto";
14
9
  import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
15
10
  import {
16
11
  createServer as createHttp2Server,
@@ -21,16 +16,8 @@ import type { AddressInfo } from "node:net";
21
16
  import { tmpdir } from "node:os";
22
17
  import { join } from "node:path";
23
18
  import { create } from "@bufbuild/protobuf";
24
- import { Code, ConnectError, type ConnectRouter } from "@connectrpc/connect";
19
+ import type { ConnectRouter } from "@connectrpc/connect";
25
20
  import { connectNodeAdapter } from "@connectrpc/connect-node";
26
- import {
27
- type Plugin,
28
- PluginSchema,
29
- } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/api_pb";
30
- import { PluginCommandController } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/command_pb";
31
- import { ListPluginMembersResponseSchema } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/io_pb";
32
- import { PluginQueryController } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/query_pb";
33
- import { PluginState } from "@stigmer/protos/ai/stigmer/agentic/plugin/v1/status_pb";
34
21
  import {
35
22
  type Organization,
36
23
  OrganizationSchema,
@@ -48,9 +35,8 @@ import {
48
35
  it,
49
36
  vi,
50
37
  } from "vitest";
38
+ import { DEFAULT_LOCAL_ORG } from "../config/index.js";
51
39
  import { classify, ExitCode } from "../errors/index.js";
52
- import { prepareDefaultPlugins } from "../local/plugins/defaults.js";
53
- import { SYSTEM_ORG } from "../local/system-org.js";
54
40
  import { buildProgram } from "../program.js";
55
41
 
56
42
  let backend: Http2Server;
@@ -58,19 +44,12 @@ let port: number;
58
44
  const openSessions = new Set<ServerHttp2Session>();
59
45
 
60
46
  let orgs: Map<string, Organization>;
61
- let plugins: Map<string, Plugin>;
62
- let pushes: number;
47
+ let creates: number;
63
48
 
64
49
  let home: string;
65
50
  let originalHome: string | undefined;
66
51
 
67
- /** The catalogue's defaults by archive digest: how this backend names what it is sent. */
68
- let nameByDigest: Map<string, string>;
69
-
70
52
  beforeAll(async () => {
71
- nameByDigest = new Map(
72
- (await prepareDefaultPlugins()).map((entry) => [entry.push.digest, entry.name]),
73
- );
74
53
  const routes = (router: ConnectRouter) => {
75
54
  router.service(OrganizationQueryController, {
76
55
  findMyOrganizations: () =>
@@ -78,40 +57,13 @@ beforeAll(async () => {
78
57
  });
79
58
  router.service(OrganizationCommandController, {
80
59
  create: (org) => {
60
+ creates += 1;
81
61
  const row = create(OrganizationSchema, org);
82
62
  if (row.metadata !== undefined) row.metadata.id = "org_1";
83
63
  orgs.set(row.metadata?.slug ?? "", row);
84
64
  return row;
85
65
  },
86
66
  });
87
- router.service(PluginCommandController, {
88
- push: (req) => {
89
- pushes += 1;
90
- const digest = createHash("sha256").update(req.artifact).digest("hex");
91
- const slug = nameByDigest.get(digest);
92
- if (slug === undefined) {
93
- throw new ConnectError("archive is not a catalogue default", Code.InvalidArgument);
94
- }
95
- const row = create(PluginSchema, {
96
- metadata: { id: `plg_${slug}`, slug, org: req.org, visibility: req.visibility },
97
- spec: { name: slug },
98
- status: { digest, state: PluginState.READY },
99
- });
100
- plugins.set(slug, row);
101
- return row;
102
- },
103
- });
104
- router.service(PluginQueryController, {
105
- getByReference: (ref) => {
106
- const row = plugins.get(ref.slug);
107
- if (row === undefined) {
108
- throw new ConnectError(`plugin ${ref.slug} not found`, Code.NotFound);
109
- }
110
- return row;
111
- },
112
- listMembers: () =>
113
- create(ListPluginMembersResponseSchema, { members: [] }),
114
- });
115
67
  };
116
68
  backend = createHttp2Server(connectNodeAdapter({ routes }));
117
69
  backend.on("session", (session) => {
@@ -129,8 +81,7 @@ afterAll(async () => {
129
81
 
130
82
  beforeEach(() => {
131
83
  orgs = new Map();
132
- plugins = new Map();
133
- pushes = 0;
84
+ creates = 0;
134
85
  originalHome = process.env.HOME;
135
86
  home = mkdtempSync(join(tmpdir(), "stigmer-bootstrap-cmd-"));
136
87
  process.env.HOME = home;
@@ -198,37 +149,30 @@ function section(payload: { sections?: JsonSection[] }, title: string) {
198
149
  }
199
150
 
200
151
  describe("bootstrap", () => {
201
- it("creates the system org, installs nothing (the catalogue has no defaults), and reports both", async () => {
152
+ it("creates the organization, installs nothing, and reports it", async () => {
202
153
  const outcome = await run("--json");
203
154
  expect(outcome.exitCode).toBe(ExitCode.Success);
204
- expect(orgs.has(SYSTEM_ORG)).toBe(true);
205
- expect(pushes).toBe(0);
155
+ expect(orgs.has(DEFAULT_LOCAL_ORG)).toBe(true);
206
156
 
207
157
  const payload = JSON.parse(outcome.stdout);
208
158
  expect(payload.status).toBe("success");
209
159
  expect(payload.message).toBe("Backend is ready");
210
- expect(section(payload, "System organization")?.fields).toEqual([
211
- { key: "Slug", value: SYSTEM_ORG },
160
+ expect(payload.sections?.map((s: JsonSection) => s.title)).toEqual(["Organization"]);
161
+ expect(section(payload, "Organization")?.fields).toEqual([
162
+ { key: "Slug", value: DEFAULT_LOCAL_ORG },
212
163
  { key: "State", value: "created" },
213
164
  ]);
214
- expect(section(payload, "Default plugins")?.fields ?? []).toEqual([]);
215
165
  });
216
166
 
217
- it("is a no-op the second time: org present, nothing pushed", async () => {
167
+ it("is a no-op the second time: org present, nothing created", async () => {
218
168
  await run("--json");
219
- const pushedFirst = pushes;
220
169
  const outcome = await run("--json");
221
170
  expect(outcome.exitCode).toBe(ExitCode.Success);
222
- expect(pushes).toBe(pushedFirst);
171
+ expect(creates).toBe(1);
223
172
  const payload = JSON.parse(outcome.stdout);
224
- expect(section(payload, "System organization")?.fields).toContainEqual({
173
+ expect(section(payload, "Organization")?.fields).toContainEqual({
225
174
  key: "State",
226
175
  value: "present",
227
176
  });
228
- expect(
229
- (section(payload, "Default plugins")?.fields ?? []).every(
230
- (f) => f.value === "up-to-date",
231
- ),
232
- ).toBe(true);
233
177
  });
234
178
  });
@@ -1,26 +1,17 @@
1
- // `stigmer bootstrap` — make the configured backend a ready Stigmer: the
2
- // system organization exists and the official marketplace's default plugins
3
- // are installed into it, public. `stigmer up` does this for the local stack
4
- // on its own; this verb is for every other shape (a raw self-hosted server
5
- // behind docker-compose or Helm, the hosted platform's scheduled lane), and
6
- // runs the very same two phases (local/bootstrap.ts), so "ready" has one
7
- // meaning everywhere.
1
+ // `stigmer bootstrap` — make the configured backend ready for the CLI: the
2
+ // organization it falls back to when none is named (`stigmer`) exists.
3
+ // `stigmer up` does this for the local stack on its own; this verb is for a
4
+ // raw self-hosted server behind docker-compose or Helm, and runs the very
5
+ // same act (local/bootstrap.ts), so "ready" has one meaning everywhere. A
6
+ // team that created its organization in the console points the CLI at that
7
+ // one instead (`stigmer config context set --org`) and needs no bootstrap.
8
8
  //
9
- // Flagless on purpose. The org is the system org in every edition, and the
10
- // defaults are idempotent by the server's digest, so there is nothing to
11
- // force: a second run over a converged backend changes nothing and says so.
12
- // The verb never deletes anything; a scheduled lane must be able to run it
13
- // without that power.
14
- //
15
- // Exit is non-zero when any default failed to land, after the outcomes are
16
- // rendered, so a lane's run is red for the right reason and a human reads
17
- // what did and did not install. Heavy modules load lazily inside the action
18
- // so `--help` stays fast.
9
+ // Flagless on purpose: the act is idempotent, so there is nothing to force;
10
+ // a second run changes nothing and says so. It never deletes anything.
11
+ // Heavy modules load lazily inside the action so `--help` stays fast.
19
12
 
20
13
  import type { Command } from "commander";
21
- import { ensureAuthenticated } from "../config/index.js";
22
- import { CliExitError } from "../errors/cli-exit-error.js";
23
- import { ExitCode } from "../errors/exit-codes.js";
14
+ import { DEFAULT_LOCAL_ORG, ensureAuthenticated } from "../config/index.js";
24
15
  import { CommandResult, type OutputFlags, renderResult } from "../output/index.js";
25
16
  import { addResultFlags, resultFormat } from "./shared.js";
26
17
 
@@ -28,64 +19,24 @@ export function registerBootstrap(program: Command): void {
28
19
  const bootstrap = program
29
20
  .command("bootstrap")
30
21
  .description(
31
- "make the configured backend ready: ensure the system organization and install the default plugins",
22
+ "make the configured backend ready: ensure the organization the CLI uses when none is named",
32
23
  )
33
24
  .action((options: OutputFlags) => runBootstrapCommand(options));
34
25
  addResultFlags(bootstrap);
35
26
  }
36
27
 
37
28
  async function runBootstrapCommand(flags: OutputFlags): Promise<void> {
38
- const [{ connectBackend }, { bootstrapBackend }, { SYSTEM_ORG }] =
39
- await Promise.all([
40
- import("../backend.js"),
41
- import("../local/bootstrap.js"),
42
- import("../local/system-org.js"),
43
- ]);
29
+ const [{ connectBackend }, { bootstrapBackend }] = await Promise.all([
30
+ import("../backend.js"),
31
+ import("../local/bootstrap.js"),
32
+ ]);
44
33
 
45
34
  const client = connectBackend();
46
35
  ensureAuthenticated(client.config);
47
36
 
48
- const say = (line: string): void => {
49
- process.stderr.write(`${line}\n`);
50
- };
51
- const result = await bootstrapBackend(client.stigmer, say);
37
+ const state = await bootstrapBackend(client.stigmer);
52
38
 
53
- const failed = result.plugins.failed;
54
- const out =
55
- failed.length === 0
56
- ? CommandResult.success("Backend is ready")
57
- : CommandResult.warning(
58
- `Backend bootstrapped with ${failed.length} default plugin${failed.length === 1 ? "" : "s"} not installed`,
59
- );
60
- out
61
- .addSection("System organization")
62
- .field("Slug", SYSTEM_ORG)
63
- .field("State", result.org);
64
- const plugins = out.addSection("Default plugins");
65
- for (const outcome of result.plugins.outcomes) {
66
- switch (outcome.action) {
67
- case "installed":
68
- case "up-to-date":
69
- plugins.field(outcome.name, outcome.action);
70
- break;
71
- case "failed":
72
- plugins.field(outcome.name, `failed: ${outcome.error}`);
73
- break;
74
- default: {
75
- const exhaustive: never = outcome;
76
- throw new Error(`unhandled outcome ${String(exhaustive)}`);
77
- }
78
- }
79
- }
80
- if (failed.length > 0) {
81
- out.hint("Fix the cause named above and run 'stigmer bootstrap' again.");
82
- }
39
+ const out = CommandResult.success("Backend is ready");
40
+ out.addSection("Organization").field("Slug", DEFAULT_LOCAL_ORG).field("State", state);
83
41
  renderResult(out, resultFormat(flags));
84
-
85
- if (failed.length > 0) {
86
- throw new CliExitError(
87
- `default plugin${failed.length === 1 ? "" : "s"} not installed: ${failed.join(", ")}`,
88
- ExitCode.General,
89
- );
90
- }
91
42
  }
@@ -0,0 +1,171 @@
1
+ // Command-level contract for `stigmer config context set --org`: an
2
+ // organization the caller belongs to on the active backend is persisted as
3
+ // the context and then resolved by every command; a slug the backend does not
4
+ // list among the caller's own is refused as not found and the config file is
5
+ // left byte-for-byte as it was; an empty slug clears the context without
6
+ // asking the backend; no `--org` at all is a usage error. And `context show`
7
+ // names the active backend, not the legacy local/cloud switch the file also
8
+ // carries. A real Connect backend over h2c serves findMyOrganizations; the
9
+ // config file (HOME redirected) points a selfhost backend at it.
10
+
11
+ import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
12
+ import {
13
+ createServer as createHttp2Server,
14
+ type Http2Server,
15
+ type ServerHttp2Session,
16
+ } from "node:http2";
17
+ import type { AddressInfo } from "node:net";
18
+ import { tmpdir } from "node:os";
19
+ import { join } from "node:path";
20
+ import { create } from "@bufbuild/protobuf";
21
+ import type { ConnectRouter } from "@connectrpc/connect";
22
+ import { connectNodeAdapter } from "@connectrpc/connect-node";
23
+ import { OrganizationSchema } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/api_pb";
24
+ import { OrganizationsSchema } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/io_pb";
25
+ import { OrganizationQueryController } from "@stigmer/protos/ai/stigmer/tenancy/organization/v1/query_pb";
26
+ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
27
+ import { load, resolveOrganization } from "../../config/index.js";
28
+ import { classify, ExitCode } from "../../errors/index.js";
29
+ import { buildProgram } from "../../program.js";
30
+
31
+ let backend: Http2Server;
32
+ let port: number;
33
+ const openSessions = new Set<ServerHttp2Session>();
34
+ let lookups: number;
35
+
36
+ let home: string;
37
+ let originalHome: string | undefined;
38
+
39
+ beforeAll(async () => {
40
+ const routes = (router: ConnectRouter) => {
41
+ router.service(OrganizationQueryController, {
42
+ findMyOrganizations: () => {
43
+ lookups += 1;
44
+ return create(OrganizationsSchema, {
45
+ entries: [create(OrganizationSchema, { metadata: { id: "acme", slug: "acme" } })],
46
+ });
47
+ },
48
+ });
49
+ };
50
+ backend = createHttp2Server(connectNodeAdapter({ routes }));
51
+ backend.on("session", (session) => {
52
+ openSessions.add(session);
53
+ session.on("close", () => openSessions.delete(session));
54
+ });
55
+ await new Promise<void>((resolve) => backend.listen(0, "127.0.0.1", resolve));
56
+ port = (backend.address() as AddressInfo).port;
57
+ });
58
+
59
+ afterAll(async () => {
60
+ for (const session of openSessions) session.destroy();
61
+ await new Promise<void>((resolve) => backend.close(() => resolve()));
62
+ });
63
+
64
+ beforeEach(() => {
65
+ lookups = 0;
66
+ originalHome = process.env.HOME;
67
+ home = mkdtempSync(join(tmpdir(), "stigmer-context-cmd-"));
68
+ process.env.HOME = home;
69
+ mkdirSync(join(home, ".stigmer"), { recursive: true });
70
+ writeFileSync(
71
+ configFile(),
72
+ [
73
+ "backend:",
74
+ " type: cloud",
75
+ "backends:",
76
+ " team:",
77
+ " type: selfhost",
78
+ ` endpoint: 127.0.0.1:${port}`,
79
+ "current_backend: team",
80
+ "",
81
+ ].join("\n"),
82
+ );
83
+ });
84
+
85
+ afterEach(() => {
86
+ if (originalHome === undefined) delete process.env.HOME;
87
+ else process.env.HOME = originalHome;
88
+ rmSync(home, { recursive: true, force: true });
89
+ });
90
+
91
+ function configFile(): string {
92
+ return join(home, ".stigmer", "config.yaml");
93
+ }
94
+
95
+ interface RunOutcome {
96
+ readonly exitCode: number;
97
+ readonly message: string;
98
+ readonly stdout: string;
99
+ }
100
+
101
+ async function run(...args: string[]): Promise<RunOutcome> {
102
+ return runContext("set", ...args);
103
+ }
104
+
105
+ async function runContext(...args: string[]): Promise<RunOutcome> {
106
+ const program = buildProgram();
107
+ program.exitOverride();
108
+ let stdout = "";
109
+ const outSpy = vi.spyOn(process.stdout, "write").mockImplementation((chunk) => {
110
+ stdout += String(chunk);
111
+ return true;
112
+ });
113
+ const errSpy = vi.spyOn(process.stderr, "write").mockReturnValue(true);
114
+ try {
115
+ await program.parseAsync(["node", "stigmer", "config", "context", ...args]);
116
+ return { exitCode: ExitCode.Success, message: "", stdout };
117
+ } catch (err) {
118
+ return {
119
+ exitCode: classify(err)?.exitCode ?? -1,
120
+ message: err instanceof Error ? err.message : String(err),
121
+ stdout,
122
+ };
123
+ } finally {
124
+ outSpy.mockRestore();
125
+ errSpy.mockRestore();
126
+ }
127
+ }
128
+
129
+ describe("config context set --org", () => {
130
+ it("persists an organization the caller belongs to, which every command then resolves", async () => {
131
+ const outcome = await run("--org", "acme");
132
+ expect(outcome.exitCode).toBe(ExitCode.Success);
133
+ expect(lookups).toBe(1);
134
+ expect(resolveOrganization(load())).toBe("acme");
135
+ });
136
+
137
+ it("refuses a slug the backend does not list as the caller's and leaves the config untouched", async () => {
138
+ const before = readFileSync(configFile(), "utf8");
139
+ const outcome = await run("--org", "acmee");
140
+ expect(outcome.exitCode).toBe(ExitCode.NotFound);
141
+ expect(outcome.message).toMatch(/organization 'acmee' is not one you belong to on the 'team' backend/);
142
+ expect(readFileSync(configFile(), "utf8")).toBe(before);
143
+ });
144
+
145
+ it("clears the context with an empty slug, without asking the backend", async () => {
146
+ await run("--org", "acme");
147
+ const outcome = await run("--org", "");
148
+ expect(outcome.exitCode).toBe(ExitCode.Success);
149
+ expect(lookups).toBe(1);
150
+ expect(resolveOrganization(load())).toBe("stigmer");
151
+ });
152
+
153
+ it("is a usage error without --org", async () => {
154
+ const outcome = await run();
155
+ expect(outcome.exitCode).toBe(ExitCode.Usage);
156
+ expect(outcome.message).toMatch(/--org is required/);
157
+ });
158
+ });
159
+
160
+ describe("config context show", () => {
161
+ it("names the active backend, not the legacy local/cloud switch", async () => {
162
+ await run("--org", "acme");
163
+ const outcome = await runContext("show", "--json");
164
+ expect(outcome.exitCode).toBe(ExitCode.Success);
165
+ const fields = JSON.parse(outcome.stdout).sections[0].fields as { key: string; value: string }[];
166
+ expect(fields).toEqual([
167
+ { key: "Organization", value: "acme" },
168
+ { key: "Backend", value: "team" },
169
+ ]);
170
+ });
171
+ });
@@ -1,10 +1,18 @@
1
- // `stigmer config context show` — display the active CLI context.
1
+ // `stigmer config context show|set` — the active CLI context: the
2
+ // organization every command targets when neither `--org` nor
3
+ // STIGMER_ORG_ID names one.
2
4
  //
3
- // `context set --org` validates the organization against the server before
4
- // persisting, so it is wired once the backend client lands (see registerConfig).
5
+ // `set --org <slug>` checks the slug against the active backend before it
6
+ // persists: the organization must be one the caller belongs to there
7
+ // (findMyOrganizations), so a typo or a stranger's slug is refused at the
8
+ // moment it is typed, not on the next command. An empty slug clears the
9
+ // context without asking the backend, and the resolver falls back to its
10
+ // default again. The raw `config set context.organization` stays the
11
+ // unchecked escape hatch.
5
12
 
6
13
  import type { Command } from "commander";
7
- import { type Config, load, resolveContextOrganization } from "../../config/index.js";
14
+ import { type Config, activeBackendName, ensureAuthenticated, load, resolveContextOrganization, save } from "../../config/index.js";
15
+ import { CliExitError, ExitCode, UsageError } from "../../errors/index.js";
8
16
  import { CommandResult, type OutputFlags, renderResult } from "../../output/index.js";
9
17
  import { addResultFlags, resultFormat } from "../shared.js";
10
18
 
@@ -16,11 +24,48 @@ export function addContextCommands(context: Command): void {
16
24
  renderResult(buildShow(load()), resultFormat(options));
17
25
  });
18
26
  addResultFlags(show);
27
+
28
+ const set = context
29
+ .command("set")
30
+ .description("set the active context's organization, checked against the backend")
31
+ .option("--org <slug>", "an organization you belong to on the active backend (empty clears it)")
32
+ .action((options: OutputFlags & { org?: string }) => runSet(options));
33
+ addResultFlags(set);
19
34
  }
20
35
 
21
36
  function buildShow(config: Config): CommandResult {
22
37
  const organization = resolveContextOrganization(config) || "(not set)";
23
38
  const result = CommandResult.success("CLI context");
24
- result.addSection("").field("Organization", organization).field("Backend", config.backend.type);
39
+ result.addSection("").field("Organization", organization).field("Backend", activeBackendName(config));
25
40
  return result;
26
41
  }
42
+
43
+ async function runSet(flags: OutputFlags & { org?: string }): Promise<void> {
44
+ const org = flags.org;
45
+ if (org === undefined) {
46
+ throw new UsageError(
47
+ "--org is required\n\nSet it with:\n stigmer config context set --org <org>\nClear it with:\n stigmer config context set --org \"\"",
48
+ );
49
+ }
50
+
51
+ const config = load();
52
+ if (org !== "") await assertMembership(config, org);
53
+
54
+ (config.context ??= {}).organization = org;
55
+ save(config);
56
+ const message = org === "" ? "Context organization cleared" : `Context organization set to '${org}'`;
57
+ renderResult(CommandResult.success(message), resultFormat(flags));
58
+ }
59
+
60
+ async function assertMembership(config: Config, org: string): Promise<void> {
61
+ const { connectBackend } = await import("../../backend.js");
62
+ const client = connectBackend(config);
63
+ ensureAuthenticated(client.config);
64
+ const mine = await client.stigmer.organization.findMyOrganizations();
65
+ if (mine.entries.some((entry) => entry.metadata?.slug === org)) return;
66
+ throw new CliExitError(
67
+ `organization '${org}' is not one you belong to on the '${activeBackendName(config)}' backend`,
68
+ ExitCode.NotFound,
69
+ ["See the organizations you belong to with: stigmer list organizations"],
70
+ );
71
+ }
@@ -32,7 +32,7 @@ export function registerInstall(program: Command): void {
32
32
  )
33
33
  .option(
34
34
  "--visibility <level>",
35
- "visibility for the plugin and everything it installs (private, org, public, platform)",
35
+ "visibility for the plugin and everything it installs (private, org, platform)",
36
36
  )
37
37
  .option(
38
38
  "-m, --message <message>",
@@ -169,11 +169,11 @@ describe("marketplace show", () => {
169
169
  expect(payload.data.warnings[0].subject).toBe("ghost");
170
170
  });
171
171
 
172
- it("shows the built-in marketplace, which installs nothing by default", async () => {
172
+ it("shows the built-in marketplace", async () => {
173
173
  const outcome = await run("show", "stigmer", "--json");
174
174
  expect(outcome.exitCode).toBe(ExitCode.Success);
175
175
  const payload = JSON.parse(outcome.stdout);
176
- expect(payload.data.marketplace.defaults).toEqual([]);
176
+ expect(payload.data.marketplace.name).toBe("stigmer");
177
177
  expect(payload.data.plugins.map((p: { name: string }) => p.name)).toContain(
178
178
  "linear",
179
179
  );
@@ -55,7 +55,7 @@ export function registerPush(program: Command): void {
55
55
  )
56
56
  .option(
57
57
  "--visibility <level>",
58
- "plugins: visibility for the plugin and everything it installs (private, org, public, platform)",
58
+ "plugins: visibility for the plugin and everything it installs (private, org, platform)",
59
59
  )
60
60
  .option("--dry-run", "validate without pushing")
61
61
  .option("--git-url <url>", "push from a remote git repository URL")