@bobannomi/client 0.1.0-next.1 → 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;
@@ -1695,7 +1694,6 @@ declare function streamServerSentEvents<T>(open: () => Promise<ReadableStream<Ui
1695
1694
  declare class SseTransport {
1696
1695
  private readonly transport;
1697
1696
  constructor(transport: HttpTransport);
1698
- streamFromReader<T>(open: () => Promise<ReadableStream<Uint8Array>>, decode?: (value: unknown) => T): AsyncIterable<T>;
1699
1697
  stream<T>(url: string, options?: SseStreamOptions<T>): AsyncIterable<T>;
1700
1698
  }
1701
1699
 
@@ -1725,13 +1723,22 @@ declare class ScheduleResource {
1725
1723
  signal?: AbortSignal;
1726
1724
  requestId?: string;
1727
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>;
1728
1730
  listRuns(options?: {
1729
1731
  taskId?: string;
1730
1732
  unread?: boolean;
1731
1733
  limit?: number;
1732
1734
  signal?: AbortSignal;
1733
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>;
1734
1740
  setRunUnread(id: string, unread: boolean, options?: {
1741
+ taskId?: string;
1735
1742
  signal?: AbortSignal;
1736
1743
  }): Promise<ScheduledRunRecord>;
1737
1744
  }
@@ -1787,6 +1794,8 @@ interface DownloadAttachmentOptions {
1787
1794
  */
1788
1795
  interface SessionBucket {
1789
1796
  goal?: SessionGoal | null;
1797
+ /** Sequence of the latest Goal record, independent of its usage sequence. */
1798
+ goalEventSeq?: number;
1790
1799
  session?: SessionRecord;
1791
1800
  inputs: SessionInputRecord[];
1792
1801
  messages: SessionMessageRecord[];
@@ -1814,7 +1823,7 @@ interface BobanNomiClientState {
1814
1823
  /** 当前已应用到的最大事件序号,用作 SSE cursor。 */
1815
1824
  lastSeq: number;
1816
1825
  }
1817
- /** `syncEvents` / `streamEvents` 的过滤与取消选项。 */
1826
+ /** `syncEvents` 的过滤、取消与重连选项。 */
1818
1827
  interface EventSyncOptions {
1819
1828
  partView?: "summary";
1820
1829
  sessionId?: string;
@@ -1913,6 +1922,8 @@ interface AdmitClientPromptInput {
1913
1922
  id?: string;
1914
1923
  items: SessionUserInputItem[];
1915
1924
  delivery?: InputDelivery;
1925
+ /** Bind a follow-up to the running reply observed by the caller. */
1926
+ expectedActiveRunId?: string;
1916
1927
  outputSchema?: Record<string, unknown>;
1917
1928
  attachments?: AdmitPromptAttachmentInput[];
1918
1929
  metadata?: Record<string, unknown>;
@@ -2150,14 +2161,11 @@ declare class SessionManagementResource {
2150
2161
  getMutation(sessionId: string, requestId: string, options?: Options): Promise<SessionMutationPublicReceipt | null>;
2151
2162
  }
2152
2163
 
2153
- /** Generate a caller-stable id for one prompt admission attempt. */
2154
- declare function createPromptRequestId(): string;
2155
2164
  declare class SessionResource {
2156
2165
  private readonly transport;
2157
2166
  readonly resources: SessionManagementResource;
2158
2167
  readonly terminals: SessionTerminalResource;
2159
2168
  constructor(transport: HttpTransport);
2160
- private checkOutputSchema;
2161
2169
  /** `GET /sessions/search` - search saved conversation text without opening it. */
2162
2170
  search(options: SearchSessionsOptions & {
2163
2171
  signal?: AbortSignal;
@@ -2276,7 +2284,7 @@ declare class SessionResource {
2276
2284
  }): Promise<CancelQueuedPromptResponse>;
2277
2285
  /**
2278
2286
  * `POST /sessions/:id/runs/:runId/resume` — 显式重放一次中断 run 的原始 prompt。
2279
- * 不会继续旧 provider stream;服务端会创建一个带恢复溯源的新 input/run。
2287
+ * 服务端复用原 Input,创建一个带恢复来源的新 Run。旧模型连接已经结束。
2280
2288
  */
2281
2289
  resumeInterruptedRun(sessionId: string, runId: string, input?: ResumeInterruptedRunInput, options?: {
2282
2290
  signal?: AbortSignal;
@@ -2285,7 +2293,6 @@ declare class SessionResource {
2285
2293
  interrupt(sessionId: string, options?: {
2286
2294
  signal?: AbortSignal;
2287
2295
  expectedRunId?: string;
2288
- source?: "user" | "system";
2289
2296
  }): Promise<InterruptSessionResponse>;
2290
2297
  /** `POST /sessions/:id/compact` */
2291
2298
  compact(sessionId: string, options?: {
@@ -2326,6 +2333,9 @@ declare class SessionResource {
2326
2333
  applyGoalAction(sessionId: string, goalId: string, input: GoalActionInput): Promise<SessionGoal>;
2327
2334
  }
2328
2335
 
2336
+ /** Generate a caller-stable id for one prompt admission attempt. */
2337
+ declare function createPromptRequestId(): string;
2338
+
2329
2339
  declare class AttachmentResource {
2330
2340
  private readonly transport;
2331
2341
  constructor(transport: HttpTransport);
@@ -2425,7 +2435,7 @@ declare class EventResource {
2425
2435
  list(options?: ListEventsOptions & {
2426
2436
  signal?: AbortSignal;
2427
2437
  }): Promise<SessionEventRecord[]>;
2428
- stream(options?: EventSyncOptions & {
2438
+ stream(options?: Omit<EventSyncOptions, "reconnectDelayMs"> & {
2429
2439
  transportReconnect?: boolean;
2430
2440
  onOpen?: () => void;
2431
2441
  }): AsyncIterable<SessionEventRecord>;
@@ -2509,7 +2519,7 @@ interface SyncEventsClient {
2509
2519
  list(options?: ListEventsOptions & {
2510
2520
  signal?: AbortSignal;
2511
2521
  }): Promise<SessionEventRecord[]>;
2512
- stream(options?: EventSyncOptions & {
2522
+ stream(options?: Omit<EventSyncOptions, "reconnectDelayMs"> & {
2513
2523
  transportReconnect?: boolean;
2514
2524
  }): AsyncIterable<SessionEventRecord>;
2515
2525
  };