@vpxa/aikit 0.1.50 → 0.1.51
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/package.json
CHANGED
|
@@ -2,10 +2,11 @@ import { FlowFormat, FlowFormatAdapter } from "../types.js";
|
|
|
2
2
|
import { ClaudePluginAdapter } from "./claude-plugin.js";
|
|
3
3
|
import { CopilotAdapter } from "./copilot.js";
|
|
4
4
|
import { NativeAdapter } from "./native.js";
|
|
5
|
+
import { OpenSpecAdapter } from "./openspec.js";
|
|
5
6
|
|
|
6
7
|
//#region packages/flows/src/adapters/index.d.ts
|
|
7
8
|
declare function detectFormat(sourceDir: string): FlowFormat | null;
|
|
8
9
|
declare function getAdapter(format: FlowFormat): FlowFormatAdapter;
|
|
9
10
|
declare function getAdapterForSource(sourceDir: string): FlowFormatAdapter | null;
|
|
10
11
|
//#endregion
|
|
11
|
-
export { ClaudePluginAdapter, CopilotAdapter, NativeAdapter, detectFormat, getAdapter, getAdapterForSource };
|
|
12
|
+
export { ClaudePluginAdapter, CopilotAdapter, NativeAdapter, OpenSpecAdapter, detectFormat, getAdapter, getAdapterForSource };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ClaudePluginAdapter as e}from"./claude-plugin.js";import{CopilotAdapter as t}from"./copilot.js";import{NativeAdapter as n}from"./native.js";const
|
|
1
|
+
import{ClaudePluginAdapter as e}from"./claude-plugin.js";import{CopilotAdapter as t}from"./copilot.js";import{NativeAdapter as n}from"./native.js";import{OpenSpecAdapter as r}from"./openspec.js";const i=[new n,new e,new t,new r];function a(e){for(let t of i)if(t.detect(e))return t.format;return null}function o(e){let t=i.find(t=>t.format===e);if(!t)throw Error(`No adapter for format: ${e}`);return t}function s(e){for(let t of i)if(t.detect(e))return t;return null}export{e as ClaudePluginAdapter,t as CopilotAdapter,n as NativeAdapter,r as OpenSpecAdapter,a as detectFormat,o as getAdapter,s as getAdapterForSource};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FlowFormatAdapter, FlowManifest, FlowParseOptions } from "../types.js";
|
|
2
|
+
|
|
3
|
+
//#region packages/flows/src/adapters/openspec.d.ts
|
|
4
|
+
declare class OpenSpecAdapter implements FlowFormatAdapter {
|
|
5
|
+
readonly format: "openspec";
|
|
6
|
+
detect(sourceDir: string): boolean;
|
|
7
|
+
parse(sourceDir: string, _options?: FlowParseOptions): Promise<FlowManifest>;
|
|
8
|
+
/**
|
|
9
|
+
* Read metadata from package.json if available, otherwise use defaults
|
|
10
|
+
* derived from the openspec config.
|
|
11
|
+
*/
|
|
12
|
+
private readMeta;
|
|
13
|
+
/**
|
|
14
|
+
* Discover phases from the openspec/specs/ directory.
|
|
15
|
+
* If the directory contains subdirectories matching known phases, use those.
|
|
16
|
+
* Otherwise, fall back to the full standard phase list.
|
|
17
|
+
*/
|
|
18
|
+
private discoverPhases;
|
|
19
|
+
/**
|
|
20
|
+
* Convert phases to FlowSteps with linear dependency chain.
|
|
21
|
+
*/
|
|
22
|
+
private buildSteps;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { OpenSpecAdapter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{existsSync as e,readFileSync as t,readdirSync as n,statSync as r}from"node:fs";import{basename as i,join as a}from"node:path";const o=[{id:`propose`,name:`Propose`,description:`Create a change proposal outlining the problem, motivation, and high-level approach`,produces:[`proposal.md`]},{id:`specs`,name:`Specs`,description:`Write detailed specifications with acceptance criteria and constraints`,produces:[`specs/`]},{id:`design`,name:`Design`,description:`Produce a technical design document mapping specs to implementation approach`,produces:[`design.md`]},{id:`tasks`,name:`Tasks`,description:`Break the design into ordered, actionable implementation tasks`,produces:[`tasks.md`]},{id:`apply`,name:`Apply`,description:`Implement the tasks, writing code and tests according to the design`,produces:[]},{id:`archive`,name:`Archive`,description:`Archive the completed change and update project documentation`,produces:[]}];var s=class{format=`openspec`;detect(t){return e(a(t,`openspec`,`config.yaml`))}async parse(e,t){let n=this.readMeta(e),r=a(e,`openspec`,`specs`),i=this.discoverPhases(r),o=this.buildSteps(i);return{name:n.name,version:n.version,description:n.description,author:n.author,steps:o,agents:[],artifacts_dir:`openspec`,install:[]}}readMeta(n){let r=a(n,`package.json`);if(e(r))try{let e=JSON.parse(t(r,`utf-8`));return{name:e.name??i(n),version:e.version??`0.1.0`,description:e.description??`OpenSpec flow`,author:e.author}}catch{}return{name:i(n),version:`0.1.0`,description:`OpenSpec flow`}}discoverPhases(t){if(!e(t))return o;try{let e=n(t).filter(e=>r(a(t,e)).isDirectory());if(e.length===0)return o;let i=new Set(o.map(e=>e.id)),s=e.filter(e=>i.has(e));if(s.length>0)return o.filter(e=>s.includes(e.id))}catch{}return o}buildSteps(e){return e.map((t,n)=>({id:t.id,name:t.name,instruction:`steps/${t.id}/README.md`,produces:t.produces,requires:n>0?[e[n-1].id]:[],agents:[],description:t.description}))}};export{s as OpenSpecAdapter};
|
|
@@ -41,7 +41,7 @@ interface FlowManifest {
|
|
|
41
41
|
/** Source type for flow installation */
|
|
42
42
|
type FlowSourceType = 'builtin' | 'git' | 'local';
|
|
43
43
|
/** Detected format of the flow source */
|
|
44
|
-
type FlowFormat = 'native' | 'claude-plugin' | 'copilot';
|
|
44
|
+
type FlowFormat = 'native' | 'claude-plugin' | 'copilot' | 'openspec';
|
|
45
45
|
/** Registry entry for an installed flow */
|
|
46
46
|
interface FlowRegistryEntry {
|
|
47
47
|
/** Flow name */
|