@xfey/tutti 0.1.15 → 0.1.16

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 (26) hide show
  1. package/dist/collaboration-state/index.d.ts +2 -2
  2. package/dist/collaboration-state/index.js +1 -1
  3. package/dist/collaboration-state/scratchpad.d.ts +2 -2
  4. package/dist/collaboration-state/scratchpad.js +94 -7
  5. package/dist/collaboration-state/storage-types.d.ts +14 -0
  6. package/dist/collaboration-state/types.d.ts +9 -1
  7. package/dist/control-plane/task-compile-output.js +7 -3
  8. package/dist/control-plane/task-compile-start.js +1 -1
  9. package/dist/server-shell/http/routes/project-api/openapi-collaboration-routes.d.ts +14 -1
  10. package/dist/server-shell/http/routes/project-api/openapi-workspace-routes.d.ts +14 -1
  11. package/dist/server-shell/http/routes/project-api/openapi.d.ts +28 -2
  12. package/dist/server-shell/http/routes/project-api/schemas.d.ts +14 -1
  13. package/migrations/0012_scratchpad_receipts.sql +31 -0
  14. package/migrations/README.md +2 -1
  15. package/node_modules/@tutti/shared/dist/schemas/api/index.d.ts +1 -1
  16. package/node_modules/@tutti/shared/dist/schemas/api/index.js +1 -1
  17. package/node_modules/@tutti/shared/dist/schemas/api/runtime-events.d.ts +14 -1
  18. package/node_modules/@tutti/shared/dist/schemas/api/types.d.ts +2 -1
  19. package/node_modules/@tutti/shared/dist/schemas/api/work-items.d.ts +24 -1
  20. package/node_modules/@tutti/shared/dist/schemas/api/work-items.js +15 -1
  21. package/node_modules/@tutti/shared/dist/schemas/api/workspace-commands.d.ts +28 -2
  22. package/package.json +1 -1
  23. package/web/assets/index-DoZOFmIq.js +29 -0
  24. package/web/assets/{index-CohZfGSh.css → index-mXkNKFjm.css} +1 -1
  25. package/web/index.html +2 -2
  26. package/web/assets/index-YQvFdpG8.js +0 -29
@@ -1,7 +1,7 @@
1
1
  export { CollaborationStateCursorError } from "./serialization.js";
2
2
  export { createIdleExecutionStatusProjection } from "./execution-status.js";
3
3
  export { createMainChatAgentMessage, createMainChatMessage, createMainChatSystemMessage, hasMainChatWorklistFeedbackMessage, readCompletedWorklistFeedbackTaskIds, readMessageProjectionById, readMainChatMessageWindow, readMainChatMessagesAfter, readMainChatMessagesAfterCursor, readMainChatMessagesBeforeCursor, } from "./messages.js";
4
- export { clearScratchpadProjection, createEmptyScratchpadProjection, readScratchpadProjection, upsertScratchpadProjection, } from "./scratchpad.js";
4
+ export { createEmptyScratchpadProjection, readScratchpadProjection, submitScratchpadProjection, upsertScratchpadProjection, } from "./scratchpad.js";
5
5
  export { advanceScratchpadTaskCompileSourceCursor, markScratchpadRefreshFailed, markScratchpadRefreshStarted, markScratchpadRefreshSucceeded, markScratchpadSourceDirty, readScratchpadSourceState, } from "./scratchpad-source-state.js";
6
6
  export { deleteStaleClarificationSubmitReplayHints, readActiveClarificationProjection, readClarificationRoundProjection, readClarificationRoundsForThread, readClarificationThreadResponse, readSealedClarificationRoundsWithoutSuccessor, readSubmittedTaskCompileClarificationRounds, readSubmittedTaskCompileClarificationRoundsAfterCursor, } from "./clarification-records.js";
7
7
  export { createClarificationRoundAgentMessage, createClarificationRoundMessage, readClarificationRoundMessagesWindow, } from "./clarification-messages.js";
@@ -13,5 +13,5 @@ export { recoverStaleRunningTasksAsFailed } from "./recovery.js";
13
13
  export { markReadStateScope, readReadStateSummary, recordReadNotificationEvent, } from "./read-state.js";
14
14
  export { readTaskDetailProjection } from "./task-details.js";
15
15
  export { applyTaskCompileProposal, markTaskRunStarted, readNextRunnableTask, readRecoverableScheduledRun, readTaskProjection, readWorklistProjection, } from "./worklist.js";
16
- export type { ApplyTaskCompileProposalResult, CloseTaskBoundClarificationRetaskingRequiredInput, CloseTaskBoundClarificationRetaskingRequiredResult, CreateClarificationRoundAgentMessageInput, CreateClarificationRoundMessageInput, CreateMainChatAgentMessageInput, CreateMainChatMessageInput, CreateMainChatSystemMessageInput, CursorPageOptions, MarkReadStateScopeInput, MarkReadStateScopeResult, MarkTaskRunStartedInput, MarkTaskRunStartedResult, MaterializeClarificationSuccessorInput, MaterializeTaskBoundRunSuccessorInput, MaterializeTaskBoundRunSuccessorResult, MessageAuthorInput, NextRunnableTaskResult, OpenNextTaskBoundClarificationRoundInput, OpenNextTaskBoundClarificationRoundResult, OpenNextTaskCompileClarificationRoundInput, OpenNextTaskCompileClarificationRoundResult, OpenTaskCompileClarificationRoundInput, OpenTaskCompileClarificationRoundResult, ReadMainChatMessagesAfterOptions, ReadMessageWindowOptions, ReadReadStateSummaryInput, RecoverStaleRunningTasksResult, RecoverableScheduledRun, RecordReadNotificationEventInput, RecordRecoverySummaryInput, RecordRecoverySummaryResult, RecordRunNeedsHumanResultInput, RecordRunNeedsHumanResultResult, RecordRunResultInput, RecordRunResultResult, RunResultPromotionProjection, ScratchpadSnapshotInput, SealedClarificationRoundWithoutSuccessor, SubmitClarificationRoundInput, TaskCompileProposalInput, TaskCompileProposalModuleInput, TaskCompileProposalTaskInput, } from "./types.js";
16
+ export type { ApplyTaskCompileProposalResult, CloseTaskBoundClarificationRetaskingRequiredInput, CloseTaskBoundClarificationRetaskingRequiredResult, CreateClarificationRoundAgentMessageInput, CreateClarificationRoundMessageInput, CreateMainChatAgentMessageInput, CreateMainChatMessageInput, CreateMainChatSystemMessageInput, CursorPageOptions, MarkReadStateScopeInput, MarkReadStateScopeResult, MarkTaskRunStartedInput, MarkTaskRunStartedResult, MaterializeClarificationSuccessorInput, MaterializeTaskBoundRunSuccessorInput, MaterializeTaskBoundRunSuccessorResult, MessageAuthorInput, NextRunnableTaskResult, OpenNextTaskBoundClarificationRoundInput, OpenNextTaskBoundClarificationRoundResult, OpenNextTaskCompileClarificationRoundInput, OpenNextTaskCompileClarificationRoundResult, OpenTaskCompileClarificationRoundInput, OpenTaskCompileClarificationRoundResult, ReadMainChatMessagesAfterOptions, ReadMessageWindowOptions, ReadReadStateSummaryInput, RecoverStaleRunningTasksResult, RecoverableScheduledRun, RecordReadNotificationEventInput, RecordRecoverySummaryInput, RecordRecoverySummaryResult, RecordRunNeedsHumanResultInput, RecordRunNeedsHumanResultResult, RecordRunResultInput, RecordRunResultResult, RunResultPromotionProjection, ScratchpadSnapshotInput, SubmitScratchpadInput, SubmitScratchpadResult, SealedClarificationRoundWithoutSuccessor, SubmitClarificationRoundInput, TaskCompileProposalInput, TaskCompileProposalModuleInput, TaskCompileProposalTaskInput, } from "./types.js";
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,7 @@
1
1
  export { CollaborationStateCursorError } from "./serialization.js";
