ralphflow-dsh 2.3.1 → 2.4.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.
Files changed (86) hide show
  1. package/README.md +47 -21
  2. package/graphs/codewiki/format.md +362 -0
  3. package/graphs/codewiki/graph.yaml +39 -0
  4. package/graphs/codewiki/nodes/assemble.md +24 -0
  5. package/graphs/codewiki/nodes/core-pages.md +17 -0
  6. package/graphs/codewiki/nodes/module-pages.md +18 -0
  7. package/graphs/codewiki/nodes/operations-pages.md +18 -0
  8. package/graphs/codewiki/nodes/survey.md +22 -0
  9. package/lib/asset-path.d.ts +59 -0
  10. package/lib/asset-path.js +181 -0
  11. package/lib/assets.d.ts +42 -0
  12. package/lib/assets.js +86 -0
  13. package/lib/client/phase.d.ts +29 -0
  14. package/lib/client/phase.js +86 -0
  15. package/lib/client/selection.d.ts +28 -0
  16. package/lib/client/selection.js +9 -0
  17. package/lib/client/status-source.d.ts +3 -1
  18. package/lib/client/status-source.js +3 -2
  19. package/lib/client/status.js +49 -13
  20. package/lib/client/viewer.d.ts +18 -0
  21. package/lib/client/viewer.js +540 -0
  22. package/lib/client.js +1159 -64
  23. package/lib/engine.d.ts +111 -47
  24. package/lib/engine.js +473 -320
  25. package/lib/facade.d.ts +175 -0
  26. package/lib/facade.js +553 -0
  27. package/lib/graph/agent-registry.d.ts +4 -0
  28. package/lib/graph/agent-registry.js +20 -0
  29. package/lib/graph/asset.d.ts +47 -0
  30. package/lib/graph/asset.js +276 -0
  31. package/lib/graph/assets.d.ts +47 -0
  32. package/lib/graph/assets.js +224 -0
  33. package/lib/graph/branches.d.ts +9 -0
  34. package/lib/graph/branches.js +13 -0
  35. package/lib/graph/check.d.ts +23 -0
  36. package/lib/graph/check.js +46 -0
  37. package/lib/graph/engine.d.ts +55 -0
  38. package/lib/graph/engine.js +2002 -0
  39. package/lib/graph/report.d.ts +9 -0
  40. package/lib/graph/report.js +117 -0
  41. package/lib/graph/state.d.ts +244 -0
  42. package/lib/graph/state.js +358 -0
  43. package/lib/graph/workspace.d.ts +68 -0
  44. package/lib/graph/workspace.js +262 -0
  45. package/lib/index.js +150 -47
  46. package/lib/owner.d.ts +34 -0
  47. package/lib/owner.js +49 -0
  48. package/lib/paths.d.ts +12 -0
  49. package/lib/paths.js +44 -0
  50. package/lib/pause.d.ts +12 -0
  51. package/lib/pause.js +19 -0
  52. package/lib/skills.d.ts +17 -30
  53. package/lib/skills.js +85 -21
  54. package/lib/status-contract.d.ts +114 -1
  55. package/lib/status-contract.js +106 -4
  56. package/lib/status-service.d.ts +5 -1
  57. package/lib/status-service.js +8 -1
  58. package/lib/tools.d.ts +14 -6
  59. package/lib/tools.js +88 -60
  60. package/lib/unfinished.d.ts +11 -0
  61. package/lib/unfinished.js +18 -0
  62. package/lib/verifier-preset.d.ts +40 -0
  63. package/lib/verifier-preset.js +126 -0
  64. package/lib/verify.d.ts +63 -9
  65. package/lib/verify.js +282 -72
  66. package/package.json +50 -38
  67. package/skills/ralphflow-create/SKILL.md +32 -0
  68. package/skills/ralphflow-create/graph-authoring.md +85 -0
  69. package/skills/ralphflow-create/matt/LICENSE +21 -0
  70. package/skills/ralphflow-create/matt/SHA256SUMS +6 -0
  71. package/skills/ralphflow-create/matt/SKILL-MECHANICS.md +22 -0
  72. package/skills/ralphflow-create/matt/SOURCE.md +12 -0
  73. package/skills/ralphflow-create/matt/grilling.md +30 -0
  74. package/skills/ralphflow-create/matt/to-spec.md +75 -0
  75. package/skills/ralphflow-create/matt/to-tickets.md +105 -0
  76. package/skills/ralphflow-create/matt/writing-for-agents.md +81 -0
  77. package/skills/ralphflow-create/ralphflow-authoring.md +31 -0
  78. package/skills/ralphflow-create/testing-workflow.md +60 -0
  79. package/{references → skills/ralphflow-create}/workflow-authoring.md +25 -5
  80. package/workflows/create-graph/steps/graph.md +17 -0
  81. package/workflows/create-graph/workflow.yaml +77 -0
  82. package/workflows/loop/workflow.yaml +23 -0
  83. package/lib/create.d.ts +0 -2
  84. package/lib/create.js +0 -17
  85. package/workflows/loop.yaml +0 -45
  86. /package/workflows/{spec.yaml → spec/workflow.yaml} +0 -0
