@metagptx/deepflow-suite-cli 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -2
- package/bin/deepflow-suite.js +77 -0
- package/bundle/deepflow-release.json +185 -0
- package/bundle/skills/deepflow-suite/SKILL.md +79 -0
- package/bundle/skills/deepflow-suite/manifest.yaml +20 -0
- package/bundle/skills/df-agentctrl/SKILL.md +143 -0
- package/bundle/skills/df-agentctrl/assets/agent.json +8 -0
- package/bundle/skills/df-agentctrl/references/maintenance.md +68 -0
- package/bundle/skills/df-agentctrl/scripts/to_snapshot.py +26 -0
- package/bundle/skills/df-agentrt/SKILL.md +191 -0
- package/bundle/skills/df-agentrt-repo/SKILL.md +83 -0
- package/bundle/skills/df-task/SKILL.md +177 -0
- package/bundle/skills/df-task/assets/payload-examples/adjudication.json +5 -0
- package/bundle/skills/df-task/assets/payload-examples/artifact_published.json +6 -0
- package/bundle/skills/df-task/assets/payload-examples/help_requested.json +5 -0
- package/bundle/skills/df-task/assets/payload-examples/run_outcome.json +5 -0
- package/bundle/skills/df-task/assets/payload-examples/run_terminated.json +4 -0
- package/bundle/skills/df-task/assets/payload-examples/summary.json +4 -0
- package/bundle/skills/df-task/references/fact-types.md +48 -0
- package/bundle/skills/df-task/skill_test.go +201 -0
- package/bundle/skills/df-taskdriver/SKILL.md +126 -0
- package/bundle/skills/df-workbench/SKILL.md +64 -0
- package/bundle/skills/df-workbench/manifest.yaml +5 -0
- package/manifest.json +68 -0
- package/package.json +28 -4
- package/scripts/build-package.mjs +12 -0
- package/skills/deepflow-suite/SKILL.md +79 -0
- package/skills/deepflow-suite/manifest.yaml +20 -0
- package/src/bundle-installer.mjs +189 -0
- package/src/bundle.mjs +128 -0
- package/src/cli-install.mjs +140 -0
- package/src/commands/doctor.mjs +35 -0
- package/src/commands/install.mjs +32 -0
- package/src/constants.mjs +30 -0
- package/src/linker.mjs +96 -0
- package/src/manifest.mjs +72 -0
package/src/manifest.mjs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
import { CLI_NAMES, DISTRIBUTION, PACKAGE_NAME, SKILL_NAMES } from "./constants.mjs";
|
|
6
|
+
|
|
7
|
+
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
8
|
+
|
|
9
|
+
export const defaultManifestPath = path.join(packageRoot, "manifest.json");
|
|
10
|
+
|
|
11
|
+
export async function loadManifest(manifestPath = defaultManifestPath) {
|
|
12
|
+
const manifest = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
13
|
+
validateManifest(manifest);
|
|
14
|
+
return manifest;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function validateManifest(manifest) {
|
|
18
|
+
if (!manifest || typeof manifest !== "object") {
|
|
19
|
+
throw new Error("DeepFlow manifest must be an object");
|
|
20
|
+
}
|
|
21
|
+
if (manifest.distribution !== DISTRIBUTION) {
|
|
22
|
+
throw new Error(`DeepFlow manifest distribution must be ${DISTRIBUTION}`);
|
|
23
|
+
}
|
|
24
|
+
if (typeof manifest.version !== "string" || !/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(manifest.version)) {
|
|
25
|
+
throw new Error("DeepFlow manifest version must be a semantic version");
|
|
26
|
+
}
|
|
27
|
+
if (!Array.isArray(manifest.skills) || manifest.skills.length !== SKILL_NAMES.length) {
|
|
28
|
+
throw new Error("DeepFlow manifest must contain exactly seven skills");
|
|
29
|
+
}
|
|
30
|
+
if (!Array.isArray(manifest.clis) || manifest.clis.length !== CLI_NAMES.length) {
|
|
31
|
+
throw new Error("DeepFlow manifest must contain exactly five CLIs");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const skillNames = manifest.skills.map((skill) => skill.name);
|
|
35
|
+
if (JSON.stringify([...skillNames].sort()) !== JSON.stringify([...SKILL_NAMES].sort())) {
|
|
36
|
+
throw new Error(`DeepFlow manifest skills must be ${SKILL_NAMES.join(", ")}`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const cliNames = manifest.clis.map((cli) => cli.name);
|
|
40
|
+
if (JSON.stringify([...cliNames].sort()) !== JSON.stringify([...CLI_NAMES].sort())) {
|
|
41
|
+
throw new Error(`DeepFlow manifest CLIs must be ${CLI_NAMES.join(", ")}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
for (const skill of manifest.skills) {
|
|
45
|
+
if (!skill || typeof skill.name !== "string" || typeof skill.source !== "string") {
|
|
46
|
+
throw new Error("DeepFlow manifest skills must define name and source");
|
|
47
|
+
}
|
|
48
|
+
if (path.isAbsolute(skill.source) || skill.source.split(/[\\/]/).includes("..")) {
|
|
49
|
+
throw new Error(`DeepFlow manifest skill source must be relative: ${skill.name}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
for (const cli of manifest.clis) {
|
|
53
|
+
if (!cli || typeof cli.name !== "string" || typeof cli.project !== "string" || typeof cli.install !== "string") {
|
|
54
|
+
throw new Error("DeepFlow manifest CLIs must define name, project, and install");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function resolveSkillSources(manifest, workspaceRoot, mode = "workspace") {
|
|
60
|
+
return manifest.skills.map((skill) => ({
|
|
61
|
+
...skill,
|
|
62
|
+
sourcePath: path.resolve(workspaceRoot, mode === "package" ? (skill.packageSource || `skills/${skill.name}`) : skill.source),
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function packageManifest() {
|
|
67
|
+
return {
|
|
68
|
+
distribution: DISTRIBUTION,
|
|
69
|
+
package: PACKAGE_NAME,
|
|
70
|
+
cli: "deepflow-suite",
|
|
71
|
+
};
|
|
72
|
+
}
|