2
2
  export { createIdleExecutionStatusProjection } from "./execution-status.js";
3
3
  export { createMainChatAgentMessage, createMainChatMessage, createMainChatSystemMessage, hasMainChatWorklistFeedbackMessage, readCompletedWorklistFeedbackTaskIds, readMessageProjectionById, readMainChatMessageWindow, readMainChatMessagesAfter, readMainChatMessagesAfterCursor, readMainChatMessagesBeforeCursor, } from "./messages.js";
4
- export { clearScratchpadProjection, createEmptyScratchpadProjection, readScratchpadProjection, upsertScratchpadProjection, } from "./scratchpad.js";
4
+ export { createEmptyScratchpadProjection, readScratchpadProjection, submitScratchpadProjection, upsertScratchpadProjection, } from "./scratchpad.js";
5
5
  export { advanceScratchpadTaskCompileSourceCursor, markScratchpadRefreshFailed, markScratchpadRefreshStarted, markScratchpadRefreshSucceeded, markScratchpadSourceDirty, readScratchpadSourceState, } from "./scratchpad-source-state.js";
6
6
  export { deleteStaleClarificationSubmitReplayHints, readActiveClarificationProjection, readClarificationRoundProjection, readClarificationRoundsForThread, readClarificationThreadResponse, readSealedClarificationRoundsWithoutSuccessor, readSubmittedTaskCompileClarificationRounds, readSubmittedTaskCompileClarificationRoundsAfterCursor, } from "./clarification-records.js";
7
7
  export { createClarificationRoundAgentMessage, createClarificationRoundMessage, readClarificationRoundMessagesWindow, } from "./clarification-messages.js";
@@ -1,8 +1,8 @@
1
1
  import type { ScratchpadProjection } from "@tutti/shared/schemas/api";
2
2
  import type { SqliteDatabase } from "../store/index.js";
3
- import type { ScratchpadSnapshotInput } from "./types.js";
3
+ import type { ScratchpadSnapshotInput, SubmitScratchpadInput } from "./types.js";
4
4
  export declare function createEmptyScratchpadProjection(): ScratchpadProjection;
5
5
  export declare function upsertScratchpadProjection(db: SqliteDatabase, input: ScratchpadSnapshotInput): ScratchpadProjection;
6
- export declare function clearScratchpadProjection(db: SqliteDatabase): ScratchpadProjection;
6
+ export declare function submitScratchpadProjection(db: SqliteDatabase, input: SubmitScratchpadInput): ScratchpadProjection;
7
7
  export declare function readScratchpadProjection(db: SqliteDatabase): ScratchpadProjection;
8
8
  //# sourceMappingURL=scratchpad.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { nowIso, parseJson, stringifyJson } from "./serialization.js";
