@cueloop/schema 0.1.0-alpha.100 → 0.1.0-alpha.101

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cueloop/schema",
3
- "version": "0.1.0-alpha.100",
3
+ "version": "0.1.0-alpha.101",
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": {
@@ -2,7 +2,7 @@ import type { AgentPermission, AgentTool, AgentConfigOption } from "./thread-age
2
2
 
3
3
  /** Harness events carry transcript data without exposing a provider's wire protocol. */
4
4
  export type AgentHarnessEvent =
5
- | { kind: "message"; id?: string; text: string }
5
+ | { kind: "message"; id?: string; text: string; replace?: boolean }
6
6
  | AgentHarnessDiagnostic
7
7
  | {
8
8
  kind: "tool";
@@ -24,10 +24,10 @@ export interface AgentHarnessResult {
24
24
  /** One harness connection owns initialization, session restore, and its subprocess. */
25
25
  export interface AgentHarnessConnection {
26
26
  start(): Promise<string>;
27
- prompt(text: string): Promise<AgentHarnessResult>;
27
+ prompt(text: string, requestId?: string): Promise<AgentHarnessResult>;
28
28
  cancel(): void;
29
29
  permission(requestId: string, optionId?: string): void;
30
- close(): void;
30
+ close(): void | Promise<void>;
31
31
  configure?(id: string, value: string): Promise<void>;
32
32
  }
33
33
 
@@ -45,6 +45,7 @@ export interface AgentHarnessAdapter {
45
45
  id: string;
46
46
  label: string;
47
47
  connect(options: AgentHarnessOptions): AgentHarnessConnection;
48
+ remove?(sessionId: string): void | Promise<void>;
48
49
  }
49
50
 
50
51
  /** Tools use the daemon API; call arguments and results are serialized JSON validated at the boundary. */
package/src/index.ts CHANGED
@@ -22,3 +22,4 @@ export { agentCommentRoot } from "./agent-comment";
22
22
  export * from "./agent-input";
23
23
 
24
24
  export * from "./harness-output-routing";
25
+ export type { SharedAgentRequest, SharedAgentFrame } from "./shared-agent";
package/src/path-view.ts CHANGED
@@ -91,15 +91,14 @@ export function sharePublicationView(
91
91
  ): Thread {
92
92
  const shared = viewFollowing(session, publication.shareBranch ?? session.history?.branch);
93
93
 
94
- return {
95
- ...shared,
96
- shares: [
97
- {
98
- id: session.id,
99
- requireAuth: publication.requireAuth,
100
- allowlist: publication.requireAuth ? publication.allowlist : [],
101
- shareBranch: shared.history?.branch ?? publication.shareBranch ?? MAIN_BRANCH,
102
- },
103
- ],
94
+ const link: ShareLink = {
95
+ id: session.id,
96
+ requireAuth: publication.requireAuth,
97
+ allowlist: publication.requireAuth ? publication.allowlist : [],
98
+ shareBranch: shared.history?.branch ?? publication.shareBranch ?? MAIN_BRANCH,
104
99
  };
100
+
101
+ if (publication.agentEnabled) link.agentEnabled = true;
102
+
103
+ return { ...shared, shares: [link] };
105
104
  }
@@ -0,0 +1,15 @@
1
+ import type { Thread } from "./types";
2
+ import type { AgentComment, AgentPromptRequest, ThreadAgentState } from "./thread-agent";
3
+
4
+ /** Gateway requests retain their identity until the owner durably accepts them. */
5
+ export interface SharedAgentRequest {
6
+ author: string;
7
+ params: AgentPromptRequest & { operationId: string };
8
+ comment?: AgentComment;
9
+ }
10
+
11
+ /** The owner receives a current artifact and the unacknowledged request outbox. */
12
+ export type SharedAgentFrame =
13
+ | { type: "hello"; shareId: string }
14
+ | { type: "requests"; thread: Thread; requests: SharedAgentRequest[] }
15
+ | { type: "state"; state: ThreadAgentState; accepted?: string[] };
@@ -43,6 +43,7 @@ export interface AgentPermission {
43
43
  export type AgentPhase =
44
44
  | { kind: "idle" }
45
45
  | { kind: "running" }
46
+ | { kind: "offline" }
46
47
  | { kind: "permission"; permission: AgentPermission }
47
48
  | { kind: "failed"; error: string };
48
49
 
@@ -67,6 +68,7 @@ export interface AgentSubmission {
67
68
  commentId?: string;
68
69
  messageId?: string;
69
70
  prompt: string;
71
+ harnessPrompt?: string;
70
72
  quote?: string;
71
73
  context?: string;
72
74
  status: "queued" | "running" | "completed" | "failed";
@@ -89,4 +91,7 @@ export interface AgentPromptRequest {
89
91
  context?: string;
90
92
  retry?: string;
91
93
  operationId?: string;
94
+ commentId?: string;
95
+ inputOnly?: boolean;
96
+ discussion?: string;
92
97
  }
package/src/types.ts CHANGED
@@ -274,7 +274,7 @@ export interface Identity {
274
274
  }
275
275
 
276
276
  /** A share link's public or private policy; a private link with an empty allowlist admits no viewers. */
277
- export type SharePolicy = Pick<ShareLink, "requireAuth" | "allowlist">;
277
+ export type SharePolicy = Pick<ShareLink, "requireAuth" | "allowlist" | "agentEnabled">;
278
278
 
279
279
  /**
280
280
  * One published share link for a thread. A thread can have several, each an
@@ -287,6 +287,7 @@ export interface ShareLink {
287
287
  name?: string;
288
288
  requireAuth: boolean;
289
289
  allowlist: string[];
290
+ agentEnabled?: boolean;
290
291
  owner?: string;
291
292
  shareBranch?: string;
292
293
  }