@abhinav2203/codeflow-canvas 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/abhinav2203-codeflow-canvas-0.1.0.tgz +0 -0
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +84 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/components/blueprint-workbench.d.ts +2 -0
- package/dist/components/blueprint-workbench.d.ts.map +1 -0
- package/dist/components/blueprint-workbench.js +144 -0
- package/dist/components/blueprint-workbench.js.map +1 -0
- package/dist/components/code-diff-editor.d.ts +12 -0
- package/dist/components/code-diff-editor.d.ts.map +1 -0
- package/dist/components/code-diff-editor.js +39 -0
- package/dist/components/code-diff-editor.js.map +1 -0
- package/dist/components/code-editor.d.ts +25 -0
- package/dist/components/code-editor.d.ts.map +1 -0
- package/dist/components/code-editor.js +264 -0
- package/dist/components/code-editor.js.map +1 -0
- package/dist/components/file-tabs.d.ts +5 -0
- package/dist/components/file-tabs.d.ts.map +1 -0
- package/dist/components/file-tabs.js +164 -0
- package/dist/components/file-tabs.js.map +1 -0
- package/dist/components/file-tree.d.ts +7 -0
- package/dist/components/file-tree.d.ts.map +1 -0
- package/dist/components/file-tree.js +176 -0
- package/dist/components/file-tree.js.map +1 -0
- package/dist/components/graph-canvas.d.ts +25 -0
- package/dist/components/graph-canvas.d.ts.map +1 -0
- package/dist/components/graph-canvas.js +224 -0
- package/dist/components/graph-canvas.js.map +1 -0
- package/dist/components/ide-layout.d.ts +10 -0
- package/dist/components/ide-layout.d.ts.map +1 -0
- package/dist/components/ide-layout.js +40 -0
- package/dist/components/ide-layout.js.map +1 -0
- package/dist/components/ide-workbench.d.ts +4 -0
- package/dist/components/ide-workbench.d.ts.map +1 -0
- package/dist/components/ide-workbench.js +6 -0
- package/dist/components/ide-workbench.js.map +1 -0
- package/dist/components/index.d.ts +13 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +13 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/monaco-setup.d.ts +4 -0
- package/dist/components/monaco-setup.d.ts.map +1 -0
- package/dist/components/monaco-setup.js +34 -0
- package/dist/components/monaco-setup.js.map +1 -0
- package/dist/components/opencode-settings.d.ts +8 -0
- package/dist/components/opencode-settings.d.ts.map +1 -0
- package/dist/components/opencode-settings.js +33 -0
- package/dist/components/opencode-settings.js.map +1 -0
- package/dist/components/policy-workbench.d.ts +2 -0
- package/dist/components/policy-workbench.d.ts.map +1 -0
- package/dist/components/policy-workbench.js +102 -0
- package/dist/components/policy-workbench.js.map +1 -0
- package/dist/components/ts-language-service.d.ts +14 -0
- package/dist/components/ts-language-service.d.ts.map +1 -0
- package/dist/components/ts-language-service.js +123 -0
- package/dist/components/ts-language-service.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/browser/storage.d.ts +16 -0
- package/dist/lib/browser/storage.d.ts.map +1 -0
- package/dist/lib/browser/storage.js +18 -0
- package/dist/lib/browser/storage.js.map +1 -0
- package/dist/lib/edit.d.ts +14 -0
- package/dist/lib/edit.d.ts.map +1 -0
- package/dist/lib/edit.js +57 -0
- package/dist/lib/edit.js.map +1 -0
- package/dist/lib/flow-view.d.ts +80 -0
- package/dist/lib/flow-view.d.ts.map +1 -0
- package/dist/lib/flow-view.js +850 -0
- package/dist/lib/flow-view.js.map +1 -0
- package/dist/lib/heatmap.d.ts +28 -0
- package/dist/lib/heatmap.d.ts.map +1 -0
- package/dist/lib/heatmap.js +61 -0
- package/dist/lib/heatmap.js.map +1 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +6 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/node-navigation.d.ts +36 -0
- package/dist/lib/node-navigation.d.ts.map +1 -0
- package/dist/lib/node-navigation.js +52 -0
- package/dist/lib/node-navigation.js.map +1 -0
- package/dist/lib/traces.d.ts +3 -0
- package/dist/lib/traces.d.ts.map +1 -0
- package/dist/lib/traces.js +64 -0
- package/dist/lib/traces.js.map +1 -0
- package/dist/lib/types.d.ts +57 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +7 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/store/blueprint-store.d.ts +35 -0
- package/dist/store/blueprint-store.d.ts.map +1 -0
- package/dist/store/blueprint-store.js +79 -0
- package/dist/store/blueprint-store.js.map +1 -0
- package/dist/store/index.d.ts +3 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +2 -0
- package/dist/store/index.js.map +1 -0
- package/package.json +52 -0
- package/scripts/wrap-cli.mjs +15 -0
- package/src/bin/cli.ts +128 -0
- package/src/components/blueprint-workbench.tsx +305 -0
- package/src/components/code-diff-editor.tsx +80 -0
- package/src/components/code-editor.tsx +389 -0
- package/src/components/file-tabs.tsx +288 -0
- package/src/components/file-tree.tsx +301 -0
- package/src/components/graph-canvas.tsx +404 -0
- package/src/components/ide-layout.tsx +104 -0
- package/src/components/ide-workbench.tsx +5 -0
- package/src/components/index.ts +12 -0
- package/src/components/monaco-setup.ts +67 -0
- package/src/components/opencode-settings.tsx +82 -0
- package/src/components/policy-workbench.tsx +233 -0
- package/src/components/ts-language-service.ts +170 -0
- package/src/index.ts +54 -0
- package/src/lib/browser/storage.ts +19 -0
- package/src/lib/edit.ts +74 -0
- package/src/lib/flow-view.ts +1176 -0
- package/src/lib/heatmap.ts +103 -0
- package/src/lib/index.ts +41 -0
- package/src/lib/node-navigation.ts +76 -0
- package/src/lib/traces.ts +79 -0
- package/src/lib/types.ts +79 -0
- package/src/store/blueprint-store.ts +136 -0
- package/src/store/index.ts +2 -0
- package/test-fixtures/minimal-blueprint.json +34 -0
- package/test-fixtures/sample-blueprint.json +184 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.json +22 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vitest.config.ts +9 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Store exports
|
|
2
|
+
export { useBlueprintStore } from "./store/blueprint-store.js";
|
|
3
|
+
export type { BlueprintStore, FloatingGraphPanel, WorkbenchMode } from "./store/blueprint-store.js";
|
|
4
|
+
|
|
5
|
+
// Component exports
|
|
6
|
+
export { IdeLayout } from "./components/ide-layout.js";
|
|
7
|
+
export { FileTree } from "./components/file-tree.js";
|
|
8
|
+
export { FileTabs } from "./components/file-tabs.js";
|
|
9
|
+
export { GraphCanvas } from "./components/graph-canvas.js";
|
|
10
|
+
export { CodeEditor } from "./components/code-editor.js";
|
|
11
|
+
export { CodeDiffEditor } from "./components/code-diff-editor.js";
|
|
12
|
+
export { BlueprintWorkbench } from "./components/blueprint-workbench.js";
|
|
13
|
+
export { PolicyWorkbench } from "./components/policy-workbench.js";
|
|
14
|
+
export { IdeWorkbench } from "./components/ide-workbench.js";
|
|
15
|
+
export { OpencodeSettings } from "./components/opencode-settings.js";
|
|
16
|
+
export { prepareMonaco, toMonacoPath } from "./components/monaco-setup.js";
|
|
17
|
+
export { TypeScriptLanguageService, getTypeScriptLanguageService } from "./components/ts-language-service.js";
|
|
18
|
+
|
|
19
|
+
// Library exports
|
|
20
|
+
export { computeHeatmap, heatColor, heatGlow } from "./lib/heatmap.js";
|
|
21
|
+
export type { HeatmapData, HeatmapNodeMetric } from "./lib/heatmap.js";
|
|
22
|
+
|
|
23
|
+
export { applyTraceOverlay } from "./lib/traces.js";
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
getNavigationTarget,
|
|
27
|
+
getNodesWithNavigation,
|
|
28
|
+
formatNavigationTarget,
|
|
29
|
+
hasNavigationMetadata,
|
|
30
|
+
isValidNavigationTarget
|
|
31
|
+
} from "./lib/node-navigation.js";
|
|
32
|
+
export type { NavigationTarget } from "./lib/node-navigation.js";
|
|
33
|
+
|
|
34
|
+
export { addNodeToGraph, addEdgeToGraph, deleteNodeFromGraph } from "./lib/edit.js";
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
buildFlowNodes,
|
|
38
|
+
buildFlowEdges,
|
|
39
|
+
buildGhostFlowNodes,
|
|
40
|
+
buildDetailFlow,
|
|
41
|
+
indexRuntimeExecutionResult,
|
|
42
|
+
buildExecutionProjection
|
|
43
|
+
} from "./lib/flow-view.js";
|
|
44
|
+
export type {
|
|
45
|
+
NodeHealthState,
|
|
46
|
+
FlowExecutionStatus,
|
|
47
|
+
FlowExecutionState,
|
|
48
|
+
FlowExecutionIndex,
|
|
49
|
+
FlowExecutionProjection,
|
|
50
|
+
FlowNodeData,
|
|
51
|
+
InspectorSection,
|
|
52
|
+
DetailFlowItem,
|
|
53
|
+
DetailFlowGraph
|
|
54
|
+
} from "./lib/flow-view.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type stubs for storage utilities.
|
|
3
|
+
* These are browser-specific and should be provided by the consumer.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Storage key constants
|
|
7
|
+
export const AUTO_IMPLEMENT_STORAGE_KEY = "codeflow:auto-implement";
|
|
8
|
+
export const LIVE_COMPLETIONS_STORAGE_KEY = "codeflow:live-completions";
|
|
9
|
+
export const THEME_STORAGE_KEY = "codeflow:theme";
|
|
10
|
+
|
|
11
|
+
// Placeholder implementations - consumer should override
|
|
12
|
+
export const loadSessionApiKey = (): string => "";
|
|
13
|
+
export const storeSessionApiKey = (_key: string): void => {};
|
|
14
|
+
export const readLocalBooleanPreference = (_key: string, _defaultValue: boolean): boolean => _defaultValue;
|
|
15
|
+
export const readLocalPreference = (_key: string, _defaultValue: string): string => _defaultValue;
|
|
16
|
+
export const writeLocalBooleanPreference = (_key: string, _value: boolean): void => {};
|
|
17
|
+
export const writeLocalPreference = (_key: string, _value: string): void => {};
|
|
18
|
+
export const readRepoPath = (): string => "";
|
|
19
|
+
export const writeRepoPath = (_path: string): void => {};
|
package/src/lib/edit.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
BlueprintEdge,
|
|
3
|
+
BlueprintGraph,
|
|
4
|
+
BlueprintNode,
|
|
5
|
+
BlueprintNodeKind
|
|
6
|
+
} from "@abhinav2203/codeflow-core/schema";
|
|
7
|
+
import { emptyContract } from "@abhinav2203/codeflow-core/schema";
|
|
8
|
+
|
|
9
|
+
// Utility functions inlined from @abhinav2203/codeflow-core
|
|
10
|
+
const createNodeId = (kind: BlueprintNodeKind, name: string): string => {
|
|
11
|
+
const slug = name.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
|
|
12
|
+
return `${kind}:${slug}`;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const dedupeEdges = (edges: BlueprintEdge[]): BlueprintEdge[] => {
|
|
16
|
+
const seen = new Set<string>();
|
|
17
|
+
return edges.filter((edge) => {
|
|
18
|
+
const key = `${edge.from}:${edge.to}:${edge.kind}`;
|
|
19
|
+
if (seen.has(key)) return false;
|
|
20
|
+
seen.add(key);
|
|
21
|
+
return true;
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// Draft management - inlined from phases
|
|
26
|
+
const withSpecDrafts = (graph: BlueprintGraph): BlueprintGraph => graph;
|
|
27
|
+
|
|
28
|
+
export const addNodeToGraph = (
|
|
29
|
+
graph: BlueprintGraph,
|
|
30
|
+
input: { kind: BlueprintNodeKind; name: string; summary?: string }
|
|
31
|
+
): BlueprintGraph => {
|
|
32
|
+
const node: BlueprintNode = {
|
|
33
|
+
id: createNodeId(input.kind, input.name),
|
|
34
|
+
kind: input.kind,
|
|
35
|
+
name: input.name,
|
|
36
|
+
summary: input.summary ?? `${input.kind} ${input.name}`,
|
|
37
|
+
contract: {
|
|
38
|
+
...emptyContract(),
|
|
39
|
+
summary: input.summary ?? `${input.kind} ${input.name}`
|
|
40
|
+
},
|
|
41
|
+
sourceRefs: [{ kind: "generated", detail: "Added in workbench" }],
|
|
42
|
+
generatedRefs: [],
|
|
43
|
+
traceRefs: []
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
return withSpecDrafts({
|
|
47
|
+
...graph,
|
|
48
|
+
nodes: [...graph.nodes.filter((existing) => existing.id !== node.id), node]
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const addEdgeToGraph = (
|
|
53
|
+
graph: BlueprintGraph,
|
|
54
|
+
input: { from: string; to: string; kind: BlueprintEdge["kind"]; label?: string }
|
|
55
|
+
): BlueprintGraph => ({
|
|
56
|
+
...graph,
|
|
57
|
+
edges: dedupeEdges([
|
|
58
|
+
...graph.edges,
|
|
59
|
+
{
|
|
60
|
+
from: input.from,
|
|
61
|
+
to: input.to,
|
|
62
|
+
kind: input.kind,
|
|
63
|
+
label: input.label,
|
|
64
|
+
required: true,
|
|
65
|
+
confidence: 1
|
|
66
|
+
}
|
|
67
|
+
])
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const deleteNodeFromGraph = (graph: BlueprintGraph, nodeId: string): BlueprintGraph => ({
|
|
71
|
+
...graph,
|
|
72
|
+
nodes: graph.nodes.filter((node) => node.id !== nodeId),
|
|
73
|
+
edges: graph.edges.filter((edge) => edge.from !== nodeId && edge.to !== nodeId)
|
|
74
|
+
});
|