@exaudeus/workrail 3.8.2 → 3.9.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 (30) hide show
  1. package/dist/di/container.js +8 -0
  2. package/dist/di/tokens.d.ts +1 -0
  3. package/dist/di/tokens.js +1 -0
  4. package/dist/engine/engine-factory.js +2 -0
  5. package/dist/manifest.json +72 -40
  6. package/dist/mcp/handlers/shared/remembered-roots.d.ts +4 -0
  7. package/dist/mcp/handlers/shared/remembered-roots.js +54 -0
  8. package/dist/mcp/handlers/shared/request-workflow-reader.d.ts +4 -1
  9. package/dist/mcp/handlers/shared/request-workflow-reader.js +71 -2
  10. package/dist/mcp/handlers/shared/workflow-source-visibility.d.ts +33 -0
  11. package/dist/mcp/handlers/shared/workflow-source-visibility.js +109 -0
  12. package/dist/mcp/handlers/v2-execution/index.js +4 -0
  13. package/dist/mcp/handlers/v2-execution/start.js +2 -1
  14. package/dist/mcp/handlers/v2-resume.js +4 -0
  15. package/dist/mcp/handlers/v2-workflow.js +94 -53
  16. package/dist/mcp/output-schemas.d.ts +372 -0
  17. package/dist/mcp/output-schemas.js +19 -0
  18. package/dist/mcp/server.js +2 -0
  19. package/dist/mcp/tool-descriptions.js +9 -4
  20. package/dist/mcp/types.d.ts +2 -0
  21. package/dist/mcp/v2/tools.d.ts +6 -6
  22. package/dist/mcp/v2/tools.js +2 -2
  23. package/dist/v2/infra/local/data-dir/index.d.ts +2 -0
  24. package/dist/v2/infra/local/data-dir/index.js +6 -0
  25. package/dist/v2/infra/local/remembered-roots-store/index.d.ts +14 -0
  26. package/dist/v2/infra/local/remembered-roots-store/index.js +172 -0
  27. package/dist/v2/ports/data-dir.port.d.ts +2 -0
  28. package/dist/v2/ports/remembered-roots-store.port.d.ts +27 -0
  29. package/dist/v2/ports/remembered-roots-store.port.js +2 -0
  30. package/package.json +1 -1
@@ -7,6 +7,7 @@ const v2_token_ops_js_1 = require("./v2-token-ops.js");
7
7
  const index_js_1 = require("../../v2/durable-core/ids/index.js");
8
8
  const resume_session_js_1 = require("../../v2/usecases/resume-session.js");
9
9
  const v2_workspace_resolution_js_1 = require("./v2-workspace-resolution.js");
