@bobannomi/client 0.1.0 → 0.1.1

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/index.d.ts CHANGED
@@ -41,6 +41,58 @@ type JsonValue = null | boolean | number | string | JsonValue[] | {
41
41
  [key: string]: JsonValue;
42
42
  };
43
43
 
44
+ /** User-facing authorization presets, independent from read-only planning. */
45
+ type ApprovalMode = "ask" | "auto_review" | "full_access";
46
+ type WorkMode = "execute" | "plan";
47
+ interface ApprovalReviewResult {
48
+ decision: "approve" | "ask_user" | "deny";
49
+ risk: "low" | "medium" | "high" | "unknown";
50
+ authorization: "explicit" | "task_implied" | "missing";
51
+ reason: string;
52
+ }
53
+ /** Ordered user inputs already written to the model history of one Run. */
54
+ interface AppliedInputStateSnapshot {
55
+ revision: number;
56
+ inputIds: readonly string[];
57
+ }
58
+
59
+ /** A directory's actual filesystem identity, captured by trusted execution code. */
60
+ interface SessionExecutionRoot {
61
+ readonly canonicalRoot: string;
62
+ readonly rootIdentity: {
63
+ readonly dev: string;
64
+ readonly ino: string;
65
+ };
66
+ }
67
+ /** Execution provenance describes a business relationship; it grants no access. */
68
+ type SessionExecutionSource = {
69
+ readonly kind: "interactive";
70
+ } | {
71
+ readonly kind: "channel";
72
+ readonly conversationId: string;
73
+ } | {
74
+ readonly kind: "automation";
75
+ readonly service: string;
76
+ readonly sourceId: string;
77
+ } | {
78
+ readonly kind: "child";
79
+ readonly sessionId: string;
80
+ readonly runId: string;
81
+ readonly childId: string;
82
+ readonly postRunPurpose?: "review" | "maintenance";
83
+ } | {
84
+ readonly kind: "fork";
85
+ readonly sessionId: string;
86
+ readonly requestId: string;
87
+ };
88
+ /** Actual roots and business source captured when work is accepted, then copied to Input/Run. */
89
+ interface SessionExecutionBinding {
90
+ readonly version: 1;
91
+ readonly cwd: SessionExecutionRoot;
92
+ readonly settingsRoot: SessionExecutionRoot;
93
+ readonly source: SessionExecutionSource;
94
+ }
95
+
44
96
  /** How an agent explains findings and delivers results, independently of update timing. */
45
97
  type ReplyStyle = "collaborative" | "direct" | "explanatory";
46
98
 
@@ -154,63 +206,6 @@ interface SessionConfigurationOptions {
154
206
  }[];
155
207
  defaults: SessionConfigurationInput;
156
208
  }
157
- interface SessionConfigurationBinding {
158
- revision: number;
159
- /** Explicit creation choices plus subsequent editor deltas; never accepted as public metadata. */
160
- configurationInput?: SessionConfigurationInput;
161
- /** Original non-role defaults for fields that role selection can replace. */
162
- roleBaseConfiguration?: SessionConfigurationInput;
163
- effectiveConfiguration: ResolvedSessionConfiguration;
164
- resolvedResources: (ConfigurationResourceRef & {
165
- revision: string;
166
- })[];
167
- defaultsRevision: string;
168
- configurationRoot: {
169
- cwd: string;
170
- settingsRoot: string;
171
- };
172
- }
173
- interface ConfigurationResourceRef {
174
- kind: "model" | "role" | "tool" | "plugin" | "service" | "skill" | "mcp";
175
- id: string;
176
- }
177
-
178
- /** A directory's actual filesystem identity, captured by trusted execution code. */
179
- interface SessionExecutionRoot {
180
- readonly canonicalRoot: string;
181
- readonly rootIdentity: {
182
- readonly dev: string;
183
- readonly ino: string;
184
- };
185
- }
186
- /** Execution provenance describes a business relationship; it grants no access. */
187
- type SessionExecutionSource = {
188
- readonly kind: "interactive";
189
- } | {
190
- readonly kind: "channel";
191
- readonly conversationId: string;
192
- } | {
193
- readonly kind: "automation";
194
- readonly service: string;
195
- readonly sourceId: string;
196
- } | {
197
- readonly kind: "child";
198
- readonly sessionId: string;
199
- readonly runId: string;
200
- readonly childId: string;
201
- readonly postRunPurpose?: "review" | "maintenance";
202
- } | {
203
- readonly kind: "fork";
204
- readonly sessionId: string;
205
- readonly requestId: string;
206
- };
207
- /** Frozen alongside configuration when work is accepted, then copied to Input/Run. */
208
- interface SessionExecutionBinding {
209
- readonly version: 1;
210
- readonly cwd: SessionExecutionRoot;
211
- readonly settingsRoot: SessionExecutionRoot;
212
- readonly source: SessionExecutionSource;
213
- }
214
209
 
