create-windy 0.8.2 → 0.8.3

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/dist/cli.js +18 -1
  2. package/package.json +1 -1
  3. package/template/.windy-template.json +2 -2
  4. package/template/apps/server/src/agent/admin-catalog-bootstrap.ts +25 -0
  5. package/template/apps/server/src/agent/agent-session-bootstrap.ts +7 -8
  6. package/template/apps/server/src/agent/agent-session-facade.ts +12 -0
  7. package/template/apps/server/src/agent/agent-session-validation.ts +43 -0
  8. package/template/apps/server/src/agent/operation-catalog.test.ts +202 -0
  9. package/template/apps/server/src/agent/operation-catalog.ts +135 -0
  10. package/template/apps/server/src/agent/run-browser-visibility.test.ts +59 -0
  11. package/template/apps/server/src/agent/run-browser-visibility.ts +11 -0
  12. package/template/apps/server/src/agent/run-operation-policy.ts +1 -0
  13. package/template/apps/server/src/agent/run-route-response.ts +35 -0
  14. package/template/apps/server/src/agent/run-routes.ts +46 -43
  15. package/template/apps/server/src/agent/runtime-bootstrap.ts +21 -20
  16. package/template/apps/server/src/agent/runtime-disabled-composition.ts +28 -0
  17. package/template/apps/server/src/agent/session-projection-facade.ts +8 -9
  18. package/template/apps/server/src/agent/session-projection-governance.ts +10 -0
  19. package/template/apps/server/src/agent/session-projection-view.ts +19 -16
  20. package/template/apps/server/src/agent/session-recording-reader.contract.test.ts +131 -0
  21. package/template/apps/server/src/agent/session-recording-reader.ts +62 -0
  22. package/template/apps/server/src/agent/tool-catalog-audit.ts +22 -0
  23. package/template/apps/server/src/agent/tool-catalog-availability.ts +21 -0
  24. package/template/apps/server/src/agent/tool-catalog-routes.test.ts +103 -0
  25. package/template/apps/server/src/agent/tool-catalog-routes.ts +62 -0
  26. package/template/apps/server/src/agent/tool-catalog.test.ts +122 -0
  27. package/template/apps/server/src/agent/tool-catalog.ts +44 -0
  28. package/template/apps/server/src/agent/tool-registry.ts +45 -14
  29. package/template/apps/server/src/agent/workbench-bootstrap.ts +39 -0
  30. package/template/apps/server/src/agent/workbench-event-projection.ts +115 -0
  31. package/template/apps/server/src/agent/workbench-facade.contract.test.ts +189 -0
  32. package/template/apps/server/src/agent/workbench-facade.ts +339 -0
  33. package/template/apps/server/src/agent/workbench-recording.contract.test.ts +328 -0
  34. package/template/apps/server/src/agent/workbench-routes.ts +97 -0
  35. package/template/apps/server/src/agent/workbench-run-integration.test.ts +231 -0
  36. package/template/apps/server/src/agent/workbench-run-reader.ts +187 -0
  37. package/template/apps/server/src/agent/workbench-safe-result.ts +61 -0
  38. package/template/apps/server/src/agent/workbench-sse.ts +50 -0
  39. package/template/apps/server/src/agent-workflow/query-service.ts +36 -0
  40. package/template/apps/server/src/agent-workflow/recording-projection.contract.test.ts +196 -0
  41. package/template/apps/server/src/agent-workflow/recording-projection.ts +86 -0
  42. package/template/apps/web/src/pages/system/AgentDebugPage.vue +14 -0
  43. package/template/apps/web/src/pages/system/AgentSessionPage.vue +29 -8
  44. package/template/apps/web/src/pages/system/AgentToolsPage.vue +76 -0
  45. package/template/apps/web/src/pages/system/components/agent-workbench/AgentWorkbench.vue +236 -0
  46. package/template/apps/web/src/pages/system/components/agent-workbench/DraftLeaveDialog.vue +34 -0
  47. package/template/apps/web/src/pages/system/components/agent-workbench/ReplayEventDetail.vue +175 -0
  48. package/template/apps/web/src/pages/system/components/agent-workbench/SessionReplayTimeline.vue +142 -0
  49. package/template/apps/web/src/pages/system/components/agent-workbench/SessionReplayTimeline.webtest.ts +242 -0
  50. package/template/apps/web/src/pages/system/components/agent-workbench/TestRunComposer.vue +97 -0
  51. package/template/apps/web/src/pages/system/components/agent-workbench/ToolCatalogPanel.vue +100 -0
  52. package/template/apps/web/src/pages/system/components/agent-workbench/ToolCatalogPanel.webtest.ts +55 -0
  53. package/template/apps/web/src/pages/system/components/agent-workbench/ToolRuleDetail.vue +81 -0
  54. package/template/apps/web/src/pages/system/components/agent-workbench/WorkbenchSessionList.vue +57 -0
  55. package/template/apps/web/src/pages/system/components/agent-workbench/catalog-presenter.ts +20 -0
  56. package/template/apps/web/src/pages/system/components/agent-workbench/replay-presenter.ts +94 -0
  57. package/template/apps/web/src/pages/system/composables/useAgentWorkbench.ts +298 -0
  58. package/template/apps/web/src/pages/system/composables/useAgentWorkbench.webtest.ts +164 -0
  59. package/template/apps/web/src/pages/system/composables/useSessionReplay.ts +48 -0
  60. package/template/apps/web/src/router/index.ts +4 -0
  61. package/template/apps/web/src/router/platform-admin-route-bindings.ts +4 -0
  62. package/template/apps/web/src/services/agent-admin-api.ts +155 -0
  63. package/template/apps/web/src/services/agent-admin-api.webtest.ts +120 -0
  64. package/template/apps/web/src/services/agent-workbench-event.ts +60 -0
  65. package/template/docs/architecture/agent-harness.md +4 -0
  66. package/template/packages/modules/src/ai-operation-composition.ts +9 -0
  67. package/template/packages/modules/src/ai-operation-visibility.test.ts +33 -0
  68. package/template/packages/modules/src/manifest.ts +2 -0
  69. package/template/packages/modules/src/system-admin-routes.ts +16 -0
  70. package/template/packages/modules/src/system-admin-ui-catalog.ts +7 -1
  71. package/template/packages/modules/src/system-agent-admin-bindings.ts +42 -0
  72. package/template/packages/modules/src/system-agent-admin-menus.ts +26 -0
  73. package/template/packages/modules/src/system-agent-admin-registration.test.ts +52 -0
  74. package/template/packages/modules/src/system-agent-audit-actions.ts +5 -0
  75. package/template/packages/modules/src/system-ai-api-bindings.ts +2 -0
  76. package/template/packages/modules/src/system-audit-actions.ts +25 -0
  77. package/template/packages/modules/src/system-features.ts +19 -0
  78. package/template/packages/modules/src/system-module-catalog.ts +14 -12
  79. package/template/packages/modules/src/system-module-ownership.ts +12 -0
  80. package/template/packages/modules/src/system-modules.ts +2 -0
  81. package/template/packages/modules/src/system-permissions.ts +5 -0
  82. package/template/packages/server-sdk/index.ts +2 -0
  83. package/template/packages/server-sdk/src/agent-session-provider.ts +19 -0
  84. package/template/packages/shared/index.ts +2 -0
  85. package/template/packages/shared/src/agent-admin-catalog.ts +73 -0
  86. package/template/packages/shared/src/agent-workbench.ts +100 -0
