@stigmer/cli 3.18.1-dev.20260919070736 → 3.19.1-dev.20260920100552

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 (141) hide show
  1. package/commands/apply.d.ts.map +1 -1
  2. package/commands/apply.js +45 -101
  3. package/commands/apply.js.map +1 -1
  4. package/commands/install.js +2 -1
  5. package/commands/install.js.map +1 -1
  6. package/commands/marketplace.js +3 -3
  7. package/commands/marketplace.js.map +1 -1
  8. package/commands/push.js +3 -1
  9. package/commands/push.js.map +1 -1
  10. package/commands/validate.js +3 -4
  11. package/commands/validate.js.map +1 -1
  12. package/local/bootstrap.d.ts +1 -2
  13. package/local/bootstrap.d.ts.map +1 -1
  14. package/local/bootstrap.js +13 -41
  15. package/local/bootstrap.js.map +1 -1
  16. package/local/daemon/launch.d.ts +2 -2
  17. package/local/daemon/launch.d.ts.map +1 -1
  18. package/local/daemon/launch.js +2 -2
  19. package/local/daemon/launch.js.map +1 -1
  20. package/local/plugins/defaults.js +2 -2
  21. package/local/plugins/defaults.js.map +1 -1
  22. package/marketplace/config.d.ts.map +1 -1
  23. package/marketplace/config.js +13 -9
  24. package/marketplace/config.js.map +1 -1
  25. package/marketplace/render.d.ts.map +1 -1
  26. package/marketplace/render.js +1 -7
  27. package/marketplace/render.js.map +1 -1
  28. package/package.json +7 -7
  29. package/registry/index.d.ts +2 -2
  30. package/registry/index.d.ts.map +1 -1
  31. package/registry/index.js +2 -2
  32. package/registry/index.js.map +1 -1
  33. package/registry/metadata.d.ts +9 -0
  34. package/registry/metadata.d.ts.map +1 -1
  35. package/registry/metadata.js +14 -5
  36. package/registry/metadata.js.map +1 -1
  37. package/registry/registry.d.ts +9 -0
  38. package/registry/registry.d.ts.map +1 -1
  39. package/registry/registry.js +16 -1
  40. package/registry/registry.js.map +1 -1
  41. package/registry/verb-support.d.ts.map +1 -1
  42. package/registry/verb-support.js +0 -13
  43. package/registry/verb-support.js.map +1 -1
  44. package/resources/apply/apply.d.ts +11 -12
  45. package/resources/apply/apply.d.ts.map +1 -1
  46. package/resources/apply/apply.js +12 -21
  47. package/resources/apply/apply.js.map +1 -1
  48. package/resources/apply/handlers.js +2 -2
  49. package/resources/apply/handlers.js.map +1 -1
  50. package/resources/connect/oauth.d.ts.map +1 -1
  51. package/resources/connect/oauth.js +4 -1
  52. package/resources/connect/oauth.js.map +1 -1
  53. package/resources/delete.d.ts.map +1 -1
  54. package/resources/delete.js +0 -1
  55. package/resources/delete.js.map +1 -1
  56. package/resources/get-bindings.d.ts.map +1 -1
  57. package/resources/get-bindings.js +0 -5
  58. package/resources/get-bindings.js.map +1 -1
  59. package/resources/list.d.ts.map +1 -1
  60. package/resources/list.js +0 -1
  61. package/resources/list.js.map +1 -1
  62. package/resources/plugin.d.ts +27 -0
  63. package/resources/plugin.d.ts.map +1 -1
  64. package/resources/plugin.js +113 -8
  65. package/resources/plugin.js.map +1 -1
  66. package/resources/validate.d.ts.map +1 -1
  67. package/resources/validate.js +0 -2
  68. package/resources/validate.js.map +1 -1
  69. package/src/commands/apply.ts +40 -150
  70. package/src/commands/install.test.ts +20 -21
  71. package/src/commands/install.ts +2 -1
  72. package/src/commands/marketplace.test.ts +10 -19
  73. package/src/commands/marketplace.ts +3 -3
  74. package/src/commands/push.ts +6 -1
  75. package/src/commands/validate.ts +2 -4
  76. package/src/local/bootstrap.test.ts +15 -59
  77. package/src/local/bootstrap.ts +12 -53
  78. package/src/local/daemon/launch.ts +4 -4
  79. package/src/local/plugins/defaults.test.ts +28 -28
  80. package/src/local/plugins/defaults.ts +2 -2
  81. package/src/marketplace/__fixtures__/cursor-marketplace.ts +16 -12
  82. package/src/marketplace/config.test.ts +12 -28
  83. package/src/marketplace/config.ts +13 -9
  84. package/src/marketplace/install.test.ts +19 -19
  85. package/src/marketplace/read.test.ts +6 -6
  86. package/src/marketplace/render.ts +1 -10
  87. package/src/registry/index.ts +7 -1
  88. package/src/registry/metadata.ts +15 -5
  89. package/src/registry/registry.test.ts +1 -7
  90. package/src/registry/registry.ts +17 -1
  91. package/src/registry/verb-support.ts +0 -13
  92. package/src/resources/apply/apply.integration.test.ts +15 -3
  93. package/src/resources/apply/apply.ts +15 -26
  94. package/src/resources/apply/handlers.ts +2 -2
  95. package/src/resources/connect/oauth.test.ts +2 -2
  96. package/src/resources/connect/oauth.ts +4 -1
  97. package/src/resources/delete.ts +0 -1
  98. package/src/resources/get-bindings.ts +0 -5
  99. package/src/resources/list.ts +0 -1
  100. package/src/resources/plugin.test.ts +119 -2
  101. package/src/resources/plugin.ts +140 -8
  102. package/src/resources/validate.test.ts +0 -1
  103. package/src/resources/validate.ts +0 -2
  104. package/local/seedpack-retire.d.ts +0 -63
  105. package/local/seedpack-retire.d.ts.map +0 -1
  106. package/local/seedpack-retire.js +0 -361
  107. package/local/seedpack-retire.js.map +0 -1
  108. package/resources/apply/declarative.d.ts +0 -106
  109. package/resources/apply/declarative.d.ts.map +0 -1
  110. package/resources/apply/declarative.js +0 -397
  111. package/resources/apply/declarative.js.map +0 -1
  112. package/resources/apply/synth/project-track.d.ts +0 -21
  113. package/resources/apply/synth/project-track.d.ts.map +0 -1
  114. package/resources/apply/synth/project-track.js +0 -102
  115. package/resources/apply/synth/project-track.js.map +0 -1
  116. package/resources/apply/synth/reader.d.ts +0 -18
  117. package/resources/apply/synth/reader.d.ts.map +0 -1
  118. package/resources/apply/synth/reader.js +0 -55
  119. package/resources/apply/synth/reader.js.map +0 -1
  120. package/resources/apply/synth/runtime.d.ts +0 -8
  121. package/resources/apply/synth/runtime.d.ts.map +0 -1
  122. package/resources/apply/synth/runtime.js +0 -32
  123. package/resources/apply/synth/runtime.js.map +0 -1
  124. package/resources/apply/synth/synthesize.d.ts +0 -43
  125. package/resources/apply/synth/synthesize.d.ts.map +0 -1
  126. package/resources/apply/synth/synthesize.js +0 -115
  127. package/resources/apply/synth/synthesize.js.map +0 -1
  128. package/src/local/seedpack-retire.test.ts +0 -499
  129. package/src/local/seedpack-retire.ts +0 -474
  130. package/src/resources/apply/declarative.integration.test.ts +0 -204
  131. package/src/resources/apply/declarative.test.ts +0 -132
  132. package/src/resources/apply/declarative.ts +0 -491
  133. package/src/resources/apply/synth/capstone.integration.test.ts +0 -134
  134. package/src/resources/apply/synth/project-track.integration.test.ts +0 -194
  135. package/src/resources/apply/synth/project-track.ts +0 -126
  136. package/src/resources/apply/synth/reader.test.ts +0 -90
  137. package/src/resources/apply/synth/reader.ts +0 -68
  138. package/src/resources/apply/synth/runtime.test.ts +0 -29
  139. package/src/resources/apply/synth/runtime.ts +0 -39
  140. package/src/resources/apply/synth/synthesize.test.ts +0 -109
  141. package/src/resources/apply/synth/synthesize.ts +0 -161
