@jterrats/open-orchestra 1.0.17 → 1.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.
Files changed (235) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/CLAUDE.md +1 -0
  3. package/dist/active-runtime-store.d.ts +18 -0
  4. package/dist/active-runtime-store.js +75 -0
  5. package/dist/active-runtime-store.js.map +1 -0
  6. package/dist/chat-api-errors.d.ts +7 -0
  7. package/dist/chat-api-errors.js +15 -0
  8. package/dist/chat-api-errors.js.map +1 -0
  9. package/dist/chat-api-message-persistence.d.ts +12 -0
  10. package/dist/chat-api-message-persistence.js +125 -0
  11. package/dist/chat-api-message-persistence.js.map +1 -0
  12. package/dist/chat-api-records.d.ts +35 -0
  13. package/dist/chat-api-records.js +94 -0
  14. package/dist/chat-api-records.js.map +1 -0
  15. package/dist/chat-api-service.d.ts +32 -0
  16. package/dist/chat-api-service.js +120 -0
  17. package/dist/chat-api-service.js.map +1 -0
  18. package/dist/chat-api-storage.d.ts +1 -0
  19. package/dist/chat-api-storage.js +14 -0
  20. package/dist/chat-api-storage.js.map +1 -0
  21. package/dist/chat-api-types.d.ts +81 -0
  22. package/dist/chat-api-types.js +2 -0
  23. package/dist/chat-api-types.js.map +1 -0
  24. package/dist/chat-compliance-service.d.ts +60 -0
  25. package/dist/chat-compliance-service.js +241 -0
  26. package/dist/chat-compliance-service.js.map +1 -0
  27. package/dist/chat-event-stream.d.ts +13 -0
  28. package/dist/chat-event-stream.js +124 -0
  29. package/dist/chat-event-stream.js.map +1 -0
  30. package/dist/chat-pagination.d.ts +6 -0
  31. package/dist/chat-pagination.js +64 -0
  32. package/dist/chat-pagination.js.map +1 -0
  33. package/dist/chat-storage-actor-validation.d.ts +4 -0
  34. package/dist/chat-storage-actor-validation.js +65 -0
  35. package/dist/chat-storage-actor-validation.js.map +1 -0
  36. package/dist/chat-storage-content-policy.d.ts +6 -0
  37. package/dist/chat-storage-content-policy.js +84 -0
  38. package/dist/chat-storage-content-policy.js.map +1 -0
  39. package/dist/chat-storage-errors.d.ts +20 -0
  40. package/dist/chat-storage-errors.js +17 -0
  41. package/dist/chat-storage-errors.js.map +1 -0
  42. package/dist/chat-storage-local-files.d.ts +17 -0
  43. package/dist/chat-storage-local-files.js +78 -0
  44. package/dist/chat-storage-local-files.js.map +1 -0
  45. package/dist/chat-storage-local-paths.d.ts +6 -0
  46. package/dist/chat-storage-local-paths.js +124 -0
  47. package/dist/chat-storage-local-paths.js.map +1 -0
  48. package/dist/chat-storage-local-projection.d.ts +10 -0
  49. package/dist/chat-storage-local-projection.js +55 -0
  50. package/dist/chat-storage-local-projection.js.map +1 -0
  51. package/dist/chat-storage-local-records.d.ts +13 -0
  52. package/dist/chat-storage-local-records.js +56 -0
  53. package/dist/chat-storage-local-records.js.map +1 -0
  54. package/dist/chat-storage-local.d.ts +6 -0
  55. package/dist/chat-storage-local.js +114 -0
  56. package/dist/chat-storage-local.js.map +1 -0
  57. package/dist/chat-storage-validation.d.ts +10 -0
  58. package/dist/chat-storage-validation.js +100 -0
  59. package/dist/chat-storage-validation.js.map +1 -0
  60. package/dist/chat-storage.d.ts +16 -0
  61. package/dist/chat-storage.js +4 -0
  62. package/dist/chat-storage.js.map +1 -0
  63. package/dist/chat-workflow-timeline.d.ts +17 -0
  64. package/dist/chat-workflow-timeline.js +210 -0
  65. package/dist/chat-workflow-timeline.js.map +1 -0
  66. package/dist/{workspace-claude-settings.d.ts → claude-settings.d.ts} +22 -3
  67. package/dist/{workspace-claude-settings.js → claude-settings.js} +28 -9
  68. package/dist/claude-settings.js.map +1 -0
  69. package/dist/command-init.d.ts +2 -0
  70. package/dist/command-init.js +150 -0
  71. package/dist/command-init.js.map +1 -0
  72. package/dist/command-manifest.js +1 -1
  73. package/dist/command-manifest.js.map +1 -1
  74. package/dist/commands.d.ts +1 -1
  75. package/dist/commands.js +1 -140
  76. package/dist/commands.js.map +1 -1
  77. package/dist/constants.d.ts +1 -0
  78. package/dist/constants.js +1 -0
  79. package/dist/constants.js.map +1 -1
  80. package/dist/context-runtime-preprocessor.d.ts +41 -0
  81. package/dist/context-runtime-preprocessor.js +199 -0
  82. package/dist/context-runtime-preprocessor.js.map +1 -0
  83. package/dist/cursor-settings.d.ts +25 -0
  84. package/dist/cursor-settings.js +72 -0
  85. package/dist/cursor-settings.js.map +1 -0
  86. package/dist/health-commands.js +43 -3
  87. package/dist/health-commands.js.map +1 -1
  88. package/dist/model-aliases.d.ts +5 -0
  89. package/dist/model-aliases.js +37 -0
  90. package/dist/model-aliases.js.map +1 -0
  91. package/dist/ollama-provider.js +25 -0
  92. package/dist/ollama-provider.js.map +1 -1
  93. package/dist/phase-playbooks.js +11 -0
  94. package/dist/phase-playbooks.js.map +1 -1
  95. package/dist/provider-agent-wrapper.js +14 -0
  96. package/dist/provider-agent-wrapper.js.map +1 -1
  97. package/dist/qa-e2e-artifacts.js +71 -3
  98. package/dist/qa-e2e-artifacts.js.map +1 -1
  99. package/dist/runtime-adapters.js +56 -0
  100. package/dist/runtime-adapters.js.map +1 -1
  101. package/dist/runtime-bootstrap.js +32 -22
  102. package/dist/runtime-bootstrap.js.map +1 -1
  103. package/dist/runtime-child-prompt.js +8 -0
  104. package/dist/runtime-child-prompt.js.map +1 -1
  105. package/dist/runtime-context-manifest.d.ts +4 -1
  106. package/dist/runtime-context-manifest.js +59 -3
  107. package/dist/runtime-context-manifest.js.map +1 -1
  108. package/dist/runtime-execution-adapters.js +19 -0
  109. package/dist/runtime-execution-adapters.js.map +1 -1
  110. package/dist/runtime-execution-renderer.js +4 -0
  111. package/dist/runtime-execution-renderer.js.map +1 -1
  112. package/dist/runtime-execution.js +13 -82
  113. package/dist/runtime-execution.js.map +1 -1
  114. package/dist/runtime-hooks.d.ts +46 -0
  115. package/dist/runtime-hooks.js +95 -0
  116. package/dist/runtime-hooks.js.map +1 -0
  117. package/dist/runtime-parent-actions.js +5 -0
  118. package/dist/runtime-parent-actions.js.map +1 -1
  119. package/dist/runtime-spawn-bridge.js +1 -0
  120. package/dist/runtime-spawn-bridge.js.map +1 -1
  121. package/dist/runtime-spawn-guidance.js +15 -61
  122. package/dist/runtime-spawn-guidance.js.map +1 -1
  123. package/dist/security/chat-guardrail-policy.d.ts +7 -0
  124. package/dist/security/chat-guardrail-policy.js +61 -0
  125. package/dist/security/chat-guardrail-policy.js.map +1 -0
  126. package/dist/security/chat-guardrail-types.d.ts +65 -0
  127. package/dist/security/chat-guardrail-types.js +2 -0
  128. package/dist/security/chat-guardrail-types.js.map +1 -0
  129. package/dist/security/chat-guardrail-validation.d.ts +9 -0
  130. package/dist/security/chat-guardrail-validation.js +64 -0
  131. package/dist/security/chat-guardrail-validation.js.map +1 -0
  132. package/dist/security/chat-guardrails.d.ts +3 -0
  133. package/dist/security/chat-guardrails.js +136 -0
  134. package/dist/security/chat-guardrails.js.map +1 -0
  135. package/dist/security/content-classifier.js +33 -1
  136. package/dist/security/content-classifier.js.map +1 -1
  137. package/dist/security/payment-card-detection.d.ts +3 -0
  138. package/dist/security/payment-card-detection.js +48 -0
  139. package/dist/security/payment-card-detection.js.map +1 -0
  140. package/dist/security/policy-types.d.ts +1 -1
  141. package/dist/security/provider-egress-policy.d.ts +27 -0
  142. package/dist/security/provider-egress-policy.js +72 -0
  143. package/dist/security/provider-egress-policy.js.map +1 -0
  144. package/dist/security/public-api-auth.d.ts +20 -0
  145. package/dist/security/public-api-auth.js +55 -0
  146. package/dist/security/public-api-auth.js.map +1 -0
  147. package/dist/security/public-api-policy.d.ts +8 -0
  148. package/dist/security/public-api-policy.js +40 -0
  149. package/dist/security/public-api-policy.js.map +1 -0
  150. package/dist/security/redaction.js +44 -13
  151. package/dist/security/redaction.js.map +1 -1
  152. package/dist/security/restricted-content-quarantine.d.ts +17 -0
  153. package/dist/security/restricted-content-quarantine.js +50 -0
  154. package/dist/security/restricted-content-quarantine.js.map +1 -0
  155. package/dist/security/restricted-data-classifier.d.ts +9 -0
  156. package/dist/security/restricted-data-classifier.js +358 -0
  157. package/dist/security/restricted-data-classifier.js.map +1 -0
  158. package/dist/skills-render.js +7 -14
  159. package/dist/skills-render.js.map +1 -1
  160. package/dist/telemetry-redaction.d.ts +2 -0
  161. package/dist/telemetry-redaction.js +25 -2
  162. package/dist/telemetry-redaction.js.map +1 -1
  163. package/dist/types/chat.d.ts +203 -0
  164. package/dist/types/chat.js +10 -0
  165. package/dist/types/chat.js.map +1 -0
  166. package/dist/types/model-config.d.ts +4 -0
  167. package/dist/types/public-api.d.ts +75 -0
  168. package/dist/types/public-api.js +2 -0
  169. package/dist/types/public-api.js.map +1 -0
  170. package/dist/types/restricted-data.d.ts +69 -0
  171. package/dist/types/restricted-data.js +8 -0
  172. package/dist/types/restricted-data.js.map +1 -0
  173. package/dist/types/restricted-fragment.d.ts +82 -0
  174. package/dist/types/restricted-fragment.js +14 -0
  175. package/dist/types/restricted-fragment.js.map +1 -0
  176. package/dist/types/runtime.d.ts +12 -0
  177. package/dist/types.d.ts +6 -0
  178. package/dist/types.js.map +1 -1
  179. package/dist/web-api.js +24 -0
  180. package/dist/web-api.js.map +1 -1
  181. package/dist/web-artifact-parsers.d.ts +6 -0
  182. package/dist/web-artifact-parsers.js +266 -0
  183. package/dist/web-artifact-parsers.js.map +1 -0
  184. package/dist/web-artifact-types.d.ts +76 -0
  185. package/dist/web-artifact-types.js +2 -0
  186. package/dist/web-artifact-types.js.map +1 -0
  187. package/dist/web-artifacts.d.ts +2 -43
  188. package/dist/web-artifacts.js +106 -57
  189. package/dist/web-artifacts.js.map +1 -1
  190. package/dist/web-chat-route-inputs.d.ts +11 -0
  191. package/dist/web-chat-route-inputs.js +156 -0
  192. package/dist/web-chat-route-inputs.js.map +1 -0
  193. package/dist/web-chat-routes.d.ts +7 -0
  194. package/dist/web-chat-routes.js +213 -0
  195. package/dist/web-chat-routes.js.map +1 -0
  196. package/dist/web-console/assets/index-CJup1cIA.css +1 -0
  197. package/dist/web-console/assets/index-CVDOfipu.js +11 -0
  198. package/dist/web-console/index.html +2 -2
  199. package/dist/web-evidence.d.ts +1 -1
  200. package/dist/web-evidence.js +9 -2
  201. package/dist/web-evidence.js.map +1 -1
  202. package/dist/web-public-route-inputs.d.ts +14 -0
  203. package/dist/web-public-route-inputs.js +136 -0
  204. package/dist/web-public-route-inputs.js.map +1 -0
  205. package/dist/web-public-routes.d.ts +6 -0
  206. package/dist/web-public-routes.js +194 -0
  207. package/dist/web-public-routes.js.map +1 -0
  208. package/dist/web-public-service.d.ts +16 -0
  209. package/dist/web-public-service.js +154 -0
  210. package/dist/web-public-service.js.map +1 -0
  211. package/dist/workflow-services.js +5 -0
  212. package/dist/workflow-services.js.map +1 -1
  213. package/dist/workspace-runtime-bootstrap.js +15 -4
  214. package/dist/workspace-runtime-bootstrap.js.map +1 -1
  215. package/docs/chat-audit-retention.md +76 -0
  216. package/docs/chat-provider-provenance-ledger.md +75 -0
  217. package/docs/context-runtime-preprocessing.md +37 -0
  218. package/docs/orchestra-mvp.md +8 -2
  219. package/docs/public-api-contract.md +43 -0
  220. package/docs/release-test-matrix.md +14 -14
  221. package/docs/restricted-fragment-storage-contract.md +147 -0
  222. package/docs/runtime-adapters.md +40 -7
  223. package/docs/site-manifest.json +128 -30
  224. package/package.json +5 -2
  225. package/site/dist/_headers +9 -0
  226. package/site/dist/_redirects +2 -0
  227. package/site/dist/architecture.mmd +61 -0
  228. package/site/dist/assets/index-Bi8l6tCE.js +10 -0
  229. package/site/dist/assets/index-BsCLqY__.css +1 -0
  230. package/site/dist/favicon.svg +19 -0
  231. package/site/dist/index.html +28 -0
  232. package/site/package.json +19 -0
  233. package/dist/web-console/assets/index-BHs7OIv8.css +0 -1
  234. package/dist/web-console/assets/index-BJuVTqfQ.js +0 -11
  235. package/dist/workspace-claude-settings.js.map +0 -1