215
210
  type AttachmentAssetStatus = "importing" | "ready" | "failed" | "deleted";
216
211
  type AttachmentIntent = "auto" | "vision" | "ocr" | "document" | "tool_resource" | "workspace_reference";
@@ -328,7 +323,8 @@ interface SessionRecord {
328
323
  agent?: string;
329
324
  status: SessionStatus;
330
325
  metadata: Record<string, unknown> & {
331
- configurationBinding?: SessionConfigurationBinding;
326
+ configurationInput?: SessionConfigurationInput;
327
+ pluginIds?: string[];
332
328
  executionBinding?: SessionExecutionBinding;
333
329
  };
334
330
  createdAt: number;
@@ -354,7 +350,6 @@ interface SessionInputRecord {
354
350
  attachments: SessionInputAttachmentRecord[];
355
351
  promotedMessageId?: string;
356
352
  metadata: Record<string, unknown> & {
357
- configurationBinding?: SessionConfigurationBinding;
358
353
  executionBinding?: SessionExecutionBinding;
359
354
  };
360
355
  createdAt: number;
@@ -436,8 +431,8 @@ interface SessionRunRecord {
436
431
  finishedAt?: number;
437
432
  error?: string;
438
433
  metadata: Record<string, unknown> & {
439
- configurationBinding?: SessionConfigurationBinding;
440
434
  executionBinding?: SessionExecutionBinding;
435
+ appliedInputState?: AppliedInputStateSnapshot;
441
436
  };
442
437
  createdAt: number;
443
438
  updatedAt: number;
@@ -661,16 +656,6 @@ declare function readSessionModelRetryState(metadata: Record<string, unknown> |
661
656
  declare function isSupersededModelPart(part: SessionMessagePartRecord): boolean;
662
657
  declare function readSessionModelUsage(metadata: Record<string, unknown> | undefined): SessionModelUsageSummary | undefined;
663
658
 
664
- /** User-facing authorization presets, independent from read-only planning. */
665
- type ApprovalMode = "ask" | "auto_review" | "full_access";
666
- type WorkMode = "execute" | "plan";
667
- interface ApprovalReviewResult {
668
- decision: "approve" | "ask_user" | "deny";
669
- risk: "low" | "medium" | "high" | "unknown";
670
- authorization: "explicit" | "task_implied" | "missing";
671
- reason: string;
672
- }
673
-
674
659
  type SessionApiFormat = "anthropic" | "openai";
675
660
  type SessionRuntimeConfig = {
676
661
  model: string;
@@ -747,11 +732,15 @@ interface SessionResourceRevision {
747
732
  interface SessionActivityPage {
748
733
  dataScopeId: string;
749
734
  revision: string;
750
- nextCursor?: string;
735
+ /** Resume the instance event stream after this authorized snapshot. */
736
+ cursor: number;
751
737
  entries: {
752
738
  sessionId: string;
753
739
  latestSeq: number;
754
740
  status: string;
741
+ storage: "sqlite" | "memory";
742
+ lastRunStatus?: "completed" | "failed" | "interrupted";
743
+ attentionSeq: number;
755
744
  activeRunId?: string;
756
745
  pendingQuestionIds: string[];
757
746
  pendingApprovalIds: string[];
@@ -1443,6 +1432,11 @@ interface McpServerStatus {
1443
1432
  error?: string;
1444
1433
  }
1445
1434
  type SkillSource = "bundled" | "agent" | "project" | "personal" | "standard";
1435
+ interface SkillMarketplaceSelection {
1436
+ id: string;
1437
+ version: string;
1438
+ sha256: string;
1439
+ }
1446
1440
  interface SkillInfo {
1447
1441
  id: string;
1448
1442
  name: string;
@@ -1453,6 +1447,7 @@ interface SkillInfo {
1453
1447
  readOnly: boolean;
1454
1448
  projectPath?: string;
1455
1449
  projectName?: string;
1450
+ marketplace?: SkillMarketplaceSelection;
1456
1451
  }
1457
1452
  interface SkillProject {
1458
1453
  name: string;
@@ -1512,6 +1507,9 @@ type ModelProviderRequest = {
1512
1507
  } | {
1513
1508
  action: "createCustom";
1514
1509
  value: CustomModelProviderInput;
1510
+ } | {
1511
+ action: "syncAccount";
1512
+ value: CustomModelProviderInput;
1515
1513
  } | {
1516
1514
  action: "updateCustom";
1517
1515
  provider: string;
@@ -1641,6 +1639,7 @@ interface AttachmentRangeOptions {
1641
1639
  }
1642
1640
  declare function attachmentRangeHeader(range: AttachmentRangeOptions | undefined): string | undefined;
1643
1641
  declare class HttpTransport {
1642
+ #private;
1644
1643
  private protocolHandshake?;
1645
1644
  private protocolVerified;
1646
1645
  readonly baseUrl: string;
@@ -1724,13 +1723,22 @@ declare class ScheduleResource {
1724
1723
  signal?: AbortSignal;
1725
1724
  requestId?: string;
1726
1725
  }): Promise<ScheduledRunRecord>;
1726
+ /** Reads the exact manual request without starting work. A missing record does not authorize replay. */
1727
+ getTriggerTaskResult(id: string, requestId: string, options?: {
1728
+ signal?: AbortSignal;
1729
+ }): Promise<ScheduledRunRecord | null>;
1727
1730
  listRuns(options?: {
1728
1731
  taskId?: string;
1729
1732
  unread?: boolean;
1730
1733
  limit?: number;
1731
1734
  signal?: AbortSignal;
1732
1735
  }): Promise<ScheduledRunRecord[]>;
1736
+ /** Reads one run belonging to this task, regardless of how it was triggered. */
1737
+ getRun(taskId: string, runId: string, options?: {
1738
+ signal?: AbortSignal;
1739
+ }): Promise<ScheduledRunRecord | null>;
1733
1740
  setRunUnread(id: string, unread: boolean, options?: {
1741
+ taskId?: string;
1734
1742
  signal?: AbortSignal;
1735
1743
  }): Promise<ScheduledRunRecord>;
1736
1744
  }
@@ -1786,6 +1794,8 @@ interface DownloadAttachmentOptions {
1786
1794
  */
1787
1795
  interface SessionBucket {
1788
1796
  goal?: SessionGoal | null;
1797
+ /** Sequence of the latest Goal record, independent of its usage sequence. */
1798
+ goalEventSeq?: number;
1789
1799
  session?: SessionRecord;
1790
1800
  inputs: SessionInputRecord[];
1791
1801
  messages: SessionMessageRecord[];
@@ -1912,6 +1922,8 @@ interface AdmitClientPromptInput {
1912
1922
  id?: string;
1913
1923
  items: SessionUserInputItem[];
1914
1924
  delivery?: InputDelivery;
1925
+ /** Bind a follow-up to the running reply observed by the caller. */
1926
+ expectedActiveRunId?: string;
1915
1927
  outputSchema?: Record<string, unknown>;
1916
1928
  attachments?: AdmitPromptAttachmentInput[];
1917
1929
  metadata?: Record<string, unknown>;
@@ -2149,14 +2161,11 @@ declare class SessionManagementResource {
2149
2161
  getMutation(sessionId: string, requestId: string, options?: Options): Promise<SessionMutationPublicReceipt | null>;
2150
2162
  }
2151
2163
 
2152
- /** Generate a caller-stable id for one prompt admission attempt. */
2153
- declare function createPromptRequestId(): string;
2154
2164
  declare class SessionResource {
2155
2165
  private readonly transport;
2156
2166
  readonly resources: SessionManagementResource;
2157
2167
  readonly terminals: SessionTerminalResource;
2158
2168
  constructor(transport: HttpTransport);
2159
- private checkOutputSchema;
2160
2169
  /** `GET /sessions/search` - search saved conversation text without opening it. */
2161
2170
  search(options: SearchSessionsOptions & {
2162
2171
  signal?: AbortSignal;
@@ -2275,7 +2284,7 @@ declare class SessionResource {
2275
2284
  }): Promise<CancelQueuedPromptResponse>;
2276
2285
  /**
2277
2286
  * `POST /sessions/:id/runs/:runId/resume` — 显式重放一次中断 run 的原始 prompt。
2278
- * 不会继续旧 provider stream;服务端会创建一个带恢复溯源的新 input/run。
2287
+ * 服务端复用原 Input,创建一个带恢复来源的新 Run。旧模型连接已经结束。
2279
2288
  */
2280
2289
  resumeInterruptedRun(sessionId: string, runId: string, input?: ResumeInterruptedRunInput, options?: {
2281
2290
  signal?: AbortSignal;
@@ -2284,7 +2293,6 @@ declare class SessionResource {
2284
2293
  interrupt(sessionId: string, options?: {
2285
2294
  signal?: AbortSignal;
2286
2295
  expectedRunId?: string;
2287
- source?: "user" | "system";
2288
2296
  }): Promise<InterruptSessionResponse>;
2289
2297
  /** `POST /sessions/:id/compact` */
2290
2298
  compact(sessionId: string, options?: {
@@ -2325,6 +2333,9 @@ declare class SessionResource {
2325
2333
  applyGoalAction(sessionId: string, goalId: string, input: GoalActionInput): Promise<SessionGoal>;
2326
2334
  }
2327
2335
 
2336
+ /** Generate a caller-stable id for one prompt admission attempt. */
2337
+ declare function createPromptRequestId(): string;
2338
+
2328
2339
  declare class AttachmentResource {
2329
2340
  private readonly transport;
2330
2341
  constructor(transport: HttpTransport);