@brainervirus/workit-core 0.6.1 → 0.7.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/package.json +3 -7
- package/scripts/doctor-check.ts +20 -0
- package/scripts/install-cursor-plugin.sh +51 -28
- package/scripts/install-opencode-plugin.sh +19 -21
- package/scripts/rewrite-workspace-deps.ts +15 -9
- package/scripts/sync-runtime.sh +71 -19
- package/scripts/vendor-assets.ts +37 -0
- package/skills/wk-implement/SKILL.md +2 -2
- package/skills/wk-pr/SKILL.md +1 -1
- package/src/core/boundary.ts +27 -0
- package/src/core/branch-policy.ts +63 -0
- package/src/core/branch.ts +30 -16
- package/src/core/config.ts +193 -31
- package/src/core/docs-layout.ts +251 -0
- package/src/core/docs-migration.ts +639 -0
- package/src/core/docs-repo.ts +11 -9
- package/src/core/docs-validate.ts +18 -6
- package/src/core/doctor.ts +801 -0
- package/src/core/flow-state.ts +1579 -141
- package/src/core/git.ts +22 -5
- package/src/{tools/handoff.ts → core/handoff-tools.ts} +5 -57
- package/src/core/hygiene.ts +26 -12
- package/src/core/init.ts +43 -11
- package/src/core/logger.ts +321 -0
- package/src/core/package-root.ts +28 -0
- package/src/core/ports/init-toolkit-status.ts +1 -1
- package/src/core/ports/vcs-verify-token.ts +1 -1
- package/src/core/ports/youtrack-api.ts +1 -1
- package/src/core/ports/youtrack-verify-token.ts +1 -1
- package/src/core/pr-create.ts +116 -21
- package/src/core/registration.ts +215 -0
- package/src/core/repo-context.ts +447 -0
- package/src/core/repo-tools.ts +23 -0
- package/src/core/safe-write.ts +22 -0
- package/src/core/scripts.ts +3 -44
- package/src/core/sdd.ts +45 -28
- package/src/core/setup-state.ts +54 -0
- package/src/core/setup.ts +1216 -0
- package/src/core/skill-manifests.ts +95 -0
- package/src/core/support-matrix.ts +12 -0
- package/src/core/sync-runtime.ts +348 -0
- package/src/core/templates.ts +2 -2
- package/src/core/vcs-config.ts +107 -37
- package/src/core/verify-project.ts +181 -0
- package/src/core/workspaces.ts +136 -17
- package/src/core/youtrack-tools.ts +228 -0
- package/src/core/youtrack.ts +125 -67
- package/templates/execution-contract.md +9 -7
- package/templates/superpowers-doc-contract.md +4 -3
- package/scripts/_shared/common.sh +0 -173
- package/scripts/changelog-context.sh +0 -42
- package/scripts/docs-refresh-context.sh +0 -40
- package/scripts/init/apply.sh +0 -5
- package/scripts/init/status.sh +0 -5
- package/scripts/init/toolkit-status.sh +0 -5
- package/scripts/pr-create.sh +0 -5
- package/scripts/pr-ready-context.sh +0 -88
- package/scripts/present/ascii-wireframe.sh +0 -5
- package/scripts/present/flow-diagram.sh +0 -5
- package/scripts/release-notes-context.sh +0 -40
- package/scripts/vcs/config.sh +0 -5
- package/scripts/vcs/merged-style.sh +0 -5
- package/scripts/vcs/token-create-urls.sh +0 -5
- package/scripts/vcs/verify-token.sh +0 -5
- package/scripts/verify-project.sh +0 -140
- package/scripts/youtrack/api.sh +0 -5
- package/scripts/youtrack/config.sh +0 -5
- package/scripts/youtrack/greeting.sh +0 -5
- package/scripts/youtrack/parse-duration.sh +0 -5
- package/scripts/youtrack/token-create-url.sh +0 -5
- package/scripts/youtrack/verify-token.sh +0 -5
- package/scripts/youtrack/work-date-ms.sh +0 -5
- package/src/tools/docs-repo.ts +0 -51
- package/src/tools/flow.ts +0 -99
- package/src/tools/index.ts +0 -22
- package/src/tools/present.ts +0 -49
- package/src/tools/repo.ts +0 -490
- package/src/tools/rules.ts +0 -30
- package/src/tools/sdd.ts +0 -216
- package/src/tools/templates.ts +0 -27
- package/src/tools/youtrack.ts +0 -423
package/src/tools/docs-repo.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { tool } from "@opencode-ai/plugin";
|
|
2
|
-
import { fail, ok } from "../core";
|
|
3
|
-
import { linkDocsRepo, listSpecs, promoteSpec } from "../core/docs-repo";
|
|
4
|
-
|
|
5
|
-
const output = (value: unknown) => JSON.stringify(value, null, 2);
|
|
6
|
-
|
|
7
|
-
export function createDocsRepoTools() {
|
|
8
|
-
return {
|
|
9
|
-
workflow_docs_repo_link: tool({
|
|
10
|
-
description:
|
|
11
|
-
"Link the component docs repo in the toolkit config (validates git repo + features/)",
|
|
12
|
-
args: {
|
|
13
|
-
path: tool.schema.string(),
|
|
14
|
-
confirmed: tool.schema.boolean(),
|
|
15
|
-
},
|
|
16
|
-
execute: async ({ path: docsPath, confirmed }, _context) => {
|
|
17
|
-
const result = linkDocsRepo(docsPath, confirmed);
|
|
18
|
-
return output(result.ok ? ok({ path: result.path }) : fail(result.error));
|
|
19
|
-
},
|
|
20
|
-
}),
|
|
21
|
-
workflow_docs_list: tool({
|
|
22
|
-
description: "List local specs (docs/<slug>/spec.md) with docs-repo promotion status",
|
|
23
|
-
args: {},
|
|
24
|
-
execute: async (_input, context) => {
|
|
25
|
-
const result = listSpecs(context.directory);
|
|
26
|
-
return output(ok(result));
|
|
27
|
-
},
|
|
28
|
-
}),
|
|
29
|
-
workflow_docs_promote: tool({
|
|
30
|
-
description:
|
|
31
|
-
"Promote a spec (+plan) to the linked docs repo features/YYYY-MM-<slug>/ with quality gate",
|
|
32
|
-
args: {
|
|
33
|
-
slug: tool.schema.string(),
|
|
34
|
-
confirmed: tool.schema.boolean(),
|
|
35
|
-
force: tool.schema.boolean().optional(),
|
|
36
|
-
},
|
|
37
|
-
execute: async ({ slug, confirmed, force }, context) => {
|
|
38
|
-
const result = promoteSpec(context.directory, slug, { confirmed, force });
|
|
39
|
-
if (result.ok)
|
|
40
|
-
return output(
|
|
41
|
-
ok({
|
|
42
|
-
target_dir: result.target_dir,
|
|
43
|
-
files: result.files,
|
|
44
|
-
index_updated: result.index_updated,
|
|
45
|
-
}),
|
|
46
|
-
);
|
|
47
|
-
return output(fail(result.error, { findings: result.findings ?? [] } as never));
|
|
48
|
-
},
|
|
49
|
-
}),
|
|
50
|
-
};
|
|
51
|
-
}
|
package/src/tools/flow.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { tool } from "@opencode-ai/plugin";
|
|
2
|
-
import { fail, ok } from "../core";
|
|
3
|
-
import {
|
|
4
|
-
readFlowState,
|
|
5
|
-
transitionSpec,
|
|
6
|
-
transitionPlan,
|
|
7
|
-
recordMenuChoice,
|
|
8
|
-
slugFromPath,
|
|
9
|
-
} from "../core/flow-state";
|
|
10
|
-
import path from "node:path";
|
|
11
|
-
|
|
12
|
-
const output = (value: unknown) => JSON.stringify(value, null, 2);
|
|
13
|
-
|
|
14
|
-
const flowPathFor = (slug: string) => path.posix.join("docs", slug, "sdd", "flow.json");
|
|
15
|
-
|
|
16
|
-
export function createFlowTools() {
|
|
17
|
-
return {
|
|
18
|
-
workflow_flow_status: tool({
|
|
19
|
-
description: "Read the spec/plan approval flow state for a workflow",
|
|
20
|
-
args: {
|
|
21
|
-
plan_path: tool.schema.string().optional(),
|
|
22
|
-
spec_path: tool.schema.string().optional(),
|
|
23
|
-
},
|
|
24
|
-
execute: async ({ plan_path, spec_path }, context) => {
|
|
25
|
-
try {
|
|
26
|
-
const slug = slugFromPath(plan_path ?? spec_path ?? "");
|
|
27
|
-
if (!slug) return output(fail("plan_path or spec_path required"));
|
|
28
|
-
const state = readFlowState(context.directory, slug);
|
|
29
|
-
return output(
|
|
30
|
-
ok({
|
|
31
|
-
slug,
|
|
32
|
-
spec: state.spec,
|
|
33
|
-
plan: state.plan,
|
|
34
|
-
menu: state.menu,
|
|
35
|
-
flow_path: flowPathFor(slug),
|
|
36
|
-
}),
|
|
37
|
-
);
|
|
38
|
-
} catch (error) {
|
|
39
|
-
return output(fail(error instanceof Error ? error.message : "flow status failed"));
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
}),
|
|
43
|
-
workflow_spec_approve: tool({
|
|
44
|
-
description:
|
|
45
|
-
"Advance spec status: first call self_reviewed, second call approved (after user approval)",
|
|
46
|
-
args: {
|
|
47
|
-
confirmed: tool.schema.boolean(),
|
|
48
|
-
spec_path: tool.schema.string(),
|
|
49
|
-
},
|
|
50
|
-
execute: async ({ confirmed, spec_path }, context) => {
|
|
51
|
-
const slug = slugFromPath(spec_path);
|
|
52
|
-
const result = transitionSpec(context.directory, slug, spec_path, confirmed);
|
|
53
|
-
return output(
|
|
54
|
-
result.ok
|
|
55
|
-
? ok({ spec: spec_path, status: readFlowState(context.directory, slug).spec.status })
|
|
56
|
-
: fail(result.error),
|
|
57
|
-
);
|
|
58
|
-
},
|
|
59
|
-
}),
|
|
60
|
-
workflow_plan_approve: tool({
|
|
61
|
-
description:
|
|
62
|
-
"Advance plan status: first call self_reviewed, second call approved. Requires approved spec.",
|
|
63
|
-
args: {
|
|
64
|
-
confirmed: tool.schema.boolean(),
|
|
65
|
-
plan_path: tool.schema.string(),
|
|
66
|
-
},
|
|
67
|
-
execute: async ({ confirmed, plan_path }, context) => {
|
|
68
|
-
const slug = slugFromPath(plan_path);
|
|
69
|
-
const result = transitionPlan(context.directory, slug, plan_path, confirmed);
|
|
70
|
-
return output(
|
|
71
|
-
result.ok
|
|
72
|
-
? ok({ plan: plan_path, status: readFlowState(context.directory, slug).plan.status })
|
|
73
|
-
: fail(result.error),
|
|
74
|
-
);
|
|
75
|
-
},
|
|
76
|
-
}),
|
|
77
|
-
workflow_plan_menu: tool({
|
|
78
|
-
description: "Record the answered post-plan choice menu (called after native question)",
|
|
79
|
-
args: {
|
|
80
|
-
confirmed: tool.schema.boolean(),
|
|
81
|
-
plan_path: tool.schema.string(),
|
|
82
|
-
choice: tool.schema.enum([
|
|
83
|
-
"subagent-driven",
|
|
84
|
-
"inline",
|
|
85
|
-
"handoff",
|
|
86
|
-
"review-spec",
|
|
87
|
-
"review-plan",
|
|
88
|
-
]),
|
|
89
|
-
},
|
|
90
|
-
execute: async ({ confirmed, plan_path, choice }, context) => {
|
|
91
|
-
const slug = slugFromPath(plan_path);
|
|
92
|
-
const result = recordMenuChoice(context.directory, slug, plan_path, choice, confirmed);
|
|
93
|
-
return output(
|
|
94
|
-
result.ok ? ok({ menu: { presented: true, chosen: choice } }) : fail(result.error),
|
|
95
|
-
);
|
|
96
|
-
},
|
|
97
|
-
}),
|
|
98
|
-
};
|
|
99
|
-
}
|
package/src/tools/index.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createRepoTools } from "./repo";
|
|
2
|
-
import { WorkflowStateStore } from "../state";
|
|
3
|
-
import { createSddTools } from "./sdd";
|
|
4
|
-
import { createHandoffTools, type HandoffClient } from "./handoff";
|
|
5
|
-
import { createYouTrackTools } from "./youtrack";
|
|
6
|
-
import { createPresentTools } from "./present";
|
|
7
|
-
import { createFlowTools } from "./flow";
|
|
8
|
-
import { createDocsRepoTools } from "./docs-repo";
|
|
9
|
-
import { createTemplateTools } from "./templates";
|
|
10
|
-
import { createRuleTools } from "./rules";
|
|
11
|
-
|
|
12
|
-
export const createTools = (client: HandoffClient, state: WorkflowStateStore) => ({
|
|
13
|
-
...createRepoTools(),
|
|
14
|
-
...createSddTools(state),
|
|
15
|
-
...createHandoffTools(client, state),
|
|
16
|
-
...createYouTrackTools(),
|
|
17
|
-
...createPresentTools(),
|
|
18
|
-
...createFlowTools(),
|
|
19
|
-
...createDocsRepoTools(),
|
|
20
|
-
...createTemplateTools(),
|
|
21
|
-
...createRuleTools(),
|
|
22
|
-
});
|
package/src/tools/present.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { tool } from "@opencode-ai/plugin";
|
|
2
|
-
import { fail, ok } from "../core";
|
|
3
|
-
import { asciiWireframe, flowDiagram } from "../core/present";
|
|
4
|
-
|
|
5
|
-
const output = (value: unknown) => JSON.stringify(value, null, 2);
|
|
6
|
-
|
|
7
|
-
export function createPresentTools() {
|
|
8
|
-
return {
|
|
9
|
-
workflow_present_ascii: tool({
|
|
10
|
-
description: "Render deterministic ASCII UI wireframe from JSON spec",
|
|
11
|
-
args: {
|
|
12
|
-
title: tool.schema.string().optional(),
|
|
13
|
-
width: tool.schema.number().optional(),
|
|
14
|
-
rows: tool.schema.array(tool.schema.record(tool.schema.string(), tool.schema.any())),
|
|
15
|
-
},
|
|
16
|
-
execute: async (spec) => {
|
|
17
|
-
const result = asciiWireframe(spec);
|
|
18
|
-
if ("error" in result) return output(fail(result.error));
|
|
19
|
-
return output(ok(result.data));
|
|
20
|
-
},
|
|
21
|
-
}),
|
|
22
|
-
workflow_present_flow: tool({
|
|
23
|
-
description: "Render mermaid flowchart from JSON nodes/edges",
|
|
24
|
-
args: {
|
|
25
|
-
title: tool.schema.string().optional(),
|
|
26
|
-
direction: tool.schema.enum(["TD", "LR", "BT", "RL"]).optional(),
|
|
27
|
-
nodes: tool.schema.array(
|
|
28
|
-
tool.schema.object({
|
|
29
|
-
id: tool.schema.string(),
|
|
30
|
-
label: tool.schema.string(),
|
|
31
|
-
shape: tool.schema.string().optional(),
|
|
32
|
-
}),
|
|
33
|
-
),
|
|
34
|
-
edges: tool.schema.array(
|
|
35
|
-
tool.schema.object({
|
|
36
|
-
from: tool.schema.string(),
|
|
37
|
-
to: tool.schema.string(),
|
|
38
|
-
label: tool.schema.string().optional(),
|
|
39
|
-
}),
|
|
40
|
-
),
|
|
41
|
-
},
|
|
42
|
-
execute: async (spec) => {
|
|
43
|
-
const result = flowDiagram(spec);
|
|
44
|
-
if ("error" in result) return output(fail(result.error));
|
|
45
|
-
return output(ok(result.data));
|
|
46
|
-
},
|
|
47
|
-
}),
|
|
48
|
-
};
|
|
49
|
-
}
|