@multileaf/ai-workflow 0.1.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.
- package/CHANGELOG.md +22 -0
- package/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/adapter-contract.d.ts +13 -0
- package/dist/adapter-contract.js +50 -0
- package/dist/adapter.d.ts +15 -0
- package/dist/adapter.js +62 -0
- package/dist/claude-layout.d.ts +9 -0
- package/dist/claude-layout.js +23 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +30 -0
- package/dist/codex-layout.d.ts +10 -0
- package/dist/codex-layout.js +24 -0
- package/dist/confirmation.d.ts +9 -0
- package/dist/confirmation.js +41 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.js +10 -0
- package/dist/context-cache.d.ts +8 -0
- package/dist/context-cache.js +17 -0
- package/dist/context-quality.d.ts +11 -0
- package/dist/context-quality.js +27 -0
- package/dist/context-retrieval.d.ts +3 -0
- package/dist/context-retrieval.js +13 -0
- package/dist/context-store.d.ts +9 -0
- package/dist/context-store.js +18 -0
- package/dist/copilot-layout.d.ts +9 -0
- package/dist/copilot-layout.js +24 -0
- package/dist/cursor-layout.d.ts +9 -0
- package/dist/cursor-layout.js +25 -0
- package/dist/dashboard.d.ts +37 -0
- package/dist/dashboard.js +251 -0
- package/dist/drift.d.ts +2 -0
- package/dist/drift.js +10 -0
- package/dist/evidence.d.ts +20 -0
- package/dist/evidence.js +32 -0
- package/dist/files.d.ts +2 -0
- package/dist/files.js +58 -0
- package/dist/gemini-layout.d.ts +9 -0
- package/dist/gemini-layout.js +23 -0
- package/dist/generator.d.ts +3 -0
- package/dist/generator.js +16 -0
- package/dist/intelligence.d.ts +2 -0
- package/dist/intelligence.js +13 -0
- package/dist/interpreter.d.ts +23 -0
- package/dist/interpreter.js +117 -0
- package/dist/lockfile.d.ts +12 -0
- package/dist/lockfile.js +59 -0
- package/dist/manifest.d.ts +15 -0
- package/dist/manifest.js +35 -0
- package/dist/migration.d.ts +22 -0
- package/dist/migration.js +50 -0
- package/dist/orchestration.d.ts +30 -0
- package/dist/orchestration.js +172 -0
- package/dist/organization-policy.d.ts +14 -0
- package/dist/organization-policy.js +47 -0
- package/dist/package-audit.d.ts +19 -0
- package/dist/package-audit.js +28 -0
- package/dist/package-contract.d.ts +30 -0
- package/dist/package-contract.js +93 -0
- package/dist/package-integrity.d.ts +8 -0
- package/dist/package-integrity.js +15 -0
- package/dist/package-updates.d.ts +11 -0
- package/dist/package-updates.js +32 -0
- package/dist/plugin-sdk.d.ts +20 -0
- package/dist/plugin-sdk.js +243 -0
- package/dist/policy-gate.d.ts +6 -0
- package/dist/policy-gate.js +20 -0
- package/dist/profile.d.ts +23 -0
- package/dist/profile.js +123 -0
- package/dist/providers.d.ts +20 -0
- package/dist/providers.js +67 -0
- package/dist/quality-gates.d.ts +2 -0
- package/dist/quality-gates.js +40 -0
- package/dist/recommendations.d.ts +12 -0
- package/dist/recommendations.js +63 -0
- package/dist/registry.d.ts +11 -0
- package/dist/registry.js +27 -0
- package/dist/scanner.d.ts +9 -0
- package/dist/scanner.js +83 -0
- package/dist/selection.d.ts +3 -0
- package/dist/selection.js +11 -0
- package/dist/self-validation.d.ts +9 -0
- package/dist/self-validation.js +9 -0
- package/dist/services.d.ts +42 -0
- package/dist/services.js +1 -0
- package/dist/team-configuration.d.ts +23 -0
- package/dist/team-configuration.js +104 -0
- package/dist/telemetry.d.ts +20 -0
- package/dist/telemetry.js +95 -0
- package/dist/token-usage.d.ts +9 -0
- package/dist/token-usage.js +38 -0
- package/dist/traceability.d.ts +23 -0
- package/dist/traceability.js +51 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.js +1 -0
- package/dist/universal-layout.d.ts +9 -0
- package/dist/universal-layout.js +21 -0
- package/dist/vercel-skills.d.ts +17 -0
- package/dist/vercel-skills.js +49 -0
- package/dist/workflow.d.ts +4 -0
- package/dist/workflow.js +1130 -0
- package/docs/README.md +20 -0
- package/docs/adapter-model.md +16 -0
- package/docs/architecture.md +66 -0
- package/docs/backlog.md +93 -0
- package/docs/orchestration.md +50 -0
- package/docs/package-model.md +53 -0
- package/docs/plugin-authoring.md +31 -0
- package/docs/product-requirements.md +57 -0
- package/docs/product-vision.md +26 -0
- package/docs/project-intelligence.md +59 -0
- package/docs/quality.md +32 -0
- package/docs/release-backlog.md +7 -0
- package/docs/release-process.md +38 -0
- package/docs/security.md +18 -0
- package/docs/telemetry.md +28 -0
- package/docs/token-efficiency.md +16 -0
- package/package.json +76 -0
- package/resources/README.md +4 -0
- package/resources/agents/adapter-engineer.md +4 -0
- package/resources/agents/documentation-writer.md +4 -0
- package/resources/agents/quality-reviewer.md +4 -0
- package/resources/agents/requirements-analyst.md +4 -0
- package/resources/agents/security-reviewer.md +4 -0
- package/resources/agents/technical-architect.md +4 -0
- package/resources/agents/test-engineer.md +4 -0
- package/resources/agents/typescript-engineer.md +4 -0
- package/resources/hooks/post-change.md +4 -0
- package/resources/hooks/post-implementation.md +4 -0
- package/resources/hooks/pre-commit.md +4 -0
- package/resources/hooks/pre-implementation.md +4 -0
- package/resources/hooks/pre-release.md +4 -0
- package/resources/package.yaml +36 -0
- package/resources/rules/architecture-policy.md +4 -0
- package/resources/rules/completion-validation.md +19 -0
- package/resources/rules/dependency-policy.md +4 -0
- package/resources/rules/documentation-policy.md +4 -0
- package/resources/rules/generated-files.md +4 -0
- package/resources/rules/language-policy.md +4 -0
- package/resources/rules/quality-gates.md +4 -0
- package/resources/rules/security-policy.md +4 -0
- package/resources/rules/self-validation.md +12 -0
- package/resources/rules/tdd-policy.md +4 -0
- package/resources/skills/adapter-development.md +9 -0
- package/resources/skills/brainstorming.md +9 -0
- package/resources/skills/code-review.md +9 -0
- package/resources/skills/documentation-maintenance.md +9 -0
- package/resources/skills/implementation-planning.md +9 -0
- package/resources/skills/project-init.md +9 -0
- package/resources/skills/requirements-specification.md +9 -0
- package/resources/skills/security-review.md +9 -0
- package/resources/skills/skill-authoring.md +9 -0
- package/resources/skills/tdd-development.md +9 -0
- package/resources/skills/technical-design.md +9 -0
- package/resources/skills/verification.md +9 -0
- package/resources/templates/brainstorm.md +16 -0
- package/resources/templates/decision-record.md +12 -0
- package/resources/templates/implementation-plan.md +12 -0
- package/resources/templates/migration-report.md +14 -0
- package/resources/templates/security-review.md +14 -0
- package/resources/templates/specification.md +23 -0
- package/resources/templates/task.md +14 -0
- package/resources/templates/technical-design.md +14 -0
- package/resources/templates/test-plan.md +12 -0
- package/resources/templates/verification-report.md +12 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const TARGETS: readonly ["codex", "claude", "cursor", "gemini", "copilot", "universal"];
|
|
2
|
+
export type Target = (typeof TARGETS)[number];
|
|
3
|
+
export type CommandResult = {
|
|
4
|
+
exitCode: number;
|
|
5
|
+
output?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
};
|
|
8
|
+
export type PathType = "missing" | "file" | "directory" | "symlink" | "other";
|
|
9
|
+
export type FileSystem = {
|
|
10
|
+
exists(path: string): boolean;
|
|
11
|
+
read(path: string): string;
|
|
12
|
+
readBytes?(path: string): Uint8Array;
|
|
13
|
+
write(path: string, content: string): void;
|
|
14
|
+
createExclusive?(path: string, content: string): boolean;
|
|
15
|
+
writeBytes?(path: string, content: Uint8Array): void;
|
|
16
|
+
mkdir(path: string): void;
|
|
17
|
+
list?(path: string): string[];
|
|
18
|
+
listFiles?(path: string): string[];
|
|
19
|
+
remove?(path: string): void;
|
|
20
|
+
pathType?(path: string): PathType;
|
|
21
|
+
realpath?(path: string): string;
|
|
22
|
+
};
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const TARGETS = ["codex", "claude", "cursor", "gemini", "copilot", "universal"];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ResourceType } from "./package-contract.js";
|
|
2
|
+
import type { FileSystem } from "./types.js";
|
|
3
|
+
export type UniversalResourceType = ResourceType | "context";
|
|
4
|
+
export type UniversalResourceDescriptor = {
|
|
5
|
+
path: string;
|
|
6
|
+
support: "fallback";
|
|
7
|
+
};
|
|
8
|
+
export declare function describeUniversalResource(type: UniversalResourceType, id: string): UniversalResourceDescriptor;
|
|
9
|
+
export declare function renderUniversalContext(root: string, content: string, fs: FileSystem): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
const ROOTS = {
|
|
3
|
+
skills: ".aiw/resources/skills",
|
|
4
|
+
rules: ".aiw/resources/rules",
|
|
5
|
+
agents: ".aiw/resources/agents",
|
|
6
|
+
hooks: ".aiw/resources/hooks",
|
|
7
|
+
templates: ".aiw/resources/templates",
|
|
8
|
+
context: ".aiw/resources/context",
|
|
9
|
+
};
|
|
10
|
+
export function describeUniversalResource(type, id) {
|
|
11
|
+
const root = ROOTS[type];
|
|
12
|
+
if (!root)
|
|
13
|
+
throw new Error(`Unsupported universal resource type: ${type}`);
|
|
14
|
+
const filename = type === "skills" ? "SKILL.md" : `${id}.md`;
|
|
15
|
+
return { path: `${root}/${id}/${filename}`, support: "fallback" };
|
|
16
|
+
}
|
|
17
|
+
export function renderUniversalContext(root, content, fs) {
|
|
18
|
+
const path = describeUniversalResource("context", "project").path;
|
|
19
|
+
fs.write(join(root, path), content);
|
|
20
|
+
return path;
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type VercelSkillsCommand = "find" | "inspect" | "add" | "check" | "update";
|
|
2
|
+
export type VercelSkillsRequest = {
|
|
3
|
+
command: VercelSkillsCommand;
|
|
4
|
+
source?: string;
|
|
5
|
+
skill?: string;
|
|
6
|
+
agent?: string;
|
|
7
|
+
};
|
|
8
|
+
export interface CommandExecutor {
|
|
9
|
+
execute(command: string[]): Promise<{
|
|
10
|
+
stdout: string;
|
|
11
|
+
exitCode: number;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
export declare const nodeCommandExecutor: CommandExecutor;
|
|
15
|
+
export declare function buildVercelSkillsCommand(request: VercelSkillsRequest): string[];
|
|
16
|
+
export declare function executeVercelSkills(executor: CommandExecutor, request: VercelSkillsRequest): Promise<string>;
|
|
17
|
+
export declare function installVercelSkill(executor: CommandExecutor, source: string, skill: string, agent: string): Promise<string>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { promisify } from "node:util";
|
|
3
|
+
const executeFile = promisify(execFile);
|
|
4
|
+
export const nodeCommandExecutor = {
|
|
5
|
+
async execute(command) {
|
|
6
|
+
const [program, ...args] = command;
|
|
7
|
+
try {
|
|
8
|
+
const result = await executeFile(program, args, { maxBuffer: 1024 * 1024 });
|
|
9
|
+
return { stdout: result.stdout, exitCode: 0 };
|
|
10
|
+
}
|
|
11
|
+
catch (error) {
|
|
12
|
+
const failure = error;
|
|
13
|
+
return { stdout: failure.stdout ?? String(error), exitCode: failure.status ?? 1 };
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export function buildVercelSkillsCommand(request) {
|
|
18
|
+
if (request.command === "find")
|
|
19
|
+
return ["npx", "skills", "find", request.skill ?? ""];
|
|
20
|
+
if (request.command === "inspect") {
|
|
21
|
+
if (!request.source)
|
|
22
|
+
throw new Error("A source is required to inspect Vercel skills.");
|
|
23
|
+
return ["npx", "skills", "add", request.source, "--list"];
|
|
24
|
+
}
|
|
25
|
+
if (request.command === "add") {
|
|
26
|
+
if (!request.source)
|
|
27
|
+
throw new Error("A source is required to add a Vercel skill.");
|
|
28
|
+
return [
|
|
29
|
+
"npx",
|
|
30
|
+
"skills",
|
|
31
|
+
"add",
|
|
32
|
+
request.skill ? `${request.source}@${request.skill}` : request.source,
|
|
33
|
+
...(request.agent ? ["--agent", request.agent] : []),
|
|
34
|
+
"--yes",
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
return ["npx", "skills", request.command];
|
|
38
|
+
}
|
|
39
|
+
export async function executeVercelSkills(executor, request) {
|
|
40
|
+
const result = await executor.execute(buildVercelSkillsCommand(request));
|
|
41
|
+
if (result.exitCode !== 0)
|
|
42
|
+
throw new Error(`Vercel Skills ${request.command} failed: ${result.stdout}`);
|
|
43
|
+
if (/failed to (?:check|update)|failed to update/i.test(result.stdout))
|
|
44
|
+
throw new Error(`Vercel Skills ${request.command} failed: ${result.stdout}`);
|
|
45
|
+
return result.stdout;
|
|
46
|
+
}
|
|
47
|
+
export async function installVercelSkill(executor, source, skill, agent) {
|
|
48
|
+
return executeVercelSkills(executor, { command: "add", source, skill, agent });
|
|
49
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CommandResult, FileSystem } from "./types.js";
|
|
2
|
+
import type { WorkflowDependencies } from "./services.js";
|
|
3
|
+
export type WorkflowServices = WorkflowDependencies;
|
|
4
|
+
export declare function runCommand(args: string[], root: string, fs: FileSystem, services?: WorkflowServices): Promise<CommandResult>;
|