@crewx/sdk 0.9.0-rc.64 → 0.9.0-rc.66

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.
@@ -0,0 +1,74 @@
1
+ export type TaskLogMigrationMode = 'dry-run' | 'apply' | 'verify';
2
+ export declare const TASK_LOG_MIGRATION_TERMINAL_STATUSES: readonly ["success", "failed", "completed"];
3
+ export declare const TASK_LOG_MIGRATION_MIN_FREE_SPACE_BYTES: number;
4
+ export declare const TASK_LOG_MIGRATION_EVENT_ROW_BYTES = 256;
5
+ export type TaskLogVerificationIssueKind = 'malformed-blob' | 'mixed-source' | 'seq-gap' | 'duplicate-seq' | 'orphan-event' | 'count-mismatch' | 'source-invariant' | 'invalid-event';
6
+ export type TaskLogMigrationFailureKind = 'malformed' | 'mixed-source' | 'metadata' | 'invalid-source';
7
+ export interface TaskLogMigrationOptions {
8
+ mode: TaskLogMigrationMode;
9
+ dbPath?: string;
10
+ batchTasks?: number;
11
+ backupPath?: string;
12
+ }
13
+ export interface TaskLogMigrationFailure {
14
+ taskId: string;
15
+ reason: string;
16
+ kind?: TaskLogMigrationFailureKind;
17
+ }
18
+ export interface TaskLogVerificationIssue {
19
+ taskId: string | null;
20
+ kind: TaskLogVerificationIssueKind;
21
+ reason: string;
22
+ expected?: number;
23
+ actual?: number;
24
+ seq?: number;
25
+ }
26
+ export interface TaskLogVerificationReport {
27
+ checkedTasks: number;
28
+ eventSourceTasks: number;
29
+ blobSourceTasks: number;
30
+ eventCount: number;
31
+ orphanEventCount: number;
32
+ failedTasks: number;
33
+ issues: TaskLogVerificationIssue[];
34
+ }
35
+ export interface TaskLogMigrationReport {
36
+ mode: TaskLogMigrationMode;
37
+ ok: boolean;
38
+ dbPath: string;
39
+ backupPath?: string;
40
+ backupMethod?: 'sqlite-online-backup';
41
+ blockedReason?: string;
42
+ activeTaskCount: number;
43
+ taskCount: number;
44
+ candidateTaskCount: number;
45
+ eligibleTaskCount: number;
46
+ statusCounts: Record<string, number>;
47
+ deferredTaskCount: number;
48
+ deferredStatusCounts: Record<string, number>;
49
+ entryCount: number;
50
+ sourceBytes: number;
51
+ estimatedFreeSpaceBytes: number;
52
+ requiredFreeSpaceBytes: number;
53
+ availableFreeSpaceBytes: number;
54
+ minimumFreeSpaceReserveBytes: number;
55
+ freeSpaceGatePassed: boolean;
56
+ migratedTasks: number;
57
+ migratedEntries: number;
58
+ skippedTasks: number;
59
+ failedTasks: number;
60
+ malformedRows: TaskLogMigrationFailure[];
61
+ failures: TaskLogMigrationFailure[];
62
+ logicalSourceBytesRemoved: number;
63
+ warnings: string[];
64
+ remainingTaskCount: number;
65
+ verification?: TaskLogVerificationReport;
66
+ }
67
+ export declare function resolveTaskLogMigrationDbPath(dbPath?: string): string;
68
+ export declare function hasSufficientTaskLogMigrationFreeSpace(availableFreeSpaceBytes: number, estimatedFreeSpaceBytes: number): boolean;
69
+ export interface TaskLogWalCheckpointConnection {
70
+ pragma(pragma: string): unknown;
71
+ }
72
+ export declare function tryCheckpointTaskLogWal(db: TaskLogWalCheckpointConnection): string | undefined;
73
+ export declare function runTaskLogMigration(options: TaskLogMigrationOptions): Promise<TaskLogMigrationReport>;
74
+ export declare function taskLogBackupName(backupPath: string): string;
@@ -0,0 +1,44 @@
1
+ import { BaseSqliteRepository } from './base-sqlite-repository.js';
2
+ export type TaskLogStorage = 'blob' | 'events';
3
+ export interface TaskLogEntry {
4
+ timestamp: string;
5
+ level: string;
6
+ message: string;
7
+ }
8
+ export type RawTaskLogEntry = TaskLogEntry;
9
+ export type TaskLogRawEntry = TaskLogEntry;
10
+ export interface TaskLogState {
11
+ taskId: string;
12
+ source: TaskLogStorage;
13
+ revision: number;
14
+ lastSeq: number;
15
+ }
16
+ export interface TaskLogReadResult extends TaskLogState {
17
+ entries: TaskLogEntry[];
18
+ }
19
+ export interface TaskLogRepositoryContract {
20
+ appendLog(taskId: string, entry: TaskLogEntry): TaskLogState;
21
+ appendLogs(taskId: string, entries: readonly TaskLogEntry[]): TaskLogState;
22
+ readLogs(taskId: string): TaskLogReadResult | undefined;
23
+ readLogsTail(taskId: string, limit: number): TaskLogReadResult | undefined;
24
+ getLogState(taskId: string): TaskLogState | undefined;
25
+ }
26
+ export declare class TaskLogRepository extends BaseSqliteRepository implements TaskLogRepositoryContract {
27
+ private readonly dbPath?;
28
+ constructor(opts?: {
29
+ dbPath?: string;
30
+ dbRoot?: string;
31
+ });
32
+ resolveDbPath(): string;
33
+ private openHandle;
34
+ private findStateRow;
35
+ private findStateRowInTransaction;
36
+ private requireStateRowInTransaction;
37
+ appendLog(taskId: string, entry: TaskLogEntry): TaskLogState;
38
+ appendLogs(taskId: string, entries: readonly TaskLogEntry[]): TaskLogState;
39
+ getLogState(taskId: string): TaskLogState | undefined;
40
+ readLogs(taskId: string): TaskLogReadResult | undefined;
41
+ readLogsTail(taskId: string, limit: number): TaskLogReadResult | undefined;
42
+ readTail(taskId: string, limit: number): TaskLogReadResult | undefined;
43
+ private readLogsInternal;
44
+ }
@@ -1,5 +1,6 @@
1
1
  import { BaseSqliteRepository } from './base-sqlite-repository.js';