@@ -33,7 +33,13 @@ const definitions = [
33
33
  // @windy-module system.agent begin
34
34
  [
35
35
  "system.agent",
36
- ["system.agent-session", "system.ai-runtime", "system.agent-workflow"],
36
+ [
37
+ "system.agent-tools",
38
+ "system.agent-debug",
39
+ "system.agent-session",
40
+ "system.ai-runtime",
41
+ "system.agent-workflow",
42
+ ],
37
43
  ],
38
44
  // @windy-module system.agent end
39
45
  // @windy-module system.operations begin
@@ -0,0 +1,42 @@
1
+ import type { ApiPermissionBinding } from "@southwind-ai/shared";
2
+ import { binding } from "./system-api-binding.js";
3
+
4
+ export function systemAgentAdminBindings(): ApiPermissionBinding[] {
5
+ return [
6
+ binding(
7
+ "GET",
8
+ "/api/agent/admin/tools",
9
+ "system.agent-tools.read",
10
+ "system.agent-tools",
11
+ "system.agent-tools.read",
12
+ ),
13
+ binding(
14
+ "GET",
15
+ "/api/agent/admin/operations",
16
+ "system.agent-debug.read",
17
+ "system.agent-debug",
18
+ "system.agent-debug.read",
19
+ ),
20
+ binding(
21
+ "GET",
22
+ "/api/agent/admin/session-recordings",
23
+ "system.agent-debug.read",
24
+ "system.agent-debug",
25
+ "agent.debug.recording.read",
26
+ ),
27
+ binding(
28
+ "GET",
29
+ "/api/agent/admin/session-recordings/:sessionId",
30
+ "system.agent-debug.read",
31
+ "system.agent-debug",
32
+ "agent.debug.recording.replay",
33
+ ),
34
+ binding(
35
+ "POST",
36
+ "/api/agent/admin/test-sessions",
37
+ "system.agent-debug.manage",
38
+ "system.agent-debug",
39
+ "agent.debug.session.create",
40
+ ),
41
+ ];
42
+ }
@@ -0,0 +1,26 @@
1
+ import type { ModuleManifest } from "./manifest.js";
2
+
3
+ export const systemAgentAdminMenus: ModuleManifest["menus"] = [
4
+ {
5
+ key: "system.agent-tools",
6
+ title: "Agent 工具目录",
7
+ type: "menu",
8
+ order: 12,
9
+ visible: true,
10
+ path: "/admin/system/agent-tools",
11
+ icon: "wrench",
12
+ permissionKey: "system.agent-tools.read",
13
+ featureKey: "system.agent-tools",
14
+ },
15
+ {
16
+ key: "system.agent-debug",
17
+ title: "Agent 调试工作台",
18
+ type: "menu",
19
+ order: 13,
20
+ visible: true,
21
+ path: "/admin/system/agent-debug",
22
+ icon: "flask-conical",
23
+ permissionKey: "system.agent-debug.read",
24
+ featureKey: "system.agent-debug",
25
+ },
26
+ ];
@@ -0,0 +1,52 @@
1
+ import { expect, test } from "bun:test";
2
+ import { systemFoundationModule } from "./system-modules.js";
3
+ import { systemModuleManifests } from "./system-module-catalog.js";
4
+
5
+ // @windy-module system.agent begin
6
+ test("Agent 工作台能力在菜单、路由、API、审计和模块分片一致注册", () => {
7
+ const manifest = systemFoundationModule();
8
+ const menus = manifest.menus.flatMap((menu) => menu.children ?? []);
9
+ for (const key of ["system.agent-tools", "system.agent-debug"]) {
10
+ expect(manifest.features.some((feature) => feature.key === key)).toBe(true);
11
+ expect(
12
+ manifest.permissions.some(
13
+ ({ key: permission }) => permission === `${key}.read`,
14
+ ),
15
+ ).toBe(true);
16
+ expect(menus.find((menu) => menu.key === key)).toMatchObject({
17
+ featureKey: key,
18
+ permissionKey: `${key}.read`,
19
+ });
20
+ expect(
21
+ manifest.adminRoutes.find((route) => route.key === key),
22
+ ).toMatchObject({ featureKey: key, permissionKey: `${key}.read` });
23
+ }
24
+ const bindings = manifest.apiPermissions.filter(({ path }) =>
25
+ path.startsWith("/api/agent/admin/"),
26
+ );
27
+ expect(bindings).toHaveLength(5);
28
+ const actions = manifest.auditActions.map((action) =>
29
+ typeof action === "string" ? action : action.key,
30
+ );
31
+ expect(
32
+ bindings.every(
33
+ ({ auditAction }) => auditAction && actions.includes(auditAction),
34
+ ),
35
+ ).toBe(true);
36
+ expect(bindings.find(({ method }) => method === "POST")).toMatchObject({
37
+ permissionKey: "system.agent-debug.manage",
38
+ featureKey: "system.agent-debug",
39
+ });
40
+ const agent = systemModuleManifests().find(
41
+ ({ name }) => name === "system.agent",
42
+ )!;
43
+ expect(
44
+ agent.apiPermissions.filter(({ path }) =>
45
+ path.startsWith("/api/agent/admin/"),
46
+ ),
47
+ ).toHaveLength(5);
48
+ expect(agent.features.map(({ key }) => key)).toEqual(
49
+ expect.arrayContaining(["system.agent-tools", "system.agent-debug"]),
50
+ );
51
+ });
52
+ // @windy-module system.agent end
@@ -1,4 +1,9 @@
1
1
  export const agentAuditActionKeys: ReadonlySet<string> = new Set([
2
+ "system.agent-tools.read",
3
+ "system.agent-debug.read",
4
+ "agent.debug.recording.read",
5
+ "agent.debug.recording.replay",
6
+ "agent.debug.session.create",
2
7
  "agent.session.read",
3
8
  "agent.session.create",
4
9
  "agent.session.checkpoint",
@@ -2,6 +2,7 @@ import type { ApiPermissionBinding } from "@southwind-ai/shared";
2
2
  import { binding } from "./system-api-binding.js";
3
3
 
4
4
  // @windy-module system.agent begin
5
+ import { systemAgentAdminBindings } from "./system-agent-admin-bindings.js";
5
6
  export function systemAiControlPlaneBindings(): ApiPermissionBinding[] {
6
7
  const reports = (
7
8
  [
@@ -67,6 +68,7 @@ export function systemAiControlPlaneBindings(): ApiPermissionBinding[] {
67
68
  ),
68
69
  );
69
70
  return [
71
+ ...systemAgentAdminBindings(),
70
72
  ...reports,
71
73
  ...read,
72
74
  ...execute,
@@ -83,6 +83,31 @@ export const systemAuditActions: ModuleManifest["auditActions"] = [
83
83
  "file.download",
84
84
  // @windy-module system.storage end
85
85
  // @windy-module system.agent begin
86
+ {
87
+ key: "system.agent-tools.read",
88
+ label: "查看 Agent 工具目录",
89
+ description: "按当前授权访问 Agent 工作台受控投影。",
90
+ },
91
+ {
92
+ key: "system.agent-debug.read",
93
+ label: "查看 Agent 调试 Operation",
94
+ description: "按当前授权访问 Agent 工作台受控投影。",
95
+ },
96
+ {
97
+ key: "agent.debug.recording.read",
98
+ label: "查询 Agent 回放会话",
99
+ description: "按当前授权访问 Agent 工作台受控投影。",
100
+ },
101
+ {
102
+ key: "agent.debug.recording.replay",
103
+ label: "回放 Agent 会话记录",
104
+ description: "按当前授权访问 Agent 工作台受控投影。",
105
+ },
106
+ {
107
+ key: "agent.debug.session.create",
108
+ label: "创建 Agent 测试会话",
109
+ description: "按当前授权访问 Agent 工作台受控投影。",
110
+ },
86
111
  "agent.mcp.access",
87
112
  "agent.tool.execute",
88
113
  "agent.operation.execute",
@@ -129,6 +129,25 @@ export const systemFeatures: ModuleManifest["features"] = [
129
129
  dependencies: [shared.featureKey("system.agent")],
130
130
  allowedLicenseVersions: [shared.licenseVersionKey("advanced")],
131
131
  },
132
+ {
133
+ ...feature(
134
+ "system.agent-tools",
135
+ "Agent 工具目录",
136
+ "查看已安装模块工具的契约、治理规则和当前调用条件。",
137
+ ),
138
+ dependencies: [shared.featureKey("system.agent")],
139
+ },
140
+ {
141
+ ...feature(
142
+ "system.agent-debug",
143
+ "Agent 调试工作台",
144
+ "创建受治理的测试会话,回放授权业务会话并定位实际调用流程。",
145
+ ),
146
+ dependencies: [
147
+ shared.featureKey("system.agent"),
148
+ shared.featureKey("system.agent-session"),
149
+ ],
150
+ },
132
151
  // @windy-module system.agent end
133
152
  // @windy-module system.operations begin
134
153
  feature(
@@ -1,4 +1,8 @@
1
1
  import type { ModuleFactory, ModuleManifest } from "./manifest.js";
2
+ import {
3
+ auditActionKey,
4
+ permissionResource,
5
+ } from "./system-module-ownership.js";
2
6
  import { selectSystemMenus } from "./system-module-menu-selection.js";
3
7
  import { systemFoundationModule } from "./system-modules.js";
4
8
  import { selectSystemJsonSchemas } from "./system-module-schema-catalog.js";
@@ -138,9 +142,18 @@ export const systemModuleDefinitions = [
138
142
  "system.scheduler",
139
143
  "system.workflow",
140
144
  ],
141
- resources: ["agent", "agent-session", "agent-workflow", "ai-runtime"],
145
+ resources: [
146
+ "agent",
147
+ "agent-tools",
148
+ "agent-debug",
149
+ "agent-session",
150
+ "agent-workflow",
151
+ "ai-runtime",
152
+ ],
142
153
  featureKeys: [
143
154
  "system.agent",
155
+ "system.agent-tools",
156
+ "system.agent-debug",
144
157
  "system.agent-session",
145
158
  "system.agent-workflow",
146
159
  "system.ai-runtime",
@@ -334,14 +347,3 @@ function createSystemCapabilityModule(
334
347
  },
335
348
  };
336
349
  }
337
-
338
- function auditActionKey(
339
- action: ModuleManifest["auditActions"][number],
340
- ): string {
341
- return typeof action === "string" ? action : action.key;
342
- }
343
-
344
- function permissionResource(permissionKey: string): string {
345
- const parts = permissionKey.split(".");
346
- return parts.length >= 3 ? parts.slice(1, -1).join(".") : "";
347
- }
@@ -0,0 +1,12 @@
1
+ import type { ModuleManifest } from "./manifest.js";
2
+
3
+ export function auditActionKey(
4
+ action: ModuleManifest["auditActions"][number],
5
+ ): string {
6
+ return typeof action === "string" ? action : action.key;
7
+ }
8
+
9
+ export function permissionResource(permissionKey: string): string {
10
+ const parts = permissionKey.split(".");
11
+ return parts.length >= 3 ? parts.slice(1, -1).join(".") : "";
12
+ }
@@ -4,6 +4,7 @@ import {
4
4
  systemAgentToolSchemas,
5
5
  systemAgentTools,
6
6
  } from "./system-agent-tools.js";
7
+ import { systemAgentAdminMenus } from "./system-agent-admin-menus.js";
7
8
  import { systemAgentSupervisorSchemas } from "./system-agent-supervisor.js";
8
9
  // @windy-module system.agent end
9
10
  import { systemAdminRoutes } from "./system-admin-routes.js";
@@ -241,6 +242,7 @@ export function systemFoundationModule(): ModuleManifest {
241
242
  },
242
243
  // @windy-module system.operations end
243
244
  // @windy-module system.agent begin
245
+ ...systemAgentAdminMenus,
244
246
  {
245
247
  key: "system.agent-session",
246
248
  title: "Agent 会话",
@@ -22,6 +22,8 @@ const systemResourceLabels = {
22
22
  // @windy-module system.agent begin
23
23
  agent: "智能代理",
24
24
  "agent-session": "Agent 长期会话",
25
+ "agent-tools": "Agent 工具目录",
26
+ "agent-debug": "Agent 调试工作台",
25
27
  "agent-workflow": "Agent Workflow",
26
28
  "ai-runtime": "AI Runtime 报表",
27
29
  // @windy-module system.agent end
@@ -129,6 +131,9 @@ export const systemPermissions: ModuleManifest["permissions"] = [
129
131
  // @windy-module system.audit end
130
132
  // @windy-module system.agent begin
131
133
  permission("agent", "read"),
134
+ permission("agent-tools", "read"),
135
+ permission("agent-debug", "read"),
136
+ permission("agent-debug", "manage"),
132
137
  permission("agent-session", "read"),
133
138
  permission("agent-session", "manage"),
134
139
  permission("agent-workflow", "read", "sensitive-disclosure"),
@@ -78,6 +78,8 @@ export type {
78
78
  ModuleAgentSessionGetInputV1,
79
79
  ModuleAgentSessionListInputV1,
80
80
  ModuleAgentSessionMessageV1,
81
+ ModuleAgentSessionRunReferenceV1,
82
+ ModuleAgentSessionWorkflowReferenceV1,
81
83
  ModuleAgentSessionPageV1,
82
84
  ModuleAgentSessionProviderV1,
83
85
  ModuleAgentSessionSummaryV1,
@@ -43,6 +43,25 @@ export interface ModuleAgentSessionMessageV1 {
43
43
 
44
44
  export interface ModuleAgentSessionV1 extends ModuleAgentSessionSummaryV1 {
45
45
  readonly messages: readonly ModuleAgentSessionMessageV1[];
46
+ /** Provider 返回了有界历史窗口;不得把该窗口当作完整会话。 */
47
+ readonly truncated?: boolean;
48
+ /** 当前 get() 已按业务来源重授权的关联事实;Host 仍逐 Run/Workflow 重授权。 */
49
+ readonly runRefs?: readonly ModuleAgentSessionRunReferenceV1[];
50
+ readonly workflowRefs?: readonly ModuleAgentSessionWorkflowReferenceV1[];
51
+ }
52
+
53
+ export interface ModuleAgentSessionRunReferenceV1 {
54
+ readonly runId: string;
55
+ readonly operationKey: string;
56
+ readonly messageSequence?: number;
57
+ readonly sessionId?: string;
58
+ readonly turnId?: string;
59
+ readonly workflowRunId?: string;
60
+ }
61
+
62
+ export interface ModuleAgentSessionWorkflowReferenceV1 {
63
+ readonly workflowRunId: string;
64
+ readonly messageSequence?: number;
46
65
  }
47
66
 
48
67
  /**
@@ -2,6 +2,8 @@ export * from "./src/audit.js";
2
2
  export * from "./src/ai-operation-readiness.js";
3
3
  // @windy-module system.agent begin
4
4
  export * from "./src/ai-runtime-report.js";
5
+ export * from "./src/agent-admin-catalog.js";
6
+ export * from "./src/agent-workbench.js";
5
7
  export * from "./src/agent-workflow.js";
6
8
  export * from "./src/agent-workflow-events.js";
7
9
  export * from "./src/agent-workflow-evaluation.js";
@@ -0,0 +1,73 @@
1
+ import type { JsonObject } from "./json.js";
2
+ import type { CandidateRole } from "./workflow.js";
3
+
4
+ /** Public, bounded categories; never include raw Guard events or Provider bodies. */
5
+ export type AgentAdminAvailabilityReason =
6
+ | "allowed"
7
+ | "permission-denied"
8
+ | "feature-unavailable"
9
+ | "license-unavailable"
10
+ | "scope-unavailable"
11
+ | "runtime-unavailable"
12
+ | "workflow-only"
13
+ | "internal-operation"
14
+ | "unsupported-operation"
15
+ | "handler-unavailable"
16
+ | "governance-unavailable";
17
+
18
+ export interface AgentAdminToolCatalogItem {
19
+ readonly key: string;
20
+ readonly label: string;
21
+ readonly description: string;
22
+ readonly module: string;
23
+ readonly operation: "query" | "command" | "background";
24
+ readonly featureKey: string;
25
+ readonly permissionKey: string;
26
+ readonly auditAction: string;
27
+ readonly scopeMode: "platform" | "request";
28
+ readonly executionMode: "host" | "sandbox";
29
+ readonly dataClassification: "public" | "internal" | "sensitive";
30
+ readonly approval: "none" | "required";
31
+ readonly approvalRoles?: readonly CandidateRole[];
32
+ readonly approvalTimeoutSeconds?: number;
33
+ readonly idempotency: "none" | "supported" | "required";
34
+ readonly limits: AgentAdminCatalogLimits;
35
+ readonly inputSchemaKey: string;
36
+ readonly outputSchemaKey: string;
37
+ readonly inputSchema: JsonObject;
38
+ readonly outputSchema: JsonObject;
39
+ readonly allowedOperationKeys: readonly string[];
40
+ /** Current Guard + Scope eligibility, not an execution or approval grant. */
41
+ readonly allowed: boolean;
42
+ readonly availabilityReason: AgentAdminAvailabilityReason;
43
+ }
44
+
45
+ export interface AgentAdminCatalogLimits {
46
+ readonly maxDurationSeconds: number;
47
+ readonly maxInputBytes: number;
48
+ readonly maxOutputBytes: number;
49
+ }
50
+
51
+ export interface AgentAdminOperationCatalogItem {
52
+ readonly key: string;
53
+ readonly module: string;
54
+ readonly moduleLabel: string;
55
+ readonly kind: string;
56
+ readonly visibility: "public" | "internal";
57
+ readonly execution: string;
58
+ readonly featureKey: string;
59
+ readonly permissionKey: string;
60
+ readonly auditAction: string;
61
+ readonly dataClassification: "public" | "internal" | "sensitive";
62
+ readonly requiredCapabilities: readonly string[];
63
+ readonly inputModalities: readonly string[];
64
+ readonly inputSchemaKey: string;
65
+ readonly outputSchemaKey: string;
66
+ readonly inputSchema?: JsonObject;
67
+ readonly outputSchema?: JsonObject;
68
+ readonly allowedToolKeys: readonly string[];
69
+ readonly limits: AgentAdminCatalogLimits;
70
+ readonly launchAuthority: "direct" | "workflow-artifact";
71
+ readonly selectable: boolean;
72
+ readonly availabilityReason: AgentAdminAvailabilityReason;
73
+ }
@@ -0,0 +1,100 @@
1
+ import type { JsonValue } from "./json.js";
2
+
3
+ export type AgentWorkbenchRecordingSourceV1 = "harness" | "business";
4
+ export type AgentWorkbenchCorrelationStatusV1 =
5
+ | "complete"
6
+ | "partial"
7
+ | "missing";
8
+
9
+ export interface AgentWorkbenchEventV1 {
10
+ readonly sequence: number;
11
+ readonly type: string;
12
+ readonly summary: string;
13
+ readonly occurredAt?: string;
14
+ readonly runId?: string;
15
+ readonly turnId?: string;
16
+ readonly stepId?: string;
17
+ readonly modelAttemptId?: string;
18
+ readonly attemptSequence?: number;
19
+ readonly toolCallId?: string;
20
+ readonly toolKey?: string;
21
+ readonly workItemId?: string;
22
+ readonly artifactId?: string;
23
+ readonly workflowRunId?: string;
24
+ readonly nodeRunId?: string;
25
+ readonly outcome?: string;
26
+ readonly usage?: {
27
+ readonly inputTokens?: number;
28
+ readonly outputTokens?: number;
29
+ readonly totalTokens?: number;
30
+ readonly costMicros?: number;
31
+ };
32
+ }
33
+
34
+ export interface AgentWorkbenchRunV1 {
35
+ readonly runId: string;
36
+ readonly operationKey: string;
37
+ readonly sessionId?: string;
38
+ readonly turnId?: string;
39
+ readonly messageSequence?: number;
40
+ readonly status: string;
41
+ readonly events: readonly AgentWorkbenchEventV1[];
42
+ readonly result?: { readonly output?: JsonValue; readonly status?: string };
43
+ readonly correlationStatus: AgentWorkbenchCorrelationStatusV1;
44
+ readonly missing: readonly string[];
45
+ }
46
+
47
+ export interface AgentWorkbenchWorkflowV1 {
48
+ readonly workflowRunId: string;
49
+ readonly sessionId?: string;
50
+ readonly messageSequence?: number;
51
+ readonly workflowKey: string;
52
+ readonly title: string;
53
+ readonly status: string;
54
+ readonly parentRunId?: string;
55
+ readonly parentNodeRunId?: string;
56
+ readonly nodes: readonly {
57
+ readonly nodeRunId: string;
58
+ readonly nodeId: string;
59
+ readonly type: string;
60
+ readonly status: string;
61
+ readonly attempt: number;
62
+ readonly previousNodeRunId?: string;
63
+ readonly agentRunId?: string;
64
+ readonly workItemId?: string;
65
+ readonly selectedBranch?: string;
66
+ readonly artifactIds: readonly string[];
67
+ }[];
68
+ readonly events: readonly AgentWorkbenchEventV1[];
69
+ }
70
+
71
+ export interface AgentWorkbenchRecordingSummaryV1 {
72
+ readonly source: AgentWorkbenchRecordingSourceV1;
73
+ readonly sessionId: string;
74
+ readonly title: string;
75
+ readonly updatedAt: string;
76
+ readonly operationKey?: string;
77
+ readonly sessionStatus?: "active" | "archived";
78
+ }
79
+
80
+ export interface AgentWorkbenchRecordingV1 extends AgentWorkbenchRecordingSummaryV1 {
81
+ readonly mode: "read-only";
82
+ readonly sideEffectPolicy: "no-reexecution";
83
+ readonly correlationStatus: AgentWorkbenchCorrelationStatusV1;
84
+ readonly messages: readonly {
85
+ readonly sequence: number;
86
+ readonly role: "user" | "assistant";
87
+ readonly content: string;
88
+ readonly createdAt: string;
89
+ }[];
90
+ readonly timeline: readonly AgentWorkbenchEventV1[];
91
+ /** Parent forks retain separate original ledger sequences, never renumbered. */
92
+ readonly segments?: readonly {
93
+ readonly sessionId: string;
94
+ readonly throughSequence: number;
95
+ readonly timeline: readonly AgentWorkbenchEventV1[];
96
+ }[];
97
+ readonly runs: readonly AgentWorkbenchRunV1[];
98
+ readonly workflows: readonly AgentWorkbenchWorkflowV1[];
99
+ readonly missing: readonly string[];
100
+ }