@xfey/tutti 0.1.127 → 0.1.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/approvals/decision-command.d.ts +2 -2
- package/dist/chat-assistant/diagnostics.d.ts +17 -3
- package/dist/chat-assistant/diagnostics.js +5 -2
- package/dist/chat-assistant/failure-messages.d.ts +4 -0
- package/dist/chat-assistant/failure-messages.js +57 -0
- package/dist/chat-assistant/failures.d.ts +27 -0
- package/dist/chat-assistant/failures.js +46 -0
- package/dist/chat-assistant/index.d.ts +18 -4
- package/dist/chat-assistant/index.js +254 -51
- package/dist/chat-assistant/language-context.d.ts +2 -0
- package/dist/chat-assistant/language-context.js +17 -14
- package/dist/chat-assistant/requests.d.ts +34 -0
- package/dist/chat-assistant/requests.js +64 -0
- package/dist/collaboration-ingestion/clarification.js +3 -1
- package/dist/collaboration-ingestion/main-chat.js +1 -0
- package/dist/collaboration-ingestion/types.d.ts +2 -0
- package/dist/collaboration-state/clarification-snapshot.d.ts +5 -5
- package/dist/collaboration-state/context-sync-attempts.d.ts +9 -0
- package/dist/collaboration-state/context-sync-attempts.js +13 -0
- package/dist/collaboration-state/task-compile-context.d.ts +1 -1
- package/dist/collaboration-state/task-compile-context.js +11 -1
- package/dist/collaboration-state/task-compile-requests.d.ts +6 -0
- package/dist/collaboration-state/task-compile-requests.js +16 -0
- package/dist/communication-language/notice-locale.d.ts +4 -0
- package/dist/communication-language/notice-locale.js +14 -0
- package/dist/control-plane/context-sync-completion.d.ts +7 -0
- package/dist/control-plane/context-sync-completion.js +27 -0
- package/dist/control-plane/context-sync.d.ts +1 -0
- package/dist/control-plane/context-sync.js +23 -0
- package/dist/control-plane/index.d.ts +13 -4
- package/dist/control-plane/index.js +30 -23
- package/dist/control-plane/task-compile-continuation.js +2 -0
- package/dist/control-plane/task-compile-request-status.d.ts +6 -0
- package/dist/control-plane/task-compile-request-status.js +70 -0
- package/dist/control-plane/task-compile-start.js +40 -2
- package/dist/control-plane/types.d.ts +2 -0
- package/dist/providers/failure-classification.d.ts +23 -0
- package/dist/providers/failure-classification.js +43 -0
- package/dist/providers/invocation-progress.d.ts +6 -0
- package/dist/providers/invocation-progress.js +24 -0
- package/dist/providers/openai/app-server/read-only-procedure.js +1 -0
- package/dist/providers/openai/chat-assistant.js +2 -1
- package/dist/reference-access/read-evidence.d.ts +2 -0
- package/dist/reference-access/read-evidence.js +5 -0
- package/dist/reference-access/service.d.ts +2 -0
- package/dist/reference-access/service.js +2 -0
- package/dist/runtime-failures.js +15 -1
- package/dist/server-shell/cli/external-reference-runtime.js +6 -3
- package/dist/server-shell/cli/host-server-runtime.js +8 -2
- package/dist/server-shell/cli/relay-registration.js +1 -0
- package/dist/server-shell/http/routes/project-api/messages-routes.js +22 -1
- package/dist/server-shell/http/routes/project-api/openapi-collaboration-routes.d.ts +140 -5
- package/dist/server-shell/http/routes/project-api/openapi-collaboration-routes.js +29 -2
- package/dist/server-shell/http/routes/project-api/openapi-skills-routes.d.ts +2 -0
- package/dist/server-shell/http/routes/project-api/openapi-workspace-routes.d.ts +6 -0
- package/dist/server-shell/http/routes/project-api/openapi.d.ts +148 -5
- package/dist/server-shell/http/routes/project-api/schemas.d.ts +6 -0
- package/dist/server-shell/http/routes/project-api/schemas.js +1 -0
- package/dist/server-shell/http/routes/project-api/types.d.ts +1 -0
- package/dist/server-shell/http/routes/project-api/workflow-routes.js +39 -3
- package/dist/server-shell/http/routes/project-api/workspace-projections.js +1 -0
- package/dist/server-shell/http/validation.js +8 -2
- package/dist/server-shell/local-console/managed-project-service.d.ts +1 -1
- package/dist/server-shell/managed-access/transport.d.ts +1 -1
- package/migrations/0024_chat_requests.sql +19 -0
- package/migrations/0025_task_compile_requests.sql +50 -0
- package/migrations/0026_context_sync_and_chat_locale.sql +12 -0
- package/migrations/README.md +3 -1
- package/node_modules/@tutti/relay-client/dist/host-control.d.ts +1 -0
- package/node_modules/@tutti/relay-client/dist/host-control.js +1 -0
- package/node_modules/@tutti/shared/dist/schemas/api/index.d.ts +1 -0
- package/node_modules/@tutti/shared/dist/schemas/api/index.js +1 -0
- package/node_modules/@tutti/shared/dist/schemas/api/operation-status.d.ts +174 -0
- package/node_modules/@tutti/shared/dist/schemas/api/operation-status.js +75 -0
- package/node_modules/@tutti/shared/dist/schemas/api/primitives.d.ts +1 -0
- package/node_modules/@tutti/shared/dist/schemas/api/primitives.js +1 -0
- package/node_modules/@tutti/shared/dist/schemas/api/workspace-commands.d.ts +1 -0
- package/node_modules/@tutti/shared/dist/schemas/api/workspace-commands.js +2 -1
- package/package.json +1 -1
- package/web/assets/{homepage-motion-scene-DyEmWwvt.js → homepage-motion-scene-BHhw4CfM.js} +1 -1
- package/web/assets/index-5COc1Yku.js +70 -0
- package/web/assets/index-BJvKuUiT.css +1 -0
- package/web/index.html +2 -2
- package/web/assets/index-By3idT4U.js +0 -70
- package/web/assets/index-DSBjOZmJ.css +0 -1
|
@@ -157,6 +157,141 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
|
|
|
157
157
|
};
|
|
158
158
|
200?: never;
|
|
159
159
|
};
|
|
160
|
+
} | {
|
|
161
|
+
method: "get";
|
|
162
|
+
path: string;
|
|
163
|
+
summary: string;
|
|
164
|
+
tags: string[];
|
|
165
|
+
querystring: import("@sinclair/typebox").TObject<{
|
|
166
|
+
workflow_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
167
|
+
command_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
168
|
+
}>;
|
|
169
|
+
responses: {
|
|
170
|
+
200: {
|
|
171
|
+
description: string;
|
|
172
|
+
schema: import("@sinclair/typebox").TObject<{
|
|
173
|
+
request: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
174
|
+
status: import("@sinclair/typebox").TLiteral<"running">;
|
|
175
|
+
phase: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"preparing">, import("@sinclair/typebox").TLiteral<"scratchpad_refresh">, import("@sinclair/typebox").TLiteral<"reference_summary_refresh">, import("@sinclair/typebox").TLiteral<"project_context_bootstrap">, import("@sinclair/typebox").TLiteral<"task_compile">]>;
|
|
176
|
+
operation: import("@sinclair/typebox").TObject<{
|
|
177
|
+
kind: import("@sinclair/typebox").TLiteral<"worklist_submit">;
|
|
178
|
+
ref: import("@sinclair/typebox").TString;
|
|
179
|
+
}>;
|
|
180
|
+
created_at: import("@sinclair/typebox").TString;
|
|
181
|
+
activity_ref: import("@sinclair/typebox").TString;
|
|
182
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
183
|
+
status: import("@sinclair/typebox").TLiteral<"waiting_input">;
|
|
184
|
+
phase: import("@sinclair/typebox").TLiteral<"clarification">;
|
|
185
|
+
round_id: import("@sinclair/typebox").TString;
|
|
186
|
+
operation: import("@sinclair/typebox").TObject<{
|
|
187
|
+
kind: import("@sinclair/typebox").TLiteral<"worklist_submit">;
|
|
188
|
+
ref: import("@sinclair/typebox").TString;
|
|
189
|
+
}>;
|
|
190
|
+
created_at: import("@sinclair/typebox").TString;
|
|
191
|
+
activity_ref: import("@sinclair/typebox").TString;
|
|
192
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
193
|
+
status: import("@sinclair/typebox").TLiteral<"succeeded">;
|
|
194
|
+
phase: import("@sinclair/typebox").TLiteral<"settled">;
|
|
195
|
+
operation: import("@sinclair/typebox").TObject<{
|
|
196
|
+
kind: import("@sinclair/typebox").TLiteral<"worklist_submit">;
|
|
197
|
+
ref: import("@sinclair/typebox").TString;
|
|
198
|
+
}>;
|
|
199
|
+
created_at: import("@sinclair/typebox").TString;
|
|
200
|
+
activity_ref: import("@sinclair/typebox").TString;
|
|
201
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
202
|
+
status: import("@sinclair/typebox").TLiteral<"failed">;
|
|
203
|
+
phase: import("@sinclair/typebox").TLiteral<"settled">;
|
|
204
|
+
failure: import("@sinclair/typebox").TObject<{
|
|
205
|
+
code: import("@sinclair/typebox").TString;
|
|
206
|
+
category: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"interrupted" | "capacity" | "access" | "configuration" | "dependency" | "internal">[]>;
|
|
207
|
+
recovery: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"resend_request" | "check_provider" | "restart_host" | "contact_support" | "none">[]>;
|
|
208
|
+
diagnostic_id: import("@sinclair/typebox").TString;
|
|
209
|
+
}>;
|
|
210
|
+
operation: import("@sinclair/typebox").TObject<{
|
|
211
|
+
kind: import("@sinclair/typebox").TLiteral<"worklist_submit">;
|
|
212
|
+
ref: import("@sinclair/typebox").TString;
|
|
213
|
+
}>;
|
|
214
|
+
created_at: import("@sinclair/typebox").TString;
|
|
215
|
+
activity_ref: import("@sinclair/typebox").TString;
|
|
216
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
217
|
+
status: import("@sinclair/typebox").TLiteral<"unknown">;
|
|
218
|
+
phase: import("@sinclair/typebox").TLiteral<"unconfirmed">;
|
|
219
|
+
operation: import("@sinclair/typebox").TObject<{
|
|
220
|
+
kind: import("@sinclair/typebox").TLiteral<"worklist_submit">;
|
|
221
|
+
ref: import("@sinclair/typebox").TString;
|
|
222
|
+
}>;
|
|
223
|
+
created_at: import("@sinclair/typebox").TString;
|
|
224
|
+
activity_ref: import("@sinclair/typebox").TString;
|
|
225
|
+
}>]>, import("@sinclair/typebox").TNull]>;
|
|
226
|
+
}>;
|
|
227
|
+
contentType?: never;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
parameters?: never;
|
|
231
|
+
requestBody?: never;
|
|
232
|
+
} | {
|
|
233
|
+
method: "get";
|
|
234
|
+
path: string;
|
|
235
|
+
summary: string;
|
|
236
|
+
tags: string[];
|
|
237
|
+
parameters: import("@tutti/shared/schemas/api").BrowserFacingOpenApiParameter[];
|
|
238
|
+
responses: {
|
|
239
|
+
200: {
|
|
240
|
+
description: string;
|
|
241
|
+
schema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
242
|
+
status: import("@sinclair/typebox").TLiteral<"queued">;
|
|
243
|
+
phase: import("@sinclair/typebox").TLiteral<"queue">;
|
|
244
|
+
operation: import("@sinclair/typebox").TObject<{
|
|
245
|
+
kind: import("@sinclair/typebox").TLiteral<"chat_answer">;
|
|
246
|
+
ref: import("@sinclair/typebox").TString;
|
|
247
|
+
}>;
|
|
248
|
+
revision: import("@sinclair/typebox").TInteger;
|
|
249
|
+
created_at: import("@sinclair/typebox").TString;
|
|
250
|
+
updated_at: import("@sinclair/typebox").TString;
|
|
251
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
252
|
+
status: import("@sinclair/typebox").TLiteral<"running">;
|
|
253
|
+
phase: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"workspace_wait">, import("@sinclair/typebox").TLiteral<"answer">]>;
|
|
254
|
+
operation: import("@sinclair/typebox").TObject<{
|
|
255
|
+
kind: import("@sinclair/typebox").TLiteral<"chat_answer">;
|
|
256
|
+
ref: import("@sinclair/typebox").TString;
|
|
257
|
+
}>;
|
|
258
|
+
revision: import("@sinclair/typebox").TInteger;
|
|
259
|
+
created_at: import("@sinclair/typebox").TString;
|
|
260
|
+
updated_at: import("@sinclair/typebox").TString;
|
|
261
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
262
|
+
status: import("@sinclair/typebox").TLiteral<"succeeded">;
|
|
263
|
+
phase: import("@sinclair/typebox").TLiteral<"settled">;
|
|
264
|
+
response_message_id: import("@sinclair/typebox").TString;
|
|
265
|
+
operation: import("@sinclair/typebox").TObject<{
|
|
266
|
+
kind: import("@sinclair/typebox").TLiteral<"chat_answer">;
|
|
267
|
+
ref: import("@sinclair/typebox").TString;
|
|
268
|
+
}>;
|
|
269
|
+
revision: import("@sinclair/typebox").TInteger;
|
|
270
|
+
created_at: import("@sinclair/typebox").TString;
|
|
271
|
+
updated_at: import("@sinclair/typebox").TString;
|
|
272
|
+
}>, import("@sinclair/typebox").TObject<{
|
|
273
|
+
status: import("@sinclair/typebox").TLiteral<"failed">;
|
|
274
|
+
phase: import("@sinclair/typebox").TLiteral<"settled">;
|
|
275
|
+
failure: import("@sinclair/typebox").TObject<{
|
|
276
|
+
code: import("@sinclair/typebox").TString;
|
|
277
|
+
category: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"interrupted" | "capacity" | "access" | "configuration" | "dependency" | "internal">[]>;
|
|
278
|
+
recovery: import("@sinclair/typebox").TUnion<import("@sinclair/typebox").TLiteral<"resend_request" | "check_provider" | "restart_host" | "contact_support" | "none">[]>;
|
|
279
|
+
diagnostic_id: import("@sinclair/typebox").TString;
|
|
280
|
+
}>;
|
|
281
|
+
response_message_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
282
|
+
operation: import("@sinclair/typebox").TObject<{
|
|
283
|
+
kind: import("@sinclair/typebox").TLiteral<"chat_answer">;
|
|
284
|
+
ref: import("@sinclair/typebox").TString;
|
|
285
|
+
}>;
|
|
286
|
+
revision: import("@sinclair/typebox").TInteger;
|
|
287
|
+
created_at: import("@sinclair/typebox").TString;
|
|
288
|
+
updated_at: import("@sinclair/typebox").TString;
|
|
289
|
+
}>]>;
|
|
290
|
+
contentType?: never;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
querystring?: never;
|
|
294
|
+
requestBody?: never;
|
|
160
295
|
} | {
|
|
161
296
|
method: "get";
|
|
162
297
|
path: string;
|
|
@@ -176,8 +311,8 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
|
|
|
176
311
|
contentType?: never;
|
|
177
312
|
};
|
|
178
313
|
};
|
|
179
|
-
requestBody?: never;
|
|
180
314
|
parameters?: never;
|
|
315
|
+
requestBody?: never;
|
|
181
316
|
} | {
|
|
182
317
|
method: "post";
|
|
183
318
|
path: string;
|
|
@@ -236,8 +371,8 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
|
|
|
236
371
|
};
|
|
237
372
|
};
|
|
238
373
|
};
|
|
239
|
-
requestBody?: never;
|
|
240
374
|
parameters?: never;
|
|
375
|
+
requestBody?: never;
|
|
241
376
|
} | {
|
|
242
377
|
method: "get";
|
|
243
378
|
path: string;
|
|
@@ -282,8 +417,8 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
|
|
|
282
417
|
};
|
|
283
418
|
};
|
|
284
419
|
querystring?: never;
|
|
285
|
-
requestBody?: never;
|
|
286
420
|
parameters?: never;
|
|
421
|
+
requestBody?: never;
|
|
287
422
|
} | {
|
|
288
423
|
method: "get";
|
|
289
424
|
path: string;
|
|
@@ -324,8 +459,8 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
|
|
|
324
459
|
};
|
|
325
460
|
};
|
|
326
461
|
querystring?: never;
|
|
327
|
-
requestBody?: never;
|
|
328
462
|
parameters?: never;
|
|
463
|
+
requestBody?: never;
|
|
329
464
|
} | {
|
|
330
465
|
method: "get";
|
|
331
466
|
path: string;
|
|
@@ -438,8 +573,8 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
|
|
|
438
573
|
};
|
|
439
574
|
};
|
|
440
575
|
querystring?: never;
|
|
441
|
-
requestBody?: never;
|
|
442
576
|
parameters?: never;
|
|
577
|
+
requestBody?: never;
|
|
443
578
|
} | {
|
|
444
579
|
method: "get";
|
|
445
580
|
path: string;
|
|
@@ -893,6 +1028,7 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
|
|
|
893
1028
|
message: import("@sinclair/typebox").TString;
|
|
894
1029
|
retryable: import("@sinclair/typebox").TBoolean;
|
|
895
1030
|
details: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
1031
|
+
request_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
896
1032
|
}>;
|
|
897
1033
|
}>;
|
|
898
1034
|
};
|
|
@@ -928,6 +1064,7 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
|
|
|
928
1064
|
message: import("@sinclair/typebox").TString;
|
|
929
1065
|
retryable: import("@sinclair/typebox").TBoolean;
|
|
930
1066
|
details: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnknown>;
|
|
1067
|
+
request_id: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
931
1068
|
}>;
|
|
932
1069
|
}>;
|
|
933
1070
|
};
|
|
@@ -1882,6 +2019,9 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
|
|
|
1882
2019
|
readonly artifact_feedback: {
|
|
1883
2020
|
readonly type: "boolean";
|
|
1884
2021
|
};
|
|
2022
|
+
readonly request_status_v1: {
|
|
2023
|
+
readonly type: "boolean";
|
|
2024
|
+
};
|
|
1885
2025
|
};
|
|
1886
2026
|
};
|
|
1887
2027
|
};
|
|
@@ -2076,6 +2216,9 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
|
|
|
2076
2216
|
readonly artifact_feedback: {
|
|
2077
2217
|
readonly type: "boolean";
|
|
2078
2218
|
};
|
|
2219
|
+
readonly request_status_v1: {
|
|
2220
|
+
readonly type: "boolean";
|
|
2221
|
+
};
|
|
2079
2222
|
};
|
|
2080
2223
|
};
|
|
2081
2224
|
};
|
|
@@ -530,6 +530,9 @@ export declare const WorkspaceResponseSchema: {
|
|
|
530
530
|
readonly artifact_feedback: {
|
|
531
531
|
readonly type: "boolean";
|
|
532
532
|
};
|
|
533
|
+
readonly request_status_v1: {
|
|
534
|
+
readonly type: "boolean";
|
|
535
|
+
};
|
|
533
536
|
};
|
|
534
537
|
};
|
|
535
538
|
};
|
|
@@ -713,6 +716,9 @@ export declare const BootstrapResponseSchema: {
|
|
|
713
716
|
readonly artifact_feedback: {
|
|
714
717
|
readonly type: "boolean";
|
|
715
718
|
};
|
|
719
|
+
readonly request_status_v1: {
|
|
720
|
+
readonly type: "boolean";
|
|
721
|
+
};
|
|
716
722
|
};
|
|
717
723
|
};
|
|
718
724
|
};
|
|
@@ -1,10 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Value } from "@sinclair/typebox/value";
|
|
2
|
+
import { HostProjectBadRequestError } from "./errors.js";
|
|
3
|
+
import { readTaskCompileRequestStatus, readTaskCompileCommandRef, } from "../../../../control-plane/task-compile-request-status.js";
|
|
4
|
+
import { RunSchedulerNowBodySchema, CurrentWorklistSubmissionSchema, WorklistSubmissionQuerySchema, RunSchedulerNowResponseSchema, ScratchpadProjectionSchema, SubmitWorklistBodySchema, SubmitWorklistResponseSchema, WorklistProjectionSchema, } from "@tutti/shared/schemas/api";
|
|
2
5
|
import { readScratchpadProjection, readWorklistProjection, } from "../../../../collaboration-state/index.js";
|
|
3
6
|
import { executeIdempotentCommand } from "../../../command-idempotency/index.js";
|
|
4
7
|
import { HOST_PROJECT_API_BASE_PATH } from "./constants.js";
|
|
5
|
-
import { schedulerRunNowInvalidates, worklistSubmitInvalidates
|
|
8
|
+
import { schedulerRunNowInvalidates, worklistSubmitInvalidates } from "./invalidations.js";
|
|
6
9
|
import { requireControlPlane, requireHostProjectSession, requireProjectStore, } from "./session-requirements.js";
|
|
7
10
|
export function registerWorkflowRoutes(app, options) {
|
|
11
|
+
app.get(`${HOST_PROJECT_API_BASE_PATH}/worklist/submission`, {
|
|
12
|
+
preValidation: (request, _reply, done) => done(Value.Check(WorklistSubmissionQuerySchema, request.query)
|
|
13
|
+
? undefined
|
|
14
|
+
: new HostProjectBadRequestError("Request status query is invalid")),
|
|
15
|
+
schema: {
|
|
16
|
+
querystring: WorklistSubmissionQuerySchema,
|
|
17
|
+
response: { 200: CurrentWorklistSubmissionSchema },
|
|
18
|
+
},
|
|
19
|
+
}, (request, reply) => {
|
|
20
|
+
requireHostProjectSession(request, options);
|
|
21
|
+
reply.header("cache-control", "no-store");
|
|
22
|
+
const db = requireProjectStore(options).db;
|
|
23
|
+
const ref = request.query.command_id === undefined
|
|
24
|
+
? request.query.workflow_ref
|
|
25
|
+
: readTaskCompileCommandRef(db, request.query.command_id);
|
|
26
|
+
return {
|
|
27
|
+
request: request.query.command_id !== undefined && ref === undefined
|
|
28
|
+
? null
|
|
29
|
+
: readTaskCompileRequestStatus(db, requireControlPlane(options).getExecutionStatus(), ref),
|
|
30
|
+
};
|
|
31
|
+
});
|
|
8
32
|
app.get(`${HOST_PROJECT_API_BASE_PATH}/scratchpad`, {
|
|
9
33
|
schema: {
|
|
10
34
|
response: {
|
|
@@ -43,7 +67,14 @@ export function registerWorkflowRoutes(app, options) {
|
|
|
43
67
|
target_ref: "scratchpad:current",
|
|
44
68
|
payload: request.body.payload,
|
|
45
69
|
...(options.now === undefined ? {} : { now: options.now }),
|
|
46
|
-
execute: () =>
|
|
70
|
+
execute: (tx) => {
|
|
71
|
+
const result = controlPlane.startTaskCompile(request.body.payload);
|
|
72
|
+
const ref = result.result?.submission_ref;
|
|
73
|
+
if (ref !== undefined) {
|
|
74
|
+
tx.prepare("INSERT INTO task_compile_request_commands (command_id, workflow_ref) VALUES (?, ?)").run(request.body.command_id, ref);
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
},
|
|
47
78
|
});
|
|
48
79
|
const response = {
|
|
49
80
|
command_id: execution.command_id,
|
|
@@ -53,6 +84,11 @@ export function registerWorkflowRoutes(app, options) {
|
|
|
53
84
|
if (execution.result !== undefined) {
|
|
54
85
|
response.result = execution.result;
|
|
55
86
|
}
|
|
87
|
+
else if (execution.replayed) {
|
|
88
|
+
const ref = readTaskCompileCommandRef(store.db, request.body.command_id);
|
|
89
|
+
if (ref !== undefined)
|
|
90
|
+
response.result = { submission_ref: ref };
|
|
91
|
+
}
|
|
56
92
|
return response;
|
|
57
93
|
});
|
|
58
94
|
app.post(`${HOST_PROJECT_API_BASE_PATH}/scheduler/run-now`, {
|
|
@@ -4,6 +4,7 @@ import { HOST_MAINLINE_BRANCH } from "./constants.js";
|
|
|
4
4
|
function defaultCapabilities(options) {
|
|
5
5
|
const overrides = options.capabilities;
|
|
6
6
|
return {
|
|
7
|
+
request_status_v1: options.controlPlane !== undefined && (overrides?.request_status_v1 ?? true),
|
|
7
8
|
sse: overrides?.sse ?? true,
|
|
8
9
|
relay_join: overrides?.relay_join ?? true,
|
|
9
10
|
repo_viewer: overrides?.repo_viewer ?? false,
|
|
@@ -125,14 +125,20 @@ export function toApiErrorResponse(error) {
|
|
|
125
125
|
export function registerApiErrorHandler(app) {
|
|
126
126
|
app.setErrorHandler((error, request, reply) => {
|
|
127
127
|
if (getValidationArray(error) !== undefined) {
|
|
128
|
-
|
|
128
|
+
const response = toValidationErrorResponse(error);
|
|
129
|
+
if (/^[A-Za-z0-9_-]{1,128}$/u.test(request.id))
|
|
130
|
+
response.error.request_id = request.id;
|
|
131
|
+
void reply.status(400).send(response);
|
|
129
132
|
return;
|
|
130
133
|
}
|
|
131
134
|
const statusCode = statusCodeFromError(error);
|
|
132
135
|
if (statusCode >= 500) {
|
|
133
136
|
request.log.error({ err: error }, "Unhandled host request error");
|
|
134
137
|
}
|
|
135
|
-
|
|
138
|
+
const response = toApiErrorResponse(error);
|
|
139
|
+
if (/^[A-Za-z0-9_-]{1,128}$/u.test(request.id))
|
|
140
|
+
response.error.request_id = request.id;
|
|
141
|
+
void reply.status(statusCode).send(response);
|
|
136
142
|
});
|
|
137
143
|
}
|
|
138
144
|
//# sourceMappingURL=validation.js.map
|
|
@@ -139,7 +139,7 @@ export declare class LocalConsoleManagedProjectService {
|
|
|
139
139
|
}>;
|
|
140
140
|
validate(requestRef: string, context: LocalConsoleInvocationContext): Promise<{
|
|
141
141
|
validation: {
|
|
142
|
-
state: "failed" | "
|
|
142
|
+
state: "failed" | "succeeded" | "unknown" | "started";
|
|
143
143
|
installation_ref: string;
|
|
144
144
|
reason_code: "validation_started" | "validation_succeeded" | "validation_route_unavailable" | "validation_http_rejected" | "validation_response_invalid" | "validation_transport_unknown" | "validation_interrupted";
|
|
145
145
|
project_id: string;
|
|
@@ -34,7 +34,7 @@ export declare function validateNativePreparation(options: {
|
|
|
34
34
|
fetchImpl?: typeof fetch;
|
|
35
35
|
signal?: AbortSignal;
|
|
36
36
|
}): Promise<{
|
|
37
|
-
state: "failed" | "
|
|
37
|
+
state: "failed" | "succeeded" | "unknown" | "started";
|
|
38
38
|
installation_ref: string;
|
|
39
39
|
reason_code: "validation_started" | "validation_succeeded" | "validation_route_unavailable" | "validation_http_rejected" | "validation_response_invalid" | "validation_transport_unknown" | "validation_interrupted";
|
|
40
40
|
project_id: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
CREATE TABLE chat_requests (
|
|
2
|
+
enqueue_order INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
3
|
+
trigger_message_id TEXT NOT NULL UNIQUE REFERENCES messages(id),
|
|
4
|
+
status TEXT NOT NULL CHECK (status IN ('queued', 'running', 'succeeded', 'failed')),
|
|
5
|
+
phase TEXT NOT NULL CHECK (phase IN ('queue', 'workspace_wait', 'answer', 'settled')),
|
|
6
|
+
revision INTEGER NOT NULL DEFAULT 1 CHECK (revision > 0),
|
|
7
|
+
attempt_ref TEXT,
|
|
8
|
+
response_message_id TEXT UNIQUE REFERENCES messages(id),
|
|
9
|
+
failure_json TEXT,
|
|
10
|
+
created_at TEXT NOT NULL,
|
|
11
|
+
updated_at TEXT NOT NULL,
|
|
12
|
+
CHECK (
|
|
13
|
+
(status = 'queued' AND phase = 'queue' AND failure_json IS NULL AND response_message_id IS NULL) OR
|
|
14
|
+
(status = 'running' AND phase IN ('workspace_wait', 'answer') AND attempt_ref IS NOT NULL AND failure_json IS NULL AND response_message_id IS NULL) OR
|
|
15
|
+
(status = 'succeeded' AND phase = 'settled' AND response_message_id IS NOT NULL AND failure_json IS NULL) OR
|
|
16
|
+
(status = 'failed' AND phase = 'settled' AND failure_json IS NOT NULL)
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
CREATE INDEX chat_requests_pending ON chat_requests(status, enqueue_order);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
-- Identity / closure evidence only. Pending inputs, clarification and receipts
|
|
2
|
+
-- remain authoritative; this table does not schedule or replay work.
|
|
3
|
+
CREATE TABLE task_compile_requests (
|
|
4
|
+
workflow_ref TEXT PRIMARY KEY,
|
|
5
|
+
accepted_activity_ref TEXT NOT NULL,
|
|
6
|
+
current_activity_ref TEXT NOT NULL,
|
|
7
|
+
created_at TEXT NOT NULL,
|
|
8
|
+
failure_code TEXT CHECK (failure_code IN ('task_compile_failed', 'scratchpad_empty_after_refresh')),
|
|
9
|
+
closed_at TEXT,
|
|
10
|
+
CHECK ((failure_code IS NULL) = (closed_at IS NULL))
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
CREATE TABLE task_compile_request_commands (
|
|
14
|
+
command_id TEXT PRIMARY KEY REFERENCES command_idempotency_records(command_id),
|
|
15
|
+
workflow_ref TEXT NOT NULL REFERENCES task_compile_requests(workflow_ref)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
CREATE INDEX idx_task_compile_requests_latest ON task_compile_requests(created_at DESC);
|
|
19
|
+
|
|
20
|
+
-- Only live submissions have provable identity at migration time. Do not infer
|
|
21
|
+
-- failed historical requests from missing contexts or unrelated activities.
|
|
22
|
+
INSERT INTO task_compile_requests
|
|
23
|
+
(workflow_ref, accepted_activity_ref, current_activity_ref, created_at)
|
|
24
|
+
SELECT workflow_ref, accepted_activity_ref, accepted_activity_ref, requested_at
|
|
25
|
+
FROM pending_task_compile_submissions;
|
|
26
|
+
INSERT OR IGNORE INTO task_compile_requests
|
|
27
|
+
(workflow_ref, accepted_activity_ref, current_activity_ref, created_at)
|
|
28
|
+
SELECT workflow_ref, captured_by_activity_ref, captured_by_activity_ref, submitted_at
|
|
29
|
+
FROM active_task_compile_context;
|
|
30
|
+
|
|
31
|
+
-- Read requirement evidence, not an authorization/token mirror. Several model
|
|
32
|
+
-- invocations may encounter the same Integration-owned authorization request.
|
|
33
|
+
CREATE TABLE external_reference_access_requirements (
|
|
34
|
+
invocation_ref TEXT NOT NULL,
|
|
35
|
+
request_ref TEXT NOT NULL,
|
|
36
|
+
activity_ref TEXT,
|
|
37
|
+
authorization_ref TEXT NOT NULL,
|
|
38
|
+
profile TEXT NOT NULL CHECK (profile IN ('docx', 'wiki_docx', 'drive_file')),
|
|
39
|
+
observed_at TEXT NOT NULL,
|
|
40
|
+
PRIMARY KEY (invocation_ref, request_ref)
|
|
41
|
+
);
|
|
42
|
+
CREATE INDEX idx_external_reference_requirements_activity
|
|
43
|
+
ON external_reference_access_requirements(activity_ref);
|
|
44
|
+
|
|
45
|
+
CREATE TABLE chat_request_invocations (
|
|
46
|
+
message_id TEXT NOT NULL REFERENCES chat_requests(trigger_message_id),
|
|
47
|
+
attempt_ref TEXT NOT NULL,
|
|
48
|
+
invocation_ref TEXT NOT NULL,
|
|
49
|
+
PRIMARY KEY (message_id, attempt_ref)
|
|
50
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
-- A started automatic maintenance attempt is not automatically replayable.
|
|
2
|
+
-- Keys refer to task/result identities, not mutable repository HEAD or chat.
|
|
3
|
+
CREATE TABLE context_sync_completion_attempts (
|
|
4
|
+
batch_key TEXT PRIMARY KEY NOT NULL,
|
|
5
|
+
workflow_ref TEXT NOT NULL UNIQUE,
|
|
6
|
+
started_at TEXT NOT NULL
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
-- Static failure notices retain their language across queueing and recovery.
|
|
10
|
+
-- Older requests have no captured preference and retain the English fallback.
|
|
11
|
+
ALTER TABLE chat_requests ADD COLUMN notice_locale TEXT NOT NULL DEFAULT 'en'
|
|
12
|
+
CHECK (notice_locale IN ('en', 'zh-Hans', 'zh-Hant'));
|
package/migrations/README.md
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
|
|
14
14
|
## 当前 migrations
|
|
15
15
|
|
|
16
|
+
后续 `0021`/`0022`/`0023` 分别增加外部读取证据、clarification 投影 cursor 和协作语言 metadata。`0024_chat_requests.sql` 为普通 Chat 增加持久 FIFO、状态/阶段 CHECK、attempt/revision、原始与回复 message FK;不回填历史提问,不保存正文/prompt。`0025_task_compile_requests.sql` 增加 Submit identity/明确关闭证据、command 关联、外部授权 requirement 与 Chat attempt→invocation 关联;仅回填 live pending/captured submission,不重建历史状态/command,不复制 token 或授权状态。最新 `0026_context_sync_and_chat_locale.sql` 新增自动整理 batch/workflow/start attempt 记录(不回填历史),以及 Chat 内部有限 notice locale(旧行默认英文,不改状态或 revision)。恢复仍由原 owner 负责,见 [请求状态与恢复](../../../docs/system/request-status-and-recovery.md)。
|
|
17
|
+
|
|
16
18
|
- `0001_init.sql`:初始化本地 `tutti.sqlite`,包含协作 truth records、store metadata、command idempotency、clarification replay hint、索引和关键 trigger。
|
|
17
19
|
- `0002_allow_sealed_round_successor_note.sql`:允许 Control Plane 在 sealed clarification round 内追加只读 Tutti successor 结论消息,同时继续禁止人类补充消息写入 sealed round。
|
|
18
20
|
- `0003_drop_scratchpad_source_message_refs.sql`:从 Scratchpad 持久化中移除不再暴露给模型、API 或 UI 的来源消息追溯字段。
|
|
@@ -36,7 +38,7 @@
|
|
|
36
38
|
|
|
37
39
|
## 当前实现状态
|
|
38
40
|
|
|
39
|
-
-
|
|
41
|
+
- 当前 Host migrations 已到 `0026_context_sync_and_chat_locale.sql`,后续表的 owner 见上方说明。`0014` 明确采用开发数据库重建策略,不提供旧 Scratchpad source/cursor 数据兼容;`0016`–`0017`不回填既有 internal Chat message/agent response 的 external mapping/outbound intent,`0018`保留旧 intent 并阻止历史 status 回填,`0019`无损加入 structured card content,`0020`加入独立 managed Reference recovery checkpoint;`0024`不回填历史 Chat 请求,`0025`只回填 live submission identity,`0026`不推断旧任务已完成过文档检查。
|
|
40
42
|
- SQLite adapter、migration runner、checksum 校验、store metadata 初始化、transaction helper 与 command recovery scan helper 已实现。
|
|
41
43
|
- 协作 repository 与 Control Plane 已实现第一批业务读写;Phase 7 首批已复用 `0001_init.sql` 中的 `tasks.latest_run_result_id`、`task_details.result_json` 与 `run_results` 表完成 Run result / checks / promotion 摘要持久化。Control Plane recovery resolver 与 task-bound continuation / retry 复用现有 schema;新 Run 的 accepted checkpoint 业务 truth 继续写入最终 Run result / task detail result,Git tag / commit trailer 承担 crash recovery evidence。Timeline 默认从 `tasks`、`run_results` 与历史主群聊 `refs.worklist_feedback` 投影任务级审计节点,当前 task terminal Chat feedback 写入 `refs.task_result` 消息;`project_timeline_events` 只保留缺少稳定 record 的轻量可观测性事件和历史 reconcile 兼容记录。project workspace、working diff 与 ignored runtime state 都不进入 SQLite truth。`provider_usage_events` 只保存 token 计数、调用来源、模型名、记录时间和可空 anchor,不保存 provider secret、prompt 或 raw response。store 基础设施本身已经可以创建并迁移 `tutti.sqlite`。
|
|
42
44
|
|
|
@@ -48,6 +48,7 @@ export type RegisterRelayHostConnectionPayload = {
|
|
|
48
48
|
integration_development_bot_v1?: boolean;
|
|
49
49
|
integration_clarification_v1?: boolean;
|
|
50
50
|
feishu_supporting_reads_v1?: boolean;
|
|
51
|
+
request_status_v1?: boolean;
|
|
51
52
|
integration_external_references_v1?: boolean;
|
|
52
53
|
integration_attachment_ingestion_v1?: boolean;
|
|
53
54
|
integration_managed_reference_ingestion_v1?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./openapi.js";
|
|
2
2
|
export * from "./managed-account.js";
|
|
3
|
+
export * from "./operation-status.js";
|
|
3
4
|
export type * from "./types.js";
|
|
4
5
|
export { ARTIFACT_FEEDBACK_MAX_ANNOTATIONS, ARTIFACT_FEEDBACK_MAX_AUTHORED_TEXT_LENGTH, ARTIFACT_FEEDBACK_MAX_COMMENT_LENGTH, ARTIFACT_FEEDBACK_MAX_SERIALIZED_BYTES, ARTIFACT_FEEDBACK_MAX_SUMMARY_LENGTH, ArtifactElementAnchorSchema, ArtifactElementKindSchema, ArtifactElementTargetSchema, ArtifactFeedbackAnnotationSchema, ArtifactFeedbackCommandSchema, ArtifactFeedbackRefSchema, ArtifactSemanticContextSchema, ArtifactSemanticSnapshotSchema, ArtifactSemanticStateSchema, } from "./artifact-feedback.js";
|
|
5
6
|
export { CompleteDesktopEntryContinuationBodySchema, CompleteDesktopEntryContinuationResponseSchema, CreateDesktopEntryContinuationResponseSchema, DESKTOP_ENTRY_COMPLETION_TOKEN_LENGTH, DESKTOP_ENTRY_PAYLOAD_KEY_LENGTH, DESKTOP_ENTRY_SEALED_IV_LENGTH, DesktopEntryCompletionTokenSchema, DesktopEntryContinuationPendingProjectionSchema, DesktopEntryContinuationReadyProjectionSchema, DesktopEntryPayloadKeySchema, GetDesktopEntryContinuationResponseSchema, MAX_DESKTOP_ENTRY_SEALED_CIPHERTEXT_LENGTH, SealedDesktopEntryPayloadSchema, } from "./desktop-entry-continuations.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./openapi.js";
|
|
2
2
|
export * from "./managed-account.js";
|
|
3
|
+
export * from "./operation-status.js";
|
|
3
4
|
export { ARTIFACT_FEEDBACK_MAX_ANNOTATIONS, ARTIFACT_FEEDBACK_MAX_AUTHORED_TEXT_LENGTH, ARTIFACT_FEEDBACK_MAX_COMMENT_LENGTH, ARTIFACT_FEEDBACK_MAX_SERIALIZED_BYTES, ARTIFACT_FEEDBACK_MAX_SUMMARY_LENGTH, ArtifactElementAnchorSchema, ArtifactElementKindSchema, ArtifactElementTargetSchema, ArtifactFeedbackAnnotationSchema, ArtifactFeedbackCommandSchema, ArtifactFeedbackRefSchema, ArtifactSemanticContextSchema, ArtifactSemanticSnapshotSchema, ArtifactSemanticStateSchema, } from "./artifact-feedback.js";
|
|
4
5
|
export { CompleteDesktopEntryContinuationBodySchema, CompleteDesktopEntryContinuationResponseSchema, CreateDesktopEntryContinuationResponseSchema, DESKTOP_ENTRY_COMPLETION_TOKEN_LENGTH, DESKTOP_ENTRY_PAYLOAD_KEY_LENGTH, DESKTOP_ENTRY_SEALED_IV_LENGTH, DesktopEntryCompletionTokenSchema, DesktopEntryContinuationPendingProjectionSchema, DesktopEntryContinuationReadyProjectionSchema, DesktopEntryPayloadKeySchema, GetDesktopEntryContinuationResponseSchema, MAX_DESKTOP_ENTRY_SEALED_CIPHERTEXT_LENGTH, SealedDesktopEntryPayloadSchema, } from "./desktop-entry-continuations.js";
|
|
5
6
|
export { LOCAL_CONSOLE_ACCOUNT_HANDOFF_TOKEN_MAX_LENGTH, LOCAL_CONSOLE_ACCOUNT_HANDOFF_TOKEN_MIN_LENGTH, RegisterLocalConsoleAccountHandoffBodySchema, RegisterLocalConsoleAccountHandoffResponseSchema, } from "./local-console-account-handoffs.js";
|