2
2
  import { tasks } from '../schema/index.js';
3
+ import type { TaskLogEntry, TaskLogReadResult, TaskLogState } from './task-log.repository.js';
3
4
  export type TaskRow = typeof tasks.$inferSelect;
4
5
  export type NewTask = typeof tasks.$inferInsert;
5
6
  export type TaskListRow = Pick<TaskRow, 'id' | 'thread_id' | 'agent_id' | 'status' | 'parent_task_id' | 'started_at' | 'completed_at' | 'duration_ms' | 'input_tokens' | 'output_tokens' | 'cost_usd' | 'error'>;
@@ -88,6 +89,7 @@ export interface ThreadChain {
88
89
  export declare const PID_NULL_REAP_GRACE_MS: number;
89
90
  export declare class TaskRepository extends BaseSqliteRepository {
90
91
  private readonly dbPath?;
92
+ private readonly taskLogRepository;
91
93
  private readonly pidNullObservedSince;
92
94
  constructor(opts?: {
93
95
  dbPath?: string;
@@ -138,6 +140,10 @@ export declare class TaskRepository extends BaseSqliteRepository {
138
140
  level: string;
139
141
  message: string;
140
142
  }): void;
143
+ appendLogs(taskId: string, entries: readonly TaskLogEntry[]): void;
144
+ readLogs(taskId: string): TaskLogReadResult | undefined;
145
+ readLogsTail(taskId: string, limit: number): TaskLogReadResult | undefined;
146
+ getLogState(taskId: string): TaskLogState | undefined;
141
147
  getRunningTasks(): TaskRow[];
142
148
  getAllTasks(): TaskRow[];
143
149
  getTask(id: string): TaskRow | undefined;
@@ -1,5 +1,6 @@
1
1
  export * from './workspaces.js';
2
2
  export * from './tasks.js';
3
+ export * from './task-log-events.js';
3
4
  export * from './threads.js';
4
5
  export * from './spans.js';
5
6
  export * from './tool-calls.js';
@@ -0,0 +1,119 @@
1
+ export declare const task_log_events: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
2
+ name: "task_log_events";
3
+ schema: undefined;
4
+ columns: {
5
+ id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
6
+ name: "id";
7
+ tableName: "task_log_events";
8
+ dataType: "number";
9
+ columnType: "SQLiteInteger";
10
+ data: number;
11
+ driverParam: number;
12
+ notNull: true;
13
+ hasDefault: true;
14
+ isPrimaryKey: true;
15
+ isAutoincrement: false;
16
+ hasRuntimeDefault: false;
17
+ enumValues: undefined;
18
+ baseColumn: never;
19
+ identity: undefined;
20
+ generated: undefined;
21
+ }, {}, {}>;
22
+ task_id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
23
+ name: "task_id";
24
+ tableName: "task_log_events";
25
+ dataType: "string";
26
+ columnType: "SQLiteText";
27
+ data: string;
28
+ driverParam: string;
29
+ notNull: true;
30
+ hasDefault: false;
31
+ isPrimaryKey: false;
32
+ isAutoincrement: false;
33
+ hasRuntimeDefault: false;
34
+ enumValues: [string, ...string[]];
35
+ baseColumn: never;
36
+ identity: undefined;
37
+ generated: undefined;
38
+ }, {}, {
39
+ length: number | undefined;
40
+ }>;
41
+ seq: import("drizzle-orm/sqlite-core").SQLiteColumn<{
42
+ name: "seq";
43
+ tableName: "task_log_events";
44
+ dataType: "number";
45
+ columnType: "SQLiteInteger";
46
+ data: number;
47
+ driverParam: number;
48
+ notNull: true;
49
+ hasDefault: false;
50
+ isPrimaryKey: false;
51
+ isAutoincrement: false;
52
+ hasRuntimeDefault: false;
53
+ enumValues: undefined;
54
+ baseColumn: never;
55
+ identity: undefined;
56
+ generated: undefined;
57
+ }, {}, {}>;
58
+ timestamp: import("drizzle-orm/sqlite-core").SQLiteColumn<{
59
+ name: "timestamp";
60
+ tableName: "task_log_events";
61
+ dataType: "string";
62
+ columnType: "SQLiteText";
63
+ data: string;
64
+ driverParam: string;
65
+ notNull: true;
66
+ hasDefault: false;
67
+ isPrimaryKey: false;
68
+ isAutoincrement: false;
69
+ hasRuntimeDefault: false;
70
+ enumValues: [string, ...string[]];
71
+ baseColumn: never;
72
+ identity: undefined;
73
+ generated: undefined;
74
+ }, {}, {
75
+ length: number | undefined;
76
+ }>;
77
+ level: import("drizzle-orm/sqlite-core").SQLiteColumn<{
78
+ name: "level";
79
+ tableName: "task_log_events";
80
+ dataType: "string";
81
+ columnType: "SQLiteText";
82
+ data: string;
83
+ driverParam: string;
84
+ notNull: true;
85
+ hasDefault: false;
86
+ isPrimaryKey: false;
87
+ isAutoincrement: false;
88
+ hasRuntimeDefault: false;
89
+ enumValues: [string, ...string[]];
90
+ baseColumn: never;
91
+ identity: undefined;
92
+ generated: undefined;
93
+ }, {}, {
94
+ length: number | undefined;
95
+ }>;
96
+ message: import("drizzle-orm/sqlite-core").SQLiteColumn<{
97
+ name: "message";
98
+ tableName: "task_log_events";
99
+ dataType: "string";
100
+ columnType: "SQLiteText";
101
+ data: string;
102
+ driverParam: string;
103
+ notNull: true;
104
+ hasDefault: false;
105
+ isPrimaryKey: false;
106
+ isAutoincrement: false;
107
+ hasRuntimeDefault: false;
108
+ enumValues: [string, ...string[]];
109
+ baseColumn: never;
110
+ identity: undefined;
111
+ generated: undefined;
112
+ }, {}, {
113
+ length: number | undefined;
114
+ }>;
115
+ };
116
+ dialect: "sqlite";
117
+ }>;
118
+ export type TaskLogEvent = typeof task_log_events.$inferSelect;
119
+ export type NewTaskLogEvent = typeof task_log_events.$inferInsert;
@@ -522,6 +522,59 @@ export declare const tasks: import("drizzle-orm/sqlite-core").SQLiteTableWithCol
522
522
  }, {}, {
523
523
  length: number | undefined;
524
524
  }>;