@@ -0,0 +1,203 @@
1
+ import type { RestrictedDataAuditEvent } from "./restricted-data.js";
2
+ export declare const CHAT_ACTOR_KINDS: readonly ["human", "parent_agent", "subagent", "provider_agent", "system", "reviewer", "workflow_event"];
3
+ export type ChatActorKind = (typeof CHAT_ACTOR_KINDS)[number];
4
+ export interface ChatScope {
5
+ tenantId: string;
6
+ workspaceId: string;
7
+ taskId: string;
8
+ runId: string;
9
+ phase: string;
10
+ sessionId: string;
11
+ }
12
+ export type HumanActorSource = "web_console" | "cli" | "api";
13
+ export type SystemActorSource = "orchestra" | "storage" | "migration";
14
+ export type ChatRuntimeSource = "codex-cli" | "claude-cli" | "cursor-cli" | "generic-runtime";
15
+ export interface ChatHumanActor {
16
+ kind: "human";
17
+ actorId: string;
18
+ displayName: string;
19
+ source: HumanActorSource;
20
+ sessionId: string;
21
+ }
22
+ export interface ChatParentAgentActor {
23
+ kind: "parent_agent";
24
+ actorId: string;
25
+ runtime: ChatRuntimeSource;
26
+ sessionId: string;
27
+ }
28
+ export interface ChatSubagentActor {
29
+ kind: "subagent";
30
+ actorId: string;
31
+ runtime: ChatRuntimeSource;
32
+ role: string;
33
+ sessionId: string;
34
+ parentSessionId: string;
35
+ }
36
+ export interface ChatProviderAgentActor {
37
+ kind: "provider_agent";
38
+ actorId: string;
39
+ provider: string;
40
+ model: string;
41
+ requestId: string;
42
+ }
43
+ export interface ChatSystemActor {
44
+ kind: "system";
45
+ actorId: string;
46
+ source: SystemActorSource;
47
+ }
48
+ export interface ChatReviewerActor {
49
+ kind: "reviewer";
50
+ actorId: string;
51
+ role: string;
52
+ reviewId: string;
53
+ }
54
+ export interface ChatWorkflowEventActor {
55
+ kind: "workflow_event";
56
+ actorId: string;
57
+ sourceEventId: string;
58
+ eventType: string;
59
+ }
60
+ export type ChatActor = ChatHumanActor | ChatParentAgentActor | ChatSubagentActor | ChatProviderAgentActor | ChatSystemActor | ChatReviewerActor | ChatWorkflowEventActor;
61
+ export type ChatProvenanceSourceKind = "user_input" | "agent_output" | "provider_output" | "workflow_event" | "review" | "storage_projection" | "migration";
62
+ export interface ChatProvenance {
63
+ sourceKind: ChatProvenanceSourceKind;
64
+ sourceId: string;
65
+ createdAt: string;
66
+ observedAt: string;
67
+ runtime?: ChatRuntimeSource;
68
+ provider?: string;
69
+ model?: string;
70
+ requestId?: string;
71
+ responseId?: string;
72
+ inputTokens?: number;
73
+ outputTokens?: number;
74
+ estimatedCostUsd?: number;
75
+ usageSource?: "provider" | "runtime" | "estimated" | "unavailable";
76
+ costSource?: "provider" | "pricing_estimate" | "free" | "unavailable";
77
+ parentMessageId?: string;
78
+ policyDecisionId?: string;
79
+ }
80
+ export type ChatContentState = "raw" | "redacted" | "tombstoned";
81
+ export type ChatContentFormat = "plain_text" | "markdown" | "workflow_event";
82
+ export type ChatRetentionStatus = "redacted_only" | "raw_allowed" | "expired" | "denied";
83
+ export type ChatRawPersistence = "forbidden" | "allowed";
84
+ export type ChatExportStatus = "exportable" | "redacted_only" | "not_exportable";
85
+ export type ChatDeleteStatus = "active" | "tombstoned";
86
+ export interface ChatRetentionMetadata {
87
+ policyId: string;
88
+ status: ChatRetentionStatus;
89
+ rawPersistence: ChatRawPersistence;
90
+ decidedAt: string;
91
+ expiresAt?: string;
92
+ }
93
+ export interface ChatExportMetadata {
94
+ status: ChatExportStatus;
95
+ rawContentExportable: boolean;
96
+ policyId: string;
97
+ decidedAt: string;
98
+ }
99
+ export interface ChatDeleteMetadata {
100
+ status: ChatDeleteStatus;
101
+ policyId: string;
102
+ tombstonedAt?: string;
103
+ tombstonedByActorId?: string;
104
+ reasonCode?: string;
105
+ }
106
+ export interface ChatRedactionMetadata {
107
+ policyId: string;
108
+ status: "applied";
109
+ redactedAt: string;
110
+ redactedByActorId: string;
111
+ markerCount: number;
112
+ summary: string;
113
+ }
114
+ export interface ChatContent {
115
+ format: ChatContentFormat;
116
+ text: string;
117
+ }
118
+ export type ChatReferenceKind = "workflow_run" | "task" | "evidence" | "review" | "decision" | "provider_request" | "restricted_fragment";
119
+ export interface ChatReference {
120
+ kind: ChatReferenceKind;
121
+ id: string;
122
+ label?: string;
123
+ }
124
+ export interface ChatWorkflowTimelineEvent {
125
+ sourceEventId: string;
126
+ eventType: string;
127
+ actor: string;
128
+ summary: string;
129
+ taskId: string;
130
+ runId?: string;
131
+ phase?: string;
132
+ gateId?: string;
133
+ result?: string;
134
+ rationale?: string;
135
+ sessionId?: string;
136
+ runtime?: ChatRuntimeSource;
137
+ actionKind?: string;
138
+ artifacts: string[];
139
+ }
140
+ export interface ChatThread {
141
+ schemaVersion: number;
142
+ id: string;
143
+ scope: ChatScope;
144
+ title: string;
145
+ createdAt: string;
146
+ updatedAt: string;
147
+ actor: ChatActor;
148
+ provenance: ChatProvenance;
149
+ retention: ChatRetentionMetadata;
150
+ export: ChatExportMetadata;
151
+ delete: ChatDeleteMetadata;
152
+ contentState: ChatContentState;
153
+ summary?: string;
154
+ }
155
+ export interface ChatMessage {
156
+ schemaVersion: number;
157
+ id: string;
158
+ threadId: string;
159
+ scope: ChatScope;
160
+ actor: ChatActor;
161
+ provenance: ChatProvenance;
162
+ createdAt: string;
163
+ sequence: number;
164
+ content: ChatContent;
165
+ contentState: ChatContentState;
166
+ retention: ChatRetentionMetadata;
167
+ redaction?: ChatRedactionMetadata;
168
+ export: ChatExportMetadata;
169
+ delete: ChatDeleteMetadata;
170
+ references?: ChatReference[];
171
+ restricted?: RestrictedDataAuditEvent;
172
+ timelineEvent?: ChatWorkflowTimelineEvent;
173
+ }
174
+ export interface ChatStorageState {
175
+ schemaVersion: number;
176
+ scope: ChatScope;
177
+ threads: number;
178
+ messages: number;
179
+ }
180
+ export interface ChatListOptions {
181
+ limit?: number;
182
+ cursor?: string;
183
+ }
184
+ export interface ChatThreadListResult {
185
+ threads: ChatThread[];
186
+ nextCursor?: string;
187
+ }
188
+ export interface ChatMessageListResult {
189
+ messages: ChatMessage[];
190
+ nextCursor?: string;
191
+ }
192
+ export interface ChatExportOptions {
193
+ includeTombstoned: boolean;
194
+ content: "redacted_only" | "raw_when_allowed";
195
+ }
196
+ export interface ChatExportRecord {
197
+ schemaVersion: number;
198
+ scope: ChatScope;
199
+ thread: ChatThread;
200
+ messages: ChatMessage[];
201
+ exportedAt: string;
202
+ content: "redacted_only" | "raw_when_allowed";
203
+ }
@@ -0,0 +1,10 @@
1
+ export const CHAT_ACTOR_KINDS = [
2
+ "human",
3
+ "parent_agent",
4
+ "subagent",
5
+ "provider_agent",
6
+ "system",
7
+ "reviewer",
8
+ "workflow_event",
9
+ ];
10
+ //# sourceMappingURL=chat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/types/chat.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO;IACP,cAAc;IACd,UAAU;IACV,gBAAgB;IAChB,QAAQ;IACR,UAAU;IACV,gBAAgB;CACR,CAAC"}
@@ -71,9 +71,13 @@ export interface ProviderFallbackResult {
71
71
  }