@@ -1,102 +0,0 @@
1
- // Synthesis (project) track: the consumer adapter for `apply entry_point`.
2
- //
3
- // Its job mirrors the declarative adapter's — turn a source into resources +
4
- // skill sources — but the source here is the SDK program rather than YAML
5
- // files: infer the runtime, run synthesis (subprocess → `.pb`), decode the
6
- // output, normalize it into the shared shapes, then hand off to the ONE shared
7
- // reconciler (DD-009 §6). There is no parallel project-apply path.
8
- //
9
- // Resources are emitted in dependency-apply order (mcp_server → agent →
10
- // workflow), matching the declarative track's APPLY_ORDER so parents land before
11
- // dependents — a deliberate, more-correct ordering than the Go synth path
12
- // (which applied agents first).
13
- import { existsSync } from "node:fs";
14
- import { isAbsolute, join } from "node:path";
15
- import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
16
- import { UsageError } from "../../../errors/index.js";
17
- import { CommandResult } from "../../../output/index.js";
18
- import { reconcileProjectMembers, } from "../declarative.js";
19
- import { APPLY_HANDLERS } from "../handlers.js";
20
- import { readSynthesisOutput } from "./reader.js";
21
- import { inferRuntime } from "./runtime.js";
22
- import { synthesize } from "./synthesize.js";
23
- /**
24
- * Apply an SDK project: synthesize the entry point, read the `.pb` output, and
25
- * reconcile membership through the shared reconciler. Returns the summary
26
- * CommandResult for the caller to render.
27
- */
28
- export async function applyProjectTrack(detect, deps) {
29
- const { project, configDir } = detect;
30
- if (project === undefined || configDir === undefined) {
31
- throw new UsageError("project synthesis requires a stigmer.yaml project with an entry_point");
32
- }
33
- const entryPoint = project.spec?.entryPoint ?? "";
34
- if (entryPoint === "")
35
- throw new UsageError("project has no entry_point");
36
- const runtime = inferRuntime(entryPoint);
37
- deps.info(`SDK mode: ${entryPoint} (runtime: ${runtime})`);
38
- const { outputDir } = await synthesize({ projectDir: configDir, entryPoint, runtime, orgId: deps.org }, deps.synthesizeDeps);
39
- const synth = readSynthesisOutput(outputDir);
40
- deps.info(`Synthesis complete: ${synth.agents.length} agent(s), ${synth.workflows.length} workflow(s), ` +
41
- `${synth.mcpServers.length} MCP server(s), ${synth.skillSynths.length} skill(s)`);
42
- const resources = toReconcileResources(synth);
43
- const skillSources = toSkillSources(synth, configDir);
44
- return reconcileProjectMembers(project, resources, skillSources, deps);
45
- }
46
- /**
47
- * Dry-run preview: validate the project configuration statically (no synthesis,
48
- * no backend), warning if the entry point file is missing. Port of Go's
49
- * executeSDKDryRun.
50
- */
51
- export function previewProjectTrack(detect) {
52
- const { project, configDir } = detect;
53
- if (project === undefined || configDir === undefined) {
54
- throw new UsageError("project synthesis requires a stigmer.yaml project with an entry_point");
55
- }
56
- const entryPoint = project.spec?.entryPoint ?? "";
57
- const runtime = inferRuntime(entryPoint);
58
- const result = CommandResult.success("Dry run: SDK project configuration is valid");
59
- const section = result.addSection("Project");
60
- if (project.metadata?.name)
61
- section.field("Name", project.metadata.name);
62
- section.field("Entry Point", entryPoint);
63
- section.field("Runtime", runtime);
64
- if (!existsSync(join(configDir, entryPoint))) {
65
- result.addSection("Warning").item(`Entry point file not found: ${entryPoint}`);
66
- }
67
- result.hint("Remove --dry-run to execute synthesis and apply resources");
68
- return result;
69
- }
70
- // Normalize decoded protos into ReconcileResources in dependency-apply order.
71
- function toReconcileResources(synth) {
72
- const resources = [];
73
- for (const message of synth.mcpServers)
74
- resources.push({ handler: handlerFor(ApiResourceKind.mcp_server), message });
75
- for (const message of synth.agents)
76
- resources.push({ handler: handlerFor(ApiResourceKind.agent), message });
77
- for (const message of synth.workflows)
78
- resources.push({ handler: handlerFor(ApiResourceKind.workflow), message });
79
- return resources;
80
- }
81
- // Normalize SkillSynths into SkillSources; local paths resolve relative to the
82
- // project dir (matching Go's pushSkillSynth).
83
- function toSkillSources(synth, configDir) {
84
- return synth.skillSynths.map((skill) => {
85
- if (skill.source.case === "local") {
86
- const path = skill.source.value.path;
87
- return { kind: "local", dir: isAbsolute(path) ? path : join(configDir, path), tag: skill.tag };
88
- }
89
- if (skill.source.case === "git") {
90
- const git = skill.source.value;
91
- return { kind: "git", url: git.url, ref: git.ref, subdir: git.subdir, tag: skill.tag };
92
- }
93
- throw new UsageError("skill synthesis has no source configured (neither local nor git)");
94
- });
95
- }
96
- function handlerFor(kind) {
97
- const handler = APPLY_HANDLERS.get(kind);
98
- if (handler === undefined)
99
- throw new UsageError(`apply not implemented for ${ApiResourceKind[kind]}`);
100
- return handler;
101
- }
102
- //# sourceMappingURL=project-track.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project-track.js","sourceRoot":"","sources":["../../../../src/resources/apply/synth/project-track.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,6EAA6E;AAC7E,0EAA0E;AAC1E,2EAA2E;AAC3E,+EAA+E;AAC/E,mEAAmE;AACnE,EAAE;AACF,wEAAwE;AACxE,iFAAiF;AACjF,0EAA0E;AAC1E,gCAAgC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,qFAAqF,CAAC;AACtH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAIL,uBAAuB,GAExB,M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AC,KAAK,CAAC;YAC/B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;QACzF,CAAC;QACD,MAAM,IAAI,UAAU,CAAC,kEAAkE,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,UAAU,CAAC,IAAqB;IACvC,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,OAAO,KAAK,SAAS;QAAE,MAAM,IAAI,UAAU,CAAC,6BAA6B,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtG,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,18 +0,0 @@
1
- import { type Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
2
- import { type McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
3
- import { type SkillSynth } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/synth_pb";
4
- import { type Workflow } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
5
- /** Decoded synthesis output, grouped by kind in read order. */
6
- export interface SynthesisResult {
7
- readonly skillSynths: SkillSynth[];
8
- readonly mcpServers: McpServer[];
9
- readonly agents: Agent[];
10
- readonly workflows: Workflow[];
11
- }
12
- /**
13
- * Read and decode all synthesized `.pb` files from `outputDir`. Throws a
14
- * UsageError if the synthesis produced no resources (a program that registered
15
- * nothing, or wrote to the wrong directory).
16
- */
17
- export declare function readSynthesisOutput(outputDir: string): SynthesisResult;
18
- //# sourceMappingURL=reader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reader.d.ts","sourceRoot":"","sources":["../../../../src/resources/apply/synth/reader.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,oDAAoD,CAAC;AAC7F,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,wDAAwD,CAAC;AACzG,OAAO,EAAE,KAAK,UAAU,EAAoB,MAAM,sDAAsD,CAAC;AACzG,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,uDAAuD,CAAC;AAGtG,+DAA+D;AAC/D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC;IACnC,QAAQ,CAAC,UAAU,EAAE,SAAS,EAAE,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,CAetE"}
@@ -1,55 +0,0 @@
1
- // Reader for SDK synthesis output.
2
- //
3
- // The SDK writes one binary proto per resource into the out dir:
4
- // skill-N.pb (SkillSynth — input for skill push)
5
- // mcpserver-N.pb (McpServer)
6
- // agent-N.pb (Agent)
7
- // workflow-N.pb (Workflow)
8
- // We glob each `<kind>-*.pb`, sort lexically (matching Go's reader so the same
9
- // bytes read identically on both consumers), and decode with `fromBinary`
10
- // (DD-009 §3). At least one resource must be present.
11
- //
12
- // `dependencies.json` (Go's local-only dependency graph) is deliberately NOT
13
- // consumed: no dependency-graph validation feature exists, and the TS SDK does
14
- // not emit it. Its absence is therefore tolerated by construction (DD-009).
15
- // Port of `internal/cli/synthesis/reader.go`.
16
- import { readdirSync, readFileSync } from "node:fs";
17
- import { join } from "node:path";
18
- import { fromBinary } from "@bufbuild/protobuf";
19
- import { AgentSchema } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
20
- import { McpServerSchema } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
21
- import { SkillSynthSchema } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/synth_pb";
22
- import { WorkflowSchema } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
23
- import { UsageError } from "../../../errors/index.js";
24
- /**
25
- * Read and decode all synthesized `.pb` files from `outputDir`. Throws a
26
- * UsageError if the synthesis produced no resources (a program that registered
27
- * nothing, or wrote to the wrong directory).
28
- */
29
- export function readSynthesisOutput(outputDir) {
30
- const skillSynths = readProtoFiles(outputDir, "skill-", SkillSynthSchema);
31
- const mcpServers = readProtoFiles(outputDir, "mcpserver-", McpServerSchema);
32
- const agents = readProtoFiles(outputDir, "agent-", AgentSchema);
33
- const workflows = readProtoFiles(outputDir, "workflow-", WorkflowSchema);
34
- if (skillSynths.length + mcpServers.length + agents.length + workflows.length === 0) {
35
- throw new UsageError("no resources found in synthesis output\n\n" +
36
- "The entry point ran but registered no resources. Register at least one " +
37
- "agent, workflow, MCP server, or skill, and end with `await project.synth()`.");
38
- }
39
- return { skillSynths, mcpServers, agents, workflows };
40
- }
41
- // Glob `<prefix>*.pb` in `dir`, sort lexically (parity with Go's sort.Strings),
42
- // and decode each. A missing directory yields an empty list (the caller's
43
- // zero-resource check produces the user-facing error).
44
- function readProtoFiles(dir, prefix, schema) {
45
- let names;
46
- try {
47
- names = readdirSync(dir);
48
- }
49
- catch {
50
- return [];
51
- }
52
- const matches = names.filter((name) => name.startsWith(prefix) && name.endsWith(".pb")).sort();
53
- return matches.map((name) => fromBinary(schema, readFileSync(join(dir, name))));
54
- }
55
- //# sourceMappingURL=reader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reader.js","sourceRoot":"","sources":["../../../../src/resources/apply/synth/reader.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,EAAE;AACF,iEAAiE;AACjE,yDAAyD;AACzD,iCAAiC;AACjC,6BAA6B;AAC7B,gCAAgC;AAChC,+EAA+E;AAC/E,0EAA0E;AAC1E,sDAAsD;AACtD,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,4EAA4E;AAC5E,8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ACpB,IAAI,CAAC;QACH,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/F,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,CAAC"}
@@ -1,8 +0,0 @@
1
- /** Language runtime used to execute an SDK entry point. */
2
- export type Runtime = "go" | "python" | "node";
3
- /**
4
- * Infer the runtime from an entry point's file extension. Throws a UsageError
5
- * listing the supported extensions when the extension is unrecognized.
6
- */
7
- export declare function inferRuntime(entryPoint: string): Runtime;
8
- //# sourceMappingURL=runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/resources/apply/synth/runtime.ts"],"names":[],"mappings":"AAWA,2DAA2D;AAC3D,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAa/C;;;GAGG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CASxD"}
@@ -1,32 +0,0 @@
1
- // Runtime inference for SDK project synthesis.
2
- //
3
- // A project's `entry_point` extension determines which language runtime executes
4
- // it — there is no explicit `runtime` field (the proto enum was removed; the
5
- // extension is the single source of truth). Port of the Go CLI's
6
- // `internal/cli/apply/runtime.go`; the extension table is kept in lockstep with
7
- // the backend's `supportedEntryPointExtensions` (project validator).
8
- import { extname } from "node:path";
9
- import { UsageError } from "../../../errors/index.js";
10
- // Extension → runtime. Keep in sync with the backend project validator and Go's
11
- // extensionToRuntime.
12
- const EXTENSION_TO_RUNTIME = new Map([
13
- [".go", "go"],
14
- [".py", "python"],
15
- [".ts", "node"],
16
- [".js", "node"],
17
- [".mts", "node"],
18
- [".mjs", "node"],
19
- ]);
20
- /**
21
- * Infer the runtime from an entry point's file extension. Throws a UsageError
22
- * listing the supported extensions when the extension is unrecognized.
23
- */
24
- export function inferRuntime(entryPoint) {
25
- const ext = extname(entryPoint).toLowerCase();
26
- const runtime = EXTENSION_TO_RUNTIME.get(ext);
27
- if (runtime !== undefined)
28
- return runtime;
29
- const supported = [...EXTENSION_TO_RUNTIME.keys()].join(", ");
30
- throw new UsageError(`cannot infer runtime from entry point '${entryPoint}' (extension '${ext}')\n\n` + `Supported extensions: ${supported}`);
31
- }
32
- //# sourceMappingURL=runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../../src/resources/apply/synth/runtime.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,iFAAiF;AACjF,6EAA6E;AAC7E,iEAAiE;AACjE,gFAAgF;AAChF,qEAAqE;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAKtD,gFAAgF;AAChF,sBAAsB;AACtB,MAAM,oBAAoB,GAAiC,IAAI,GAAG,CAAC;IACjE,CAAC,KAAK,EAAE,IAAI,CAAC;IACb,CAAC,KAAK,EAAE,QAAQ,CAAC;IACjB,CAAC,KAAK,EAAE,MAAM,CAAC;IACf,CAAC,KAAK,EAAE,MAAM,CAAC;IACf,CAAC,MAAM,EAAE,MAAM,CAAC;IAChB,CAAC,MAAM,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9C,MAAM,OAAO,GAAG,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IAE1C,MAAM,SAAS,GAAG,CAAC,GAAG,oBAAoB,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,IAAI,UAAU,CAClB,0CAA0C,UAAU,iBAAiB,GAAG,QAAQ,GAAG,yBAAyB,SAAS,EAAE,CACxH,CAAC;AACJ,CAAC"}
@@ -1,43 +0,0 @@
1
- import type { Runtime } from "./runtime.js";
2
- /** Result of running a subprocess to completion. */
3
- export interface SpawnResult {
4
- readonly exitCode: number;
5
- readonly stdout: string;
6
- readonly stderr: string;
7
- }
8
- /** A function that runs a command to completion (injectable for tests). */
9
- export type SpawnFn = (command: string, args: readonly string[], options: {
10
- readonly cwd: string;
11
- readonly env: NodeJS.ProcessEnv;
12
- }) => Promise<SpawnResult>;
13
- /** Inputs for one synthesis run. */
14
- export interface SynthesizeOptions {
15
- /** Directory containing the SDK code and stigmer.yaml. */
16
- readonly projectDir: string;
17
- /** Entry point file, relative to `projectDir`. */
18
- readonly entryPoint: string;
19
- /** Runtime inferred from the entry point extension. */
20
- readonly runtime: Runtime;
21
- /** Resolved org, injected as STIGMER_ORG_ID (empty = omit). */
22
- readonly orgId: string;
23
- }
24
- /** Injectable collaborators (defaults run real subprocesses / fs checks). */
25
- export interface SynthesizeDeps {
26
- readonly spawn?: SpawnFn;
27
- readonly prepare?: (runtime: Runtime, projectDir: string) => void;
28
- }
29
- /** Outcome of synthesis: where the `.pb` files were written, plus SDK stdout. */
30
- export interface SynthesizeResult {
31
- readonly outputDir: string;
32
- readonly stdout: string;
33
- }
34
- /**
35
- * Execute the SDK entry point and leave the synthesized `.pb` files in
36
- * `<projectDir>/.stigmer`. Validates inputs, runs runtime prep, spawns the
37
- * program with the synthesis env, and maps a non-zero exit (or spawn failure)
38
- * to an actionable error. The caller reads the output dir with the reader.
39
- */
40
- export declare function synthesize(opts: SynthesizeOptions, deps?: SynthesizeDeps): Promise<SynthesizeResult>;
41
- /** Command + args to execute an entry point for the given runtime. */
42
- export declare function runtimeCommand(runtime: Runtime, entryPoint: string): string[];
43
- //# sourceMappingURL=synthesize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../../../../src/resources/apply/synth/synthesize.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,oDAAoD;AACpD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,2EAA2E;AAC3E,MAAM,MAAM,OAAO,GAAG,CACpB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,KAC/D,OAAO,CAAC,WAAW,CAAC,CAAC;AAE1B,oCAAoC;AACpC,MAAM,WAAW,iBAAiB;IAChC,0DAA0D;IAC1D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,kDAAkD;IAClD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,+DAA+D;IAC/D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACnE;AAED,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,iBAAiB,EAAE,IAAI,GAAE,cAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAiC9G;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAY7E"}
@@ -1,115 +0,0 @@
1
- // SDK synthesis execution.
2
- //
3
- // Runs a project's `entry_point` as a subprocess with `STIGMER_OUT_DIR` (and
4
- // `STIGMER_ORG_ID`) set; the program writes `.pb` files into that dir, which the
5
- // reader then decodes. Uniform subprocess model for every runtime (DD-009 §5):
6
- // go → `go run <entry>`
7
- // python → `python3 <entry>`
8
- // node → `npx tsx <entry>` for TS, `node <entry>` for JS
9
- //
10
- // `tsx` (not Go's `ts-node`) executes TypeScript entries — it is the runner the
11
- // CLI ecosystem already standardizes on (DD-009 alternatives). The spawn is
12
- // injected so the orchestration is unit-testable without a real subprocess
13
- // (mirrors `connect/oauth.ts`). Port of `internal/cli/apply/synthesize.go`.
14
- import { spawn } from "node:child_process";
15
- import { existsSync, mkdirSync } from "node:fs";
16
- import { extname, join, resolve } from "node:path";
17
- import { UsageError } from "../../../errors/index.js";
18
- /**
19
- * Execute the SDK entry point and leave the synthesized `.pb` files in
20
- * `<projectDir>/.stigmer`. Validates inputs, runs runtime prep, spawns the
21
- * program with the synthesis env, and maps a non-zero exit (or spawn failure)
22
- * to an actionable error. The caller reads the output dir with the reader.
23
- */
24
- export async function synthesize(opts, deps = {}) {
25
- if (opts.projectDir === "")
26
- throw new UsageError("project directory is required");
27
- if (opts.entryPoint === "")
28
- throw new UsageError("entry point is required");
29
- const projectDir = resolve(opts.projectDir);
30
- if (!existsSync(projectDir))
31
- throw new UsageError(`project directory not found: ${opts.projectDir}`);
32
- const entryAbs = join(projectDir, opts.entryPoint);
33
- if (!existsSync(entryAbs))
34
- throw new UsageError(`entry point not found: ${opts.entryPoint}`);
35
- const outputDir = join(projectDir, ".stigmer");
36
- mkdirSync(outputDir, { recursive: true });
37
- (deps.prepare ?? defaultPrepare)(opts.runtime, projectDir);
38
- // Pass the ABSOLUTE entry path: `npx` resolves a relative entry against the
39
- // npm project root (its "local prefix"), not the spawn cwd, so a relative path
40
- // breaks for the node runtime. An absolute path is correct for every runtime;
41
- // cwd stays the project dir so the program's own relative imports resolve.
42
- const [command, ...args] = runtimeCommand(opts.runtime, entryAbs);
43
- const env = { ...process.env, STIGMER_OUT_DIR: outputDir };
44
- if (opts.orgId !== "")
45
- env.STIGMER_ORG_ID = opts.orgId;
46
- let result;
47
- try {
48
- result = await (deps.spawn ?? defaultSpawn)(command, args, { cwd: projectDir, env });
49
- }
50
- catch (err) {
51
- throw new UsageError(formatExecutionError(opts.runtime, "", err.message));
52
- }
53
- if (result.exitCode !== 0) {
54
- throw new UsageError(formatExecutionError(opts.runtime, result.stderr, `exited with code ${result.exitCode}`));
55
- }
56
- return { outputDir, stdout: result.stdout };
57
- }
58
- /** Command + args to execute an entry point for the given runtime. */
59
- export function runtimeCommand(runtime, entryPoint) {
60
- switch (runtime) {
61
- case "go":
62
- return ["go", "run", entryPoint];
63
- case "python":
64
- return ["python3", entryPoint];
65
- case "node": {
66
- const ext = extname(entryPoint).toLowerCase();
67
- // TypeScript entries run through tsx; plain JS runs on node directly.
68
- return ext === ".ts" || ext === ".tsx" || ext === ".mts" ? ["npx", "tsx", entryPoint] : ["node", entryPoint];
69
- }
70
- }
71
- }
72
- // Lightweight, runtime-specific readiness checks (no subprocess). Unlike Go we
73
- // do NOT auto-run `go mod tidy`; the entry-point run surfaces missing deps and
74
- // the user resolves them — keeping the single subprocess the synthesis itself.
75
- function defaultPrepare(runtime, projectDir) {
76
- if (runtime === "node") {
77
- if (!existsSync(join(projectDir, "package.json"))) {
78
- throw new UsageError("package.json not found: run 'npm init' to initialize a Node.js project");
79
- }
80
- if (!existsSync(join(projectDir, "node_modules"))) {
81
- throw new UsageError("node_modules not found: run 'npm install' to install dependencies");
82
- }
83
- }
84
- else if (runtime === "go" && !existsSync(join(projectDir, "go.mod"))) {
85
- throw new UsageError("go.mod not found: run 'go mod init' to initialize a Go module");
86
- }
87
- }
88
- // Real subprocess: collects stdout/stderr, resolves with the exit code.
89
- const defaultSpawn = (command, args, options) => new Promise((resolvePromise, rejectPromise) => {
90
- const child = spawn(command, [...args], { cwd: options.cwd, env: options.env });
91
- let stdout = "";
92
- let stderr = "";
93
- child.stdout?.on("data", (chunk) => {
94
- stdout += chunk.toString();
95
- });
96
- child.stderr?.on("data", (chunk) => {
97
- stderr += chunk.toString();
98
- });
99
- child.on("error", (err) => rejectPromise(err));
100
- child.on("close", (code) => resolvePromise({ exitCode: code ?? 0, stdout, stderr }));
101
- });
102
- // Actionable failure message: truncated stderr + runtime-specific guidance.
103
- // Port of Go's formatExecutionError.
104
- function formatExecutionError(runtime, stderr, fallback) {
105
- let detail = stderr.length > 800 ? `${stderr.slice(0, 800)}\n... (truncated)` : stderr;
106
- if (detail === "")
107
- detail = fallback;
108
- const guidance = runtime === "go"
109
- ? "Check for compile errors above. Run 'go build' to see full error output."
110
- : runtime === "python"
111
- ? "If you see import errors, install your dependencies (e.g. pip install -r requirements.txt)."
112
- : "If you see module errors, run 'npm install' to install dependencies.";
113
- return `SDK synthesis failed:\n${detail}\n\n${guidance}`;
114
- }
115
- //# sourceMappingURL=synthesize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"synthesize.js","sourceRoot":"","sources":["../../../../src/resources/apply/synth/synthesize.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,EAAE;AACF,6EAA6E;AA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