525
+ log_storage: import("drizzle-orm/sqlite-core").SQLiteColumn<{
526
+ name: "log_storage";
527
+ tableName: "tasks";
528
+ dataType: "string";
529
+ columnType: "SQLiteText";
530
+ data: "blob" | "events";
531
+ driverParam: string;
532
+ notNull: true;
533
+ hasDefault: true;
534
+ isPrimaryKey: false;
535
+ isAutoincrement: false;
536
+ hasRuntimeDefault: false;
537
+ enumValues: ["blob", "events"];
538
+ baseColumn: never;
539
+ identity: undefined;
540
+ generated: undefined;
541
+ }, {}, {
542
+ length: number | undefined;
543
+ }>;
544
+ last_log_seq: import("drizzle-orm/sqlite-core").SQLiteColumn<{
545
+ name: "last_log_seq";
546
+ tableName: "tasks";
547
+ dataType: "number";
548
+ columnType: "SQLiteInteger";
549
+ data: number;
550
+ driverParam: number;
551
+ notNull: true;
552
+ hasDefault: true;
553
+ isPrimaryKey: false;
554
+ isAutoincrement: false;
555
+ hasRuntimeDefault: false;
556
+ enumValues: undefined;
557
+ baseColumn: never;
558
+ identity: undefined;
559
+ generated: undefined;
560
+ }, {}, {}>;
561
+ log_revision: import("drizzle-orm/sqlite-core").SQLiteColumn<{
562
+ name: "log_revision";
563
+ tableName: "tasks";
564
+ dataType: "number";
565
+ columnType: "SQLiteInteger";
566
+ data: number;
567
+ driverParam: number;
568
+ notNull: true;
569
+ hasDefault: true;
570
+ isPrimaryKey: false;
571
+ isAutoincrement: false;
572
+ hasRuntimeDefault: false;
573
+ enumValues: undefined;
574
+ baseColumn: never;
575
+ identity: undefined;
576
+ generated: undefined;
577
+ }, {}, {}>;
525
578
  thread_id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
526
579
  name: "thread_id";
527
580
  tableName: "tasks";
