@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.
- package/commands/apply.d.ts.map +1 -1
- package/commands/apply.js +45 -101
- package/commands/apply.js.map +1 -1
- package/commands/install.js +2 -1
- package/commands/install.js.map +1 -1
- package/commands/marketplace.js +3 -3
- package/commands/marketplace.js.map +1 -1
- package/commands/push.js +3 -1
- package/commands/push.js.map +1 -1
- package/commands/validate.js +3 -4
- package/commands/validate.js.map +1 -1
- package/local/bootstrap.d.ts +1 -2
- package/local/bootstrap.d.ts.map +1 -1
- package/local/bootstrap.js +13 -41
- package/local/bootstrap.js.map +1 -1
- package/local/daemon/launch.d.ts +2 -2
- package/local/daemon/launch.d.ts.map +1 -1
- package/local/daemon/launch.js +2 -2
- package/local/daemon/launch.js.map +1 -1
- package/local/plugins/defaults.js +2 -2
- package/local/plugins/defaults.js.map +1 -1
- package/marketplace/config.d.ts.map +1 -1
- package/marketplace/config.js +13 -9
- package/marketplace/config.js.map +1 -1
- package/marketplace/render.d.ts.map +1 -1
- package/marketplace/render.js +1 -7
- package/marketplace/render.js.map +1 -1
- package/package.json +7 -7
- package/registry/index.d.ts +2 -2
- package/registry/index.d.ts.map +1 -1
- package/registry/index.js +2 -2
- package/registry/index.js.map +1 -1
- package/registry/metadata.d.ts +9 -0
- package/registry/metadata.d.ts.map +1 -1
- package/registry/metadata.js +14 -5
- package/registry/metadata.js.map +1 -1
- package/registry/registry.d.ts +9 -0
- package/registry/registry.d.ts.map +1 -1
- package/registry/registry.js +16 -1
- package/registry/registry.js.map +1 -1
- package/registry/verb-support.d.ts.map +1 -1
- package/registry/verb-support.js +0 -13
- package/registry/verb-support.js.map +1 -1
- package/resources/apply/apply.d.ts +11 -12
- package/resources/apply/apply.d.ts.map +1 -1
- package/resources/apply/apply.js +12 -21
- package/resources/apply/apply.js.map +1 -1
- package/resources/apply/handlers.js +2 -2
- package/resources/apply/handlers.js.map +1 -1
- package/resources/connect/oauth.d.ts.map +1 -1
- package/resources/connect/oauth.js +4 -1
- package/resources/connect/oauth.js.map +1 -1
- package/resources/delete.d.ts.map +1 -1
- package/resources/delete.js +0 -1
- package/resources/delete.js.map +1 -1
- package/resources/get-bindings.d.ts.map +1 -1
- package/resources/get-bindings.js +0 -5
- package/resources/get-bindings.js.map +1 -1
- package/resources/list.d.ts.map +1 -1
- package/resources/list.js +0 -1
- package/resources/list.js.map +1 -1
- package/resources/plugin.d.ts +27 -0
- package/resources/plugin.d.ts.map +1 -1
- package/resources/plugin.js +113 -8
- package/resources/plugin.js.map +1 -1
- package/resources/validate.d.ts.map +1 -1
- package/resources/validate.js +0 -2
- package/resources/validate.js.map +1 -1
- package/src/commands/apply.ts +40 -150
- package/src/commands/install.test.ts +20 -21
- package/src/commands/install.ts +2 -1
- package/src/commands/marketplace.test.ts +10 -19
- package/src/commands/marketplace.ts +3 -3
- package/src/commands/push.ts +6 -1
- package/src/commands/validate.ts +2 -4
- package/src/local/bootstrap.test.ts +15 -59
- package/src/local/bootstrap.ts +12 -53
- package/src/local/daemon/launch.ts +4 -4
- package/src/local/plugins/defaults.test.ts +28 -28
- package/src/local/plugins/defaults.ts +2 -2
- package/src/marketplace/__fixtures__/cursor-marketplace.ts +16 -12
- package/src/marketplace/config.test.ts +12 -28
- package/src/marketplace/config.ts +13 -9
- package/src/marketplace/install.test.ts +19 -19
- package/src/marketplace/read.test.ts +6 -6
- package/src/marketplace/render.ts +1 -10
- package/src/registry/index.ts +7 -1
- package/src/registry/metadata.ts +15 -5
- package/src/registry/registry.test.ts +1 -7
- package/src/registry/registry.ts +17 -1
- package/src/registry/verb-support.ts +0 -13
- package/src/resources/apply/apply.integration.test.ts +15 -3
- package/src/resources/apply/apply.ts +15 -26
- package/src/resources/apply/handlers.ts +2 -2
- package/src/resources/connect/oauth.test.ts +2 -2
- package/src/resources/connect/oauth.ts +4 -1
- package/src/resources/delete.ts +0 -1
- package/src/resources/get-bindings.ts +0 -5
- package/src/resources/list.ts +0 -1
- package/src/resources/plugin.test.ts +119 -2
- package/src/resources/plugin.ts +140 -8
- package/src/resources/validate.test.ts +0 -1
- package/src/resources/validate.ts +0 -2
- package/local/seedpack-retire.d.ts +0 -63
- package/local/seedpack-retire.d.ts.map +0 -1
- package/local/seedpack-retire.js +0 -361
- package/local/seedpack-retire.js.map +0 -1
- package/resources/apply/declarative.d.ts +0 -106
- package/resources/apply/declarative.d.ts.map +0 -1
- package/resources/apply/declarative.js +0 -397
- package/resources/apply/declarative.js.map +0 -1
- package/resources/apply/synth/project-track.d.ts +0 -21
- package/resources/apply/synth/project-track.d.ts.map +0 -1
- package/resources/apply/synth/project-track.js +0 -102
- package/resources/apply/synth/project-track.js.map +0 -1
- package/resources/apply/synth/reader.d.ts +0 -18
- package/resources/apply/synth/reader.d.ts.map +0 -1
- package/resources/apply/synth/reader.js +0 -55
- package/resources/apply/synth/reader.js.map +0 -1
- package/resources/apply/synth/runtime.d.ts +0 -8
- package/resources/apply/synth/runtime.d.ts.map +0 -1
- package/resources/apply/synth/runtime.js +0 -32
- package/resources/apply/synth/runtime.js.map +0 -1
- package/resources/apply/synth/synthesize.d.ts +0 -43
- package/resources/apply/synth/synthesize.d.ts.map +0 -1
- package/resources/apply/synth/synthesize.js +0 -115
- package/resources/apply/synth/synthesize.js.map +0 -1
- package/src/local/seedpack-retire.test.ts +0 -499
- package/src/local/seedpack-retire.ts +0 -474
- package/src/resources/apply/declarative.integration.test.ts +0 -204
- package/src/resources/apply/declarative.test.ts +0 -132
- package/src/resources/apply/declarative.ts +0 -491
- package/src/resources/apply/synth/capstone.integration.test.ts +0 -134
- package/src/resources/apply/synth/project-track.integration.test.ts +0 -194
- package/src/resources/apply/synth/project-track.ts +0 -126
- package/src/resources/apply/synth/reader.test.ts +0 -90
- package/src/resources/apply/synth/reader.ts +0 -68
- package/src/resources/apply/synth/runtime.test.ts +0 -29
- package/src/resources/apply/synth/runtime.ts +0 -39
- package/src/resources/apply/synth/synthesize.test.ts +0 -109
- package/src/resources/apply/synth/synthesize.ts +0 -161
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { type Message } from "@bufbuild/protobuf";
|
|
2
|
-
import { type Project } from "@stigmer/protos/ai/stigmer/tenancy/project/v1/api_pb";
|
|
3
|
-
import type { Stigmer } from "@stigmer/sdk";
|
|
4
|
-
import { CommandResult } from "../../output/index.js";
|
|
5
|
-
import { type PushResult } from "../skill.js";
|
|
6
|
-
import { type ApplyItem } from "./apply.js";
|
|
7
|
-
import type { ApplyHandler, ControllerFn } from "./handlers.js";
|
|
8
|
-
/** The detected CLI operation mode (mirrors Go's project.Track). */
|
|
9
|
-
export type Track = "atomic" | "declarative" | "project";
|
|
10
|
-
export interface DetectResult {
|
|
11
|
-
readonly track: Track;
|
|
12
|
-
/** Absolute path to stigmer.yaml; undefined for the atomic track. */
|
|
13
|
-
readonly configPath?: string;
|
|
14
|
-
/** Directory containing stigmer.yaml; undefined for the atomic track. */
|
|
15
|
-
readonly configDir?: string;
|
|
16
|
-
/** Parsed Project; undefined for the atomic track. */
|
|
17
|
-
readonly project?: Project;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Walk up from `startDir` (max 10 levels, matching Go) looking for stigmer.yaml.
|
|
21
|
-
* Absent → atomic track. Present-but-invalid → a hard error (the user clearly
|
|
22
|
-
* intended a project; help them fix it rather than silently falling back).
|
|
23
|
-
* Present with an entry_point → the SDK "project" track (synthesis), which this
|
|
24
|
-
* wave does not implement.
|
|
25
|
-
*/
|
|
26
|
-
export declare function detectTrack(startDir: string, maxDepth?: number): DetectResult;
|
|
27
|
-
/**
|
|
28
|
-
* YAML resource files beside stigmer.yaml: top-level files plus files in
|
|
29
|
-
* immediate subdirectories. stigmer.yaml itself is excluded, as are skill
|
|
30
|
-
* directories (handled separately) and grouping dirs that hold skills.
|
|
31
|
-
*/
|
|
32
|
-
export declare function scanResourceFiles(projectDir: string): string[];
|
|
33
|
-
/**
|
|
34
|
-
* Skill directories beside stigmer.yaml: immediate children that contain a
|
|
35
|
-
* SKILL.md (flat layout), plus grandchildren under a grouping dir like skills/
|
|
36
|
-
* (organized layout). Scanning stops one level deep, matching Go.
|
|
37
|
-
*/
|
|
38
|
-
export declare function scanSkillDirectories(projectDir: string): string[];
|
|
39
|
-
/**
|
|
40
|
-
* Build ordered apply items from scanned resource files. Project documents are
|
|
41
|
-
* skipped (stigmer.yaml is already loaded) and Organization documents are
|
|
42
|
-
* skipped with a warning — an organization sits above a project in the resource
|
|
43
|
-
* hierarchy and must be applied independently with file mode.
|
|
44
|
-
*/
|
|
45
|
-
export declare function buildDeclarativeItems(files: readonly string[], warn: (line: string) => void): ApplyItem[];
|
|
46
|
-
export interface DeclarativeDeps {
|
|
47
|
-
/** Raw command-controller accessor (full-proto apply, preserves metadata.id). */
|
|
48
|
-
readonly controller: ControllerFn;
|
|
49
|
-
/** High-level client for skill push + post-apply MCP discovery. */
|
|
50
|
-
readonly stigmer: Stigmer;
|
|
51
|
-
/** Resolved organization (already validated non-empty by the caller). */
|
|
52
|
-
readonly org: string;
|
|
53
|
-
/** Human progress lines (stderr; not a parity surface). */
|
|
54
|
-
readonly info: (line: string) => void;
|
|
55
|
-
/** Warnings (stderr). */
|
|
56
|
-
readonly warn: (line: string) => void;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Apply a declarative project: scan the directory for YAML resources and skill
|
|
60
|
-
* directories, marshal each resource, then hand everything to the shared
|
|
61
|
-
* reconciler. This adapter's only job is "filesystem → resources + skill
|
|
62
|
-
* sources"; the synthesis track has its own adapter ("SDK → resources + skill
|
|
63
|
-
* sources") and both converge on {@link reconcileProjectMembers} (DD-009 §6).
|
|
64
|
-
*/
|
|
65
|
-
export declare function applyDeclarative(detect: DetectResult, deps: DeclarativeDeps): Promise<CommandResult>;
|
|
66
|
-
/** A resource ready to apply: its handler plus the fully-marshalled message. */
|
|
67
|
-
export interface ReconcileResource {
|
|
68
|
-
readonly handler: ApplyHandler;
|
|
69
|
-
readonly message: Message;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* A skill to push as a project member. `local` is a directory beside the
|
|
73
|
-
* project (declarative) or resolved from a SkillSynth local path (synthesis);
|
|
74
|
-
* `git` is a remote repo cloned on demand (synthesis only — SkillSynth git).
|
|
75
|
-
*/
|
|
76
|
-
export type SkillSource = {
|
|
77
|
-
readonly kind: "local";
|
|
78
|
-
readonly dir: string;
|
|
79
|
-
readonly tag: string;
|
|
80
|
-
} | {
|
|
81
|
-
readonly kind: "git";
|
|
82
|
-
readonly url: string;
|
|
83
|
-
readonly ref: string;
|
|
84
|
-
readonly subdir: string;
|
|
85
|
-
readonly tag: string;
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* Reconcile a project's membership: push skills first (agents may reference
|
|
89
|
-
* them), apply MCP servers and run capability discovery on them, apply the
|
|
90
|
-
* remaining resources, collect references to the member-eligible ones, then
|
|
91
|
-
* apply the project with that exact member set so the server can reconcile by
|
|
92
|
-
* set-difference (orphan pruning is server-side; see S1 in commands/apply.ts).
|
|
93
|
-
*/
|
|
94
|
-
export declare function reconcileProjectMembers(project: Project, resources: readonly ReconcileResource[], skillSources: readonly SkillSource[], deps: DeclarativeDeps): Promise<CommandResult>;
|
|
95
|
-
/**
|
|
96
|
-
* Push one skill source and return the result. Local sources push directly;
|
|
97
|
-
* git sources clone to a temp dir, push from the subdir, then clean up
|
|
98
|
-
* (mirrors `commands/push.ts` --git-url and Go's `pushSkillSynth`).
|
|
99
|
-
*/
|
|
100
|
-
export declare function pushSkillSource(client: Stigmer, src: SkillSource, org: string, info: (line: string) => void): Promise<PushResult>;
|
|
101
|
-
/** Dry-run: validate every resource without touching the backend. */
|
|
102
|
-
export declare function previewDeclarative(detect: DetectResult, deps: Pick<DeclarativeDeps, "controller" | "warn">): {
|
|
103
|
-
results: CommandResult[];
|
|
104
|
-
summary: CommandResult;
|
|
105
|
-
};
|
|
106
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EAAE,SAAS,iBAAiB,EAAE,EACvC,YAAY,EAAE,SAAS,WAAW,EAAE,EACpC,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,aAAa,CAAC,CAmDxB;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC3B,OAAO,CAAC,UAAU,CAAC,CAuBrB;AASD,qEAAqE;AACrE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,MAAM,CAAC,GAAG;IAC5G,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,OAAO,EAAE,aAAa,CAAC;CACxB,CAQA"}
|
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
// Declarative apply (`stigmer apply` inside a stigmer.yaml project directory).
|
|
2
|
-
//
|
|
3
|
-
// The project is a lightweight membership tracker: it stores only references
|
|
4
|
-
// (org/kind/slug) to its members and the server reconciles by set-difference
|
|
5
|
-
// against the previous member list. The CLI's job is to discover the resources
|
|
6
|
-
// that live beside stigmer.yaml, apply each one, collect references to the
|
|
7
|
-
// member-eligible ones, then apply the project with that member set. Pruning of
|
|
8
|
-
// orphans is therefore entirely server-side — see the note on `--prune` in
|
|
9
|
-
// commands/apply.ts (S1).
|
|
10
|
-
//
|
|
11
|
-
// Two project layouts are supported, mirroring the Go CLI:
|
|
12
|
-
// flat: project/agent.yaml, project/my-skill/SKILL.md
|
|
13
|
-
// organized: project/agents/*.yaml, project/skills/my-skill/SKILL.md
|
|
14
|
-
// Scanning is top-level plus one level of subdirectories — deep trees are not
|
|
15
|
-
// walked, matching Go (this keeps membership predictable and fast).
|
|
16
|
-
import { existsSync, mkdtempSync, readdirSync, rmSync, statSync } from "node:fs";
|
|
17
|
-
import { tmpdir } from "node:os";
|
|
18
|
-
import { basename, dirname, extname, join, resolve } from "node:path";
|
|
19
|
-
import { create, fromJson } from "@bufbuild/protobuf";
|
|
20
|
-
import { ApiResourceReferenceSchema, } from "@stigmer/protos/ai/stigmer/commons/apiresource/io_pb";
|
|
21
|
-
import { ApiResourceKind } from "@stigmer/protos/ai/stigmer/commons/apiresource/apiresourcekind/api_resource_kind_pb";
|
|
22
|
-
import { ApiResourceMetadataSchema, } from "@stigmer/protos/ai/stigmer/commons/apiresource/metadata_pb";
|
|
23
|
-
import { ProjectSchema } from "@stigmer/protos/ai/stigmer/tenancy/project/v1/api_pb";
|
|
24
|
-
import { ProjectCommandController } from "@stigmer/protos/ai/stigmer/tenancy/project/v1/command_pb";
|
|
25
|
-
import { ProjectSpecSchema } from "@stigmer/protos/ai/stigmer/tenancy/project/v1/spec_pb";
|
|
26
|
-
import { UsageError } from "../../errors/index.js";
|
|
27
|
-
import { CommandResult } from "../../output/index.js";
|
|
28
|
-
import { loadDocuments } from "../documents.js";
|
|
29
|
-
import { cloneRepository } from "../git.js";
|
|
30
|
-
import { hasSkillFile, pushSkill, pushSkillFromClone } from "../skill.js";
|
|
31
|
-
import { applyMessage, marshalItem, resolveHandlerForKind, resourceMetadata, sortApplyItems } from "./apply.js";
|
|
32
|
-
import { discoverAppliedMcpServers } from "./discovery.js";
|
|
33
|
-
const CONFIG_FILE_NAME = "stigmer.yaml";
|
|
34
|
-
const DEFAULT_MAX_DEPTH = 10;
|
|
35
|
-
/**
|
|
36
|
-
* Walk up from `startDir` (max 10 levels, matching Go) looking for stigmer.yaml.
|
|
37
|
-
* Absent → atomic track. Present-but-invalid → a hard error (the user clearly
|
|
38
|
-
* intended a project; help them fix it rather than silently falling back).
|
|
39
|
-
* Present with an entry_point → the SDK "project" track (synthesis), which this
|
|
40
|
-
* wave does not implement.
|
|
41
|
-
*/
|
|
42
|
-
export function detectTrack(startDir, maxDepth = DEFAULT_MAX_DEPTH) {
|
|
43
|
-
let dir = resolve(startDir);
|
|
44
|
-
for (let depth = 0; depth < maxDepth; depth++) {
|
|
45
|
-
const candidate = join(dir, CONFIG_FILE_NAME);
|
|
46
|
-
if (existsSync(candidate) && statSync(candidate).isFile()) {
|
|
47
|
-
const project = loadProject(candidate);
|
|
48
|
-
const track = project.spec?.entryPoint ? "project" : "declarative";
|
|
49
|
-
return { track, configPath: candidate, configDir: dirname(candidate), project };
|
|
50
|
-
}
|
|
51
|
-
const parent = dirname(dir);
|
|
52
|
-
if (parent === dir)
|
|
53
|
-
break;
|
|
54
|
-
dir = parent;
|
|
55
|
-
}
|
|
56
|
-
return { track: "atomic" };
|
|
57
|
-
}
|
|
58
|
-
// Strict parse of stigmer.yaml into a Project (proto carries apiVersion/kind as
|
|
59
|
-
// real fields, so the discriminator is accepted, not rejected). Unknown fields
|
|
60
|
-
// are an error — a typo in stigmer.yaml should fail loudly.
|
|
61
|
-
function loadProject(configPath) {
|
|
62
|
-
const docs = loadDocuments(configPath, { strict: true });
|
|
63
|
-
if (docs.length === 0)
|
|
64
|
-
throw new UsageError(`${configPath} contains no document`);
|
|
65
|
-
const doc = docs[0];
|
|
66
|
-
if (doc.kind !== "Project") {
|
|
67
|
-
throw new UsageError(`${configPath} must declare 'kind: Project' (found '${doc.kind}')`);
|
|
68
|
-
}
|
|
69
|
-
try {
|
|
70
|
-
return fromJson(ProjectSchema, doc.document, { ignoreUnknownFields: false });
|
|
71
|
-
}
|
|
72
|
-
catch (err) {
|
|
73
|
-
throw new UsageError(`invalid project configuration in ${configPath}: ${err.message}\n\n` +
|
|
74
|
-
"Fix the issues above or remove the file to use file mode (stigmer apply -f).");
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// =============================================================================
|
|
78
|
-
// Directory scanning
|
|
79
|
-
// =============================================================================
|
|
80
|
-
/**
|
|
81
|
-
* YAML resource files beside stigmer.yaml: top-level files plus files in
|
|
82
|
-
* immediate subdirectories. stigmer.yaml itself is excluded, as are skill
|
|
83
|
-
* directories (handled separately) and grouping dirs that hold skills.
|
|
84
|
-
*/
|
|
85
|
-
export function scanResourceFiles(projectDir) {
|
|
86
|
-
const files = [];
|
|
87
|
-
for (const entry of readdirSync(projectDir, { withFileTypes: true })) {
|
|
88
|
-
const full = join(projectDir, entry.name);
|
|
89
|
-
if (entry.isDirectory()) {
|
|
90
|
-
if (isSkillDirectory(full) || containsSkillDirectories(full))
|
|
91
|
-
continue;
|
|
92
|
-
for (const sub of readdirSync(full, { withFileTypes: true })) {
|
|
93
|
-
if (!sub.isDirectory() && isYaml(sub.name))
|
|
94
|
-
files.push(join(full, sub.name));
|
|
95
|
-
}
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
if (isYaml(entry.name) && entry.name.toLowerCase() !== CONFIG_FILE_NAME) {
|
|
99
|
-
files.push(full);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return files.sort();
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Skill directories beside stigmer.yaml: immediate children that contain a
|
|
106
|
-
* SKILL.md (flat layout), plus grandchildren under a grouping dir like skills/
|
|
107
|
-
* (organized layout). Scanning stops one level deep, matching Go.
|
|
108
|
-
*/
|
|
109
|
-
export function scanSkillDirectories(projectDir) {
|
|
110
|
-
const skillDirs = [];
|
|
111
|
-
for (const entry of readdirSync(projectDir, { withFileTypes: true })) {
|
|
112
|
-
if (!entry.isDirectory())
|
|
113
|
-
continue;
|
|
114
|
-
const full = join(projectDir, entry.name);
|
|
115
|
-
if (isSkillDirectory(full)) {
|
|
116
|
-
skillDirs.push(full);
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
for (const sub of readdirSync(full, { withFileTypes: true })) {
|
|
120
|
-
const nested = join(full, sub.name);
|
|
121
|
-
if (sub.isDirectory() && isSkillDirectory(nested))
|
|
122
|
-
skillDirs.push(nested);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return skillDirs.sort();
|
|
126
|
-
}
|
|
127
|
-
function containsSkillDirectories(dir) {
|
|
128
|
-
try {
|
|
129
|
-
return readdirSync(dir, { withFileTypes: true }).some((e) => e.isDirectory() && isSkillDirectory(join(dir, e.name)));
|
|
130
|
-
}
|
|
131
|
-
catch {
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
function isSkillDirectory(dir) {
|
|
136
|
-
return hasSkillFile(dir);
|
|
137
|
-
}
|
|
138
|
-
function isYaml(name) {
|
|
139
|
-
const ext = extname(name).toLowerCase();
|
|
140
|
-
return ext === ".yaml" || ext === ".yml";
|
|
141
|
-
}
|
|
142
|
-
// =============================================================================
|
|
143
|
-
// Item building
|
|
144
|
-
// =============================================================================
|
|
145
|
-
/**
|
|
146
|
-
* Build ordered apply items from scanned resource files. Project documents are
|
|
147
|
-
* skipped (stigmer.yaml is already loaded) and Organization documents are
|
|
148
|
-
* skipped with a warning — an organization sits above a project in the resource
|
|
149
|
-
* hierarchy and must be applied independently with file mode.
|
|
150
|
-
*/
|
|
151
|
-
export function buildDeclarativeItems(files, warn) {
|
|
152
|
-
const items = [];
|
|
153
|
-
for (const file of files) {
|
|
154
|
-
for (const doc of loadDocuments(file, { strict: true })) {
|
|
155
|
-
if (doc.kind === "Project")
|
|
156
|
-
continue;
|
|
157
|
-
if (doc.kind === "Organization") {
|
|
158
|
-
warn(`Skipping ${file}: Organization is not a project resource. Use 'stigmer apply -f' to manage organizations.`);
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
items.push({ filePath: file, handler: resolveHandlerForKind(doc.kind, file), document: doc.document });
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
return sortApplyItems(items);
|
|
165
|
-
}
|
|
166
|
-
// Member-eligible kinds participate in project membership and reconciliation.
|
|
167
|
-
// Mirrors Go's types.IsProjectMemberKind.
|
|
168
|
-
const MEMBER_KINDS = new Set([
|
|
169
|
-
ApiResourceKind.agent,
|
|
170
|
-
ApiResourceKind.workflow,
|
|
171
|
-
ApiResourceKind.mcp_server,
|
|
172
|
-
ApiResourceKind.skill,
|
|
173
|
-
]);
|
|
174
|
-
/**
|
|
175
|
-
* Apply a declarative project: scan the directory for YAML resources and skill
|
|
176
|
-
* directories, marshal each resource, then hand everything to the shared
|
|
177
|
-
* reconciler. This adapter's only job is "filesystem → resources + skill
|
|
178
|
-
* sources"; the synthesis track has its own adapter ("SDK → resources + skill
|
|
179
|
-
* sources") and both converge on {@link reconcileProjectMembers} (DD-009 §6).
|
|
180
|
-
*/
|
|
181
|
-
export async function applyDeclarative(detect, deps) {
|
|
182
|
-
const { project, configDir } = detect;
|
|
183
|
-
if (project === undefined || configDir === undefined) {
|
|
184
|
-
throw new UsageError("declarative apply requires a stigmer.yaml project");
|
|
185
|
-
}
|
|
186
|
-
const resourceFiles = scanResourceFiles(configDir);
|
|
187
|
-
const skillDirs = scanSkillDirectories(configDir);
|
|
188
|
-
if (resourceFiles.length === 0 && skillDirs.length === 0) {
|
|
189
|
-
return buildNoResourcesResult(configDir);
|
|
190
|
-
}
|
|
191
|
-
const items = buildDeclarativeItems(resourceFiles, deps.warn);
|
|
192
|
-
deps.info(`Found ${items.length} resource(s) in ${resourceFiles.length} file(s), ${skillDirs.length} skill(s)`);
|
|
193
|
-
const resources = items.map((item) => ({ handler: item.handler, message: marshalItem(item) }));
|
|
194
|
-
const skillSources = skillDirs.map((dir) => ({ kind: "local", dir, tag: "latest" }));
|
|
195
|
-
return reconcileProjectMembers(project, resources, skillSources, deps);
|
|
196
|
-
}
|
|
197
|
-
// Both tracks treat skill artifacts the same way; the default ignore policy
|
|
198
|
-
// mirrors the declarative push (respect .gitignore, no extra patterns).
|
|
199
|
-
const DEFAULT_IGNORE_OPTIONS = { respectGitignore: true, extraIgnore: [], extraInclude: [] };
|
|
200
|
-
/**
|
|
201
|
-
* Reconcile a project's membership: push skills first (agents may reference
|
|
202
|
-
* them), apply MCP servers and run capability discovery on them, apply the
|
|
203
|
-
* remaining resources, collect references to the member-eligible ones, then
|
|
204
|
-
* apply the project with that exact member set so the server can reconcile by
|
|
205
|
-
* set-difference (orphan pruning is server-side; see S1 in commands/apply.ts).
|
|
206
|
-
*/
|
|
207
|
-
export async function reconcileProjectMembers(project, resources, skillSources, deps) {
|
|
208
|
-
const members = [];
|
|
209
|
-
// Skills first — agents may reference them.
|
|
210
|
-
for (const src of skillSources) {
|
|
211
|
-
const pushed = await pushSkillSource(deps.stigmer, src, deps.org, deps.info);
|
|
212
|
-
members.push(reference(deps.org, ApiResourceKind.skill, pushed.slug));
|
|
213
|
-
}
|
|
214
|
-
// Each resource is applied through the shared apply core, collecting member
|
|
215
|
-
// references from the APPLIED result so membership carries the server's
|
|
216
|
-
// authoritative slug. (This is the unified policy: the declarative track
|
|
217
|
-
// used to read the pre-apply YAML slug, the Go synthesis track read the
|
|
218
|
-
// applied result — converging on the applied result is correct for both and
|
|
219
|
-
// matches what the backend actually stored.)
|
|
220
|
-
const appliedMcpServers = [];
|
|
221
|
-
const applyOne = async (res) => {
|
|
222
|
-
const outcome = await applyMessage(deps.controller, res.handler, res.message, deps.org, false);
|
|
223
|
-
if (outcome.warning !== undefined)
|
|
224
|
-
deps.warn(outcome.warning);
|
|
225
|
-
if (outcome.appliedMcpServer !== undefined)
|
|
226
|
-
appliedMcpServers.push(outcome.appliedMcpServer);
|
|
227
|
-
if (MEMBER_KINDS.has(res.handler.kind) && outcome.applied !== undefined) {
|
|
228
|
-
const slug = memberSlugOf(outcome.applied);
|
|
229
|
-
if (slug)
|
|
230
|
-
members.push(reference(deps.org, res.handler.kind, slug));
|
|
231
|
-
}
|
|
232
|
-
};
|
|
233
|
-
// MCP servers first, then capability discovery, then everything else — the
|
|
234
|
-
// dependency principle applied to capabilities, not just existence. The
|
|
235
|
-
// server validates agent enabled_tools against discovered capabilities at
|
|
236
|
-
// apply time (stigmer/stigmer#402), and the backend's own post-apply
|
|
237
|
-
// connect is asynchronous; discovering here means agents in this apply
|
|
238
|
-
// validate against the toolset this apply just shipped, not the previous
|
|
239
|
-
// generation's (which would falsely reject e.g. a project upgrade that
|
|
240
|
-
// adds a tool to a server and enables it in an agent in the same pass). Discovery stays
|
|
241
|
-
// best-effort: a failed connect warns, capabilities stay stale, and the
|
|
242
|
-
// dependent apply surfaces an actionable error listing last-known tools.
|
|
243
|
-
for (const res of resources) {
|
|
244
|
-
if (res.handler.kind === ApiResourceKind.mcp_server)
|
|
245
|
-
await applyOne(res);
|
|
246
|
-
}
|
|
247
|
-
await discoverAppliedMcpServers(deps.stigmer, appliedMcpServers, deps.org, deps.info);
|
|
248
|
-
for (const res of resources) {
|
|
249
|
-
if (res.handler.kind !== ApiResourceKind.mcp_server)
|
|
250
|
-
await applyOne(res);
|
|
251
|
-
}
|
|
252
|
-
injectOrg(project, deps.org);
|
|
253
|
-
if (project.spec === undefined)
|
|
254
|
-
project.spec = create(ProjectSpecSchema, {});
|
|
255
|
-
project.spec.members = members;
|
|
256
|
-
const created = (project.metadata?.id ?? "") === "";
|
|
257
|
-
const applied = await deps.controller(ProjectCommandController).apply(project);
|
|
258
|
-
return buildDeclarativeResult(applied, members, created);
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Push one skill source and return the result. Local sources push directly;
|
|
262
|
-
* git sources clone to a temp dir, push from the subdir, then clean up
|
|
263
|
-
* (mirrors `commands/push.ts` --git-url and Go's `pushSkillSynth`).
|
|
264
|
-
*/
|
|
265
|
-
export async function pushSkillSource(client, src, org, info) {
|
|
266
|
-
if (src.kind === "local") {
|
|
267
|
-
info(`Pushing skill from ${basename(src.dir)}...`);
|
|
268
|
-
return pushSkill(client, src.dir, org, src.tag, "", DEFAULT_IGNORE_OPTIONS);
|
|
269
|
-
}
|
|
270
|
-
info(`Pushing skill from ${src.url}...`);
|
|
271
|
-
const tempDir = mkdtempSync(join(tmpdir(), "stigmer-skill-"));
|
|
272
|
-
try {
|
|
273
|
-
cloneRepository(src.url, src.ref, tempDir);
|
|
274
|
-
const skillDir = src.subdir !== "" ? join(tempDir, src.subdir) : tempDir;
|
|
275
|
-
return await pushSkillFromClone(client, skillDir, {
|
|
276
|
-
gitUrl: src.url,
|
|
277
|
-
gitRef: src.ref,
|
|
278
|
-
subdir: src.subdir,
|
|
279
|
-
org,
|
|
280
|
-
tag: src.tag,
|
|
281
|
-
message: "",
|
|
282
|
-
options: DEFAULT_IGNORE_OPTIONS,
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
finally {
|
|
286
|
-
rmSync(tempDir, { recursive: true, force: true });
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
// Member slug from an applied resource: prefer the server's slug, fall back to
|
|
290
|
-
// the name (mirrors Go's buildResourceReference / reader name-fallback).
|
|
291
|
-
function memberSlugOf(message) {
|
|
292
|
-
const meta = resourceMetadata(message);
|
|
293
|
-
return meta?.slug || meta?.name || "";
|
|
294
|
-
}
|
|
295
|
-
/** Dry-run: validate every resource without touching the backend. */
|
|
296
|
-
export function previewDeclarative(detect, deps) {
|
|
297
|
-
const { configDir } = detect;
|
|
298
|
-
if (configDir === undefined)
|
|
299
|
-
throw new UsageError("declarative apply requires a stigmer.yaml project");
|
|
300
|
-
const items = buildDeclarativeItems(scanResourceFiles(configDir), deps.warn);
|
|
301
|
-
const results = items.map((item) => buildDryRunPreview(item));
|
|
302
|
-
const summary = CommandResult.success(`Dry run complete: ${items.length} resource(s) validated`);
|
|
303
|
-
summary.hint("Remove --dry-run to apply resources to the backend");
|
|
304
|
-
return { results, summary };
|
|
305
|
-
}
|
|
306
|
-
function buildDryRunPreview(item) {
|
|
307
|
-
const meta = metaOf(item);
|
|
308
|
-
const result = CommandResult.success(`Dry run: ${meta?.name ?? item.handler.displayName} is valid`);
|
|
309
|
-
const section = result.addSection(`${item.handler.displayName} Preview`);
|
|
310
|
-
if (meta?.name)
|
|
311
|
-
section.field("Name", meta.name);
|
|
312
|
-
if (meta?.slug)
|
|
313
|
-
section.field("Slug", meta.slug);
|
|
314
|
-
return result;
|
|
315
|
-
}
|
|
316
|
-
// The document is YAML-shaped JSON; read metadata fields for membership/preview
|
|
317
|
-
// without marshalling (the apply itself marshals strictly).
|
|
318
|
-
function metaOf(item) {
|
|
319
|
-
const meta = item.document.metadata;
|
|
320
|
-
if (meta === undefined)
|
|
321
|
-
return undefined;
|
|
322
|
-
return {
|
|
323
|
-
name: typeof meta.name === "string" ? meta.name : undefined,
|
|
324
|
-
slug: typeof meta.slug === "string" ? meta.slug : undefined,
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
function reference(org, kind, slug) {
|
|
328
|
-
return create(ApiResourceReferenceSchema, { org, kind, slug });
|
|
329
|
-
}
|
|
330
|
-
function injectOrg(project, org) {
|
|
331
|
-
if (org === "")
|
|
332
|
-
return;
|
|
333
|
-
const holder = project;
|
|
334
|
-
if (holder.metadata === undefined) {
|
|
335
|
-
holder.metadata = create(ApiResourceMetadataSchema, { org });
|
|
336
|
-
}
|
|
337
|
-
else if (holder.metadata.org === "") {
|
|
338
|
-
holder.metadata.org = org;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
// =============================================================================
|
|
342
|
-
// Result builders
|
|
343
|
-
// =============================================================================
|
|
344
|
-
function buildNoResourcesResult(projectDir) {
|
|
345
|
-
const result = CommandResult.warning("No resource files found in project directory");
|
|
346
|
-
result
|
|
347
|
-
.addSection("")
|
|
348
|
-
.field("Directory", projectDir)
|
|
349
|
-
.item("Add YAML resource files (Agent, Workflow, McpServer) or skill directories (with SKILL.md) next to stigmer.yaml");
|
|
350
|
-
result.hint("Example: create agent.yaml with kind: Agent, then run 'stigmer apply'");
|
|
351
|
-
return result;
|
|
352
|
-
}
|
|
353
|
-
function buildDeclarativeResult(project, members, created) {
|
|
354
|
-
const name = project.metadata?.name ?? "project";
|
|
355
|
-
const result = CommandResult.success(`Project ${name} successfully (${created ? "created" : "updated"})`);
|
|
356
|
-
const section = result.addSection("Project");
|
|
357
|
-
if (project.metadata?.name)
|
|
358
|
-
section.field("Name", project.metadata.name);
|
|
359
|
-
if (project.metadata?.slug)
|
|
360
|
-
section.field("Slug", project.metadata.slug);
|
|
361
|
-
if (project.metadata?.id)
|
|
362
|
-
section.field("ID", project.metadata.id);
|
|
363
|
-
const counts = countByKind(members);
|
|
364
|
-
if (counts.size > 0) {
|
|
365
|
-
const memberSection = result.addSection("Members Applied");
|
|
366
|
-
for (const kind of [
|
|
367
|
-
ApiResourceKind.agent,
|
|
368
|
-
ApiResourceKind.workflow,
|
|
369
|
-
ApiResourceKind.mcp_server,
|
|
370
|
-
ApiResourceKind.skill,
|
|
371
|
-
]) {
|
|
372
|
-
const count = counts.get(kind);
|
|
373
|
-
if (count !== undefined)
|
|
374
|
-
memberSection.field(ApiResourceKind[kind], String(count));
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
const recon = project.status?.lastReconciliation;
|
|
378
|
-
if (recon !== undefined && (recon.created.length > 0 || recon.updated.length > 0 || recon.deleted.length > 0)) {
|
|
379
|
-
const reconSection = result.addSection("Reconciliation");
|
|
380
|
-
if (recon.created.length > 0)
|
|
381
|
-
reconSection.field("Created", String(recon.created.length));
|
|
382
|
-
if (recon.updated.length > 0)
|
|
383
|
-
reconSection.field("Updated", String(recon.updated.length));
|
|
384
|
-
if (recon.deleted.length > 0)
|
|
385
|
-
reconSection.field("Pruned", String(recon.deleted.length));
|
|
386
|
-
}
|
|
387
|
-
if (project.metadata?.slug)
|
|
388
|
-
result.hint(`View project: stigmer get project ${project.metadata.slug}`);
|
|
389
|
-
return result;
|
|
390
|
-
}
|
|
391
|
-
function countByKind(members) {
|
|
392
|
-
const counts = new Map();
|
|
393
|
-
for (const member of members)
|
|
394
|
-
counts.set(member.kind, (counts.get(member.kind) ?? 0) + 1);
|
|
395
|
-
return counts;
|
|
396
|
-
}
|
|
397
|
-
//# sourceMappingURL=declarative.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"declarative.js","sourceRoot":"","sources":["../../../src/resources/apply/declarative.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,EAAE;AACF,6EAA6E;AAC7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AAY,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QAC1F,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3F,CAAC;IAED,IAAI,OAAO,CAAC,QAAQ,EAAE,IAAI;QAAE,MAAM,CAAC,IAAI,CAAC,qCAAqC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACtG,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,WAAW,CAAC,OAAwC;IAC3D,MAAM,MAAM,GAAG,IAAI,GAAG,EAA2B,CAAC;IAClD,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1F,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { CommandResult } from "../../../output/index.js";
|
|
2
|
-
import { type DeclarativeDeps, type DetectResult } from "../declarative.js";
|
|
3
|
-
import type { SynthesizeDeps } from "./synthesize.js";
|
|
4
|
-
/** Deps for the project track: the reconciler deps plus injectable synthesis. */
|
|
5
|
-
export interface ProjectTrackDeps extends DeclarativeDeps {
|
|
6
|
-
/** Injectable synthesis collaborators (real subprocess by default). */
|
|
7
|
-
readonly synthesizeDeps?: SynthesizeDeps;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Apply an SDK project: synthesize the entry point, read the `.pb` output, and
|
|
11
|
-
* reconcile membership through the shared reconciler. Returns the summary
|
|
12
|
-
* CommandResult for the caller to render.
|
|
13
|
-
*/
|
|
14
|
-
export declare function applyProjectTrack(detect: DetectResult, deps: ProjectTrackDeps): Promise<CommandResult>;
|
|
15
|
-
/**
|
|
16
|
-
* Dry-run preview: validate the project configuration statically (no synthesis,
|
|
17
|
-
* no backend), warning if the entry point file is missing. Port of Go's
|
|
18
|
-
* executeSDKDryRun.
|
|
19
|
-
*/
|
|
20
|
-
export declare function previewProjectTrack(detect: DetectResult): CommandResult;
|
|
21
|
-
//# sourceMappingURL=project-track.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project-track.d.ts","sourceRoot":"","sources":["../../../../src/resources/apply/synth/project-track.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EAIlB,MAAM,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,iFAAiF;AACjF,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,uEAAuE;IACvE,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;CAC1C;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAyB5G;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAmBvE"}
|