@@ -0,0 +1,175 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ import type { Agent } from "@deepseek-ai/dsh-agent";
3
+ import { type EnginePorts, type HistoryInfo, type InstanceInfo, type InstanceState, type ToolResult, type WorkflowEntry } from "./engine.js";
4
+ import { type GraphWorkflowEntry } from "./graph/assets.js";
5
+ import { type GraphInstanceState, type GraphRunProjection } from "./graph/state.js";
6
+ import { type UnifiedAssetEntry } from "./assets.js";
7
+ import type { ViewerAsset, WorkflowStatus } from "./status-contract.js";
8
+ export interface FacadeOptions {
9
+ ctx: Context;
10
+ ports: EnginePorts;
11
+ }
12
+ export type AssetKind = "flow" | "graph";
13
+ export declare function createFacade(workspace: string, options: FacadeOptions): {
14
+ kind: "facade";
15
+ projectDir: string;
16
+ root: string;
17
+ instancesDir: string;
18
+ workflowsDir: string;
19
+ reportsDir: string;
20
+ graphsDir: string;
21
+ ensureLayout: () => void;
22
+ listWorkflows: () => WorkflowEntry[];
23
+ loadWorkflow: (name: string, ctx?: import("./engine.js").SubWorkflowLoadCtx) => {
24
+ def: import("./engine.js").WorkflowDef | null;
25
+ problems: string[];
26
+ warnings: string[];
27
+ };
28
+ readState: (instId: string) => InstanceState | null;
29
+ listInstances: () => InstanceInfo[];
30
+ listHistory: () => HistoryInfo[];
31
+ instanceDir: (instId: string) => string;
32
+ artifactsDirOf: (instId: string) => string;
33
+ artifactsRelDirOf: (instId: string) => string;
34
+ reportRelPathOf: (instId: string) => string;
35
+ destroyInstance: (instId: string, status: "done" | "cancelled", state?: InstanceState) => {
36
+ reportPath: string;
37
+ instanceDirRemoved: boolean;
38
+ instanceDir: string;
39
+ } | null;
40
+ start: (workflowName: string, task: string, sessionId: string) => Promise<ToolResult>;
41
+ onSubmit: (agent: Agent | undefined, summary?: string, unfinished?: string[]) => Promise<ToolResult>;
42
+ submitFromAny: (agent: Agent | undefined, summary?: string, unfinished?: string[]) => Promise<ToolResult>;
43
+ noteAssistantText: (sessionId: string, text: string) => void;
44
+ noteAction: (sessionId: string, time: number) => void;
45
+ remindToSubmit: (sessionId: string) => {
46
+ remind: boolean;
47
+ message?: string;
48
+ summary?: string;
49
+ };
50
+ continueInstance: (sessionId: string, instanceRef?: string) => Promise<ToolResult>;
51
+ resetCurrent: (sessionId: string) => ToolResult;
52
+ rewindTo: (sessionId: string, targetRef: string, reason?: string) => ToolResult;
53
+ cancelInstance: (sessionId: string, instanceRef?: string, reason?: string) => Promise<ToolResult>;
54
+ pauseForUserStop: (sessionId: string) => ToolResult;
55
+ cleanupInstance: (instanceRef?: string) => Promise<ToolResult>;
56
+ respond: (agent: Agent | undefined, text: string, todoId?: string) => string;
57
+ statusOf: (sessionId: string, instanceRef?: string) => ToolResult;
58
+ listAll: () => ToolResult;
59
+ restore: () => void;
60
+ diagnose: (target?: string) => ToolResult;
61
+ activeInstanceOfSession: (sessionId: string) => {
62
+ id: string;
63
+ kind: AssetKind;
64
+ } | undefined;
65
+ activeKindsOfSession: (sessionId: string) => {
66
+ flow?: string;
67
+ graph?: string;
68
+ };
69
+ kindOfInstance: (instanceRef: string) => AssetKind | undefined;
70
+ listAssets: () => UnifiedAssetEntry[];
71
+ viewerCatalog: () => ViewerAsset[];
72
+ uiStatus: (sessionId: string) => {
73
+ status: WorkflowStatus | null;
74
+ error: string | null;
75
+ };
76
+ uiReport: (ref: Parameters<(ref: import("./message-source.js").WorkflowUiRef) => WorkflowStatus | null>[0]) => WorkflowStatus | null;
77
+ graph: {
78
+ kind: "graph";
79
+ root: string;
80
+ graphsDir: string;
81
+ instancesDir: string;
82
+ reportsDir: string;
83
+ projectDir: string;
84
+ ensureLayout: () => void;
85
+ listWorkflows: () => GraphWorkflowEntry[];
86
+ loadWorkflow: (name: string) => import("./graph/assets.js").GraphLoadResult;
87
+ readState: (instId: string) => GraphInstanceState | null;
88
+ listStates: () => Array<{
89
+ id: string;
90
+ state: GraphInstanceState;
91
+ }>;
92
+ instanceDir: (instId: string) => string;
93
+ artifactsDirOf: (state: GraphInstanceState) => string;
94
+ start: (workflowName: string, task: string, sessionId: string) => Promise<ToolResult>;
95
+ submitFromAgent: (agent: Agent | undefined, summary?: string, unfinished?: string[]) => Promise<ToolResult | null>;
96
+ continueInstance: (sessionId: string, instanceRef?: string) => Promise<ToolResult>;
97
+ pauseForUserStop: (sessionId: string) => ToolResult;
98
+ cancelInstance: (sessionId: string, instanceRef?: string, reason?: string) => Promise<ToolResult>;
99
+ cleanupInstance: (instanceRef?: string) => Promise<ToolResult>;
100
+ statusOf: (sessionId: string, instanceRef?: string) => ToolResult;
101
+ listAll: () => ToolResult;
102
+ diagnose: () => ToolResult;
103
+ restore: () => void;
104
+ respond: (agent: Agent | undefined, text: string, todoId?: string) => string;
105
+ remindToSubmit: (sessionId: string) => {
106
+ remind: boolean;
107
+ message?: string;
108
+ summary?: string;
109
+ };
110
+ uiStatus: (sessionId: string) => {
111
+ projection: GraphRunProjection | null;
112
+ error: string | null;
113
+ };
114
+ activeInstanceOfSession: (sessionId: string) => {
115
+ id: string;
116
+ state: GraphInstanceState;
117
+ } | undefined;
118
+ syncSession: (sessionId: string) => void;
119
+ projectionOf: (state: GraphInstanceState, id: string) => GraphRunProjection;
120
+ };
121
+ flow: {
122
+ root: string;
123
+ instancesDir: string;
124
+ workflowsDir: string;
125
+ reportsDir: string;
126
+ projectDir: string;
127
+ ensureLayout: () => void;
128
+ listWorkflows: () => WorkflowEntry[];
129
+ loadWorkflow: (name: string, ctx?: import("./engine.js").SubWorkflowLoadCtx) => {
130
+ def: import("./engine.js").WorkflowDef | null;
131
+ problems: string[];
132
+ warnings: string[];
133
+ };
134
+ readState: (instId: string) => InstanceState | null;
135
+ listInstances: () => InstanceInfo[];
136
+ listHistory: () => HistoryInfo[];
137
+ instanceDir: (instId: string) => string;
138
+ artifactsDirOf: (instId: string) => string;
139
+ artifactsRelDirOf: (instId: string) => string;
140
+ reportRelPathOf: (instId: string) => string;
141
+ destroyInstance: (instId: string, status: "done" | "cancelled", state?: InstanceState) => {
142
+ reportPath: string;
143
+ instanceDirRemoved: boolean;
144
+ instanceDir: string;
145
+ } | null;
146
+ start: (workflowName: string, task: string, sessionId: string) => ToolResult;
147
+ onSubmit: (sessionId: string, summary?: string, unfinished?: string[]) => ToolResult;
148
+ noteAssistantText: (sessionId: string, text: string) => void;
149
+ remindToSubmit: (sessionId: string) => {
150
+ remind: boolean;
151
+ message?: string;
152
+ summary?: string;
153
+ };
154
+ pauseForUserStop: (sessionId: string) => ToolResult;
155
+ continueInstance: (sessionId: string, instanceRef?: string) => ToolResult;
156
+ resetCurrent: (sessionId: string) => ToolResult;
157
+ rewindTo: (sessionId: string, targetRef: string, reason?: string) => ToolResult;
158
+ cancelInstance: (sessionId: string, instanceRef?: string, reason?: string) => ToolResult;
159
+ statusOf: (sessionId: string, instanceRef?: string) => ToolResult;
160
+ listAll: () => ToolResult;
161
+ restore: () => void;
162
+ diagnose: () => ToolResult;
163
+ activeInstanceOfSession: (sessionId: string) => InstanceInfo | undefined;
164
+ uiStatus: (sessionId: string) => {
165
+ status: WorkflowStatus | null;
166
+ error: string | null;
167
+ };
168
+ uiReport: (ref: import("./message-source.js").WorkflowUiRef) => WorkflowStatus | null;
169
+ };
170
+ findGraphState: (instanceRef: string) => {
171
+ id: string;
172
+ state: GraphInstanceState;
173
+ } | undefined;
174
+ };
175
+ export type Facade = ReturnType<typeof createFacade>;