@@ -1 +1 @@
1
- 'use strict';function m(){let e=[];return {events:e,async log(t,o){e.push({event:t,payload:o});}}}function f(){let e={debug:[],info:[],warn:[],error:[]};return {entries:e,debug(t,o){e.debug.push({msg:t,meta:o});},info(t,o){e.info.push({msg:t,meta:o});},warn(t,o){e.warn.push({msg:t,meta:o});},error(t,o){e.error.push({msg:t,meta:o});}}}function C(){let e=200,t,o,n={},r={status(i){return e=i,r},set(i,d){return n[i]=d,r},send(i){return o=i,r},json(i){return t=i,r},end(){return r},getStatusCode:()=>e,getJsonBody:()=>t,getSentBody:()=>o,getHeaders:()=>({...n})};return r}function h(){let e=[];return {routes:e,registerRoute(o,n,r){e.push({path:o,handler:n,opts:r});},async simulate(o,n,r=Buffer.alloc(0),i={},d={},p={}){let c=e.find(g=>g.path===n);if(!c)return {status:404,body:{error:"Not found"},headers:{}};let l={method:o,url:n,headers:i,body:r,params:d,query:p},u=C();return await c.handler(l,u),{status:u.getStatusCode(),body:u.getJsonBody()??u.getSentBody(),headers:u.getHeaders()}}}}function M(e){let t=new Map,o=n=>n.startsWith(`${e}::`)?n:`${e}::${n}`;return {async get(n){let r=t.get(o(n));return r?r.value:void 0},async set(n,r){t.set(o(n),{value:r});},async delete(n){return t.delete(o(n))},async list(n){let r=n?o(n):`${e}::`,i=[];for(let d of t.keys())d.startsWith(r)&&i.push(d.slice(e.length+2));return i}}}function x(e){return M(e)}function y(){let e=new Map;return {blobs:e,async put(t,o,n){return e.set(t,{data:o,contentType:n}),t},async get(t){let o=e.get(t);return o?o.data:void 0},async delete(t){return e.delete(t)}}}function A(e){let t=e.instanceId??"mock-instance",o=m(),n=f(),r=h(),i=x(t),d=y(),p=[],c=[],l=[],u={run:async()=>({output:""}),...e.agentRunner},g=new AbortController,P=async a=>(p.push(a),{accepted:true}),v=async a=>(c.push(a),{accepted:true}),w=async(a,R)=>{l.push({messageId:a,patch:R});},E=async a=>({userId:a,displayName:a}),O=async()=>{},b=async()=>({messageId:"mock-proactive",sentAt:Date.now()});return {instanceId:t,installationId:e.installationId,config:e.config,capabilities:new Set(e.capabilities??[]),log:n,agentRunner:u,db:i,storage:d,audit:o,abortSignal:e.abortSignal??g.signal,httpRouter:r,router:r,inbound:P,emitEvent:v,updateMessage:w,resolveUser:E,respondSync:O,proactive:b,inboundCalls:p,emittedEvents:c,sentMessages:l}}function D(){}var k={claude:{models:[{id:"claude-fable-5",name:"Claude Fable 5",contextWindowTokens:1e6,tier:"flagship",recommended:true},{id:"claude-opus-5",name:"Claude Opus 5",contextWindowTokens:1e6,tier:"flagship",recommended:true},{id:"claude-sonnet-5",name:"Claude Sonnet 5",contextWindowTokens:1e6,tier:"balanced",recommended:true},{id:"claude-opus-4-8[1m]",name:"Claude Opus 4.8",contextWindowTokens:1e6,tier:"flagship"},{id:"claude-opus-4-7[1m]",name:"Claude Opus 4.7",contextWindowTokens:1e6,tier:"flagship"},{id:"claude-opus-4-6[1m]",name:"Claude Opus 4.6",contextWindowTokens:1e6,tier:"flagship"},{id:"claude-sonnet-4-6[1m]",name:"Claude Sonnet 4.6",contextWindowTokens:1e6,tier:"balanced"},{id:"claude-haiku-4-5",name:"Claude Haiku 4.5",contextWindowTokens:2e5,tier:"speed"}],modes:[{id:"default",name:"Default",description:"Uses Claude's default permission handling with normal approval prompts."},{id:"acceptEdits",name:"Accept Edits",description:"Allows file edits without approval; other permission checks remain in place."},{id:"plan",name:"Plan",description:"Keeps Claude in plan mode so it can inspect and propose changes without applying them."},{id:"dontAsk",name:"Don't Ask",description:"Does not ask for permissions; only pre-approved tool actions can proceed."},{id:"bypassPermissions",name:"Bypass Permissions",description:"Bypasses Claude permission checks so tools can run without approval prompts."}],effort:["low","medium","high"],modelOverrides:{"claude-fable-5":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-opus-5":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-sonnet-5":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-opus-4-8[1m]":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-opus-4-7[1m]":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-opus-4-6[1m]":{effort:["low","medium","high","max"],defaultEffort:"high"},"claude-sonnet-4-6[1m]":{effort:["low","medium","high","max"],defaultEffort:"high"},"claude-haiku-4-5":{effort:[]}},providerOptions:[]},codex:{models:[{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",contextWindowTokens:105e4,tier:"flagship",recommended:true},{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",contextWindowTokens:105e4,tier:"balanced",recommended:true},{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",contextWindowTokens:105e4,tier:"speed",recommended:true},{id:"gpt-5.5",name:"GPT-5.5",contextWindowTokens:105e4,tier:"flagship"},{id:"gpt-5.4",name:"GPT-5.4",contextWindowTokens:105e4,tier:"flagship"},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",contextWindowTokens:4e5,tier:"speed"},{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",contextWindowTokens:4e5,tier:"flagship"},{id:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",contextWindowTokens:128e3,tier:"speed"}],modes:[{id:"agent",name:"Agent",description:"Uses the workspace-write sandbox; can read and modify workspace files without full machine access."},{id:"read-only",name:"Read Only",description:"Uses the read-only sandbox; can inspect files but cannot write to the workspace."},{id:"plan",name:"Plan",description:"Uses the read-only sandbox for planning and inspection; cannot write to the workspace."},{id:"agent-full-access",name:"Agent Full Access",description:"Bypasses approvals and the sandbox; can access and modify files beyond the workspace."},{id:"yolo",name:"YOLO",description:"Bypasses approvals and the sandbox for unrestricted execution and full filesystem access."}],effort:["minimal","low","medium","high"],modelOverrides:{"gpt-5.6-sol":{effort:["none","low","medium","high","xhigh","max"],defaultEffort:"xhigh"},"gpt-5.6-terra":{effort:["none","low","medium","high","xhigh","max"],defaultEffort:"high"},"gpt-5.6-luna":{effort:["none","low","medium","high","xhigh","max"],defaultEffort:"high"},"gpt-5.5":{effort:["minimal","low","medium","high","xhigh"],defaultEffort:"high"}},providerOptions:[]},opencode:{models:[],modes:[{id:"plan",name:"Plan",description:"Uses the plan agent without --auto; planning follows standard approval behavior."},{id:"plan-auto",name:"Plan \xB7 Auto",description:"Uses the plan agent with --auto; planning uses automatic approvals."},{id:"build",name:"Build",description:"Uses the build agent without --auto; work follows standard approval behavior."},{id:"build-auto",name:"Build \xB7 Auto",description:"Uses the build agent with --auto; work uses automatic approvals."}],effort:[],modelOverrides:{},providerOptions:[]},copilot:{models:[{id:"auto",name:"Auto"},{id:"claude-sonnet-5",name:"Claude Sonnet 5",contextWindowTokens:1e6,tier:"balanced"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",contextWindowTokens:1e6,tier:"balanced"},{id:"gpt-5.5",name:"GPT-5.5",contextWindowTokens:105e4,tier:"flagship"},{id:"gpt-5.4",name:"GPT-5.4",contextWindowTokens:105e4,tier:"flagship"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro",contextWindowTokens:1048576,tier:"flagship"}],modes:[{id:"interactive",name:"Interactive",description:"Passes --mode interactive; tool access follows Copilot's interactive mode behavior."},{id:"plan",name:"Plan",description:"Passes --mode plan; planning and permission behavior follow Copilot's plan mode."},{id:"autopilot",name:"Autopilot",description:"Passes --mode autopilot; execution behavior follows Copilot's autonomous mode."}],effort:["none","low","medium","high","xhigh","max"],modelOverrides:{},providerOptions:[]},antigravity:{models:[{id:"gemini-3.6-flash-high",name:"Gemini 3.6 Flash (High)",contextWindowTokens:1048576,tier:"balanced"},{id:"gemini-3.6-flash-medium",name:"Gemini 3.6 Flash (Medium)",contextWindowTokens:1048576,tier:"balanced"},{id:"gemini-3.6-flash-low",name:"Gemini 3.6 Flash (Low)",contextWindowTokens:1048576,tier:"balanced"},{id:"Gemini 3.5 Flash (Medium)",name:"Gemini 3.5 Flash (Medium)",contextWindowTokens:1048576,tier:"balanced"},{id:"Gemini 3.5 Flash (High)",name:"Gemini 3.5 Flash (High)",contextWindowTokens:1048576,tier:"balanced"},{id:"Gemini 3.5 Flash (Low)",name:"Gemini 3.5 Flash (Low)",contextWindowTokens:1048576,tier:"balanced"},{id:"Gemini 3.1 Pro (Low)",name:"Gemini 3.1 Pro (Low)",contextWindowTokens:1048576,tier:"flagship"},{id:"Gemini 3.1 Pro (High)",name:"Gemini 3.1 Pro (High)",contextWindowTokens:1048576,tier:"flagship"},{id:"Claude Sonnet 4.6 (Thinking)",name:"Claude Sonnet 4.6 (Thinking)",contextWindowTokens:1e6,tier:"balanced"},{id:"Claude Opus 4.6 (Thinking)",name:"Claude Opus 4.6 (Thinking)",contextWindowTokens:1e6,tier:"flagship"},{id:"GPT-OSS 120B (Medium)",name:"GPT-OSS 120B (Medium)",contextWindowTokens:128e3,tier:"balanced"}],modes:[],effort:[],modelOverrides:{},providerOptions:[]},grok:{models:[{id:"grok-4.6",name:"Grok 4.6",contextWindowTokens:5e5,tier:"flagship",recommended:true},{id:"grok-4.5",name:"Grok 4.5",contextWindowTokens:5e5,tier:"flagship"}],modes:[{id:"default",name:"Default",description:"Uses Grok's default permission handling."},{id:"acceptEdits",name:"Accept Edits",description:"Allows file edits without changing the selected sandbox profile."},{id:"auto",name:"Auto",description:"Uses Grok automatic permission handling."},{id:"dontAsk",name:"Don't Ask",description:"Does not ask for permission before tool execution."},{id:"bypassPermissions",name:"Bypass Permissions",description:"Bypasses Grok permission checks for tool execution."},{id:"plan",name:"Plan",description:"Keeps Grok in planning mode without applying changes."}],effort:["low","medium","high"],modelOverrides:{"grok-4.6":{effort:["low","medium","high","xhigh"],defaultEffort:"high"},"grok-4.5":{effort:["low","medium","high"],defaultEffort:"high"}},providerOptions:[{key:"alwaysApprove",type:"boolean"},{key:"sandbox",type:"enum",values:["workspace","read-only","off"]}]}};Object.fromEntries(Object.entries(k).map(([e,t])=>[e,t.models]));var L=[{baseModelId:"claude-opus-4-8",catalogModelId:"claude-opus-4-8[1m]"},{baseModelId:"claude-opus-4-7",catalogModelId:"claude-opus-4-7[1m]"},{baseModelId:"claude-opus-4-6",catalogModelId:"claude-opus-4-6[1m]"},{baseModelId:"claude-sonnet-4-6",catalogModelId:"claude-sonnet-4-6[1m]"}];new Map(L.map(({baseModelId:e,catalogModelId:t})=>[e,t]));function G(){}exports.createMockAudit=m;exports.createMockContext=A;exports.createMockLogger=f;exports.createMockRouter=h;exports.createMockStorage=y;exports.createMockStore=x;exports.resetModelsOverride=G;exports.resetPricingOverride=D;
1
+ 'use strict';function m(){let e=[];return {events:e,async log(t,o){e.push({event:t,payload:o});}}}function f(){let e={debug:[],info:[],warn:[],error:[]};return {entries:e,debug(t,o){e.debug.push({msg:t,meta:o});},info(t,o){e.info.push({msg:t,meta:o});},warn(t,o){e.warn.push({msg:t,meta:o});},error(t,o){e.error.push({msg:t,meta:o});}}}function C(){let e=200,t,o,n={},r={status(i){return e=i,r},set(i,d){return n[i]=d,r},send(i){return o=i,r},json(i){return t=i,r},end(){return r},getStatusCode:()=>e,getJsonBody:()=>t,getSentBody:()=>o,getHeaders:()=>({...n})};return r}function h(){let e=[];return {routes:e,registerRoute(o,n,r){e.push({path:o,handler:n,opts:r});},async simulate(o,n,r=Buffer.alloc(0),i={},d={},p={}){let c=e.find(g=>g.path===n);if(!c)return {status:404,body:{error:"Not found"},headers:{}};let l={method:o,url:n,headers:i,body:r,params:d,query:p},u=C();return await c.handler(l,u),{status:u.getStatusCode(),body:u.getJsonBody()??u.getSentBody(),headers:u.getHeaders()}}}}function M(e){let t=new Map,o=n=>n.startsWith(`${e}::`)?n:`${e}::${n}`;return {async get(n){let r=t.get(o(n));return r?r.value:void 0},async set(n,r){t.set(o(n),{value:r});},async delete(n){return t.delete(o(n))},async list(n){let r=n?o(n):`${e}::`,i=[];for(let d of t.keys())d.startsWith(r)&&i.push(d.slice(e.length+2));return i}}}function x(e){return M(e)}function y(){let e=new Map;return {blobs:e,async put(t,o,n){return e.set(t,{data:o,contentType:n}),t},async get(t){let o=e.get(t);return o?o.data:void 0},async delete(t){return e.delete(t)}}}function A(e){let t=e.instanceId??"mock-instance",o=m(),n=f(),r=h(),i=x(t),d=y(),p=[],c=[],l=[],u={run:async()=>({output:""}),...e.agentRunner},g=new AbortController,k=async a=>(p.push(a),{accepted:true}),v=async a=>(c.push(a),{accepted:true}),w=async(a,R)=>{l.push({messageId:a,patch:R});},E=async a=>({userId:a,displayName:a}),O=async()=>{},b=async()=>({messageId:"mock-proactive",sentAt:Date.now()});return {instanceId:t,installationId:e.installationId,config:e.config,capabilities:new Set(e.capabilities??[]),log:n,agentRunner:u,db:i,storage:d,audit:o,abortSignal:e.abortSignal??g.signal,httpRouter:r,router:r,inbound:k,emitEvent:v,updateMessage:w,resolveUser:E,respondSync:O,proactive:b,inboundCalls:p,emittedEvents:c,sentMessages:l}}function D(){}var P={claude:{models:[{id:"claude-fable-5",name:"Claude Fable 5",contextWindowTokens:1e6,tier:"flagship",recommended:true},{id:"claude-opus-5",name:"Claude Opus 5",contextWindowTokens:1e6,tier:"flagship",recommended:true},{id:"claude-sonnet-5",name:"Claude Sonnet 5",contextWindowTokens:1e6,tier:"balanced",recommended:true},{id:"claude-opus-4-8[1m]",name:"Claude Opus 4.8",contextWindowTokens:1e6,tier:"flagship"},{id:"claude-opus-4-7[1m]",name:"Claude Opus 4.7",contextWindowTokens:1e6,tier:"flagship"},{id:"claude-opus-4-6[1m]",name:"Claude Opus 4.6",contextWindowTokens:1e6,tier:"flagship"},{id:"claude-sonnet-4-6[1m]",name:"Claude Sonnet 4.6",contextWindowTokens:1e6,tier:"balanced"},{id:"claude-haiku-4-5",name:"Claude Haiku 4.5",contextWindowTokens:2e5,tier:"speed"}],modes:[{id:"default",name:"Default",description:"Uses Claude's default permission handling with normal approval prompts."},{id:"acceptEdits",name:"Accept Edits",description:"Allows file edits without approval; other permission checks remain in place."},{id:"plan",name:"Plan",description:"Keeps Claude in plan mode so it can inspect and propose changes without applying them."},{id:"dontAsk",name:"Don't Ask",description:"Does not ask for permissions; only pre-approved tool actions can proceed."},{id:"bypassPermissions",name:"Bypass Permissions",description:"Bypasses Claude permission checks so tools can run without approval prompts."}],effort:["low","medium","high"],modelOverrides:{"claude-fable-5":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-opus-5":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-sonnet-5":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-opus-4-8[1m]":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-opus-4-7[1m]":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-opus-4-6[1m]":{effort:["low","medium","high","max"],defaultEffort:"high"},"claude-sonnet-4-6[1m]":{effort:["low","medium","high","max"],defaultEffort:"high"},"claude-haiku-4-5":{effort:[]}},providerOptions:[]},codex:{models:[{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",contextWindowTokens:105e4,tier:"flagship",recommended:true},{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",contextWindowTokens:105e4,tier:"balanced",recommended:true},{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",contextWindowTokens:105e4,tier:"speed",recommended:true},{id:"gpt-5.5",name:"GPT-5.5",contextWindowTokens:105e4,tier:"flagship"},{id:"gpt-5.4",name:"GPT-5.4",contextWindowTokens:105e4,tier:"flagship"},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",contextWindowTokens:4e5,tier:"speed"},{id:"gpt-5.3-codex",name:"GPT-5.3 Codex",contextWindowTokens:4e5,tier:"flagship"},{id:"gpt-5.3-codex-spark",name:"GPT-5.3 Codex Spark",contextWindowTokens:128e3,tier:"speed"}],modes:[{id:"agent",name:"Agent",description:"Uses the workspace-write sandbox; can read and modify workspace files without full machine access."},{id:"read-only",name:"Read Only",description:"Uses the read-only sandbox; can inspect files but cannot write to the workspace."},{id:"plan",name:"Plan",description:"Uses the read-only sandbox for planning and inspection; cannot write to the workspace."},{id:"agent-full-access",name:"Agent Full Access",description:"Bypasses approvals and the sandbox; can access and modify files beyond the workspace."},{id:"yolo",name:"YOLO",description:"Bypasses approvals and the sandbox for unrestricted execution and full filesystem access."}],effort:["minimal","low","medium","high"],modelOverrides:{"gpt-5.6-sol":{effort:["none","low","medium","high","xhigh","max"],defaultEffort:"xhigh"},"gpt-5.6-terra":{effort:["none","low","medium","high","xhigh","max"],defaultEffort:"high"},"gpt-5.6-luna":{effort:["none","low","medium","high","xhigh","max"],defaultEffort:"high"},"gpt-5.5":{effort:["minimal","low","medium","high","xhigh"],defaultEffort:"high"}},providerOptions:[]},opencode:{models:[],modes:[{id:"plan",name:"Plan",description:"Uses the plan agent without --auto; planning follows standard approval behavior."},{id:"plan-auto",name:"Plan \xB7 Auto",description:"Uses the plan agent with --auto; planning uses automatic approvals."},{id:"build",name:"Build",description:"Uses the build agent without --auto; work follows standard approval behavior."},{id:"build-auto",name:"Build \xB7 Auto",description:"Uses the build agent with --auto; work uses automatic approvals."}],effort:[],modelOverrides:{},providerOptions:[]},copilot:{models:[{id:"auto",name:"Auto"},{id:"claude-sonnet-5",name:"Claude Sonnet 5",contextWindowTokens:1e6,tier:"balanced"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",contextWindowTokens:1e6,tier:"balanced"},{id:"gpt-5.5",name:"GPT-5.5",contextWindowTokens:105e4,tier:"flagship"},{id:"gpt-5.4",name:"GPT-5.4",contextWindowTokens:105e4,tier:"flagship"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro",contextWindowTokens:1048576,tier:"flagship"}],modes:[{id:"interactive",name:"Interactive",description:"Passes --mode interactive; tool access follows Copilot's interactive mode behavior."},{id:"plan",name:"Plan",description:"Passes --mode plan; planning and permission behavior follow Copilot's plan mode."},{id:"autopilot",name:"Autopilot",description:"Passes --mode autopilot; execution behavior follows Copilot's autonomous mode."}],effort:["none","low","medium","high","xhigh","max"],modelOverrides:{},providerOptions:[]},antigravity:{models:[{id:"gemini-3.6-flash-high",name:"Gemini 3.6 Flash (High)",contextWindowTokens:1048576,tier:"balanced"},{id:"gemini-3.6-flash-medium",name:"Gemini 3.6 Flash (Medium)",contextWindowTokens:1048576,tier:"balanced"},{id:"gemini-3.6-flash-low",name:"Gemini 3.6 Flash (Low)",contextWindowTokens:1048576,tier:"balanced"},{id:"Gemini 3.5 Flash (Medium)",name:"Gemini 3.5 Flash (Medium)",contextWindowTokens:1048576,tier:"balanced"},{id:"Gemini 3.5 Flash (High)",name:"Gemini 3.5 Flash (High)",contextWindowTokens:1048576,tier:"balanced"},{id:"Gemini 3.5 Flash (Low)",name:"Gemini 3.5 Flash (Low)",contextWindowTokens:1048576,tier:"balanced"},{id:"Gemini 3.1 Pro (Low)",name:"Gemini 3.1 Pro (Low)",contextWindowTokens:1048576,tier:"flagship"},{id:"Gemini 3.1 Pro (High)",name:"Gemini 3.1 Pro (High)",contextWindowTokens:1048576,tier:"flagship"},{id:"Claude Sonnet 4.6 (Thinking)",name:"Claude Sonnet 4.6 (Thinking)",contextWindowTokens:1e6,tier:"balanced"},{id:"Claude Opus 4.6 (Thinking)",name:"Claude Opus 4.6 (Thinking)",contextWindowTokens:1e6,tier:"flagship"},{id:"GPT-OSS 120B (Medium)",name:"GPT-OSS 120B (Medium)",contextWindowTokens:128e3,tier:"balanced"}],modes:[],effort:[],modelOverrides:{},providerOptions:[]},grok:{models:[{id:"grok-4.6",name:"Grok 4.6",contextWindowTokens:5e5,tier:"flagship",recommended:true},{id:"grok-4.5",name:"Grok 4.5",contextWindowTokens:5e5,tier:"flagship"}],modes:[{id:"default",name:"Default",description:"Uses Grok's default permission handling."},{id:"acceptEdits",name:"Accept Edits",description:"Allows file edits without changing the selected sandbox profile."},{id:"auto",name:"Auto",description:"Uses Grok automatic permission handling."},{id:"dontAsk",name:"Don't Ask",description:"Does not ask for permission before tool execution."},{id:"bypassPermissions",name:"Bypass Permissions",description:"Bypasses Grok permission checks for tool execution."},{id:"plan",name:"Plan",description:"Keeps Grok in planning mode without applying changes."}],effort:["low","medium","high"],modelOverrides:{"grok-4.6":{effort:["low","medium","high","xhigh"],defaultEffort:"high"},"grok-4.5":{effort:["low","medium","high"],defaultEffort:"high"}},providerOptions:[{key:"alwaysApprove",type:"boolean"},{key:"sandbox",type:"enum",values:["workspace","read-only","off"]}]}};Object.fromEntries(Object.entries(P).map(([e,t])=>[e,t.models]));var L=[{baseModelId:"claude-opus-4-8",catalogModelId:"claude-opus-4-8[1m]"},{baseModelId:"claude-opus-4-7",catalogModelId:"claude-opus-4-7[1m]"},{baseModelId:"claude-opus-4-6",catalogModelId:"claude-opus-4-6[1m]"},{baseModelId:"claude-sonnet-4-6",catalogModelId:"claude-sonnet-4-6[1m]"}];new Map(L.map(({baseModelId:e,catalogModelId:t})=>[e,t]));function G(){}exports.createMockAudit=m;exports.createMockContext=A;exports.createMockLogger=f;exports.createMockRouter=h;exports.createMockStorage=y;exports.createMockStore=x;exports.resetModelsOverride=G;exports.resetPricingOverride=D;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewx/sdk",
3
- "version": "0.9.0-rc.64",
3
+ "version": "0.9.0-rc.66",
4
4
  "license": "UNLICENSED",
5
5
  "engines": {
6
6
  "node": ">=20.19.0"