72
72
  export interface ModelProvenanceInput {
73
73
  task: string;
74
+ tenantId?: string;
75
+ workspaceId?: string;
76
+ sessionId?: string;
74
77
  runId?: string;
75
78
  phase?: string;
76
79
  actor?: string;
80
+ initiatedBy?: "human" | "parent_agent" | "subagent" | "system";
77
81
  role: string;
78
82
  provider: string;
79
83
  model: string;
@@ -0,0 +1,75 @@
1
+ export interface PublicApiMeta {
2
+ requestId: string;
3
+ idempotencyKey?: string;
4
+ idempotentReplay?: boolean;
5
+ nextCursor?: string;
6
+ }
7
+ export interface PublicApiSuccess<T> {
8
+ data: T;
9
+ meta: PublicApiMeta;
10
+ }
11
+ export interface PublicApiErrorBody {
12
+ error: {
13
+ code: "invalid_request" | "invalid_json" | "payload_too_large" | "not_found" | "idempotency_conflict" | "policy_blocked" | "rate_limited" | "unauthorized" | "internal_error";
14
+ message: string;
15
+ requestId: string;
16
+ retryable: boolean;
17
+ };
18
+ }
19
+ export interface PublicApiThread {
20
+ id: string;
21
+ object: "thread";
22
+ title: string;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ }
26
+ export interface PublicApiMessage {
27
+ id: string;
28
+ object: "message";
29
+ threadId: string;
30
+ role: "user" | "agent" | "system";
31
+ text: string;
32
+ format: "plain_text" | "markdown";
33
+ createdAt: string;
34
+ }
35
+ export interface PublicApiModel {
36
+ id: string;
37
+ object: "model";
38
+ title: string;
39
+ default: boolean;
40
+ capabilities: {
41
+ conversation: boolean;
42
+ streaming: boolean;
43
+ };
44
+ }
45
+ export interface PublicApiListModels {
46
+ models: PublicApiModel[];
47
+ }
48
+ export interface PublicApiListThreads {
49
+ threads: PublicApiThread[];
50
+ }
51
+ export interface PublicApiThreadDetail {
52
+ thread: PublicApiThread;
53
+ }
54
+ export interface PublicApiListMessages {
55
+ messages: PublicApiMessage[];
56
+ }
57
+ export interface PublicApiCreateThreadInput {
58
+ requestId?: string;
59
+ idempotencyKey?: string;
60
+ title: string;
61
+ }
62
+ export interface PublicApiListInput {
63
+ requestId?: string;
64
+ limit?: number;
65
+ cursor?: string;
66
+ }
67
+ export interface PublicApiThreadInput {
68
+ requestId?: string;
69
+ threadId: string;
70
+ }
71
+ export interface PublicApiCreateMessageInput extends PublicApiThreadInput {
72
+ idempotencyKey: string;
73
+ text: string;
74
+ format?: "plain_text" | "markdown";
75
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=public-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../src/types/public-api.ts"],"names":[],"mappings":""}
@@ -0,0 +1,69 @@
1
+ export declare const restrictedDataCategories: readonly ["password", "secret", "private_key", "payment_data", "sensitive_pii"];
2
+ export type RestrictedDataCategory = (typeof restrictedDataCategories)[number];
3
+ export type RestrictedDataBoundary = "chat_ingress" | "public_api_ingress";
4
+ export type RestrictedDataConfidence = "medium" | "high";
5
+ export type RestrictedDataSeverity = "high" | "critical";
6
+ export type RestrictedDataPolicyRecommendation = "block" | "redact" | "encrypt" | "tokenize" | "purge";
7
+ export type RestrictedDataPolicyOutcome = "allow" | "block";
8
+ export type RestrictedProviderEgressDecision = "allowed" | "denied";
9
+ export type RestrictedRawPersistenceDecision = "allowed" | "forbidden";
10
+ export type RestrictedDataAuditEventType = "restricted_data_detected" | "restricted_request_blocked" | "restricted_provider_egress_denied" | "restricted_redacted_exported" | "restricted_telemetry_redacted" | "restricted_raw_not_persisted";
11
+ export interface RestrictedDataFinding {
12
+ category: RestrictedDataCategory;
13
+ kind: string;
14
+ ruleId: string;
15
+ confidence: RestrictedDataConfidence;
16
+ severity: RestrictedDataSeverity;
17
+ occurrenceCount: number;
18
+ redactionMarker: string;
19
+ summary: string;
20
+ }
21
+ export interface RestrictedDataClassification {
22
+ hasRestrictedData: boolean;
23
+ findings: RestrictedDataFinding[];
24
+ redactedText: string;
25
+ redactionCount: number;
26
+ }
27
+ export interface RestrictedBoundaryPolicyRequest {
28
+ requestId: string;
29
+ boundary: RestrictedDataBoundary;
30
+ classification: RestrictedDataClassification;
31
+ }
32
+ export interface RestrictedBoundaryPolicyDecision {
33
+ decisionId: string;
34
+ requestId: string;
35
+ boundary: RestrictedDataBoundary;
36
+ outcome: RestrictedDataPolicyOutcome;
37
+ categories: RestrictedDataCategory[];
38
+ recommendations: RestrictedDataPolicyRecommendation[];
39
+ redactionCount: number;
40
+ providerEgress: RestrictedProviderEgressDecision;
41
+ rawPersistence: RestrictedRawPersistenceDecision;
42
+ sanitizedReasons: string[];
43
+ auditSummary: string;
44
+ }
45
+ export interface RestrictedDataAuditFinding {
46
+ category: RestrictedDataCategory;
47
+ ruleId: string;
48
+ confidence: RestrictedDataConfidence;
49
+ severity: RestrictedDataSeverity;
50
+ occurrenceCount: number;
51
+ redactionMarker: string;
52
+ summary: string;
53
+ }
54
+ export interface RestrictedDataAuditEvent {
55
+ schemaVersion: 1;
56
+ eventType: RestrictedDataAuditEventType;
57
+ sourceId: string;
58
+ boundary?: RestrictedDataBoundary;
59
+ requestId?: string;
60
+ decisionId?: string;
61
+ categories: RestrictedDataCategory[];
62
+ findings: RestrictedDataAuditFinding[];
63
+ redactionCount: number;
64
+ redactionMarkers: string[];
65
+ sanitizedReasons: string[];
66
+ rawContentIncluded: false;
67
+ providerEgress?: RestrictedProviderEgressDecision;
68
+ rawPersistence?: RestrictedRawPersistenceDecision;
69
+ }
@@ -0,0 +1,8 @@
1
+ export const restrictedDataCategories = [
2
+ "password",
3
+ "secret",
4
+ "private_key",
5
+ "payment_data",
6
+ "sensitive_pii",
7
+ ];
8
+ //# sourceMappingURL=restricted-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restricted-data.js","sourceRoot":"","sources":["../../src/types/restricted-data.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,UAAU;IACV,QAAQ;IACR,aAAa;IACb,cAAc;IACd,eAAe;CACP,CAAC"}
@@ -0,0 +1,82 @@
1
+ export declare const RESTRICTED_FRAGMENT_STORAGE_DEFAULT_MODE: "disabled";
2
+ export declare const RESTRICTED_FRAGMENT_ENVELOPE_ALGORITHMS: readonly ["AES-256-GCM"];
3
+ export declare const RESTRICTED_FRAGMENT_AUDIT_EVENTS: readonly ["restricted_fragment_detected", "restricted_fragment_shadow_recorded", "restricted_fragment_encrypted", "restricted_fragment_decrypt_denied", "restricted_fragment_restore_attempted", "restricted_fragment_ciphertext_deleted", "restricted_fragment_key_destroyed", "restricted_fragment_crypto_shredded", "restricted_fragment_backup_expiry_pending"];
4
+ export type RestrictedFragmentStorageMode = typeof RESTRICTED_FRAGMENT_STORAGE_DEFAULT_MODE;
5
+ export type RestrictedFragmentEnvelopeAlgorithm = (typeof RESTRICTED_FRAGMENT_ENVELOPE_ALGORITHMS)[number];
6
+ export type RestrictedFragmentAuditEventType = (typeof RESTRICTED_FRAGMENT_AUDIT_EVENTS)[number];
7
+ export type RestrictedFragmentCategory = "credential" | "password" | "api_key" | "token" | "private_key" | "payment_data" | "regulated_pii" | "sensitive_pii";
8
+ export type RestrictedFragmentLifecycleStatus = "shadow_only" | "encrypted" | "delete_requested" | "ciphertext_deleted" | "key_destroyed" | "crypto_shredded" | "raw_not_persisted" | "backup_expiry_pending";
9
+ export type RestrictedFragmentRestoreStatus = "not_allowed" | "allowed_by_policy" | "blocked_key_destroyed" | "blocked_expired" | "blocked_unauthorized" | "blocked_legal_hold" | "blocked_policy";
10
+ export interface RestrictedFragmentRedactedShadow {
11
+ schemaVersion: number;
12
+ fragmentId: string;
13
+ tenantId: string;
14
+ workspaceId: string;
15
+ sourceMessageId: string;
16
+ category: RestrictedFragmentCategory;
17
+ policyId: string;
18
+ redactionMarker: string;
19
+ sanitizedSummary: string;
20
+ lifecycleStatus: RestrictedFragmentLifecycleStatus;
21
+ createdAt: string;
22
+ expiresAt: string;
23
+ legalHold: boolean;
24
+ plaintextDigest?: string;
25
+ }
26
+ export interface RestrictedFragmentKeyScope {
27
+ tenantId: string;
28
+ workspaceId: string;
29
+ retentionClass: string;
30
+ policyId: string;
31
+ }
32
+ export interface RestrictedFragmentCiphertextMetadata {
33
+ ciphertextObjectId: string;
34
+ ciphertextDigest: string;
35
+ nonceId: string;
36
+ authenticationTagId: string;
37
+ }
38
+ export interface RestrictedFragmentWrappedKeyMetadata {
39
+ wrappedDataKeyId: string;
40
+ keyVersion: string;
41
+ kmsProviderAlias: string;
42
+ keyScope: RestrictedFragmentKeyScope;
43
+ }
44
+ export interface RestrictedFragmentEnvelope {
45
+ schemaVersion: number;
46
+ fragmentId: string;
47
+ shadowId: string;
48
+ algorithm: RestrictedFragmentEnvelopeAlgorithm;
49
+ category: RestrictedFragmentCategory;
50
+ purpose: string;
51
+ retentionClass: string;
52
+ policyId: string;
53
+ ciphertext: RestrictedFragmentCiphertextMetadata;
54
+ wrappedKey: RestrictedFragmentWrappedKeyMetadata;
55
+ createdAt: string;
56
+ expiresAt: string;
57
+ legalHold: boolean;
58
+ }
59
+ export interface RestrictedFragmentAuditEvent {
60
+ schemaVersion: number;
61
+ eventType: RestrictedFragmentAuditEventType;
62
+ fragmentId: string;
63
+ tenantId: string;
64
+ workspaceId: string;
65
+ actorId: string;
66
+ policyId: string;
67
+ decisionId: string;
68
+ category: RestrictedFragmentCategory;
69
+ occurredAt: string;
70
+ sanitizedSummary: string;
71
+ }
72
+ export interface RestrictedFragmentCryptoShredResult {
73
+ fragmentId: string;
74
+ tenantId: string;
75
+ workspaceId: string;
76
+ status: RestrictedFragmentLifecycleStatus;
77
+ ciphertextDeleted: boolean;
78
+ keyDestroyed: boolean;
79
+ backupExpiryPending: boolean;
80
+ auditEventId: string;
81
+ completedAt: string;
82
+ }
@@ -0,0 +1,14 @@
1
+ export const RESTRICTED_FRAGMENT_STORAGE_DEFAULT_MODE = "disabled";
2
+ export const RESTRICTED_FRAGMENT_ENVELOPE_ALGORITHMS = ["AES-256-GCM"];
3
+ export const RESTRICTED_FRAGMENT_AUDIT_EVENTS = [
4
+ "restricted_fragment_detected",
5
+ "restricted_fragment_shadow_recorded",
6
+ "restricted_fragment_encrypted",
7
+ "restricted_fragment_decrypt_denied",
8
+ "restricted_fragment_restore_attempted",
9
+ "restricted_fragment_ciphertext_deleted",
10
+ "restricted_fragment_key_destroyed",
11
+ "restricted_fragment_crypto_shredded",
12
+ "restricted_fragment_backup_expiry_pending",
13
+ ];
14
+ //# sourceMappingURL=restricted-fragment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"restricted-fragment.js","sourceRoot":"","sources":["../../src/types/restricted-fragment.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wCAAwC,GAAG,UAAmB,CAAC;AAE5E,MAAM,CAAC,MAAM,uCAAuC,GAAG,CAAC,aAAa,CAAU,CAAC;AAEhF,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,8BAA8B;IAC9B,qCAAqC;IACrC,+BAA+B;IAC/B,oCAAoC;IACpC,uCAAuC;IACvC,wCAAwC;IACxC,mCAAmC;IACnC,qCAAqC;IACrC,2CAA2C;CACnC,CAAC"}
@@ -35,6 +35,10 @@ export interface RuntimeAdapter {
35
35
  supportsManagedBlocks: boolean;
36
36
  supportsImports: boolean;
37
37
  guidance: string;
38
+ bootstrapSpawnHint?: string[];
39
+ recurringPreflightLines?: string[];
40
+ bootstrapSpawnLines?: string[];
41
+ spawnProtocolLines?: string[];
38
42
  }
39
43
  export interface RuntimeAdapterCatalogEntry extends RuntimeAdapter {
40
44
  executionAdapters: RuntimeExecutionAdapter[];
@@ -83,6 +87,12 @@ export interface RuntimeExecutionAdapter {
83
87
  briefOnlyFallback: boolean;
84
88
  directProviderApiAllowed: false;
85
89
  guidance: string;
90
+ /** Output format for skill rendering: "markdown" for most targets, "json" for structured consumers (e.g. vscode). */
91
+ skillRenderFormat?: "markdown" | "json";
92
+ /** Title heading used in the rendered skill context document. */
93
+ skillContextTitle?: string;
94
+ /** Introductory sentence placed below the title in the rendered skill context document. */
95
+ skillContextIntro?: string;
86
96
  }
87
97
  export interface RuntimeExecutorConfig {
88
98
  executor?: RuntimeExecutionId;
@@ -108,6 +118,7 @@ export interface RuntimeSelection {
108
118
  export interface RuntimeDelegationAssignment {
109
119
  role: string;
110
120
  paths: string[];
121
+ executionMode: "ask" | "plan" | "agent";
111
122
  allowedCommands: string[];
112
123
  expectedArtifacts: string[];
113
124
  }
@@ -240,6 +251,7 @@ export interface RuntimeParentAction {
240
251
  runtime: RuntimeExecutionId;
241
252
  tool: string;
242
253
  mode: RuntimeSpawnCapabilityMode;
254
+ executionMode: RuntimeDelegationAssignment["executionMode"];
243
255
  sessionId: string;
244
256
  phase: string;
245
257
  role: string;
package/dist/types.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { ContextBudgetMetadata } from "./types/context.js";
2
2
  import type { ModelProvenanceRecord, TelemetryConsentState } from "./types/model-config.js";
3
3
  import type { CollaborationFlowRecommendation, MemoryPacket, SkillPlan, SkillRenderTarget, WorkflowTemplateSelection } from "./types/skills.js";
4
4
  import type { EventEntry, LockEntry, Task, TaskStatus } from "./types/tasks.js";
5
+ export type { ChatActor, ChatActorKind, ChatContent, ChatContentFormat, ChatContentState, ChatDeleteMetadata, ChatDeleteStatus, ChatExportMetadata, ChatExportOptions, ChatExportRecord, ChatExportStatus, ChatHumanActor, ChatListOptions, ChatMessage, ChatMessageListResult, ChatParentAgentActor, ChatProviderAgentActor, ChatProvenance, ChatProvenanceSourceKind, ChatRawPersistence, ChatRedactionMetadata, ChatReference, ChatReferenceKind, ChatRetentionMetadata, ChatRetentionStatus, ChatReviewerActor, ChatRuntimeSource, ChatScope, ChatStorageState, ChatSubagentActor, ChatSystemActor, ChatThread, ChatThreadListResult, ChatWorkflowEventActor, HumanActorSource, SystemActorSource, } from "./types/chat.js";
5
6
  export type { ContextBudgetMetadata, ContextBudgetSection, } from "./types/context.js";
6
7
  export type { ContextIndexBuildResult, ContextIndexFileEntry, ContextIndexManifest, ContextIndexSearchMatch, ContextIndexSearchResult, ContextIndexStatus, ContextPackBudget, ContextPackItem, ContextPackResult, ContextPackSnippet, } from "./types/context-index.js";
7
8
  export type { BudgetLimit, BudgetPolicy, ConfiguredProviderSummary, GitHubConfig, GitHubNotificationConfig, ModelMessage, ModelProvider, ModelProviderCapabilities, ModelProviderError, ModelProvenanceInput, ModelProvenanceRecord, ModelRequest, ModelResponse, ModelStreamEvent, NotificationChannelResult, NotificationsConfig, PhaseExecutionMode, PhaseExecutorPhase, PhaseLlmResult, PhaseOutcome, PhaseStructuredOutput, ProviderFallbackResult, ProviderFailureDetail, ProviderBackedAgentBudget, ProviderBackedAgentCost, ProviderBackedAgentEvidencePolicy, ProviderBackedAgentFallback, ProviderBackedAgentOutcome, ProviderBackedAgentPolicy, ProviderBackedAgentProvenance, ProviderBackedAgentRequest, ProviderBackedAgentResult, ProviderBackedAgentUsage, ProviderCostSource, ProviderDataClass, ProviderProfileSmokeCheck, ProviderProfileSmokeResult, ProviderCredentialConfig, ProviderCredentialsConfig, ProviderPolicyConfig, ProviderRegistryCredentialEnv, ProviderRegistryEntry, ProviderRuntimeProfile, ProviderRuntimeProfileSummary, ProviderRouting, ProviderUsageSource, SlackNotificationConfig, TelemetryConsentState, TelemetryLevel, ToolConfig, WorkflowConfig, WorkflowProvidersConfig, } from "./types/model-config.js";
@@ -307,6 +308,11 @@ export interface UsageReport {
307
308
  totals: UsageBreakdown;
308
309
  byRole: UsageBreakdown[];
309
310
  byProvider: UsageBreakdown[];
311
+ byTenant: UsageBreakdown[];
312
+ byWorkspace: UsageBreakdown[];
313
+ byActor: UsageBreakdown[];
314
+ byInitiator: UsageBreakdown[];
315
+ byPhase: UsageBreakdown[];
310
316
  }
311
317
  export interface BudgetViolation {
312
318
  scope: string;
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAiLA,OAAO,EACL,aAAa,GAoBd,MAAM,oBAAoB,CAAC;AA2B5B,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,6BAA6B,EAC7B,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAwNA,OAAO,EACL,aAAa,GAoBd,MAAM,oBAAoB,CAAC;AA2B5B,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,6BAA6B,EAC7B,gCAAgC,EAChC,4BAA4B,GAC7B,MAAM,4BAA4B,CAAC"}
package/dist/web-api.js CHANGED
@@ -17,6 +17,8 @@ import { repairRecoveryItem } from "./web-recovery.js";
17
17
  import { renderWebConsoleHtml } from "./web-console.js";
18
18
  import { runWorkflowRun } from "./workflow-run-commands.js";
19
19
  import { handleRuntimeSpawnLifecyclePost, handleRuntimeSpawnRequestPost, } from "./web-runtime-actions.js";
20
+ import { handleWebChatRoute } from "./web-chat-routes.js";
21
+ import { handleWebPublicRoute } from "./web-public-routes.js";
20
22
  import { renderSubagentProtocol } from "./subagent-protocol.js";
21
23
  import { recommendCollaborationFlow } from "./collaboration-flows.js";
22
24
  import { renderWorkflowTemplates, selectWorkflowTemplates, } from "./workflow-templates.js";
@@ -250,6 +252,16 @@ export async function startWebApiServer(options = {}) {
250
252
  writeJson(response, result.status, result.body);
251
253
  return;
252
254
  }
255
+ const chatRoute = await handleWebChatRoute(request, selectedRoot, url);
256
+ if (chatRoute) {
257
+ writeWebChatResult(response, chatRoute);
258
+ return;
259
+ }
260
+ const publicRoute = await handleWebPublicRoute(request, selectedRoot, url);
261
+ if (publicRoute) {
262
+ writeJson(response, publicRoute.status, publicRoute.body);
263
+ return;
264
+ }
253
265
  if (request.method === "POST" &&
254
266
  url.pathname === "/api/workflow/gate-approve") {
255
267
  const result = await handleWorkflowGateApprovePost(request, selectedRoot);
@@ -727,6 +739,18 @@ function writeJson(response, status, body) {
727
739
  });
728
740
  response.end(`${JSON.stringify(body, null, 2)}\n`);
729
741
  }
742
+ function writeWebChatResult(response, result) {
743
+ if (result.contentType === "text/event-stream") {
744
+ response.writeHead(result.status, {
745
+ "content-type": "text/event-stream; charset=utf-8",
746
+ "cache-control": "no-store",
747
+ connection: "keep-alive",
748
+ });
749
+ response.end(String(result.body));
750
+ return;
751
+ }
752
+ writeJson(response, result.status, result.body);
753
+ }
730
754
  function writeHtml(response, body) {
731
755
  response.writeHead(200, {
732
756
  "content-type": "text/html; charset=utf-8",