2
+ const SCRATCHPAD_RECEIPT_LIMIT = 100;
2
3
  export function createEmptyScratchpadProjection() {
3
4
  return {
4
5
  id: "current",
@@ -8,8 +9,37 @@ export function createEmptyScratchpadProjection() {
8
9
  current_consensus: [],
9
10
  open_questions: [],
10
11
  task_changes: [],
12
+ receipts: [],
11
13
  };
12
14
  }
15
+ function readScratchpadReceipts(db) {
16
+ const rows = db
17
+ .prepare(`
18
+ SELECT
19
+ workflow_ref,
20
+ activity_ref,
21
+ topic,
22
+ background_summary,
23
+ current_consensus_json,
24
+ open_questions_json,
25
+ task_changes_json,
26
+ submitted_at
27
+ FROM scratchpad_receipts
28
+ ORDER BY submitted_at DESC, workflow_ref DESC
29
+ LIMIT ${SCRATCHPAD_RECEIPT_LIMIT}
30
+ `)
31
+ .all();
32
+ return rows.map((row) => ({
33
+ workflow_ref: row.workflow_ref,
34
+ activity_ref: row.activity_ref,
35
+ topic: row.topic,
36
+ background_summary: row.background_summary,
37
+ current_consensus: parseJson(row.current_consensus_json, []),
38
+ open_questions: parseJson(row.open_questions_json, []),
39
+ task_changes: parseJson(row.task_changes_json, []),
40
+ submitted_at: row.submitted_at,
41
+ }));
42
+ }
13
43
  export function upsertScratchpadProjection(db, input) {
14
44
  const updatedAt = nowIso(input.now);
15
45
  db.prepare(`
@@ -34,51 +64,108 @@ export function upsertScratchpadProjection(db, input) {
34
64
  ?
35
65
  )
36
66
  ON CONFLICT(id) DO UPDATE SET
67
+ state = 'ready',
37
68
  topic = excluded.topic,
38
69
  background_summary = excluded.background_summary,
39
70
  current_consensus_json = excluded.current_consensus_json,
40
71
  open_questions_json = excluded.open_questions_json,
41
72
  task_changes_json = excluded.task_changes_json,
42
73
  updated_by_activity_ref = excluded.updated_by_activity_ref,
43
- updated_at = excluded.updated_at
74
+ updated_at = excluded.updated_at,
75
+ submitted_by_activity_ref = NULL,
76
+ submitted_by_workflow_ref = NULL,
77
+ submitted_at = NULL
44
78
  `).run(input.topic, input.background_summary, stringifyJson(input.current_consensus), stringifyJson(input.open_questions), stringifyJson(input.task_changes), input.updated_by_activity_ref ?? null, updatedAt);
45
79
  return readScratchpadProjection(db);
46
80
  }
47
- export function clearScratchpadProjection(db) {
48
- db.prepare("DELETE FROM scratchpad WHERE id = 'current'").run();
49
- return createEmptyScratchpadProjection();
81
+ export function submitScratchpadProjection(db, input) {
82
+ const submittedAt = nowIso(input.now);
83
+ const scratchpad = readScratchpadProjection(db);
84
+ if (scratchpad.state === "empty") {
85
+ return scratchpad;
86
+ }
87
+ db.prepare(`
88
+ INSERT INTO scratchpad_receipts (
89
+ workflow_ref,
90
+ activity_ref,
91
+ topic,
92
+ background_summary,
93
+ current_consensus_json,
94
+ open_questions_json,
95
+ task_changes_json,
96
+ submitted_at
97
+ )
98
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)
99
+ ON CONFLICT(workflow_ref) DO UPDATE SET
100
+ activity_ref = excluded.activity_ref,
101
+ topic = excluded.topic,
102
+ background_summary = excluded.background_summary,
103
+ current_consensus_json = excluded.current_consensus_json,
104
+ open_questions_json = excluded.open_questions_json,
105
+ task_changes_json = excluded.task_changes_json,
106
+ submitted_at = excluded.submitted_at
107
+ `).run(input.workflow_ref, input.activity_ref, scratchpad.topic, scratchpad.background_summary, stringifyJson(scratchpad.current_consensus), stringifyJson(scratchpad.open_questions), stringifyJson(scratchpad.task_changes), submittedAt);
108
+ db.prepare(`
109
+ UPDATE scratchpad
110
+ SET
111
+ state = 'submitted',
112
+ submitted_by_activity_ref = ?,
113
+ submitted_by_workflow_ref = ?,
114
+ submitted_at = ?,
115
+ updated_at = ?
116
+ WHERE id = 'current'
117
+ `).run(input.activity_ref, input.workflow_ref, submittedAt, submittedAt);
118
+ return readScratchpadProjection(db);
50
119
  }
51
120
  export function readScratchpadProjection(db) {
121
+ const receipts = readScratchpadReceipts(db);
52
122
  const row = db
53
123
  .prepare(`
54
124
  SELECT
125
+ state,
55
126
  topic,
56
127
  background_summary,
57
128
  current_consensus_json,
58
129
  open_questions_json,
59
130
  task_changes_json,
60
131
  updated_by_activity_ref,
61
- updated_at
132
+ updated_at,
133
+ submitted_by_activity_ref,
134
+ submitted_by_workflow_ref,
135
+ submitted_at
62
136
  FROM scratchpad
63
137
  WHERE id = 'current'
64
138
  `)
65
139
  .get();
66
140
  if (row === undefined) {
67
- return createEmptyScratchpadProjection();
141
+ return {
142
+ ...createEmptyScratchpadProjection(),
143
+ receipts,
144
+ };
68
145
  }
69
146
  const scratchpad = {
70
147
  id: "current",
71
- state: "ready",
148
+ state: row.state,
72
149
  topic: row.topic,
73
150
  background_summary: row.background_summary,
74
151
  current_consensus: parseJson(row.current_consensus_json, []),
75
152
  open_questions: parseJson(row.open_questions_json, []),
76
153
  task_changes: parseJson(row.task_changes_json, []),
77
154
  updated_at: row.updated_at,
155
+ receipts,
78
156
  };
79
157
  if (row.updated_by_activity_ref !== null) {
80
158
  scratchpad.updated_by_activity_ref = row.updated_by_activity_ref;
81
159
  }
160
+ if (row.submitted_by_activity_ref !== null) {
161
+ scratchpad.submitted_by_activity_ref = row.submitted_by_activity_ref;
162
+ }
163
+ if (row.submitted_by_workflow_ref !== null) {
164
+ scratchpad.submitted_by_workflow_ref = row.submitted_by_workflow_ref;
165
+ }
166
+ if (row.submitted_at !== null) {
167
+ scratchpad.submitted_at = row.submitted_at;
168
+ }
82
169
  return scratchpad;
83
170
  }
84
171
  //# sourceMappingURL=scratchpad.js.map
@@ -13,6 +13,7 @@ export type MessageRow = {
13
13
  created_at: string;
14
14
  };
15
15
  export type ScratchpadRow = {
16
+ state: "ready" | "submitted";
16
17
  topic: string;
17
18
  background_summary: string;
18
19
  current_consensus_json: string;
@@ -20,6 +21,19 @@ export type ScratchpadRow = {
20
21
  task_changes_json: string;
21
22
  updated_by_activity_ref: string | null;
22
23
  updated_at: string;
24
+ submitted_by_activity_ref: string | null;
25
+ submitted_by_workflow_ref: string | null;
26
+ submitted_at: string | null;
27
+ };
28
+ export type ScratchpadReceiptRow = {
29
+ workflow_ref: string;
30
+ activity_ref: string;
31
+ topic: string;
32
+ background_summary: string;
33
+ current_consensus_json: string;
34
+ open_questions_json: string;
35
+ task_changes_json: string;
36
+ submitted_at: string;
23
37
  };
24
38
  export type ScratchpadSourceStateRow = {
25
39
  main_chat_cursor_created_at: string | null;
@@ -1,7 +1,7 @@
1
1
  import type { RunLineage } from "@tutti/shared/domain";
2
2
  import type { AccountAvatarProjection } from "@tutti/shared/domain";
3
3
  import type { ActivityRef, ClarificationRoundRef, TaskId, TaskModuleId, WorkflowInvocationRef } from "@tutti/shared/ids";
4
- import type { ClarificationRequestPayload, ClarificationRoundProjection, ClarificationSuccessorRef, ClarificationThreadProjection, MessageProjection, ReadStateScope, ReadStateSummaryProjection, RecoverySummaryProjection, RunResultProjection, TaskContractProjection, TaskDetailProjection, TaskDetailResultProjection, TaskProjection, WorklistProjection } from "@tutti/shared/schemas/api";
4
+ import type { ClarificationRequestPayload, ClarificationRoundProjection, ClarificationSuccessorRef, ClarificationThreadProjection, MessageProjection, ReadStateScope, ReadStateSummaryProjection, RecoverySummaryProjection, RunResultProjection, ScratchpadProjection, TaskContractProjection, TaskDetailProjection, TaskDetailResultProjection, TaskProjection, WorklistProjection } from "@tutti/shared/schemas/api";
5
5
  export type MessageAuthorInput = {
6
6
  kind: "human" | "system" | "agent";
7
7
  ref?: string;
@@ -56,6 +56,14 @@ export type ScratchpadSnapshotInput = {
56
56
  updated_by_activity_ref?: ActivityRef;
57
57
  now?: () => Date;
58
58
  };
59
+ export type SubmitScratchpadInput = {
60
+ workflow_ref: WorkflowInvocationRef;
61
+ activity_ref: ActivityRef;
62
+ now?: () => Date;
63
+ };
64
+ export type SubmitScratchpadResult = {
65
+ scratchpad: ScratchpadProjection;
66
+ };
59
67
  export type TaskCompileProposalInput = {
60
68
  workflow_ref: WorkflowInvocationRef;
61
69
  proposal: {
@@ -1,4 +1,4 @@
1
- import { applyTaskCompileProposal, clearScratchpadProjection, openNextTaskCompileClarificationRound, openTaskCompileClarificationRound, readWorklistProjection, } from "../collaboration-state/index.js";
1
+ import { applyTaskCompileProposal, openNextTaskCompileClarificationRound, openTaskCompileClarificationRound, readWorklistProjection, submitScratchpadProjection, } from "../collaboration-state/index.js";
2
2
  import { clarificationInvalidates, taskCompileInvalidates, } from "./invalidations.js";
3
3
  import { normalizeTaskCompileProposal } from "./task-proposal.js";
4
4
  const EMPTY_INITIAL_WORKLIST_CLARIFICATION = {
@@ -86,7 +86,11 @@ export function applyTaskCompileProcedureOutput(input) {
86
86
  if (applied.changed_task_ids.length > 0) {
87
87
  input.onTasksAdded?.();
88
88
  }
89
- const clearedScratchpad = clearScratchpadProjection(input.store.db);
89
+ const submittedScratchpad = submitScratchpadProjection(input.store.db, {
90
+ workflow_ref: input.workflowRef,
91
+ activity_ref: input.activityRef,
92
+ now: input.now,
93
+ });
90
94
  input.events.publish({
91
95
  event_type: "worklist.changed",
92
96
  payload: {
@@ -101,7 +105,7 @@ export function applyTaskCompileProcedureOutput(input) {
101
105
  input.events.publish({
102
106
  event_type: "scratchpad.updated",
103
107
  payload: {
104
- scratchpad: clearedScratchpad,
108
+ scratchpad: submittedScratchpad,
105
109
  activity_ref: input.activityRef,
106
110
  },
107
111
  invalidates: taskCompileInvalidates(),
@@ -51,7 +51,7 @@ export function startControlPlaneTaskCompile(options) {
51
51
  sourceBatch,
52
52
  });
53
53
  }
54
- if (scratchpad.state === "empty") {
54
+ if (scratchpad.state !== "ready") {
55
55
  return { disposition: { kind: "scratchpad_empty" } };
56
56
  }
57
57
  if (shouldInitializeProjectContext) {
@@ -88,7 +88,7 @@ export declare const HOST_PROJECT_COLLABORATION_OPENAPI_ROUTES: ({
88
88
  description: string;
89
89
  schema: import("@sinclair/typebox").TObject<{
90
90
  id: import("@sinclair/typebox").TLiteral<"current">;
91
- state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">]>;
91
+ state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"submitted">]>;
92
92
  topic: import("@sinclair/typebox").TString;
93
93
  background_summary: import("@sinclair/typebox").TString;
94
94
  current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
@@ -96,6 +96,19 @@ export declare const HOST_PROJECT_COLLABORATION_OPENAPI_ROUTES: ({
96
96
  task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
97
97
  updated_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
98
98
  updated_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
99
+ submitted_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
100
+ submitted_by_workflow_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
101
+ submitted_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
102
+ receipts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
103
+ workflow_ref: import("@sinclair/typebox").TString;
104
+ activity_ref: import("@sinclair/typebox").TString;
105
+ topic: import("@sinclair/typebox").TString;
106
+ background_summary: import("@sinclair/typebox").TString;
107
+ current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
108
+ open_questions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
109
+ task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
110
+ submitted_at: import("@sinclair/typebox").TString;
111
+ }>>;
99
112
  }>;
100
113
  contentType?: never;
101
114
  };
@@ -949,7 +949,7 @@ export declare const HOST_PROJECT_WORKSPACE_OPENAPI_ROUTES: ({
949
949
  readonly main_chat: import("@sinclair/typebox").TSchema;
950
950
  readonly scratchpad: import("@sinclair/typebox").TObject<{
951
951
  id: import("@sinclair/typebox").TLiteral<"current">;
952
- state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">]>;
952
+ state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"submitted">]>;
953
953
  topic: import("@sinclair/typebox").TString;
954
954
  background_summary: import("@sinclair/typebox").TString;
955
955
  current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
@@ -957,6 +957,19 @@ export declare const HOST_PROJECT_WORKSPACE_OPENAPI_ROUTES: ({
957
957
  task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
958
958
  updated_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
959
959
  updated_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
960
+ submitted_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
961
+ submitted_by_workflow_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
962
+ submitted_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
963
+ receipts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
964
+ workflow_ref: import("@sinclair/typebox").TString;
965
+ activity_ref: import("@sinclair/typebox").TString;
966
+ topic: import("@sinclair/typebox").TString;
967
+ background_summary: import("@sinclair/typebox").TString;
968
+ current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
969
+ open_questions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
970
+ task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
971
+ submitted_at: import("@sinclair/typebox").TString;
972
+ }>>;
960
973
  }>;
961
974
  readonly worklist: import("@sinclair/typebox").TObject<{
962
975
  modules: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
@@ -250,7 +250,7 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
250
250
  description: string;
251
251
  schema: import("@sinclair/typebox").TObject<{
252
252
  id: import("@sinclair/typebox").TLiteral<"current">;
253
- state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">]>;
253
+ state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"submitted">]>;
254
254
  topic: import("@sinclair/typebox").TString;
255
255
  background_summary: import("@sinclair/typebox").TString;
256
256
  current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
@@ -258,6 +258,19 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
258
258
  task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
259
259
  updated_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
260
260
  updated_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
261
+ submitted_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
262
+ submitted_by_workflow_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
263
+ submitted_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
264
+ receipts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
265
+ workflow_ref: import("@sinclair/typebox").TString;
266
+ activity_ref: import("@sinclair/typebox").TString;
267
+ topic: import("@sinclair/typebox").TString;
268
+ background_summary: import("@sinclair/typebox").TString;
269
+ current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
270
+ open_questions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
271
+ task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
272
+ submitted_at: import("@sinclair/typebox").TString;
273
+ }>>;
261
274
  }>;
262
275
  contentType?: never;
263
276
  };
@@ -2102,7 +2115,7 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
2102
2115
  readonly main_chat: import("@sinclair/typebox").TSchema;
2103
2116
  readonly scratchpad: import("@sinclair/typebox").TObject<{
2104
2117
  id: import("@sinclair/typebox").TLiteral<"current">;
2105
- state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">]>;
2118
+ state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"submitted">]>;
2106
2119
  topic: import("@sinclair/typebox").TString;
2107
2120
  background_summary: import("@sinclair/typebox").TString;
2108
2121
  current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
@@ -2110,6 +2123,19 @@ export declare const HOST_PROJECT_OPENAPI_ROUTES: ({
2110
2123
  task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
2111
2124
  updated_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
2112
2125
  updated_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
2126
+ submitted_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
2127
+ submitted_by_workflow_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
2128
+ submitted_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
2129
+ receipts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
2130
+ workflow_ref: import("@sinclair/typebox").TString;
2131
+ activity_ref: import("@sinclair/typebox").TString;
2132
+ topic: import("@sinclair/typebox").TString;
2133
+ background_summary: import("@sinclair/typebox").TString;
2134
+ current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
2135
+ open_questions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
2136
+ task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
2137
+ submitted_at: import("@sinclair/typebox").TString;
2138
+ }>>;
2113
2139
  }>;
2114
2140
  readonly worklist: import("@sinclair/typebox").TObject<{
2115
2141
  modules: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
@@ -931,7 +931,7 @@ export declare const BootstrapResponseSchema: {
931
931
  readonly main_chat: import("@sinclair/typebox").TSchema;
932
932
  readonly scratchpad: import("@sinclair/typebox").TObject<{
933
933
  id: import("@sinclair/typebox").TLiteral<"current">;
934
- state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">]>;
934
+ state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"submitted">]>;
935
935
  topic: import("@sinclair/typebox").TString;
936
936
  background_summary: import("@sinclair/typebox").TString;
937
937
  current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
@@ -939,6 +939,19 @@ export declare const BootstrapResponseSchema: {
939
939
  task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
940
940
  updated_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
941
941
  updated_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
942
+ submitted_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
943
+ submitted_by_workflow_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
944
+ submitted_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
945
+ receipts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
946
+ workflow_ref: import("@sinclair/typebox").TString;
947
+ activity_ref: import("@sinclair/typebox").TString;
948
+ topic: import("@sinclair/typebox").TString;
949
+ background_summary: import("@sinclair/typebox").TString;
950
+ current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
951
+ open_questions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
952
+ task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
953
+ submitted_at: import("@sinclair/typebox").TString;
954
+ }>>;
942
955
  }>;
943
956
  readonly worklist: import("@sinclair/typebox").TObject<{
944
957
  modules: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
@@ -0,0 +1,31 @@
1
+ ALTER TABLE scratchpad
2
+ ADD COLUMN state TEXT NOT NULL DEFAULT 'ready' CHECK (state IN ('ready', 'submitted'));
3
+
4
+ ALTER TABLE scratchpad
5
+ ADD COLUMN submitted_by_activity_ref TEXT;
6
+
7
+ ALTER TABLE scratchpad
8
+ ADD COLUMN submitted_by_workflow_ref TEXT;
9
+
10
+ ALTER TABLE scratchpad
11
+ ADD COLUMN submitted_at TEXT;
12
+
13
+ CREATE TABLE IF NOT EXISTS scratchpad_receipts (
14
+ workflow_ref TEXT PRIMARY KEY,
15
+ activity_ref TEXT NOT NULL,
16
+ topic TEXT NOT NULL,
17
+ background_summary TEXT NOT NULL,
18
+ current_consensus_json TEXT NOT NULL CHECK (
19
+ json_valid(current_consensus_json) AND json_type(current_consensus_json) = 'array'
20
+ ),
21
+ open_questions_json TEXT NOT NULL CHECK (
22
+ json_valid(open_questions_json) AND json_type(open_questions_json) = 'array'
23
+ ),
24
+ task_changes_json TEXT NOT NULL CHECK (
25
+ json_valid(task_changes_json) AND json_type(task_changes_json) = 'array'
26
+ ),
27
+ submitted_at TEXT NOT NULL
28
+ );
29
+
30
+ CREATE INDEX IF NOT EXISTS idx_scratchpad_receipts_submitted_at
31
+ ON scratchpad_receipts (submitted_at DESC, workflow_ref DESC);
@@ -24,10 +24,11 @@
24
24
  - `0009_project_timeline_events.sql`:新增 Timeline 专用 append-only durable event 表,用于记录缺少其他稳定 record 的 context sync、reference summary 与 promotion reconcile 轻量可观测性节点。
25
25
  - `0010_project_brief.sql`:新增 host-local Project Brief projection 表,用于保存四个 baseline Project Docs 的短摘要和 source fingerprint。
26
26
  - `0011_message_author_avatar.sql`:为消息作者增加可选 Relay account avatar 快照,保证跨浏览器查看历史消息时不依赖当前 viewer profile 或 presence sample。
27
+ - `0012_scratchpad_receipts.sql`:为当前 Scratchpad 增加 `submitted` 状态字段,并新增已提交 Scratchpad 小票历史表。
27
28
 
28
29
  ## 当前实现状态
29
30
 
30
- - `0001_init.sql`、`0002_allow_sealed_round_successor_note.sql`、`0003_drop_scratchpad_source_message_refs.sql`、`0004_read_state.sql`、`0005_provider_usage.sql`、`0006_scratchpad_source_state.sql`、`0007_workspace_signal_read_state_scopes.sql`、`0008_provider_usage_anchors.sql`、`0009_project_timeline_events.sql`、`0010_project_brief.sql` 与 `0011_message_author_avatar.sql` 已存在,代表当前 host project SQLite schema contract。
31
+ - `0001_init.sql`、`0002_allow_sealed_round_successor_note.sql`、`0003_drop_scratchpad_source_message_refs.sql`、`0004_read_state.sql`、`0005_provider_usage.sql`、`0006_scratchpad_source_state.sql`、`0007_workspace_signal_read_state_scopes.sql`、`0008_provider_usage_anchors.sql`、`0009_project_timeline_events.sql`、`0010_project_brief.sql`、`0011_message_author_avatar.sql` 与 `0012_scratchpad_receipts.sql` 已存在,代表当前 host project SQLite schema contract。
31
32
  - SQLite adapter、migration runner、checksum 校验、store metadata 初始化、transaction helper 与 command recovery scan helper 已实现。
32
33
  - 协作 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;deterministic promotion reconcile 的业务 truth 仍写入最终 Run result / task detail result,Timeline 轻量节点写入 `project_timeline_events`,merge workspace 不进入 SQLite truth。`provider_usage_events` 只保存 token 计数、调用来源、模型名、记录时间和可空 anchor,不保存 provider secret、prompt 或 raw response。store 基础设施本身已经可以创建并迁移 `tutti.sqlite`。
33
34
 
@@ -7,7 +7,7 @@ export { ProjectTimelineItemKindSchema, ProjectTimelineItemSchema, ProjectTimeli
7
7
  export { MAX_REFERENCE_STAGED_UPLOAD_BYTES, MAX_SKILL_ZIP_STAGED_UPLOAD_BYTES, MAX_STAGED_UPLOAD_BYTES, PresignedUploadPutSchema, ReferenceFileStartRelayUploadPayloadSchema, ReferenceStagedUploadReferenceProperties, RelayUploadProjectionSchema, RelayUploadPurposeSchema, Sha256DigestSchema, SkillZipStartRelayUploadPayloadSchema, SkillZipStagedUploadReferenceProperties, StagedUploadReferenceProperties, StagedUploadReferenceSchema, StartRelayUploadBodySchema, StartRelayUploadDispositionSchema, StartRelayUploadPayloadSchema, StartRelayUploadResponseSchema, StartRelayUploadResultSchema, maxStagedUploadBytesForPurpose, } from "./uploads.js";
8
8
  export { MarkReadBodySchema, MarkReadDispositionSchema, MarkReadPayloadSchema, MarkReadResponseSchema, MarkReadResultSchema, ReadStateScopeProjectionSchema, ReadStateScopeSchema, ReadStateSummaryProjectionSchema, } from "./read-state.js";
9
9
  export { GetMessagesRequestSchema, MessageAuthorSchema, MessageCreatedEventPayloadSchema, MessageKindSchema, MessageProjectionSchema, MessageReferenceFileRefSchema, MessageRefsSchema, MessageScopeSchema, MessageWindowSchema, ReferenceFileCategorySchema, SendMainChatMessageBodySchema, SendMainChatMessageCreatedDispositionSchema, SendMainChatMessageDispositionSchema, SendMainChatMessagePayloadSchema, SendMainChatMessageResponseSchema, SendMainChatMessageResultSchema, WorklistFeedbackItemSchema, WorklistFeedbackRefSchema, } from "./messages.js";
10
- export { CheckSkipReasonCodeSchema, ExternalSideEffectSummaryProjectionSchema, GetRecoverySummariesRequestSchema, GetRecoverySummariesResponseSchema, GetRecoverySummaryResponseSchema, RecoverySummaryProjectionSchema, ResultAnchorSchema, RunLineageSchema, RunResultProjectionSchema, ScratchpadProjectionSchema, TaskContractProjectionSchema, TaskDetailProjectionSchema, TaskDetailResultProjectionSchema, TaskModuleProjectionSchema, TaskProjectionSchema, TaskRunResultsPageSchema, TaskStatusSchema, WorklistProjectionSchema, } from "./work-items.js";
10
+ export { CheckSkipReasonCodeSchema, ExternalSideEffectSummaryProjectionSchema, GetRecoverySummariesRequestSchema, GetRecoverySummariesResponseSchema, GetRecoverySummaryResponseSchema, RecoverySummaryProjectionSchema, ResultAnchorSchema, RunLineageSchema, RunResultProjectionSchema, ScratchpadProjectionSchema, ScratchpadReceiptProjectionSchema, TaskContractProjectionSchema, TaskDetailProjectionSchema, TaskDetailResultProjectionSchema, TaskModuleProjectionSchema, TaskProjectionSchema, TaskRunResultsPageSchema, TaskStatusSchema, WorklistProjectionSchema, } from "./work-items.js";
11
11
  export { ActiveApprovalProjectionSchema, ApprovalCommandProjectionSchema, ApprovalDecisionKindSchema, ApprovalDecisionOptionProjectionSchema, ApprovalDecisionToneSchema, ApprovalFileChangeProjectionSchema, ApprovalPermissionsProjectionSchema, ApprovalRequestKindSchema, ApprovalRequestProjectionSchema, ApprovalResolutionOutcomeSchema, ApprovalResolutionProjectionSchema, DecideApprovalBodySchema, DecideApprovalDispositionSchema, DecideApprovalPayloadSchema, DecideApprovalResponseSchema, DecideApprovalResultSchema, } from "./approvals.js";
12
12
  export { ActiveClarificationProjectionSchema, ClarificationChangedEventPayloadSchema, ClarificationOwnerProjectionSchema, ClarificationRequestPayloadSchema, ClarificationRoundProjectionSchema, ClarificationRoundSummaryProjectionSchema, ClarificationSuccessorRefSchema, ClarificationThreadProjectionSchema, ContextRefSchema, GetClarificationRoundMessagesRequestSchema, GetClarificationRoundResponseSchema, GetClarificationThreadResponseSchema, HumanInteractionPayloadSchema, HumanRequestPayloadSchema, SendClarificationRoundMessageBodySchema, SendClarificationRoundMessageDispositionSchema, SendClarificationRoundMessagePayloadSchema, SendClarificationRoundMessageResponseSchema, SendClarificationRoundMessageResultSchema, SubmitClarificationRoundBodySchema, SubmitClarificationRoundDispositionSchema, SubmitClarificationRoundPayloadSchema, SubmitClarificationRoundResponseSchema, SubmitClarificationRoundResultSchema, } from "./clarifications.js";
13
13
  export { GetProjectDocRequestSchema, GetProjectDocResponseSchema, GetProjectDocsResponseSchema, GetReferenceFilesRequestSchema, GetReferenceFilesResponseSchema, GetViewerAssetRequestSchema, GetViewerFileRequestSchema, GetViewerFileResponseSchema, GetViewerTreeRequestSchema, GetViewerTreeResponseSchema, ProjectDocKeySchema, ProjectDocParamsSchema, ProjectDocSummaryProjectionSchema, ReferenceDirectoryProjectionSchema, ReferenceFileProjectionSchema, ReferenceSummaryProjectionSchema, ReferenceTextReadBlockedReasonSchema, RefreshReferenceSummariesBodySchema, RefreshReferenceSummariesDispositionSchema, RefreshReferenceSummariesPayloadSchema, RefreshReferenceSummariesResponseSchema, RefreshReferenceSummariesResultSchema, UploadReferenceFileBodySchema, UploadReferenceFileDispositionSchema, UploadReferenceFilePayloadSchema, UploadReferenceFileResponseSchema, UploadReferenceFileResultSchema, ViewerAssetVariantSchema, ViewerFileContentProjectionSchema, ViewerFileProjectionSchema, ViewerPageSchema, ViewerPathSchema, ViewerRepoSnapshotSchema, ViewerTreeEntryProjectionSchema, ViewerTreeTextReadBlockedReasonSchema, ViewerUnreadableReasonSchema, } from "./viewer-reference.js";
@@ -6,7 +6,7 @@ export { ProjectTimelineItemKindSchema, ProjectTimelineItemSchema, ProjectTimeli
6
6
  export { MAX_REFERENCE_STAGED_UPLOAD_BYTES, MAX_SKILL_ZIP_STAGED_UPLOAD_BYTES, MAX_STAGED_UPLOAD_BYTES, PresignedUploadPutSchema, ReferenceFileStartRelayUploadPayloadSchema, ReferenceStagedUploadReferenceProperties, RelayUploadProjectionSchema, RelayUploadPurposeSchema, Sha256DigestSchema, SkillZipStartRelayUploadPayloadSchema, SkillZipStagedUploadReferenceProperties, StagedUploadReferenceProperties, StagedUploadReferenceSchema, StartRelayUploadBodySchema, StartRelayUploadDispositionSchema, StartRelayUploadPayloadSchema, StartRelayUploadResponseSchema, StartRelayUploadResultSchema, maxStagedUploadBytesForPurpose, } from "./uploads.js";
7
7
  export { MarkReadBodySchema, MarkReadDispositionSchema, MarkReadPayloadSchema, MarkReadResponseSchema, MarkReadResultSchema, ReadStateScopeProjectionSchema, ReadStateScopeSchema, ReadStateSummaryProjectionSchema, } from "./read-state.js";
8
8
  export { GetMessagesRequestSchema, MessageAuthorSchema, MessageCreatedEventPayloadSchema, MessageKindSchema, MessageProjectionSchema, MessageReferenceFileRefSchema, MessageRefsSchema, MessageScopeSchema, MessageWindowSchema, ReferenceFileCategorySchema, SendMainChatMessageBodySchema, SendMainChatMessageCreatedDispositionSchema, SendMainChatMessageDispositionSchema, SendMainChatMessagePayloadSchema, SendMainChatMessageResponseSchema, SendMainChatMessageResultSchema, WorklistFeedbackItemSchema, WorklistFeedbackRefSchema, } from "./messages.js";
9
- export { CheckSkipReasonCodeSchema, ExternalSideEffectSummaryProjectionSchema, GetRecoverySummariesRequestSchema, GetRecoverySummariesResponseSchema, GetRecoverySummaryResponseSchema, RecoverySummaryProjectionSchema, ResultAnchorSchema, RunLineageSchema, RunResultProjectionSchema, ScratchpadProjectionSchema, TaskContractProjectionSchema, TaskDetailProjectionSchema, TaskDetailResultProjectionSchema, TaskModuleProjectionSchema, TaskProjectionSchema, TaskRunResultsPageSchema, TaskStatusSchema, WorklistProjectionSchema, } from "./work-items.js";
9
+ export { CheckSkipReasonCodeSchema, ExternalSideEffectSummaryProjectionSchema, GetRecoverySummariesRequestSchema, GetRecoverySummariesResponseSchema, GetRecoverySummaryResponseSchema, RecoverySummaryProjectionSchema, ResultAnchorSchema, RunLineageSchema, RunResultProjectionSchema, ScratchpadProjectionSchema, ScratchpadReceiptProjectionSchema, TaskContractProjectionSchema, TaskDetailProjectionSchema, TaskDetailResultProjectionSchema, TaskModuleProjectionSchema, TaskProjectionSchema, TaskRunResultsPageSchema, TaskStatusSchema, WorklistProjectionSchema, } from "./work-items.js";
10
10
  export { ActiveApprovalProjectionSchema, ApprovalCommandProjectionSchema, ApprovalDecisionKindSchema, ApprovalDecisionOptionProjectionSchema, ApprovalDecisionToneSchema, ApprovalFileChangeProjectionSchema, ApprovalPermissionsProjectionSchema, ApprovalRequestKindSchema, ApprovalRequestProjectionSchema, ApprovalResolutionOutcomeSchema, ApprovalResolutionProjectionSchema, DecideApprovalBodySchema, DecideApprovalDispositionSchema, DecideApprovalPayloadSchema, DecideApprovalResponseSchema, DecideApprovalResultSchema, } from "./approvals.js";
11
11
  export { ActiveClarificationProjectionSchema, ClarificationChangedEventPayloadSchema, ClarificationOwnerProjectionSchema, ClarificationRequestPayloadSchema, ClarificationRoundProjectionSchema, ClarificationRoundSummaryProjectionSchema, ClarificationSuccessorRefSchema, ClarificationThreadProjectionSchema, ContextRefSchema, GetClarificationRoundMessagesRequestSchema, GetClarificationRoundResponseSchema, GetClarificationThreadResponseSchema, HumanInteractionPayloadSchema, HumanRequestPayloadSchema, SendClarificationRoundMessageBodySchema, SendClarificationRoundMessageDispositionSchema, SendClarificationRoundMessagePayloadSchema, SendClarificationRoundMessageResponseSchema, SendClarificationRoundMessageResultSchema, SubmitClarificationRoundBodySchema, SubmitClarificationRoundDispositionSchema, SubmitClarificationRoundPayloadSchema, SubmitClarificationRoundResponseSchema, SubmitClarificationRoundResultSchema, } from "./clarifications.js";
12
12
  export { GetProjectDocRequestSchema, GetProjectDocResponseSchema, GetProjectDocsResponseSchema, GetReferenceFilesRequestSchema, GetReferenceFilesResponseSchema, GetViewerAssetRequestSchema, GetViewerFileRequestSchema, GetViewerFileResponseSchema, GetViewerTreeRequestSchema, GetViewerTreeResponseSchema, ProjectDocKeySchema, ProjectDocParamsSchema, ProjectDocSummaryProjectionSchema, ReferenceDirectoryProjectionSchema, ReferenceFileProjectionSchema, ReferenceSummaryProjectionSchema, ReferenceTextReadBlockedReasonSchema, RefreshReferenceSummariesBodySchema, RefreshReferenceSummariesDispositionSchema, RefreshReferenceSummariesPayloadSchema, RefreshReferenceSummariesResponseSchema, RefreshReferenceSummariesResultSchema, UploadReferenceFileBodySchema, UploadReferenceFileDispositionSchema, UploadReferenceFilePayloadSchema, UploadReferenceFileResponseSchema, UploadReferenceFileResultSchema, ViewerAssetVariantSchema, ViewerFileContentProjectionSchema, ViewerFileProjectionSchema, ViewerPageSchema, ViewerPathSchema, ViewerRepoSnapshotSchema, ViewerTreeEntryProjectionSchema, ViewerTreeTextReadBlockedReasonSchema, ViewerUnreadableReasonSchema, } from "./viewer-reference.js";
@@ -494,7 +494,7 @@ export declare const TaskDetailUpdatedEventPayloadSchema: import("@sinclair/type
494
494
  export declare const ScratchpadUpdatedEventPayloadSchema: import("@sinclair/typebox").TObject<{
495
495
  scratchpad: import("@sinclair/typebox").TObject<{
496
496
  id: import("@sinclair/typebox").TLiteral<"current">;
497
- state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">]>;
497
+ state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"empty">, import("@sinclair/typebox").TLiteral<"ready">, import("@sinclair/typebox").TLiteral<"submitted">]>;
498
498
  topic: import("@sinclair/typebox").TString;
499
499
  background_summary: import("@sinclair/typebox").TString;
500
500
  current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
@@ -502,6 +502,19 @@ export declare const ScratchpadUpdatedEventPayloadSchema: import("@sinclair/type
502
502
  task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
503
503
  updated_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
504
504
  updated_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
505
+ submitted_by_activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
506
+ submitted_by_workflow_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
507
+ submitted_at: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
508
+ receipts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
509
+ workflow_ref: import("@sinclair/typebox").TString;
510
+ activity_ref: import("@sinclair/typebox").TString;
511
+ topic: import("@sinclair/typebox").TString;
512
+ background_summary: import("@sinclair/typebox").TString;
513
+ current_consensus: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
514
+ open_questions: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
515
+ task_changes: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>;
516
+ submitted_at: import("@sinclair/typebox").TString;
517
+ }>>;
505
518
  }>;
506
519
  activity_ref: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
507
520
  }>;
@@ -7,7 +7,7 @@ import type { ProjectTimelineItemKindSchema, ProjectTimelineItemSchema, ProjectT
7
7
  import type { PresignedUploadPutSchema, RelayUploadProjectionSchema, RelayUploadPurposeSchema, Sha256DigestSchema, StagedUploadReferenceSchema, StartRelayUploadDispositionSchema, StartRelayUploadPayloadSchema, StartRelayUploadResultSchema } from "./uploads.js";
8
8
  import type { MarkReadDispositionSchema, MarkReadPayloadSchema, MarkReadResultSchema, ReadStateScopeProjectionSchema, ReadStateScopeSchema, ReadStateSummaryProjectionSchema } from "./read-state.js";
9
9
  import type { GetMessagesRequestSchema, MessageCreatedEventPayloadSchema, MessageProjectionSchema, MessageReferenceFileRefSchema, ReferenceFileCategorySchema, SendMainChatMessageCreatedDispositionSchema, SendMainChatMessageDispositionSchema, SendMainChatMessagePayloadSchema, SendMainChatMessageResultSchema, WorklistFeedbackItemSchema, WorklistFeedbackRefSchema } from "./messages.js";
10
- import type { CheckSkipReasonCodeSchema, ExternalSideEffectSummaryProjectionSchema, GetRecoverySummariesRequestSchema, GetRecoverySummaryResponseSchema, RecoverySummaryProjectionSchema, RunResultProjectionSchema, ScratchpadProjectionSchema, TaskContractProjectionSchema, TaskDetailProjectionSchema, TaskDetailResultProjectionSchema, TaskModuleProjectionSchema, TaskProjectionSchema, TaskStatusSchema, WorklistProjectionSchema } from "./work-items.js";
10
+ import type { CheckSkipReasonCodeSchema, ExternalSideEffectSummaryProjectionSchema, GetRecoverySummariesRequestSchema, GetRecoverySummaryResponseSchema, RecoverySummaryProjectionSchema, RunResultProjectionSchema, ScratchpadProjectionSchema, ScratchpadReceiptProjectionSchema, TaskContractProjectionSchema, TaskDetailProjectionSchema, TaskDetailResultProjectionSchema, TaskModuleProjectionSchema, TaskProjectionSchema, TaskStatusSchema, WorklistProjectionSchema } from "./work-items.js";
11
11
  import type { ActiveApprovalProjectionSchema, ApprovalCommandProjectionSchema, ApprovalDecisionKindSchema, ApprovalDecisionOptionProjectionSchema, ApprovalFileChangeProjectionSchema, ApprovalPermissionsProjectionSchema, ApprovalRequestKindSchema, ApprovalRequestProjectionSchema, ApprovalResolutionOutcomeSchema, ApprovalResolutionProjectionSchema, DecideApprovalDispositionSchema, DecideApprovalPayloadSchema, DecideApprovalResultSchema } from "./approvals.js";
12
12
  import type { ActiveClarificationProjectionSchema, ClarificationChangedEventPayloadSchema, ClarificationOwnerProjectionSchema, ClarificationRequestPayloadSchema, ClarificationRoundProjectionSchema, ClarificationRoundSummaryProjectionSchema, ClarificationSuccessorRefSchema, ClarificationThreadProjectionSchema, ContextRefSchema, GetClarificationRoundMessagesRequestSchema, GetClarificationRoundResponseSchema, GetClarificationThreadResponseSchema, HumanInteractionPayloadSchema, HumanRequestPayloadSchema, SendClarificationRoundMessageDispositionSchema, SendClarificationRoundMessagePayloadSchema, SendClarificationRoundMessageResultSchema, SubmitClarificationRoundDispositionSchema, SubmitClarificationRoundPayloadSchema, SubmitClarificationRoundResultSchema } from "./clarifications.js";
13
13
  import type { GetProjectDocRequestSchema, GetProjectDocResponseSchema, GetProjectDocsResponseSchema, GetReferenceFilesRequestSchema, GetReferenceFilesResponseSchema, GetViewerAssetRequestSchema, GetViewerFileRequestSchema, GetViewerFileResponseSchema, GetViewerTreeRequestSchema, GetViewerTreeResponseSchema, ProjectDocKeySchema, ProjectDocParamsSchema, ProjectDocSummaryProjectionSchema, ReferenceDirectoryProjectionSchema, ReferenceFileProjectionSchema, ReferenceSummaryProjectionSchema, ReferenceTextReadBlockedReasonSchema, RefreshReferenceSummariesDispositionSchema, RefreshReferenceSummariesPayloadSchema, RefreshReferenceSummariesResultSchema, UploadReferenceFileDispositionSchema, UploadReferenceFilePayloadSchema, UploadReferenceFileResultSchema, ViewerAssetVariantSchema, ViewerFileContentProjectionSchema, ViewerFileProjectionSchema, ViewerPathSchema, ViewerRepoSnapshotSchema, ViewerTreeEntryProjectionSchema, ViewerTreeTextReadBlockedReasonSchema, ViewerUnreadableReasonSchema } from "./viewer-reference.js";
@@ -110,6 +110,7 @@ export type GetMessagesRequest = Static<typeof GetMessagesRequestSchema>;
110
110
  export type SendMainChatMessageResponse = CommandResponse<SendMainChatMessageDisposition, SendMainChatMessageResult>;
111
111
  export type MessageCreatedEventPayload = Static<typeof MessageCreatedEventPayloadSchema>;
112
112
  export type ScratchpadProjection = Static<typeof ScratchpadProjectionSchema>;
113
+ export type ScratchpadReceiptProjection = Static<typeof ScratchpadReceiptProjectionSchema>;
113
114
  export type TaskStatus = Static<typeof TaskStatusSchema>;
114
115
  export type TaskModuleProjection = Static<typeof TaskModuleProjectionSchema>;
115
116
  export type TaskProjection = Static<typeof TaskProjectionSchema>;