10
+ const remembered_roots_js_1 = require("./shared/remembered-roots.js");
10
11
  function anchorValue(anchors, key) {
11
12
  const anchor = anchors.find((a) => a.key === key);
12
13
  return anchor?.value;
@@ -19,6 +20,9 @@ async function handleV2ResumeSession(input, ctx) {
19
20
  if (!v2.sessionSummaryProvider) {
20
21
  return (0, types_js_1.errNotRetryable)('INTERNAL_ERROR', 'resume_session requires sessionSummaryProvider port');
21
22
  }
23
+ const rememberedRootFailure = await (0, remembered_roots_js_1.rememberExplicitWorkspaceRoot)(input.workspacePath, v2.rememberedRootsStore);
24
+ if (rememberedRootFailure)
25
+ return rememberedRootFailure;
22
26
  const anchorsResult = await (0, v2_workspace_resolution_js_1.resolveWorkspaceAnchors)(v2, input.workspacePath);
23
27
  const anchors = anchorsResult.isOk() ? anchorsResult.value : [];
24
28
  const query = {
@@ -12,71 +12,42 @@ const hashing_js_1 = require("../../v2/durable-core/canonical/hashing.js");
12
12
  const TIMEOUT_MS = 30000;
13
13
  const with_timeout_js_1 = require("./shared/with-timeout.js");
14
14
  const request_workflow_reader_js_1 = require("./shared/request-workflow-reader.js");
15
+ const remembered_roots_js_1 = require("./shared/remembered-roots.js");
16
+ const workflow_source_visibility_js_1 = require("./shared/workflow-source-visibility.js");
17
+ function isToolErrorResult(value) {
18
+ return !Array.isArray(value);
19
+ }
15
20
  async function handleV2ListWorkflows(input, ctx) {
16
21
  const guard = (0, types_js_1.requireV2Context)(ctx);
17
22
  if (!guard.ok)
18
23
  return guard.error;
24
+ const rememberedRootFailure = await (0, remembered_roots_js_1.rememberExplicitWorkspaceRoot)(input.workspacePath, guard.ctx.v2.rememberedRootsStore);
25
+ if (rememberedRootFailure)
26
+ return rememberedRootFailure;
27
+ const rememberedRootRecordsResult = await (0, remembered_roots_js_1.listRememberedRootRecords)(guard.ctx.v2.rememberedRootsStore);
28
+ if (isToolErrorResult(rememberedRootRecordsResult))
29
+ return rememberedRootRecordsResult;
30
+ const rememberedRootRecords = rememberedRootRecordsResult;
19
31
  const { crypto, pinnedStore } = guard.ctx.v2;
20
32
  const workflowReader = (0, request_workflow_reader_js_1.hasRequestWorkspaceSignal)({
21
33
  workspacePath: input.workspacePath,
22
34
  resolvedRootUris: guard.ctx.v2.resolvedRootUris,
23
35
  })
24
- ? (0, request_workflow_reader_js_1.createWorkflowReaderForRequest)({
36
+ ? await (0, request_workflow_reader_js_1.createWorkflowReaderForRequest)({
25
37
  featureFlags: ctx.featureFlags,
26
38
  workspacePath: input.workspacePath,
27
39
  resolvedRootUris: guard.ctx.v2.resolvedRootUris,
40
+ rememberedRootsStore: guard.ctx.v2.rememberedRootsStore,
28
41
  })
29
42
  : ctx.workflowService;
30
43
  return neverthrow_1.ResultAsync.fromPromise((0, with_timeout_js_1.withTimeout)(workflowReader.listWorkflowSummaries(), TIMEOUT_MS, 'list_workflows'), (err) => (0, error_mapper_js_1.mapUnknownErrorToToolError)(err))
31
- .andThen((summaries) => neverthrow_1.ResultAsync.combine(summaries.map((s) => neverthrow_1.ResultAsync.fromPromise(workflowReader.getWorkflowById(s.id), (err) => (0, error_mapper_js_1.mapUnknownErrorToToolError)(err)).andThen((wf) => {
32
- if (!wf) {
33
- return (0, neverthrow_1.okAsync)({
34
- workflowId: s.id,
35
- name: s.name,
36
- description: s.description,
37
- version: s.version,
38
- workflowHash: null,
39
- kind: 'workflow',
40
- });
41
- }
42
- const snapshot = (0, v1_to_v2_shim_js_1.compileV1WorkflowToV2PreviewSnapshot)(wf);
43
- const hashRes = (0, hashing_js_1.workflowHashForCompiledSnapshot)(snapshot, crypto);
44
- if (hashRes.isErr()) {
45
- return (0, neverthrow_1.okAsync)({
46
- workflowId: s.id,
47
- name: s.name,
48
- description: s.description,
49
- version: s.version,
50
- workflowHash: null,
51
- kind: 'workflow',
52
- });
53
- }
54
- const hash = hashRes.value;
55
- return pinnedStore
56
- .get(hash)
57
- .andThen((existing) => {
58
- if (!existing) {
59
- return pinnedStore.put(hash, snapshot).map(() => undefined);
60
- }
61
- return (0, neverthrow_1.okAsync)(undefined);
62
- })
63
- .map(() => ({
64
- workflowId: s.id,
65
- name: s.name,
66
- description: s.description,
67
- version: s.version,
68
- workflowHash: hash,
69
- kind: 'workflow',
70
- }))
71
- .orElse(() => (0, neverthrow_1.okAsync)({
72
- workflowId: s.id,
73
- name: s.name,
74
- description: s.description,
75
- version: s.version,
76
- workflowHash: hash,
77
- kind: 'workflow',
78
- }));
79
- }))))
44
+ .andThen((summaries) => neverthrow_1.ResultAsync.combine(summaries.map((s) => neverthrow_1.ResultAsync.fromPromise(buildV2WorkflowListItem({
45
+ summary: s,
46
+ workflowReader,
47
+ rememberedRootRecords,
48
+ crypto,
49
+ pinnedStore,
50
+ }), (err) => (0, error_mapper_js_1.mapUnknownErrorToToolError)(err)))))
80
51
  .map((compiled) => {
81
52
  const payload = output_schemas_js_1.V2WorkflowListOutputSchema.parse({
82
53
  workflows: compiled.sort((a, b) => a.workflowId.localeCompare(b.workflowId)),
@@ -89,15 +60,23 @@ async function handleV2InspectWorkflow(input, ctx) {
89
60
  const guard = (0, types_js_1.requireV2Context)(ctx);
90
61
  if (!guard.ok)
91
62
  return guard.error;
63
+ const rememberedRootFailure = await (0, remembered_roots_js_1.rememberExplicitWorkspaceRoot)(input.workspacePath, guard.ctx.v2.rememberedRootsStore);
64
+ if (rememberedRootFailure)
65
+ return rememberedRootFailure;
66
+ const rememberedRootRecordsResult = await (0, remembered_roots_js_1.listRememberedRootRecords)(guard.ctx.v2.rememberedRootsStore);
67
+ if (isToolErrorResult(rememberedRootRecordsResult))
68
+ return rememberedRootRecordsResult;
69
+ const rememberedRootRecords = rememberedRootRecordsResult;
92
70
  const { crypto, pinnedStore } = guard.ctx.v2;
93
71
  const workflowReader = (0, request_workflow_reader_js_1.hasRequestWorkspaceSignal)({
94
72
  workspacePath: input.workspacePath,
95
73
  resolvedRootUris: guard.ctx.v2.resolvedRootUris,
96
74
  })
97
- ? (0, request_workflow_reader_js_1.createWorkflowReaderForRequest)({
75
+ ? await (0, request_workflow_reader_js_1.createWorkflowReaderForRequest)({
98
76
  featureFlags: ctx.featureFlags,
99
77
  workspacePath: input.workspacePath,
100
78
  resolvedRootUris: guard.ctx.v2.resolvedRootUris,
79
+ rememberedRootsStore: guard.ctx.v2.rememberedRootsStore,
101
80
  })
102
81
  : ctx.workflowService;
103
82
  return neverthrow_1.ResultAsync.fromPromise((0, with_timeout_js_1.withTimeout)(workflowReader.getWorkflowById(input.workflowId), TIMEOUT_MS, 'inspect_workflow'), (err) => (0, error_mapper_js_1.mapUnknownErrorToToolError)(err))
@@ -111,7 +90,7 @@ async function handleV2InspectWorkflow(input, ctx) {
111
90
  return (0, neverthrow_1.errAsync)((0, types_js_1.errNotRetryable)('INTERNAL_ERROR', 'WorkRail could not compute a content hash for the workflow definition. This is not caused by your input.', { suggestion: (0, v2_execution_helpers_js_1.internalSuggestion)('Retry inspect_workflow.', 'WorkRail has an internal error computing workflow hashes.') }));
112
91
  }
113
92
  const workflowHash = hashRes.value;
114
- return pinnedStore
93
+ return neverthrow_1.ResultAsync.fromPromise(buildWorkflowVisibility(workflow, workflowReader, rememberedRootRecords), (err) => (0, error_mapper_js_1.mapUnknownErrorToToolError)(err)).andThen((visibility) => pinnedStore
115
94
  .get(workflowHash)
116
95
  .andThen((existing) => {
117
96
  if (!existing) {
@@ -133,10 +112,72 @@ async function handleV2InspectWorkflow(input, ctx) {
133
112
  workflowHash,
134
113
  mode: input.mode,
135
114
  compiled: body,
115
+ ...(visibility ? { visibility } : {}),
136
116
  ...(references != null && references.length > 0 ? { references } : {}),
137
117
  });
138
118
  return (0, neverthrow_1.okAsync)((0, types_js_1.success)(payload));
139
- });
119
+ }));
140
120
  })
141
121
  .match((result) => Promise.resolve(result), (err) => Promise.resolve(err));
142
122
  }
123
+ async function buildWorkflowVisibility(workflow, workflowReader, rememberedRootRecords) {
124
+ const migration = await (0, workflow_source_visibility_js_1.detectWorkflowMigrationGuidance)({
125
+ workflow,
126
+ workflowReader: workflowReader,
127
+ rememberedRoots: rememberedRootRecords,
128
+ });
129
+ return (0, workflow_source_visibility_js_1.toWorkflowVisibility)(workflow, rememberedRootRecords, { migration });
130
+ }
131
+ async function buildV2WorkflowListItem(options) {
132
+ const { summary, workflowReader, rememberedRootRecords, crypto, pinnedStore } = options;
133
+ const workflow = await workflowReader.getWorkflowById(summary.id);
134
+ if (!workflow) {
135
+ return {
136
+ workflowId: summary.id,
137
+ name: summary.name,
138
+ description: summary.description,
139
+ version: summary.version,
140
+ workflowHash: null,
141
+ kind: 'workflow',
142
+ };
143
+ }
144
+ const visibility = await buildWorkflowVisibility(workflow, workflowReader, rememberedRootRecords);
145
+ const snapshot = (0, v1_to_v2_shim_js_1.compileV1WorkflowToV2PreviewSnapshot)(workflow);
146
+ const hashRes = (0, hashing_js_1.workflowHashForCompiledSnapshot)(snapshot, crypto);
147
+ if (hashRes.isErr()) {
148
+ return {
149
+ workflowId: summary.id,
150
+ name: summary.name,
151
+ description: summary.description,
152
+ version: summary.version,
153
+ workflowHash: null,
154
+ kind: 'workflow',
155
+ visibility,
156
+ };
157
+ }
158
+ const hash = hashRes.value;
159
+ const existing = await pinnedStore.get(hash);
160
+ if (existing.isOk() && !existing.value) {
161
+ const persisted = await pinnedStore.put(hash, snapshot);
162
+ if (persisted.isErr()) {
163
+ return {
164
+ workflowId: summary.id,
165
+ name: summary.name,
166
+ description: summary.description,
167
+ version: summary.version,
168
+ workflowHash: hash,
169
+ kind: 'workflow',
170
+ visibility,
171
+ };
172
+ }
173
+ }
174
+ return {
175
+ workflowId: summary.id,
176
+ name: summary.name,
177
+ description: summary.description,
178
+ version: summary.version,
179
+ workflowHash: hash,
180
+ kind: 'workflow',
181
+ visibility,
182
+ };
183
+ }
@@ -159,6 +159,82 @@ export declare const V2WorkflowListItemSchema: z.ZodObject<{
159
159
  version: z.ZodString;
160
160
  kind: z.ZodLiteral<"workflow">;
161
161
  workflowHash: z.ZodNullable<z.ZodString>;
162
+ visibility: z.ZodOptional<z.ZodObject<{
163
+ category: z.ZodEnum<["built_in", "personal", "legacy_project", "rooted_sharing", "external"]>;
164
+ source: z.ZodObject<{
165
+ kind: z.ZodEnum<["bundled", "user", "project", "custom", "git", "remote", "plugin"]>;
166
+ displayName: z.ZodString;
167
+ }, "strip", z.ZodTypeAny, {
168
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
169
+ displayName: string;
170
+ }, {
171
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
172
+ displayName: string;
173
+ }>;
174
+ rootedSharing: z.ZodOptional<z.ZodObject<{
175
+ kind: z.ZodLiteral<"remembered_root">;
176
+ rootPath: z.ZodString;
177
+ groupLabel: z.ZodString;
178
+ }, "strip", z.ZodTypeAny, {
179
+ kind: "remembered_root";
180
+ rootPath: string;
181
+ groupLabel: string;
182
+ }, {
183
+ kind: "remembered_root";
184
+ rootPath: string;
185
+ groupLabel: string;
186
+ }>>;
187
+ migration: z.ZodOptional<z.ZodObject<{
188
+ preferredSource: z.ZodLiteral<"rooted_sharing">;
189
+ currentSource: z.ZodLiteral<"legacy_project">;
190
+ reason: z.ZodLiteral<"legacy_project_precedence">;
191
+ summary: z.ZodString;
192
+ }, "strip", z.ZodTypeAny, {
193
+ reason: "legacy_project_precedence";
194
+ summary: string;
195
+ preferredSource: "rooted_sharing";
196
+ currentSource: "legacy_project";
197
+ }, {
198
+ reason: "legacy_project_precedence";
199
+ summary: string;
200
+ preferredSource: "rooted_sharing";
201
+ currentSource: "legacy_project";
202
+ }>>;
203
+ }, "strip", z.ZodTypeAny, {
204
+ source: {
205
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
206
+ displayName: string;
207
+ };
208
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
209
+ rootedSharing?: {
210
+ kind: "remembered_root";
211
+ rootPath: string;
212
+ groupLabel: string;
213
+ } | undefined;
214
+ migration?: {
215
+ reason: "legacy_project_precedence";
216
+ summary: string;
217
+ preferredSource: "rooted_sharing";
218
+ currentSource: "legacy_project";
219
+ } | undefined;
220
+ }, {
221
+ source: {
222
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
223
+ displayName: string;
224
+ };
225
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
226
+ rootedSharing?: {
227
+ kind: "remembered_root";
228
+ rootPath: string;
229
+ groupLabel: string;
230
+ } | undefined;
231
+ migration?: {
232
+ reason: "legacy_project_precedence";
233
+ summary: string;
234
+ preferredSource: "rooted_sharing";
235
+ currentSource: "legacy_project";
236
+ } | undefined;
237
+ }>>;
162
238
  }, "strip", z.ZodTypeAny, {
163
239
  kind: "workflow";
164
240
  name: string;
@@ -166,6 +242,24 @@ export declare const V2WorkflowListItemSchema: z.ZodObject<{
166
242
  version: string;
167
243
  workflowId: string;
168
244
  workflowHash: string | null;
245
+ visibility?: {
246
+ source: {
247
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
248
+ displayName: string;
249
+ };
250
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
251
+ rootedSharing?: {
252
+ kind: "remembered_root";
253
+ rootPath: string;
254
+ groupLabel: string;
255
+ } | undefined;
256
+ migration?: {
257
+ reason: "legacy_project_precedence";
258
+ summary: string;
259
+ preferredSource: "rooted_sharing";
260
+ currentSource: "legacy_project";
261
+ } | undefined;
262
+ } | undefined;
169
263
  }, {
170
264
  kind: "workflow";
171
265
  name: string;
@@ -173,6 +267,24 @@ export declare const V2WorkflowListItemSchema: z.ZodObject<{
173
267
  version: string;
174
268
  workflowId: string;
175
269
  workflowHash: string | null;
270
+ visibility?: {
271
+ source: {
272
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
273
+ displayName: string;
274
+ };
275
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
276
+ rootedSharing?: {
277
+ kind: "remembered_root";
278
+ rootPath: string;
279
+ groupLabel: string;
280
+ } | undefined;
281
+ migration?: {
282
+ reason: "legacy_project_precedence";
283
+ summary: string;
284
+ preferredSource: "rooted_sharing";
285
+ currentSource: "legacy_project";
286
+ } | undefined;
287
+ } | undefined;
176
288
  }>;
177
289
  export declare const V2WorkflowListOutputSchema: z.ZodObject<{
178
290
  workflows: z.ZodArray<z.ZodObject<{
@@ -182,6 +294,82 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
182
294
  version: z.ZodString;
183
295
  kind: z.ZodLiteral<"workflow">;
184
296
  workflowHash: z.ZodNullable<z.ZodString>;
297
+ visibility: z.ZodOptional<z.ZodObject<{
298
+ category: z.ZodEnum<["built_in", "personal", "legacy_project", "rooted_sharing", "external"]>;
299
+ source: z.ZodObject<{
300
+ kind: z.ZodEnum<["bundled", "user", "project", "custom", "git", "remote", "plugin"]>;
301
+ displayName: z.ZodString;
302
+ }, "strip", z.ZodTypeAny, {
303
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
304
+ displayName: string;
305
+ }, {
306
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
307
+ displayName: string;
308
+ }>;
309
+ rootedSharing: z.ZodOptional<z.ZodObject<{
310
+ kind: z.ZodLiteral<"remembered_root">;
311
+ rootPath: z.ZodString;
312
+ groupLabel: z.ZodString;
313
+ }, "strip", z.ZodTypeAny, {
314
+ kind: "remembered_root";
315
+ rootPath: string;
316
+ groupLabel: string;
317
+ }, {
318
+ kind: "remembered_root";
319
+ rootPath: string;
320
+ groupLabel: string;
321
+ }>>;
322
+ migration: z.ZodOptional<z.ZodObject<{
323
+ preferredSource: z.ZodLiteral<"rooted_sharing">;
324
+ currentSource: z.ZodLiteral<"legacy_project">;
325
+ reason: z.ZodLiteral<"legacy_project_precedence">;
326
+ summary: z.ZodString;
327
+ }, "strip", z.ZodTypeAny, {
328
+ reason: "legacy_project_precedence";
329
+ summary: string;
330
+ preferredSource: "rooted_sharing";
331
+ currentSource: "legacy_project";
332
+ }, {
333
+ reason: "legacy_project_precedence";
334
+ summary: string;
335
+ preferredSource: "rooted_sharing";
336
+ currentSource: "legacy_project";
337
+ }>>;
338
+ }, "strip", z.ZodTypeAny, {
339
+ source: {
340
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
341
+ displayName: string;
342
+ };
343
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
344
+ rootedSharing?: {
345
+ kind: "remembered_root";
346
+ rootPath: string;
347
+ groupLabel: string;
348
+ } | undefined;
349
+ migration?: {
350
+ reason: "legacy_project_precedence";
351
+ summary: string;
352
+ preferredSource: "rooted_sharing";
353
+ currentSource: "legacy_project";
354
+ } | undefined;
355
+ }, {
356
+ source: {
357
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
358
+ displayName: string;
359
+ };
360
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
361
+ rootedSharing?: {
362
+ kind: "remembered_root";
363
+ rootPath: string;
364
+ groupLabel: string;
365
+ } | undefined;
366
+ migration?: {
367
+ reason: "legacy_project_precedence";
368
+ summary: string;
369
+ preferredSource: "rooted_sharing";
370
+ currentSource: "legacy_project";
371
+ } | undefined;
372
+ }>>;
185
373
  }, "strip", z.ZodTypeAny, {
186
374
  kind: "workflow";
187
375
  name: string;
@@ -189,6 +377,24 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
189
377
  version: string;
190
378
  workflowId: string;
191
379
  workflowHash: string | null;
380
+ visibility?: {
381
+ source: {
382
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
383
+ displayName: string;
384
+ };
385
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
386
+ rootedSharing?: {
387
+ kind: "remembered_root";
388
+ rootPath: string;
389
+ groupLabel: string;
390
+ } | undefined;
391
+ migration?: {
392
+ reason: "legacy_project_precedence";
393
+ summary: string;
394
+ preferredSource: "rooted_sharing";
395
+ currentSource: "legacy_project";
396
+ } | undefined;
397
+ } | undefined;
192
398
  }, {
193
399
  kind: "workflow";
194
400
  name: string;
@@ -196,6 +402,24 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
196
402
  version: string;
197
403
  workflowId: string;
198
404
  workflowHash: string | null;
405
+ visibility?: {
406
+ source: {
407
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
408
+ displayName: string;
409
+ };
410
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
411
+ rootedSharing?: {
412
+ kind: "remembered_root";
413
+ rootPath: string;
414
+ groupLabel: string;
415
+ } | undefined;
416
+ migration?: {
417
+ reason: "legacy_project_precedence";
418
+ summary: string;
419
+ preferredSource: "rooted_sharing";
420
+ currentSource: "legacy_project";
421
+ } | undefined;
422
+ } | undefined;
199
423
  }>, "many">;
200
424
  }, "strip", z.ZodTypeAny, {
201
425
  workflows: {
@@ -205,6 +429,24 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
205
429
  version: string;
206
430
  workflowId: string;
207
431
  workflowHash: string | null;
432
+ visibility?: {
433
+ source: {
434
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
435
+ displayName: string;
436
+ };
437
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
438
+ rootedSharing?: {
439
+ kind: "remembered_root";
440
+ rootPath: string;
441
+ groupLabel: string;
442
+ } | undefined;
443
+ migration?: {
444
+ reason: "legacy_project_precedence";
445
+ summary: string;
446
+ preferredSource: "rooted_sharing";
447
+ currentSource: "legacy_project";
448
+ } | undefined;
449
+ } | undefined;
208
450
  }[];
209
451
  }, {
210
452
  workflows: {
@@ -214,6 +456,24 @@ export declare const V2WorkflowListOutputSchema: z.ZodObject<{
214
456
  version: string;
215
457
  workflowId: string;
216
458
  workflowHash: string | null;
459
+ visibility?: {
460
+ source: {
461
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
462
+ displayName: string;
463
+ };
464
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
465
+ rootedSharing?: {
466
+ kind: "remembered_root";
467
+ rootPath: string;
468
+ groupLabel: string;
469
+ } | undefined;
470
+ migration?: {
471
+ reason: "legacy_project_precedence";
472
+ summary: string;
473
+ preferredSource: "rooted_sharing";
474
+ currentSource: "legacy_project";
475
+ } | undefined;
476
+ } | undefined;
217
477
  }[];
218
478
  }>;
219
479
  export declare const V2WorkflowInspectOutputSchema: z.ZodObject<{
@@ -221,6 +481,82 @@ export declare const V2WorkflowInspectOutputSchema: z.ZodObject<{
221
481
  workflowHash: z.ZodString;
222
482
  mode: z.ZodEnum<["metadata", "preview"]>;
223
483
  compiled: z.ZodType<JsonValue, z.ZodTypeDef, JsonValue>;
484
+ visibility: z.ZodOptional<z.ZodOptional<z.ZodObject<{
485
+ category: z.ZodEnum<["built_in", "personal", "legacy_project", "rooted_sharing", "external"]>;
486
+ source: z.ZodObject<{
487
+ kind: z.ZodEnum<["bundled", "user", "project", "custom", "git", "remote", "plugin"]>;
488
+ displayName: z.ZodString;
489
+ }, "strip", z.ZodTypeAny, {
490
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
491
+ displayName: string;
492
+ }, {
493
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
494
+ displayName: string;
495
+ }>;
496
+ rootedSharing: z.ZodOptional<z.ZodObject<{
497
+ kind: z.ZodLiteral<"remembered_root">;
498
+ rootPath: z.ZodString;
499
+ groupLabel: z.ZodString;
500
+ }, "strip", z.ZodTypeAny, {
501
+ kind: "remembered_root";
502
+ rootPath: string;
503
+ groupLabel: string;
504
+ }, {
505
+ kind: "remembered_root";
506
+ rootPath: string;
507
+ groupLabel: string;
508
+ }>>;
509
+ migration: z.ZodOptional<z.ZodObject<{
510
+ preferredSource: z.ZodLiteral<"rooted_sharing">;
511
+ currentSource: z.ZodLiteral<"legacy_project">;
512
+ reason: z.ZodLiteral<"legacy_project_precedence">;
513
+ summary: z.ZodString;
514
+ }, "strip", z.ZodTypeAny, {
515
+ reason: "legacy_project_precedence";
516
+ summary: string;
517
+ preferredSource: "rooted_sharing";
518
+ currentSource: "legacy_project";
519
+ }, {
520
+ reason: "legacy_project_precedence";
521
+ summary: string;
522
+ preferredSource: "rooted_sharing";
523
+ currentSource: "legacy_project";
524
+ }>>;
525
+ }, "strip", z.ZodTypeAny, {
526
+ source: {
527
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
528
+ displayName: string;
529
+ };
530
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
531
+ rootedSharing?: {
532
+ kind: "remembered_root";
533
+ rootPath: string;
534
+ groupLabel: string;
535
+ } | undefined;
536
+ migration?: {
537
+ reason: "legacy_project_precedence";
538
+ summary: string;
539
+ preferredSource: "rooted_sharing";
540
+ currentSource: "legacy_project";
541
+ } | undefined;
542
+ }, {
543
+ source: {
544
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
545
+ displayName: string;
546
+ };
547
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
548
+ rootedSharing?: {
549
+ kind: "remembered_root";
550
+ rootPath: string;
551
+ groupLabel: string;
552
+ } | undefined;
553
+ migration?: {
554
+ reason: "legacy_project_precedence";
555
+ summary: string;
556
+ preferredSource: "rooted_sharing";
557
+ currentSource: "legacy_project";
558
+ } | undefined;
559
+ }>>>;
224
560
  references: z.ZodOptional<z.ZodArray<z.ZodObject<{
225
561
  id: z.ZodString;
226
562
  title: z.ZodString;
@@ -256,6 +592,24 @@ export declare const V2WorkflowInspectOutputSchema: z.ZodObject<{
256
592
  authoritative: boolean;
257
593
  resolveFrom?: "workspace" | "package" | undefined;
258
594
  }[] | undefined;
595
+ visibility?: {
596
+ source: {
597
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
598
+ displayName: string;
599
+ };
600
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
601
+ rootedSharing?: {
602
+ kind: "remembered_root";
603
+ rootPath: string;
604
+ groupLabel: string;
605
+ } | undefined;
606
+ migration?: {
607
+ reason: "legacy_project_precedence";
608
+ summary: string;
609
+ preferredSource: "rooted_sharing";
610
+ currentSource: "legacy_project";
611
+ } | undefined;
612
+ } | undefined;
259
613
  }, {
260
614
  workflowId: string;
261
615
  workflowHash: string;
@@ -269,6 +623,24 @@ export declare const V2WorkflowInspectOutputSchema: z.ZodObject<{
269
623
  authoritative: boolean;
270
624
  resolveFrom?: "workspace" | "package" | undefined;
271
625
  }[] | undefined;
626
+ visibility?: {
627
+ source: {
628
+ kind: "custom" | "bundled" | "user" | "project" | "git" | "remote" | "plugin";
629
+ displayName: string;
630
+ };
631
+ category: "built_in" | "personal" | "legacy_project" | "rooted_sharing" | "external";
632
+ rootedSharing?: {
633
+ kind: "remembered_root";
634
+ rootPath: string;
635
+ groupLabel: string;
636
+ } | undefined;
637
+ migration?: {
638
+ reason: "legacy_project_precedence";
639
+ summary: string;
640
+ preferredSource: "rooted_sharing";
641
+ currentSource: "legacy_project";
642
+ } | undefined;
643
+ } | undefined;
272
644
  }>;
273
645
  export declare const V2PendingStepSchema: z.ZodObject<{
274
646
  stepId: z.ZodString;