@crewx/sdk 0.9.0-rc.124 → 0.9.0-rc.126
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/config/models.generated.d.ts +2 -2
- package/dist/config/pricing.generated.d.ts +2 -2
- package/dist/esm/index.js +382 -257
- package/dist/esm/plugins/index.js +70 -64
- package/dist/esm/publish/index.js +2 -2
- package/dist/esm/repository/index.js +84 -78
- package/dist/esm/testing/index.js +1 -1
- package/dist/index.browser.js +4 -4
- package/dist/index.d.ts +7 -5
- package/dist/index.js +383 -258
- package/dist/mcp-app/agent-access.d.ts +12 -1
- package/dist/mcp-app/bundle-provenance.d.ts +2 -0
- package/dist/mcp-app/dev-checks.d.ts +27 -0
- package/dist/mcp-app/discovery.d.ts +51 -4
- package/dist/mcp-app/index.d.ts +10 -8
- package/dist/mcp-app/projection.d.ts +2 -1
- package/dist/mcp-app/registry.d.ts +9 -2
- package/dist/mcp-app/skill-backend.d.ts +40 -3
- package/dist/mcp-app/types.d.ts +52 -3
- package/dist/mcp-app/workspace-snapshot.d.ts +3 -2
- package/dist/migrations/0034_keen_fallen_one.sql +36 -0
- package/dist/migrations/meta/0034_snapshot.json +3473 -0
- package/dist/migrations/meta/_journal.json +8 -1
- package/dist/plugins/index.js +71 -65
- package/dist/publish/index.js +2 -2
- package/dist/repository/index.js +86 -80
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/ui-action-receipts.d.ts +55 -0
- package/dist/schema/ui-instance-repins.d.ts +222 -0
- package/dist/testing/index.js +1 -1
- package/dist/ui-instance/index.d.ts +4 -2
- package/dist/ui-instance/json.d.ts +10 -0
- package/dist/ui-instance/lineage.d.ts +22 -0
- package/dist/ui-instance/store.d.ts +38 -1
- package/dist/ui-instance/types.d.ts +24 -0
- package/package.json +1 -1
package/dist/schema/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './notifications.js';
|
|
|
13
13
|
export * from './agent-suggestions.js';
|
|
14
14
|
export * from './ui-instances.js';
|
|
15
15
|
export * from './ui-action-receipts.js';
|
|
16
|
+
export * from './ui-instance-repins.js';
|
|
16
17
|
export * from './projects.js';
|
|
17
18
|
export * from './common-codes.js';
|
|
18
19
|
export * from './thread-history.js';
|
|
@@ -40,6 +40,61 @@ export declare const ui_action_receipts: import("drizzle-orm/sqlite-core").SQLit
|
|
|
40
40
|
}, {}, {
|
|
41
41
|
length: number | undefined;
|
|
42
42
|
}>;
|
|
43
|
+
definition_id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
44
|
+
name: "definition_id";
|
|
45
|
+
tableName: "ui_action_receipts";
|
|
46
|
+
dataType: "string";
|
|
47
|
+
columnType: "SQLiteText";
|
|
48
|
+
data: string;
|
|
49
|
+
driverParam: string;
|
|
50
|
+
notNull: false;
|
|
51
|
+
hasDefault: false;
|
|
52
|
+
isPrimaryKey: false;
|
|
53
|
+
isAutoincrement: false;
|
|
54
|
+
hasRuntimeDefault: false;
|
|
55
|
+
enumValues: [string, ...string[]];
|
|
56
|
+
baseColumn: never;
|
|
57
|
+
identity: undefined;
|
|
58
|
+
generated: undefined;
|
|
59
|
+
}, {}, {
|
|
60
|
+
length: number | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
definition_version: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
63
|
+
name: "definition_version";
|
|
64
|
+
tableName: "ui_action_receipts";
|
|
65
|
+
dataType: "number";
|
|
66
|
+
columnType: "SQLiteInteger";
|
|
67
|
+
data: number;
|
|
68
|
+
driverParam: number;
|
|
69
|
+
notNull: false;
|
|
70
|
+
hasDefault: false;
|
|
71
|
+
isPrimaryKey: false;
|
|
72
|
+
isAutoincrement: false;
|
|
73
|
+
hasRuntimeDefault: false;
|
|
74
|
+
enumValues: undefined;
|
|
75
|
+
baseColumn: never;
|
|
76
|
+
identity: undefined;
|
|
77
|
+
generated: undefined;
|
|
78
|
+
}, {}, {}>;
|
|
79
|
+
definition_hash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
80
|
+
name: "definition_hash";
|
|
81
|
+
tableName: "ui_action_receipts";
|
|
82
|
+
dataType: "string";
|
|
83
|
+
columnType: "SQLiteText";
|
|
84
|
+
data: string;
|
|
85
|
+
driverParam: string;
|
|
86
|
+
notNull: false;
|
|
87
|
+
hasDefault: false;
|
|
88
|
+
isPrimaryKey: false;
|
|
89
|
+
isAutoincrement: false;
|
|
90
|
+
hasRuntimeDefault: false;
|
|
91
|
+
enumValues: [string, ...string[]];
|
|
92
|
+
baseColumn: never;
|
|
93
|
+
identity: undefined;
|
|
94
|
+
generated: undefined;
|
|
95
|
+
}, {}, {
|
|
96
|
+
length: number | undefined;
|
|
97
|
+
}>;
|
|
43
98
|
request_id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
44
99
|
name: "request_id";
|
|
45
100
|
tableName: "ui_action_receipts";
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
export declare const ui_instance_repins: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
2
|
+
name: "ui_instance_repins";
|
|
3
|
+
schema: undefined;
|
|
4
|
+
columns: {
|
|
5
|
+
instance_id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
6
|
+
name: "instance_id";
|
|
7
|
+
tableName: "ui_instance_repins";
|
|
8
|
+
dataType: "string";
|
|
9
|
+
columnType: "SQLiteText";
|
|
10
|
+
data: string;
|
|
11
|
+
driverParam: string;
|
|
12
|
+
notNull: true;
|
|
13
|
+
hasDefault: false;
|
|
14
|
+
isPrimaryKey: false;
|
|
15
|
+
isAutoincrement: false;
|
|
16
|
+
hasRuntimeDefault: false;
|
|
17
|
+
enumValues: [string, ...string[]];
|
|
18
|
+
baseColumn: never;
|
|
19
|
+
identity: undefined;
|
|
20
|
+
generated: undefined;
|
|
21
|
+
}, {}, {
|
|
22
|
+
length: number | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
from_version: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
25
|
+
name: "from_version";
|
|
26
|
+
tableName: "ui_instance_repins";
|
|
27
|
+
dataType: "number";
|
|
28
|
+
columnType: "SQLiteInteger";
|
|
29
|
+
data: number;
|
|
30
|
+
driverParam: number;
|
|
31
|
+
notNull: true;
|
|
32
|
+
hasDefault: false;
|
|
33
|
+
isPrimaryKey: false;
|
|
34
|
+
isAutoincrement: false;
|
|
35
|
+
hasRuntimeDefault: false;
|
|
36
|
+
enumValues: undefined;
|
|
37
|
+
baseColumn: never;
|
|
38
|
+
identity: undefined;
|
|
39
|
+
generated: undefined;
|
|
40
|
+
}, {}, {}>;
|
|
41
|
+
from_hash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
42
|
+
name: "from_hash";
|
|
43
|
+
tableName: "ui_instance_repins";
|
|
44
|
+
dataType: "string";
|
|
45
|
+
columnType: "SQLiteText";
|
|
46
|
+
data: string;
|
|
47
|
+
driverParam: string;
|
|
48
|
+
notNull: true;
|
|
49
|
+
hasDefault: false;
|
|
50
|
+
isPrimaryKey: false;
|
|
51
|
+
isAutoincrement: false;
|
|
52
|
+
hasRuntimeDefault: false;
|
|
53
|
+
enumValues: [string, ...string[]];
|
|
54
|
+
baseColumn: never;
|
|
55
|
+
identity: undefined;
|
|
56
|
+
generated: undefined;
|
|
57
|
+
}, {}, {
|
|
58
|
+
length: number | undefined;
|
|
59
|
+
}>;
|
|
60
|
+
to_version: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
61
|
+
name: "to_version";
|
|
62
|
+
tableName: "ui_instance_repins";
|
|
63
|
+
dataType: "number";
|
|
64
|
+
columnType: "SQLiteInteger";
|
|
65
|
+
data: number;
|
|
66
|
+
driverParam: number;
|
|
67
|
+
notNull: true;
|
|
68
|
+
hasDefault: false;
|
|
69
|
+
isPrimaryKey: false;
|
|
70
|
+
isAutoincrement: false;
|
|
71
|
+
hasRuntimeDefault: false;
|
|
72
|
+
enumValues: undefined;
|
|
73
|
+
baseColumn: never;
|
|
74
|
+
identity: undefined;
|
|
75
|
+
generated: undefined;
|
|
76
|
+
}, {}, {}>;
|
|
77
|
+
to_hash: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
78
|
+
name: "to_hash";
|
|
79
|
+
tableName: "ui_instance_repins";
|
|
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
|
+
from_revision: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
97
|
+
name: "from_revision";
|
|
98
|
+
tableName: "ui_instance_repins";
|
|
99
|
+
dataType: "number";
|
|
100
|
+
columnType: "SQLiteInteger";
|
|
101
|
+
data: number;
|
|
102
|
+
driverParam: number;
|
|
103
|
+
notNull: true;
|
|
104
|
+
hasDefault: false;
|
|
105
|
+
isPrimaryKey: false;
|
|
106
|
+
isAutoincrement: false;
|
|
107
|
+
hasRuntimeDefault: false;
|
|
108
|
+
enumValues: undefined;
|
|
109
|
+
baseColumn: never;
|
|
110
|
+
identity: undefined;
|
|
111
|
+
generated: undefined;
|
|
112
|
+
}, {}, {}>;
|
|
113
|
+
to_revision: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
114
|
+
name: "to_revision";
|
|
115
|
+
tableName: "ui_instance_repins";
|
|
116
|
+
dataType: "number";
|
|
117
|
+
columnType: "SQLiteInteger";
|
|
118
|
+
data: number;
|
|
119
|
+
driverParam: number;
|
|
120
|
+
notNull: false;
|
|
121
|
+
hasDefault: false;
|
|
122
|
+
isPrimaryKey: false;
|
|
123
|
+
isAutoincrement: false;
|
|
124
|
+
hasRuntimeDefault: false;
|
|
125
|
+
enumValues: undefined;
|
|
126
|
+
baseColumn: never;
|
|
127
|
+
identity: undefined;
|
|
128
|
+
generated: undefined;
|
|
129
|
+
}, {}, {}>;
|
|
130
|
+
status: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
131
|
+
name: "status";
|
|
132
|
+
tableName: "ui_instance_repins";
|
|
133
|
+
dataType: "string";
|
|
134
|
+
columnType: "SQLiteText";
|
|
135
|
+
data: string;
|
|
136
|
+
driverParam: string;
|
|
137
|
+
notNull: true;
|
|
138
|
+
hasDefault: false;
|
|
139
|
+
isPrimaryKey: false;
|
|
140
|
+
isAutoincrement: false;
|
|
141
|
+
hasRuntimeDefault: false;
|
|
142
|
+
enumValues: [string, ...string[]];
|
|
143
|
+
baseColumn: never;
|
|
144
|
+
identity: undefined;
|
|
145
|
+
generated: undefined;
|
|
146
|
+
}, {}, {
|
|
147
|
+
length: number | undefined;
|
|
148
|
+
}>;
|
|
149
|
+
code: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
150
|
+
name: "code";
|
|
151
|
+
tableName: "ui_instance_repins";
|
|
152
|
+
dataType: "string";
|
|
153
|
+
columnType: "SQLiteText";
|
|
154
|
+
data: string;
|
|
155
|
+
driverParam: string;
|
|
156
|
+
notNull: false;
|
|
157
|
+
hasDefault: false;
|
|
158
|
+
isPrimaryKey: false;
|
|
159
|
+
isAutoincrement: false;
|
|
160
|
+
hasRuntimeDefault: false;
|
|
161
|
+
enumValues: [string, ...string[]];
|
|
162
|
+
baseColumn: never;
|
|
163
|
+
identity: undefined;
|
|
164
|
+
generated: undefined;
|
|
165
|
+
}, {}, {
|
|
166
|
+
length: number | undefined;
|
|
167
|
+
}>;
|
|
168
|
+
attempts: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
169
|
+
name: "attempts";
|
|
170
|
+
tableName: "ui_instance_repins";
|
|
171
|
+
dataType: "number";
|
|
172
|
+
columnType: "SQLiteInteger";
|
|
173
|
+
data: number;
|
|
174
|
+
driverParam: number;
|
|
175
|
+
notNull: true;
|
|
176
|
+
hasDefault: true;
|
|
177
|
+
isPrimaryKey: false;
|
|
178
|
+
isAutoincrement: false;
|
|
179
|
+
hasRuntimeDefault: false;
|
|
180
|
+
enumValues: undefined;
|
|
181
|
+
baseColumn: never;
|
|
182
|
+
identity: undefined;
|
|
183
|
+
generated: undefined;
|
|
184
|
+
}, {}, {}>;
|
|
185
|
+
first_at: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
186
|
+
name: "first_at";
|
|
187
|
+
tableName: "ui_instance_repins";
|
|
188
|
+
dataType: "number";
|
|
189
|
+
columnType: "SQLiteInteger";
|
|
190
|
+
data: number;
|
|
191
|
+
driverParam: number;
|
|
192
|
+
notNull: true;
|
|
193
|
+
hasDefault: false;
|
|
194
|
+
isPrimaryKey: false;
|
|
195
|
+
isAutoincrement: false;
|
|
196
|
+
hasRuntimeDefault: false;
|
|
197
|
+
enumValues: undefined;
|
|
198
|
+
baseColumn: never;
|
|
199
|
+
identity: undefined;
|
|
200
|
+
generated: undefined;
|
|
201
|
+
}, {}, {}>;
|
|
202
|
+
last_at: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
203
|
+
name: "last_at";
|
|
204
|
+
tableName: "ui_instance_repins";
|
|
205
|
+
dataType: "number";
|
|
206
|
+
columnType: "SQLiteInteger";
|
|
207
|
+
data: number;
|
|
208
|
+
driverParam: number;
|
|
209
|
+
notNull: true;
|
|
210
|
+
hasDefault: false;
|
|
211
|
+
isPrimaryKey: false;
|
|
212
|
+
isAutoincrement: false;
|
|
213
|
+
hasRuntimeDefault: false;
|
|
214
|
+
enumValues: undefined;
|
|
215
|
+
baseColumn: never;
|
|
216
|
+
identity: undefined;
|
|
217
|
+
generated: undefined;
|
|
218
|
+
}, {}, {}>;
|
|
219
|
+
};
|
|
220
|
+
dialect: "sqlite";
|
|
221
|
+
}>;
|
|
222
|
+
export type UiInstanceRepinRow = typeof ui_instance_repins.$inferSelect;
|
package/dist/testing/index.js
CHANGED
|
@@ -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 R(){let e=200,t,o,n={},i={status(r){return e=r,i},set(r,d){return n[r]=d,i},send(r){return o=r,i},json(r){return t=r,i},end(){return i},getStatusCode:()=>e,getJsonBody:()=>t,getSentBody:()=>o,getHeaders:()=>({...n})};return i}function h(){let e=[];return {routes:e,registerRoute(o,n,i){e.push({path:o,handler:n,opts:i});},async simulate(o,n,i=Buffer.alloc(0),r={},d={},c={}){let l=e.find(g=>g.path===n);if(!l)return {status:404,body:{error:"Not found"},headers:{}};let p={method:o,url:n,headers:r,body:i,params:d,query:c},u=R();return await l.handler(p,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 i=t.get(o(n));return i?i.value:void 0},async set(n,i){t.set(o(n),{value:i});},async delete(n){return t.delete(o(n))},async list(n){let i=n?o(n):`${e}::`,r=[];for(let d of t.keys())d.startsWith(i)&&r.push(d.slice(e.length+2));return r}}}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(),i=h(),r=x(t),d=y(),c=[],l=[],p=[],u={run:async()=>({output:""}),...e.agentRunner},g=new AbortController,k=async a=>(c.push(a),{accepted:true}),w=async a=>(l.push(a),{accepted:true}),v=async(a,O)=>{p.push({messageId:a,patch:O});},E=async a=>({userId:a,displayName:a}),b=async()=>{},I=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:r,storage:d,audit:o,abortSignal:e.abortSignal??g.signal,httpRouter:i,router:i,inbound:k,emitEvent:w,updateMessage:v,resolveUser:E,respondSync:b,proactive:I,inboundCalls:c,emittedEvents:l,sentMessages:p}}function L(){}var P={claude:{models:[{id:"claude-fable-5-1",name:"Claude Fable 5.1",contextWindowTokens:1e6,tier:"flagship",recommended:true},{id:"claude-fable-5",name:"Claude Fable 5",contextWindowTokens:1e6,tier:"flagship"},{id:"claude-opus-5-5",name:"Claude Opus 5.5",contextWindowTokens:1e6,tier:"flagship",recommended:true},{id:"claude-opus-5",name:"Claude Opus 5",contextWindowTokens:1e6,tier:"flagship"},{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-1":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-fable-5":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-opus-5-5":{effort:["low","medium","high","xhigh","max"],defaultEffort:"medium"},"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-6-astra",name:"GPT-6 Astra",contextWindowTokens:105e4,tier:"flagship"},{id:"gpt-6-sol",name:"GPT-6 Sol",contextWindowTokens:105e4,tier:"balanced",recommended:true},{id:"gpt-6-luna",name:"GPT-6 Luna",contextWindowTokens:105e4,tier:"speed",recommended:true},{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",contextWindowTokens:105e4,tier:"flagship"},{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",contextWindowTokens:105e4,tier:"balanced"},{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",contextWindowTokens:105e4,tier:"speed"},{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-6-astra":{effort:["low","medium","high","xhigh","max"],defaultEffort:"xhigh"},"gpt-6-sol":{effort:["none","low","medium","high","xhigh","max"],defaultEffort:"medium"},"gpt-6-luna":{effort:["none","low","medium","high","xhigh","max"],defaultEffort:"medium"},"gpt-5.6-sol":{effort:["low","medium","high","xhigh","max","ultra"],defaultEffort:"xhigh"},"gpt-5.6-terra":{effort:["low","medium","high","xhigh","max","ultra"],defaultEffort:"high"},"gpt-5.6-luna":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"gpt-5.5":{effort:["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.7-flash",name:"Gemini 3.7 Flash",contextWindowTokens:1048576,tier:"balanced"},{id:"gemini-3.6-flash",name:"Gemini 3.6 Flash",contextWindowTokens:1048576,tier:"balanced"},{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",contextWindowTokens:1048576,tier:"balanced"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro",contextWindowTokens:1048576,tier:"flagship"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",contextWindowTokens:1e6,tier:"balanced"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",contextWindowTokens:1e6,tier:"flagship"},{id:"gpt-oss-120b",name:"GPT-OSS 120B",contextWindowTokens:128e3,tier:"balanced"}],modes:[{id:"default",name:"Default",description:"Uses Antigravity's default permission handling. No extra permission flags are passed."},{id:"plan",name:"Plan",description:"Passes --mode plan. This turns on /plan; it is not a Claude-style permission mode."},{id:"acceptEdits",name:"Accept Edits",description:"Passes --mode accept-edits."},{id:"bypassPermissions",name:"Bypass Permissions",description:"Passes --dangerously-skip-permissions so tools can run without approval prompts."}],effort:["low","medium","high"],modelOverrides:{"gemini-3.7-flash":{effort:["low","medium","high"],defaultEffort:"medium"},"gemini-3.6-flash":{effort:["low","medium","high"],defaultEffort:"medium"},"gemini-3.5-flash":{effort:["low","medium","high"],defaultEffort:"medium"},"gemini-3.1-pro":{effort:["low","high"],defaultEffort:"high"},"claude-sonnet-4-6":{effort:[]},"claude-opus-4-6-thinking":{effort:[]},"gpt-oss-120b":{effort:["medium"],defaultEffort:"medium"}},providerOptions:[]},grok:{models:[{id:"grok-4.7",name:"Grok 4.7",contextWindowTokens:5e5,tier:"flagship",recommended:true},{id:"grok-4.6",name:"Grok 4.6",contextWindowTokens:5e5,tier:"flagship"},{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.7":{effort:["low","medium","high","xhigh"],defaultEffort:"high"},"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 D=[{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(D.map(({baseModelId:e,catalogModelId:t})=>[e,t]));var _=[{legacyId:"Gemini 3.7 Flash (High)",model:"gemini-3.7-flash",effort:"high"},{legacyId:"Gemini 3.7 Flash (Medium)",model:"gemini-3.7-flash",effort:"medium"},{legacyId:"Gemini 3.7 Flash (Low)",model:"gemini-3.7-flash",effort:"low"},{legacyId:"Gemini 3.6 Flash (High)",model:"gemini-3.6-flash",effort:"high"},{legacyId:"Gemini 3.6 Flash (Medium)",model:"gemini-3.6-flash",effort:"medium"},{legacyId:"Gemini 3.6 Flash (Low)",model:"gemini-3.6-flash",effort:"low"},{legacyId:"Gemini 3.5 Flash (Medium)",model:"gemini-3.5-flash",effort:"medium"},{legacyId:"Gemini 3.5 Flash (High)",model:"gemini-3.5-flash",effort:"high"},{legacyId:"Gemini 3.5 Flash (Low)",model:"gemini-3.5-flash",effort:"low"},{legacyId:"Gemini 3.1 Pro (Low)",model:"gemini-3.1-pro",effort:"low"},{legacyId:"Gemini 3.1 Pro (High)",model:"gemini-3.1-pro",effort:"high"},{legacyId:"Claude Sonnet 4.6 (Thinking)",model:"claude-sonnet-4-6"},{legacyId:"Claude Opus 4.6 (Thinking)",model:"claude-opus-4-6-thinking"},{legacyId:"GPT-OSS 120B (Medium)",model:"gpt-oss-120b",effort:"medium"},{legacyId:"gemini-3.7-flash-high",model:"gemini-3.7-flash",effort:"high"},{legacyId:"gemini-3.7-flash-medium",model:"gemini-3.7-flash",effort:"medium"},{legacyId:"gemini-3.7-flash-low",model:"gemini-3.7-flash",effort:"low"},{legacyId:"gemini-3.6-flash-high",model:"gemini-3.6-flash",effort:"high"},{legacyId:"gemini-3.6-flash-medium",model:"gemini-3.6-flash",effort:"medium"},{legacyId:"gemini-3.6-flash-low",model:"gemini-3.6-flash",effort:"low"},{legacyId:"gemini-3.5-flash-high",model:"gemini-3.5-flash",effort:"high"},{legacyId:"gemini-3.5-flash-medium",model:"gemini-3.5-flash",effort:"medium"},{legacyId:"gemini-3.5-flash-low",model:"gemini-3.5-flash",effort:"low"},{legacyId:"gemini-3.1-pro-high",model:"gemini-3.1-pro",effort:"high"},{legacyId:"gemini-3.1-pro-low",model:"gemini-3.1-pro",effort:"low"},{legacyId:"gpt-oss-120b-medium",model:"gpt-oss-120b",effort:"medium"}];new Map(_.map(({legacyId:e,model:t,effort:o})=>[e,o===void 0?{model:t}:{model:t,effort:o}]));function W(){}exports.createMockAudit=m;exports.createMockContext=A;exports.createMockLogger=f;exports.createMockRouter=h;exports.createMockStorage=y;exports.createMockStore=x;exports.resetModelsOverride=W;exports.resetPricingOverride=L;
|
|
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 R(){let e=200,t,o,n={},i={status(r){return e=r,i},set(r,d){return n[r]=d,i},send(r){return o=r,i},json(r){return t=r,i},end(){return i},getStatusCode:()=>e,getJsonBody:()=>t,getSentBody:()=>o,getHeaders:()=>({...n})};return i}function h(){let e=[];return {routes:e,registerRoute(o,n,i){e.push({path:o,handler:n,opts:i});},async simulate(o,n,i=Buffer.alloc(0),r={},d={},c={}){let l=e.find(g=>g.path===n);if(!l)return {status:404,body:{error:"Not found"},headers:{}};let p={method:o,url:n,headers:r,body:i,params:d,query:c},u=R();return await l.handler(p,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 i=t.get(o(n));return i?i.value:void 0},async set(n,i){t.set(o(n),{value:i});},async delete(n){return t.delete(o(n))},async list(n){let i=n?o(n):`${e}::`,r=[];for(let d of t.keys())d.startsWith(i)&&r.push(d.slice(e.length+2));return r}}}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(),i=h(),r=x(t),d=y(),c=[],l=[],p=[],u={run:async()=>({output:""}),...e.agentRunner},g=new AbortController,k=async a=>(c.push(a),{accepted:true}),w=async a=>(l.push(a),{accepted:true}),v=async(a,O)=>{p.push({messageId:a,patch:O});},E=async a=>({userId:a,displayName:a}),b=async()=>{},I=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:r,storage:d,audit:o,abortSignal:e.abortSignal??g.signal,httpRouter:i,router:i,inbound:k,emitEvent:w,updateMessage:v,resolveUser:E,respondSync:b,proactive:I,inboundCalls:c,emittedEvents:l,sentMessages:p}}function L(){}var P={claude:{models:[{id:"claude-fable-5-1",name:"Claude Fable 5.1",contextWindowTokens:1e6,tier:"flagship",recommended:true},{id:"claude-fable-5",name:"Claude Fable 5",contextWindowTokens:1e6,tier:"flagship"},{id:"claude-opus-5-5",name:"Claude Opus 5.5",contextWindowTokens:1e6,tier:"flagship",recommended:true},{id:"claude-opus-5",name:"Claude Opus 5",contextWindowTokens:1e6,tier:"flagship"},{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-1":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-fable-5":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"claude-opus-5-5":{effort:["low","medium","high","xhigh","max"],defaultEffort:"medium"},"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-6-astra",name:"GPT-6 Astra",contextWindowTokens:105e4,tier:"flagship"},{id:"gpt-6-sol",name:"GPT-6 Sol",contextWindowTokens:105e4,tier:"balanced",recommended:true},{id:"gpt-6-luna",name:"GPT-6 Luna",contextWindowTokens:105e4,tier:"speed",recommended:true},{id:"gpt-5.6-sol",name:"GPT-5.6 Sol",contextWindowTokens:105e4,tier:"flagship"},{id:"gpt-5.6-terra",name:"GPT-5.6 Terra",contextWindowTokens:105e4,tier:"balanced"},{id:"gpt-5.6-luna",name:"GPT-5.6 Luna",contextWindowTokens:105e4,tier:"speed"},{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-6-astra":{effort:["low","medium","high","xhigh","max"],defaultEffort:"xhigh"},"gpt-6-sol":{effort:["none","low","medium","high","xhigh","max"],defaultEffort:"max"},"gpt-6-luna":{effort:["none","low","medium","high","xhigh","max"],defaultEffort:"medium"},"gpt-5.6-sol":{effort:["low","medium","high","xhigh","max","ultra"],defaultEffort:"xhigh"},"gpt-5.6-terra":{effort:["low","medium","high","xhigh","max","ultra"],defaultEffort:"high"},"gpt-5.6-luna":{effort:["low","medium","high","xhigh","max"],defaultEffort:"high"},"gpt-5.5":{effort:["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.7-flash",name:"Gemini 3.7 Flash",contextWindowTokens:1048576,tier:"balanced"},{id:"gemini-3.6-flash",name:"Gemini 3.6 Flash",contextWindowTokens:1048576,tier:"balanced"},{id:"gemini-3.5-flash",name:"Gemini 3.5 Flash",contextWindowTokens:1048576,tier:"balanced"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro",contextWindowTokens:1048576,tier:"flagship"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",contextWindowTokens:1e6,tier:"balanced"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",contextWindowTokens:1e6,tier:"flagship"},{id:"gpt-oss-120b",name:"GPT-OSS 120B",contextWindowTokens:128e3,tier:"balanced"}],modes:[{id:"default",name:"Default",description:"Uses Antigravity's default permission handling. No extra permission flags are passed."},{id:"plan",name:"Plan",description:"Passes --mode plan. This turns on /plan; it is not a Claude-style permission mode."},{id:"acceptEdits",name:"Accept Edits",description:"Passes --mode accept-edits."},{id:"bypassPermissions",name:"Bypass Permissions",description:"Passes --dangerously-skip-permissions so tools can run without approval prompts."}],effort:["low","medium","high"],modelOverrides:{"gemini-3.7-flash":{effort:["low","medium","high"],defaultEffort:"medium"},"gemini-3.6-flash":{effort:["low","medium","high"],defaultEffort:"medium"},"gemini-3.5-flash":{effort:["low","medium","high"],defaultEffort:"medium"},"gemini-3.1-pro":{effort:["low","high"],defaultEffort:"high"},"claude-sonnet-4-6":{effort:[]},"claude-opus-4-6-thinking":{effort:[]},"gpt-oss-120b":{effort:["medium"],defaultEffort:"medium"}},providerOptions:[]},grok:{models:[{id:"grok-4.7",name:"Grok 4.7",contextWindowTokens:5e5,tier:"flagship",recommended:true},{id:"grok-4.6",name:"Grok 4.6",contextWindowTokens:5e5,tier:"flagship"},{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.7":{effort:["low","medium","high","xhigh"],defaultEffort:"high"},"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 D=[{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(D.map(({baseModelId:e,catalogModelId:t})=>[e,t]));var _=[{legacyId:"Gemini 3.7 Flash (High)",model:"gemini-3.7-flash",effort:"high"},{legacyId:"Gemini 3.7 Flash (Medium)",model:"gemini-3.7-flash",effort:"medium"},{legacyId:"Gemini 3.7 Flash (Low)",model:"gemini-3.7-flash",effort:"low"},{legacyId:"Gemini 3.6 Flash (High)",model:"gemini-3.6-flash",effort:"high"},{legacyId:"Gemini 3.6 Flash (Medium)",model:"gemini-3.6-flash",effort:"medium"},{legacyId:"Gemini 3.6 Flash (Low)",model:"gemini-3.6-flash",effort:"low"},{legacyId:"Gemini 3.5 Flash (Medium)",model:"gemini-3.5-flash",effort:"medium"},{legacyId:"Gemini 3.5 Flash (High)",model:"gemini-3.5-flash",effort:"high"},{legacyId:"Gemini 3.5 Flash (Low)",model:"gemini-3.5-flash",effort:"low"},{legacyId:"Gemini 3.1 Pro (Low)",model:"gemini-3.1-pro",effort:"low"},{legacyId:"Gemini 3.1 Pro (High)",model:"gemini-3.1-pro",effort:"high"},{legacyId:"Claude Sonnet 4.6 (Thinking)",model:"claude-sonnet-4-6"},{legacyId:"Claude Opus 4.6 (Thinking)",model:"claude-opus-4-6-thinking"},{legacyId:"GPT-OSS 120B (Medium)",model:"gpt-oss-120b",effort:"medium"},{legacyId:"gemini-3.7-flash-high",model:"gemini-3.7-flash",effort:"high"},{legacyId:"gemini-3.7-flash-medium",model:"gemini-3.7-flash",effort:"medium"},{legacyId:"gemini-3.7-flash-low",model:"gemini-3.7-flash",effort:"low"},{legacyId:"gemini-3.6-flash-high",model:"gemini-3.6-flash",effort:"high"},{legacyId:"gemini-3.6-flash-medium",model:"gemini-3.6-flash",effort:"medium"},{legacyId:"gemini-3.6-flash-low",model:"gemini-3.6-flash",effort:"low"},{legacyId:"gemini-3.5-flash-high",model:"gemini-3.5-flash",effort:"high"},{legacyId:"gemini-3.5-flash-medium",model:"gemini-3.5-flash",effort:"medium"},{legacyId:"gemini-3.5-flash-low",model:"gemini-3.5-flash",effort:"low"},{legacyId:"gemini-3.1-pro-high",model:"gemini-3.1-pro",effort:"high"},{legacyId:"gemini-3.1-pro-low",model:"gemini-3.1-pro",effort:"low"},{legacyId:"gpt-oss-120b-medium",model:"gpt-oss-120b",effort:"medium"}];new Map(_.map(({legacyId:e,model:t,effort:o})=>[e,o===void 0?{model:t}:{model:t,effort:o}]));function W(){}exports.createMockAudit=m;exports.createMockContext=A;exports.createMockLogger=f;exports.createMockRouter=h;exports.createMockStorage=y;exports.createMockStore=x;exports.resetModelsOverride=W;exports.resetPricingOverride=L;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
export type { ActionReceipt, ActionReceiptOutcome, CreateUiInstanceInput, JsonObject, JsonPrimitive, JsonValue, UiActionHandlerContext, UiActionHandlerRegistration, UiActionHandlerResult, UiActionEnvelope, UiActionConfirmation, UiActor, UiDefinition, UiDefinitionAction, UiDefinitionDisplayMode, UiDefinitionInput, UiDefinitionRef, UiDefinitionUsage, UiProjectionPolicy, UiExecutionContext, UiAuthenticatedActor, UiTaskActorSnapshot, UiAuthenticatedExecutionContext, UiApprovalRequestContext, UiTaskExecutionContext, UiApprovalDecisionProvenance, UiApprovalPendingReceipt, UiApprovalRequestReceiptResult, UiAuthenticatedGrantPolicy, UiServerRuntimeFacade, UiServerRuntimeOptions, UiAgentContextProjection, UiExternalActionHandlerRegistration, UiInstance, UiInstanceStatus, UiLocalGrantPolicy, UiRuntimeFacade, UiRuntimeOptions, UiStateActionHandlerRegistration, } from './types.js';
|
|
1
|
+
export type { ActionReceipt, ActionReceiptOutcome, CreateUiInstanceInput, JsonObject, JsonPrimitive, JsonValue, UiActionHandlerContext, UiActionHandlerRegistration, UiActionHandlerResult, UiActionEnvelope, UiActionConfirmation, UiActor, UiDefinition, UiDefinitionAction, UiDefinitionDisplayMode, UiDefinitionInput, UiDefinitionLegacyMetadata, UiDefinitionRef, UiDefinitionUsage, UiProjectionPolicy, UiExecutionContext, UiAuthenticatedActor, UiTaskActorSnapshot, UiAuthenticatedExecutionContext, UiApprovalRequestContext, UiTaskExecutionContext, UiApprovalDecisionProvenance, UiApprovalPendingReceipt, UiApprovalRequestReceiptResult, UiAuthenticatedGrantPolicy, UiServerRuntimeFacade, UiServerRuntimeOptions, UiAgentContextProjection, UiExternalActionHandlerRegistration, UiInstance, UiInstanceStatus, UiLocalGrantPolicy, UiRuntimeFacade, UiRuntimeOptions, UiStateActionHandlerRegistration, } from './types.js';
|
|
2
2
|
export { isUiAuthenticatedActor, resolveUiEffectiveCapabilities } from './types.js';
|
|
3
3
|
export { UiRuntimeError } from './errors.js';
|
|
4
4
|
export type { UiRuntimeErrorCode } from './errors.js';
|
|
5
5
|
export { projectSafeJsonObject, redactJsonPaths } from './json.js';
|
|
6
6
|
export { hashUiDefinition } from './definition.js';
|
|
7
|
+
export { hasUiDefinitionLineageBreak, selectUiDefinitionLineageEntry, UiDefinitionLineageError, validateUiDefinitionLineage, } from './lineage.js';
|
|
8
|
+
export type { UiDefinitionLineageEntry, UiDefinitionLineageFailureCode, ValidatedUiDefinitionLineage, } from './lineage.js';
|
|
7
9
|
export { UiInstanceStore, openUiInstanceReadStore } from './store.js';
|
|
8
|
-
export type { UiAuditSnapshotInput, UiInstanceReadStore } from './store.js';
|
|
10
|
+
export type { UiAuditSnapshotInput, UiInstanceReadStore, UiInstanceRepinInput, UiInstanceRepinLedgerEntry, UiInstanceRepinResult, UiInstanceRepinWorkspaceInput, ReservationInput, } from './store.js';
|
|
9
11
|
export { createUiRuntimeForTest, createUiServerRuntime } from './runtime.js';
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import type { JsonObject, JsonValue } from './types.js';
|
|
2
|
+
export type ProjectionRule = 'html' | 'url' | 'local_path' | 'sensitive_key' | 'path_key' | 'depth' | 'non_finite_number' | 'unsupported_type' | 'cycle' | 'not_object' | 'bad_options';
|
|
3
|
+
export interface ProjectionViolation {
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly rule: ProjectionRule;
|
|
6
|
+
}
|
|
7
|
+
export interface FindProjectionViolationsOptions {
|
|
8
|
+
readonly envelopeDepth?: number;
|
|
9
|
+
readonly dataPaths?: readonly string[];
|
|
10
|
+
}
|
|
2
11
|
export declare function projectSafeJsonObject(value: unknown, envelopeDepth?: number, dataPaths?: readonly string[]): JsonObject;
|
|
12
|
+
export declare function findProjectionViolations(value: unknown, options?: FindProjectionViolationsOptions): ProjectionViolation[];
|
|
3
13
|
export declare function pathIsAtOrBelowPath(path: string, parentPath: string): boolean;
|
|
4
14
|
export declare function omitJsonPaths(value: JsonObject, dataPaths: readonly string[]): JsonObject;
|
|
5
15
|
export declare function redactJsonPaths(value: JsonObject, dataPaths: readonly string[], placeholder?: string): JsonObject;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UiDefinition, UiDefinitionInput, UiDefinitionRef } from './types.js';
|
|
2
|
+
export type UiDefinitionLineageFailureCode = 'LINEAGE_INVALID' | 'LINEAGE_STALE';
|
|
3
|
+
export interface UiDefinitionLineageEntry {
|
|
4
|
+
readonly version: number;
|
|
5
|
+
readonly hash: string;
|
|
6
|
+
readonly definition: UiDefinitionInput;
|
|
7
|
+
readonly sourceHash?: string;
|
|
8
|
+
readonly compat?: 'break';
|
|
9
|
+
}
|
|
10
|
+
export interface ValidatedUiDefinitionLineage {
|
|
11
|
+
readonly entries: readonly UiDefinitionLineageEntry[];
|
|
12
|
+
readonly current: UiDefinition;
|
|
13
|
+
}
|
|
14
|
+
export declare class UiDefinitionLineageError extends Error {
|
|
15
|
+
readonly code: UiDefinitionLineageFailureCode;
|
|
16
|
+
readonly violations: readonly string[];
|
|
17
|
+
readonly name = "UiDefinitionLineageError";
|
|
18
|
+
constructor(code: UiDefinitionLineageFailureCode, message?: string, violations?: readonly string[]);
|
|
19
|
+
}
|
|
20
|
+
export declare function validateUiDefinitionLineage(entriesValue: unknown, currentValue: unknown): ValidatedUiDefinitionLineage;
|
|
21
|
+
export declare function selectUiDefinitionLineageEntry(entries: unknown, current: unknown, selected: UiDefinitionRef): UiDefinition;
|
|
22
|
+
export declare function hasUiDefinitionLineageBreak(lineage: ValidatedUiDefinitionLineage, from: UiDefinitionRef, to?: UiDefinitionRef): boolean;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { UiDefinitionLineageEntry } from './lineage.js';
|
|
2
|
+
import type { ActionReceipt, ActionReceiptOutcome, UiApprovalDecisionProvenance, UiApprovalPendingReceipt, UiApprovalRequestReceiptResult, JsonObject, UiActionHandlerContext, UiActor, UiInstance, UiAuthenticatedActor, UiDefinition, UiDefinitionRef } from './types.js';
|
|
2
3
|
export type UiInstanceDataPathResolver = (definition: UiDefinitionRef) => readonly string[];
|
|
3
4
|
interface UiInstanceStoreTestHooks {
|
|
4
5
|
injectDatabaseError?: () => unknown | undefined;
|
|
5
6
|
bumpRevisionBeforeCas?: boolean;
|
|
6
7
|
beforeOpenRead?: () => void;
|
|
8
|
+
bumpRevisionBeforeRepinCas?: boolean;
|
|
7
9
|
}
|
|
8
10
|
export interface ReservationInput {
|
|
9
11
|
instanceId: string;
|
|
12
|
+
definition?: UiDefinitionRef;
|
|
10
13
|
requestId: string;
|
|
11
14
|
actionId: string;
|
|
12
15
|
actor: UiActor;
|
|
@@ -17,6 +20,33 @@ export interface ReservationInput {
|
|
|
17
20
|
receiptInput?: JsonObject;
|
|
18
21
|
now: number;
|
|
19
22
|
}
|
|
23
|
+
export interface UiInstanceRepinInput {
|
|
24
|
+
readonly instanceId: string;
|
|
25
|
+
readonly workspaceId: string;
|
|
26
|
+
readonly appId: string;
|
|
27
|
+
readonly currentDefinition: UiDefinition;
|
|
28
|
+
readonly lineage: readonly UiDefinitionLineageEntry[];
|
|
29
|
+
readonly observedRevision: number;
|
|
30
|
+
readonly hasSkillActions: boolean;
|
|
31
|
+
readonly now: number;
|
|
32
|
+
}
|
|
33
|
+
export type UiInstanceRepinWorkspaceInput = Omit<UiInstanceRepinInput, 'instanceId' | 'observedRevision'>;
|
|
34
|
+
export interface UiInstanceRepinLedgerEntry {
|
|
35
|
+
readonly instanceId: string;
|
|
36
|
+
readonly fromVersion: number;
|
|
37
|
+
readonly fromHash: string;
|
|
38
|
+
readonly toVersion: number;
|
|
39
|
+
readonly toHash: string;
|
|
40
|
+
readonly fromRevision: number;
|
|
41
|
+
readonly toRevision: number | null;
|
|
42
|
+
readonly status: 'applied' | 'deferred' | 'failed';
|
|
43
|
+
readonly code: string | null;
|
|
44
|
+
readonly attempts: number;
|
|
45
|
+
readonly firstAt: number;
|
|
46
|
+
readonly lastAt: number;
|
|
47
|
+
}
|
|
48
|
+
export interface UiInstanceRepinResult extends UiInstanceRepinLedgerEntry {
|
|
49
|
+
}
|
|
20
50
|
export interface ApprovalPendingReservationInput {
|
|
21
51
|
readonly reservation: ReservationInput;
|
|
22
52
|
readonly approvalId: string;
|
|
@@ -37,6 +67,7 @@ interface ApprovalReceiptMarker {
|
|
|
37
67
|
}
|
|
38
68
|
interface ApprovalReceiptRecord {
|
|
39
69
|
readonly receipt: ActionReceipt;
|
|
70
|
+
readonly definition: UiDefinitionRef | null;
|
|
40
71
|
readonly approvalId: string;
|
|
41
72
|
readonly expiresAt: number;
|
|
42
73
|
readonly state: ApprovalReceiptMarker['state'];
|
|
@@ -77,6 +108,11 @@ export declare class UiInstanceStore {
|
|
|
77
108
|
private readonly testHooks?;
|
|
78
109
|
constructor(dbPath?: string, testHooks?: UiInstanceStoreTestHooks);
|
|
79
110
|
close(): void;
|
|
111
|
+
repinInstance(input: UiInstanceRepinInput): UiInstanceRepinResult | null;
|
|
112
|
+
repinWorkspaceApp(input: UiInstanceRepinWorkspaceInput): UiInstanceRepinResult[];
|
|
113
|
+
getRepinLedgerEntry(instanceId: string, workspaceId: string, appId: string, toHash: string): UiInstanceRepinLedgerEntry | null;
|
|
114
|
+
listRepinLedgerEntries(workspaceId: string, appId: string, toHash: string): UiInstanceRepinLedgerEntry[];
|
|
115
|
+
private writeRepinLedger;
|
|
80
116
|
create(input: {
|
|
81
117
|
id: string;
|
|
82
118
|
definitionId: string;
|
|
@@ -113,6 +149,7 @@ export declare class UiInstanceStore {
|
|
|
113
149
|
listByThread(workspaceId: string, threadId: string, resolveDataPaths?: UiInstanceDataPathResolver): UiInstance[];
|
|
114
150
|
updateAuditSnapshot(input: UiAuditSnapshotInput): UiInstance | null;
|
|
115
151
|
getReceipt(instanceId: string, requestId: string): ActionReceipt | null;
|
|
152
|
+
listRecentReceipts(instanceId: string, limit: number): ActionReceipt[];
|
|
116
153
|
getReceiptById(receiptId: string): ActionReceipt | null;
|
|
117
154
|
createApprovalPendingReceipt(reservation: ReservationInput, approval: {
|
|
118
155
|
readonly approvalId: string;
|
|
@@ -23,6 +23,26 @@ export interface UiDefinitionAction {
|
|
|
23
23
|
export interface UiProjectionPolicy {
|
|
24
24
|
allow: readonly string[];
|
|
25
25
|
}
|
|
26
|
+
export type UiDefinitionLegacyToolVisibility = 'model' | 'app';
|
|
27
|
+
export interface UiDefinitionLegacyTool {
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly description: string;
|
|
30
|
+
readonly inputSchema: JsonObject;
|
|
31
|
+
readonly textFallback: string;
|
|
32
|
+
readonly visibility: readonly UiDefinitionLegacyToolVisibility[];
|
|
33
|
+
}
|
|
34
|
+
export interface UiDefinitionLegacyReadTool extends UiDefinitionLegacyTool {
|
|
35
|
+
readonly fixedResult?: {
|
|
36
|
+
readonly structuredContent: JsonObject;
|
|
37
|
+
readonly argsPolicy: 'empty-only' | 'ignore';
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface UiDefinitionLegacyMetadata {
|
|
41
|
+
readonly readTool?: UiDefinitionLegacyReadTool;
|
|
42
|
+
readonly actionTool?: UiDefinitionLegacyTool;
|
|
43
|
+
readonly hostTools?: Readonly<Record<string, string>>;
|
|
44
|
+
readonly agentAccess?: Readonly<Record<string, 'allowed' | 'denied'>>;
|
|
45
|
+
}
|
|
26
46
|
export interface UiDefinitionInput {
|
|
27
47
|
readonly id: string;
|
|
28
48
|
readonly version: number;
|
|
@@ -35,6 +55,8 @@ export interface UiDefinitionInput {
|
|
|
35
55
|
readonly surfaces?: readonly string[];
|
|
36
56
|
readonly stateProjection?: UiProjectionPolicy;
|
|
37
57
|
readonly dataPaths?: readonly string[];
|
|
58
|
+
readonly summaryProjection?: UiProjectionPolicy;
|
|
59
|
+
readonly legacy?: UiDefinitionLegacyMetadata;
|
|
38
60
|
}
|
|
39
61
|
export interface UiDefinition extends UiDefinitionInput {
|
|
40
62
|
readonly hash: string;
|
|
@@ -69,6 +91,7 @@ export interface UiActionEnvelope {
|
|
|
69
91
|
expectedRevision: number;
|
|
70
92
|
requestId: string;
|
|
71
93
|
input: JsonObject;
|
|
94
|
+
resolvedDefinition?: UiDefinitionRef;
|
|
72
95
|
}
|
|
73
96
|
export type UiActor = {
|
|
74
97
|
kind: 'local';
|
|
@@ -170,6 +193,7 @@ export interface UiActionHandlerContext {
|
|
|
170
193
|
source: 'cli' | 'ui_host' | 'system' | 'mcp';
|
|
171
194
|
input: JsonObject;
|
|
172
195
|
requestId: string;
|
|
196
|
+
reservationNow?: number;
|
|
173
197
|
}
|
|
174
198
|
export type UiActionHandlerResult = {
|
|
175
199
|
state?: JsonObject;
|