@cueloop/schema 0.1.0-alpha.98 → 0.1.0-alpha.99
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/package.json +1 -1
- package/src/agent-comment.ts +2 -0
- package/src/thread-agent.ts +16 -1
- package/src/types.ts +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cueloop/schema",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.99",
|
|
4
4
|
"description": "The Thread primitive: types, markdown block model, quote-primary anchors, feedback serialization",
|
|
5
5
|
"homepage": "https://github.com/mmurakaru/cueloop#readme",
|
|
6
6
|
"bugs": {
|
package/src/agent-comment.ts
CHANGED
|
@@ -5,8 +5,10 @@ import type { AgentComment, ThreadAgentState } from "./thread-agent";
|
|
|
5
5
|
/** Submitted bottom prompts are discussion roots without duplicating them in stored comments. */
|
|
6
6
|
export function agentCommentRoot(state: ThreadAgentState, id: string): AgentComment | undefined {
|
|
7
7
|
const comment = state.comments.find((entry) => entry.id === id);
|
|
8
|
+
|
|
8
9
|
if (comment) return comment;
|
|
9
10
|
const submission = state.submissions?.find((entry) => entry.id === id && entry.commentId === id);
|
|
11
|
+
|
|
10
12
|
if (!submission) return undefined;
|
|
11
13
|
const blocks = parseBlocks(submission.prompt);
|
|
12
14
|
const anchor = makeAnchor(blocks, 0, 0, Math.min(blocks[0]?.text.length ?? 0, 32768));
|
package/src/thread-agent.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Anchor } from "./types";
|
|
1
|
+
import type { Anchor, OperationReceipt } from "./types";
|
|
2
2
|
|
|
3
3
|
/** An agent message keeps its identity after streaming and across reconnects. */
|
|
4
4
|
export interface AgentMessage {
|
|
@@ -56,6 +56,10 @@ export interface ThreadAgentState {
|
|
|
56
56
|
tools: AgentTool[];
|
|
57
57
|
comments: AgentComment[];
|
|
58
58
|
submissions?: AgentSubmission[];
|
|
59
|
+
/** Original accepted submission identities survive acknowledgement loss and daemon restart. */
|
|
60
|
+
promptOperations?: (OperationReceipt<string[]> & {
|
|
61
|
+
outcome?: "completed" | "failed" | "cancelled";
|
|
62
|
+
})[];
|
|
59
63
|
configOptions?: AgentConfigOption[];
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -68,6 +72,8 @@ export interface AgentSubmission {
|
|
|
68
72
|
quote?: string;
|
|
69
73
|
context?: string;
|
|
70
74
|
status: "queued" | "running" | "completed" | "failed";
|
|
75
|
+
/** Explicit cancellation is terminal without changing legacy retry status. */
|
|
76
|
+
cancelled?: boolean;
|
|
71
77
|
}
|
|
72
78
|
|
|
73
79
|
/** Model and reasoning choices are advertised by the harness, never invented by the UI. */
|
|
@@ -78,3 +84,12 @@ export interface AgentConfigOption {
|
|
|
78
84
|
currentValue: string;
|
|
79
85
|
options: { value: string; name: string }[];
|
|
80
86
|
}
|
|
87
|
+
|
|
88
|
+
/** Prompt submission preserves operation identity while optional context remains separate from input. */
|
|
89
|
+
export interface AgentPromptRequest {
|
|
90
|
+
id: string;
|
|
91
|
+
text: string;
|
|
92
|
+
context?: string;
|
|
93
|
+
retry?: string;
|
|
94
|
+
operationId?: string;
|
|
95
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -226,6 +226,7 @@ export interface Annotation {
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
export const REVIEW_SEVERITIES = ["p0", "p1", "p2"] as const;
|
|
229
|
+
|
|
229
230
|
export type ReviewSeverity = (typeof REVIEW_SEVERITIES)[number];
|
|
230
231
|
|
|
231
232
|
/** Data needed to render and publish one agent-authored pull request comment. */
|
|
@@ -281,8 +282,16 @@ export interface PendingDelivery {
|
|
|
281
282
|
}
|
|
282
283
|
|
|
283
284
|
export const MESSAGE_OUTCOMES = ["comment", "approved", "changes_requested"] as const;
|
|
285
|
+
|
|
284
286
|
export type MessageOutcome = (typeof MESSAGE_OUTCOMES)[number];
|
|
285
287
|
|
|
288
|
+
/** Durable acceptance records are committed together with the mutation they identify. */
|
|
289
|
+
export interface OperationReceipt<Result> {
|
|
290
|
+
operationId: string;
|
|
291
|
+
fingerprint: string;
|
|
292
|
+
result: Result;
|
|
293
|
+
}
|
|
294
|
+
|
|
286
295
|
export interface Message {
|
|
287
296
|
/** Stable identity used to deduplicate at-least-once harness delivery. */
|
|
288
297
|
id: string;
|
|
@@ -387,6 +396,8 @@ export interface Thread {
|
|
|
387
396
|
* progress. Undefined = the walk never started.
|
|
388
397
|
*/
|
|
389
398
|
viewedPaths?: string[];
|
|
399
|
+
/** Acceptance receipts persist atomically with review messages for safe explicit retries. */
|
|
400
|
+
messageOperations?: OperationReceipt<Message>[];
|
|
390
401
|
message: Message | null;
|
|
391
402
|
status: SessionStatus;
|
|
392
403
|
createdAt: string;
|