@agentknight/sdk 0.9.56 → 0.9.57
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/chunks/{acp-adapter-HUNUQGUF.js → acp-adapter-WYDK3PLS.js} +4 -3
- package/dist/chunks/chunk-3LEPYV7Y.js +72 -0
- package/dist/chunks/{chunk-L3A736SO.js → chunk-7ZYBES47.js} +2 -66
- package/dist/chunks/{chunk-NTFNQYQ3.js → chunk-DAKDVZ7X.js} +2 -2
- package/dist/chunks/{chunk-HFVA7ZOD.js → chunk-EDZPP6SJ.js} +2 -2
- package/dist/chunks/{chunk-5J7BK2Y7.js → chunk-IPJWNGNK.js} +1 -1
- package/dist/chunks/{chunk-K5CMKBW6.js → chunk-KBI5IWPR.js} +183 -51
- package/dist/chunks/chunk-LT5ULDVT.js +1217 -0
- package/dist/chunks/{chunk-6ZPE7VIE.js → chunk-OOCAIULD.js} +28 -1223
- package/dist/chunks/{chunk-Z5STULMQ.js → chunk-USI66MEF.js} +1 -1
- package/dist/chunks/{chunk-E7QL4CBT.js → chunk-WPVH7HKC.js} +1 -1
- package/dist/chunks/chunk-ZLKFFKAX.js +571 -0
- package/dist/chunks/{claude-adapter-G6YTPXRP.js → claude-adapter-GCH36EZ6.js} +4 -3
- package/dist/chunks/{codex-adapter-ELYJE2A2.js → codex-adapter-CXD4SVCE.js} +4 -3
- package/dist/chunks/{copilot-adapter-2QAIOSEK.js → copilot-adapter-SYFGOAGE.js} +456 -632
- package/dist/chunks/{managed-agent-adapter-KEXZFLGA.js → managed-agent-adapter-ODCNYYO6.js} +14 -6
- package/dist/chunks/{pi-adapter-5BFIJTPD.js → pi-adapter-XLY46UDL.js} +4 -3
- package/dist/configuration.js +4 -3
- package/dist/index.d.ts +51 -0
- package/dist/index.js +62 -34
- package/dist/runtime.js +2 -2
- package/dist/session-analytics-worker.js +474 -0
- package/package.json +1 -1
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentSelectionSchema,
|
|
3
3
|
assertSelectionSnapshotFits
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DAKDVZ7X.js";
|
|
5
5
|
import {
|
|
6
6
|
isResearchSessionId
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-WPVH7HKC.js";
|
|
8
8
|
import {
|
|
9
9
|
GroupChatError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EDZPP6SJ.js";
|
|
11
11
|
import {
|
|
12
12
|
AgentModelListingError,
|
|
13
13
|
AgentSessionRenameError,
|
|
14
14
|
CODING_AGENT_IDS,
|
|
15
|
-
SessionOperationError,
|
|
16
15
|
UnsupportedAgentOperationError,
|
|
17
16
|
captureWorkbenchAccess,
|
|
18
17
|
validateSessionName
|
|
19
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3LEPYV7Y.js";
|
|
19
|
+
import {
|
|
20
|
+
SessionOperationError
|
|
21
|
+
} from "./chunk-7ZYBES47.js";
|
|
20
22
|
import {
|
|
21
23
|
InteractionResponseSchema,
|
|
22
24
|
SessionSummarySchema
|
|
23
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-KBI5IWPR.js";
|
|
24
26
|
|
|
25
27
|
// src/managed-agent-adapter.ts
|
|
26
28
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -164,6 +166,12 @@ var ManagedCodingAgentAdapter = class {
|
|
|
164
166
|
queue: (id) => this.#withWorkbench(id, (runtime, native) => runtime.queue(native)),
|
|
165
167
|
mutateQueue: (id, request) => this.#withWorkbench(id, (runtime, native) => runtime.mutateQueue(native, request)),
|
|
166
168
|
insights: (id) => this.#withWorkbench(id, (runtime, native) => runtime.insights(native)),
|
|
169
|
+
analytics: (id, request) => this.#withWorkbench(id, (runtime, native) => {
|
|
170
|
+
if (runtime.analytics === void 0) {
|
|
171
|
+
throw new SessionOperationError("ANALYTICS_UNSUPPORTED", "This agent does not expose passive analytics");
|
|
172
|
+
}
|
|
173
|
+
return runtime.analytics(native, request);
|
|
174
|
+
}, false),
|
|
167
175
|
compact: (id) => this.#withWorkbench(id, (runtime, native) => runtime.compact(native))
|
|
168
176
|
};
|
|
169
177
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
latestPreviewItems
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IPJWNGNK.js";
|
|
4
4
|
import {
|
|
5
5
|
AgentSessionRenameError,
|
|
6
6
|
UnsupportedAgentOperationError,
|
|
7
7
|
validateSessionName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3LEPYV7Y.js";
|
|
9
|
+
import "./chunk-7ZYBES47.js";
|
|
9
10
|
import {
|
|
10
11
|
InteractionRequestSchema,
|
|
11
12
|
REASONING_EFFORTS,
|
|
12
13
|
SESSION_TIMELINE_PAGE_SIZE
|
|
13
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KBI5IWPR.js";
|
|
14
15
|
|
|
15
16
|
// src/pi-adapter.ts
|
|
16
17
|
import { createHash as createHash2, randomUUID } from "node:crypto";
|
package/dist/configuration.js
CHANGED
|
@@ -5,15 +5,16 @@ import {
|
|
|
5
5
|
} from "./chunks/chunk-XPHAIOKN.js";
|
|
6
6
|
import {
|
|
7
7
|
AgentSelectionSchema
|
|
8
|
-
} from "./chunks/chunk-
|
|
8
|
+
} from "./chunks/chunk-DAKDVZ7X.js";
|
|
9
9
|
import {
|
|
10
10
|
SessionImageRelayUrlSchema,
|
|
11
11
|
SessionImagesConfigSchema
|
|
12
12
|
} from "./chunks/chunk-IJPJQF7S.js";
|
|
13
13
|
import {
|
|
14
14
|
CODING_AGENT_IDS
|
|
15
|
-
} from "./chunks/chunk-
|
|
16
|
-
import "./chunks/chunk-
|
|
15
|
+
} from "./chunks/chunk-3LEPYV7Y.js";
|
|
16
|
+
import "./chunks/chunk-7ZYBES47.js";
|
|
17
|
+
import "./chunks/chunk-KBI5IWPR.js";
|
|
17
18
|
export {
|
|
18
19
|
AgentSelectionSchema,
|
|
19
20
|
CODING_AGENT_IDS,
|
package/dist/index.d.ts
CHANGED
|
@@ -1443,6 +1443,55 @@ declare const WorkbenchCompactResultSchema: z.ZodObject<{
|
|
|
1443
1443
|
}, z.core.$strict>;
|
|
1444
1444
|
type WorkbenchCompactResult = z.infer<typeof WorkbenchCompactResultSchema>;
|
|
1445
1445
|
|
|
1446
|
+
declare const SessionAnalyticsRequestSchema: z.ZodObject<{
|
|
1447
|
+
since: z.ZodISODateTime;
|
|
1448
|
+
until: z.ZodISODateTime;
|
|
1449
|
+
timeZone: z.ZodString;
|
|
1450
|
+
}, z.core.$strict>;
|
|
1451
|
+
declare const SessionAnalyticsResultSchema: z.ZodObject<{
|
|
1452
|
+
sampledAt: z.ZodISODateTime;
|
|
1453
|
+
days: z.ZodArray<z.ZodObject<{
|
|
1454
|
+
date: z.ZodString;
|
|
1455
|
+
messages: z.ZodNumber;
|
|
1456
|
+
models: z.ZodArray<z.ZodObject<{
|
|
1457
|
+
model: z.ZodString;
|
|
1458
|
+
calls: z.ZodNumber;
|
|
1459
|
+
inputTokens: z.ZodNumber;
|
|
1460
|
+
outputTokens: z.ZodNumber;
|
|
1461
|
+
cacheReadTokens: z.ZodOptional<z.ZodNumber>;
|
|
1462
|
+
}, z.core.$strict>>;
|
|
1463
|
+
}, z.core.$strict>>;
|
|
1464
|
+
historyTruncated: z.ZodBoolean;
|
|
1465
|
+
usageTruncated: z.ZodBoolean;
|
|
1466
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1467
|
+
name: z.ZodString;
|
|
1468
|
+
description: z.ZodOptional<z.ZodString>;
|
|
1469
|
+
source: z.ZodString;
|
|
1470
|
+
enabled: z.ZodBoolean;
|
|
1471
|
+
userInvocable: z.ZodBoolean;
|
|
1472
|
+
commandName: z.ZodOptional<z.ZodString>;
|
|
1473
|
+
}, z.core.$strip>>>;
|
|
1474
|
+
skillsSampledAt: z.ZodOptional<z.ZodISODateTime>;
|
|
1475
|
+
userActivity: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1476
|
+
date: z.ZodString;
|
|
1477
|
+
messages: z.ZodNumber;
|
|
1478
|
+
keywords: z.ZodArray<z.ZodObject<{
|
|
1479
|
+
term: z.ZodString;
|
|
1480
|
+
messages: z.ZodNumber;
|
|
1481
|
+
}, z.core.$strict>>;
|
|
1482
|
+
keywordsTruncated: z.ZodBoolean;
|
|
1483
|
+
}, z.core.$strict>>>;
|
|
1484
|
+
coverage: z.ZodOptional<z.ZodObject<{
|
|
1485
|
+
recordingStartedAt: z.ZodISODateTime;
|
|
1486
|
+
usageObservedSince: z.ZodISODateTime;
|
|
1487
|
+
historyIndexedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
1488
|
+
droppedEvents: z.ZodNumber;
|
|
1489
|
+
usageSource: z.ZodLiteral<"observed">;
|
|
1490
|
+
}, z.core.$strict>>;
|
|
1491
|
+
}, z.core.$strict>;
|
|
1492
|
+
type SessionAnalyticsRequest = z.infer<typeof SessionAnalyticsRequestSchema>;
|
|
1493
|
+
type SessionAnalyticsResult = z.infer<typeof SessionAnalyticsResultSchema>;
|
|
1494
|
+
|
|
1446
1495
|
declare const WorkbenchScheduleSnapshotSchema: z.ZodObject<{
|
|
1447
1496
|
state: z.ZodEnum<{
|
|
1448
1497
|
active: "active";
|
|
@@ -1660,6 +1709,7 @@ interface WorkbenchSchedules {
|
|
|
1660
1709
|
}
|
|
1661
1710
|
|
|
1662
1711
|
interface WorkbenchRuntime {
|
|
1712
|
+
analytics?(sessionId: string, request: SessionAnalyticsRequest): Promise<SessionAnalyticsResult>;
|
|
1663
1713
|
readonly schedules?: WorkbenchSchedules;
|
|
1664
1714
|
ask(sessionId: string, question: string): Promise<WorkbenchAskResult>;
|
|
1665
1715
|
commands(sessionId: string): Promise<WorkbenchCommand[]>;
|
|
@@ -2092,6 +2142,7 @@ declare const UploaderConfigSchema: z.ZodObject<{
|
|
|
2092
2142
|
direct: "direct";
|
|
2093
2143
|
proxy: "proxy";
|
|
2094
2144
|
}>>;
|
|
2145
|
+
clientVerifiedUploads: z.ZodDefault<z.ZodBoolean>;
|
|
2095
2146
|
}, z.core.$strip>;
|
|
2096
2147
|
type SessionImageUploaderConfig = z.input<typeof UploaderConfigSchema>;
|
|
2097
2148
|
type Stage = "config" | "source" | "reserve" | "put" | "complete";
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
detectClaude,
|
|
3
|
+
detectCopilot,
|
|
4
|
+
detectPi,
|
|
5
|
+
hasLocalExecutable
|
|
6
|
+
} from "./chunks/chunk-T6226JFS.js";
|
|
1
7
|
import {
|
|
2
8
|
DataDirectoryLease,
|
|
3
9
|
PEER_CHAT_TIMEOUT_MS,
|
|
4
10
|
PeerChatRequestSchema,
|
|
5
11
|
PeerChatResultSchema,
|
|
6
12
|
validateDataDirectory
|
|
7
|
-
} from "./chunks/chunk-
|
|
13
|
+
} from "./chunks/chunk-USI66MEF.js";
|
|
8
14
|
import {
|
|
9
15
|
DeviceIdentitySchema,
|
|
10
16
|
codingAgentPresentation,
|
|
@@ -14,9 +20,8 @@ import {
|
|
|
14
20
|
AgentSelectionSchema,
|
|
15
21
|
assertSelectionSnapshotFits,
|
|
16
22
|
supportsAgentSelection
|
|
17
|
-
} from "./chunks/chunk-
|
|
23
|
+
} from "./chunks/chunk-DAKDVZ7X.js";
|
|
18
24
|
import {
|
|
19
|
-
ConversationNormalizer,
|
|
20
25
|
LiveTimelineProjection,
|
|
21
26
|
OperationDiagnostics,
|
|
22
27
|
OperationMetrics,
|
|
@@ -28,7 +33,6 @@ import {
|
|
|
28
33
|
diagnosticError,
|
|
29
34
|
diagnosticReference,
|
|
30
35
|
diagnosticRequest,
|
|
31
|
-
isDisplayableHumanMessage,
|
|
32
36
|
isSessionRestoreFailure,
|
|
33
37
|
measureOperationPhase,
|
|
34
38
|
projectWorkbenchInsights,
|
|
@@ -38,37 +42,37 @@ import {
|
|
|
38
42
|
resolveGitProjectIdentity,
|
|
39
43
|
sessionRestoreFailure,
|
|
40
44
|
validateOperationResponse
|
|
41
|
-
} from "./chunks/chunk-
|
|
45
|
+
} from "./chunks/chunk-OOCAIULD.js";
|
|
42
46
|
import {
|
|
43
47
|
SessionImageRelayUrlSchema,
|
|
44
48
|
SessionImagesConfigSchema
|
|
45
49
|
} from "./chunks/chunk-IJPJQF7S.js";
|
|
50
|
+
import {
|
|
51
|
+
ConversationNormalizer,
|
|
52
|
+
isDisplayableHumanMessage
|
|
53
|
+
} from "./chunks/chunk-LT5ULDVT.js";
|
|
46
54
|
import {
|
|
47
55
|
GROUP_CHAT_MAX_TURNS,
|
|
48
56
|
GroupChatError
|
|
49
|
-
} from "./chunks/chunk-
|
|
50
|
-
import {
|
|
51
|
-
detectClaude,
|
|
52
|
-
detectCopilot,
|
|
53
|
-
detectPi,
|
|
54
|
-
hasLocalExecutable
|
|
55
|
-
} from "./chunks/chunk-T6226JFS.js";
|
|
57
|
+
} from "./chunks/chunk-EDZPP6SJ.js";
|
|
56
58
|
import {
|
|
57
59
|
assistantPreview,
|
|
58
60
|
isContentfulAssistant,
|
|
59
61
|
userPreview
|
|
60
|
-
} from "./chunks/chunk-
|
|
62
|
+
} from "./chunks/chunk-IPJWNGNK.js";
|
|
61
63
|
import {
|
|
62
64
|
AgentModelListingError,
|
|
63
65
|
AgentSessionRenameError,
|
|
64
66
|
CODING_AGENT_IDS,
|
|
65
|
-
SessionOperationError,
|
|
66
|
-
SessionOperations,
|
|
67
67
|
TimelinePageBudgetError,
|
|
68
68
|
UnsupportedAgentOperationError,
|
|
69
69
|
captureResearchAccess,
|
|
70
70
|
captureWorkbenchAccess
|
|
71
|
-
} from "./chunks/chunk-
|
|
71
|
+
} from "./chunks/chunk-3LEPYV7Y.js";
|
|
72
|
+
import {
|
|
73
|
+
SessionOperationError,
|
|
74
|
+
SessionOperations
|
|
75
|
+
} from "./chunks/chunk-7ZYBES47.js";
|
|
72
76
|
import {
|
|
73
77
|
A2aRelayRequestSchema,
|
|
74
78
|
A2aRelayResponseSchema,
|
|
@@ -157,6 +161,7 @@ import {
|
|
|
157
161
|
SESSION_GIT_DIFF_OPERATION,
|
|
158
162
|
SESSION_GIT_DIFF_PARTIAL_VERSION,
|
|
159
163
|
SESSION_GIT_DIFF_VERSION,
|
|
164
|
+
SESSION_IMAGE_CLIENT_VERIFIED_CAPABILITY,
|
|
160
165
|
SESSION_IMAGE_MAX_BYTES,
|
|
161
166
|
SESSION_IMAGE_MAX_PIXELS,
|
|
162
167
|
SESSION_IMAGE_STORAGE_CAPABILITY,
|
|
@@ -178,6 +183,8 @@ import {
|
|
|
178
183
|
SecureMessageSchema,
|
|
179
184
|
SessionAbortRequestSchema,
|
|
180
185
|
SessionActivityUpdateSchema,
|
|
186
|
+
SessionAnalyticsRequestSchema,
|
|
187
|
+
SessionAnalyticsResultSchema,
|
|
181
188
|
SessionCommunicationDataSchema,
|
|
182
189
|
SessionCommunicationRequestSchema,
|
|
183
190
|
SessionCommunicationSchema,
|
|
@@ -263,7 +270,7 @@ import {
|
|
|
263
270
|
sessionCommunicationError,
|
|
264
271
|
sessionCommunicationOperationCapability,
|
|
265
272
|
workbenchCapability
|
|
266
|
-
} from "./chunks/chunk-
|
|
273
|
+
} from "./chunks/chunk-KBI5IWPR.js";
|
|
267
274
|
|
|
268
275
|
// src/initialize.ts
|
|
269
276
|
import { createHash as createHash16 } from "node:crypto";
|
|
@@ -283,7 +290,7 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
283
290
|
switch (engine.kind) {
|
|
284
291
|
case "managed": {
|
|
285
292
|
if (owner === void 0) throw new Error("Managed coding agents require the PC owner identity");
|
|
286
|
-
const { ManagedCodingAgentAdapter } = await import("./chunks/managed-agent-adapter-
|
|
293
|
+
const { ManagedCodingAgentAdapter } = await import("./chunks/managed-agent-adapter-ODCNYYO6.js");
|
|
287
294
|
return new ManagedCodingAgentAdapter({
|
|
288
295
|
dataDirectory: config.dataDirectory,
|
|
289
296
|
owner,
|
|
@@ -340,13 +347,21 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
340
347
|
});
|
|
341
348
|
}
|
|
342
349
|
case "copilot": {
|
|
343
|
-
const { GithubCopilotAdapter } = await import("./chunks/copilot-adapter-
|
|
350
|
+
const { GithubCopilotAdapter } = await import("./chunks/copilot-adapter-SYFGOAGE.js");
|
|
344
351
|
if (owner !== void 0) {
|
|
345
|
-
return new GithubCopilotAdapter(
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
352
|
+
return new GithubCopilotAdapter(
|
|
353
|
+
void 0,
|
|
354
|
+
void 0,
|
|
355
|
+
void 0,
|
|
356
|
+
{
|
|
357
|
+
dataDirectory: config.dataDirectory,
|
|
358
|
+
owner,
|
|
359
|
+
enabled: config.groupChatEnabled ?? true
|
|
360
|
+
},
|
|
361
|
+
config.peerChatEnabled !== false,
|
|
362
|
+
resolve(config.dataDirectory, "schedule-drafts"),
|
|
363
|
+
resolve(config.dataDirectory, "analytics")
|
|
364
|
+
);
|
|
350
365
|
}
|
|
351
366
|
if (config.groupChatEnabled) throw new Error("Group chat requires the PC owner identity");
|
|
352
367
|
return new GithubCopilotAdapter(
|
|
@@ -355,18 +370,19 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
355
370
|
void 0,
|
|
356
371
|
void 0,
|
|
357
372
|
config.peerChatEnabled !== false,
|
|
358
|
-
resolve(config.dataDirectory, "schedule-drafts")
|
|
373
|
+
resolve(config.dataDirectory, "schedule-drafts"),
|
|
374
|
+
resolve(config.dataDirectory, "analytics")
|
|
359
375
|
);
|
|
360
376
|
}
|
|
361
377
|
case "pi": {
|
|
362
378
|
assertPiRuntimeSupported();
|
|
363
|
-
const { PiCodingAgentAdapter } = await import("./chunks/pi-adapter-
|
|
379
|
+
const { PiCodingAgentAdapter } = await import("./chunks/pi-adapter-XLY46UDL.js");
|
|
364
380
|
return new PiCodingAgentAdapter(
|
|
365
381
|
engine.agentDirectory === void 0 ? {} : { agentDirectory: resolve(engine.agentDirectory) }
|
|
366
382
|
);
|
|
367
383
|
}
|
|
368
384
|
case "codex": {
|
|
369
|
-
const { CodexCodingAgentAdapter } = await import("./chunks/codex-adapter-
|
|
385
|
+
const { CodexCodingAgentAdapter } = await import("./chunks/codex-adapter-CXD4SVCE.js");
|
|
370
386
|
return new CodexCodingAgentAdapter({
|
|
371
387
|
dataDirectory: resolve(config.dataDirectory, "coding-agents"),
|
|
372
388
|
...owner === void 0 ? {} : { nativeSessionOwner: owner },
|
|
@@ -375,7 +391,7 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
375
391
|
});
|
|
376
392
|
}
|
|
377
393
|
case "claude": {
|
|
378
|
-
const { ClaudeCodingAgentAdapter } = await import("./chunks/claude-adapter-
|
|
394
|
+
const { ClaudeCodingAgentAdapter } = await import("./chunks/claude-adapter-GCH36EZ6.js");
|
|
379
395
|
return new ClaudeCodingAgentAdapter({
|
|
380
396
|
dataDirectory: resolve(config.dataDirectory, "coding-agents"),
|
|
381
397
|
...owner === void 0 ? {} : { nativeSessionOwner: owner },
|
|
@@ -383,7 +399,7 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
383
399
|
});
|
|
384
400
|
}
|
|
385
401
|
case "acp": {
|
|
386
|
-
const { AcpCodingAgentAdapter } = await import("./chunks/acp-adapter-
|
|
402
|
+
const { AcpCodingAgentAdapter } = await import("./chunks/acp-adapter-WYDK3PLS.js");
|
|
387
403
|
return new AcpCodingAgentAdapter({
|
|
388
404
|
command: engine.command,
|
|
389
405
|
args: engine.args,
|
|
@@ -1728,7 +1744,10 @@ var diagnosticCodes = /* @__PURE__ */ new Set([
|
|
|
1728
1744
|
"SCHEDULE_DRAFT_STORE_UNAVAILABLE",
|
|
1729
1745
|
"SCHEDULE_DRAFT_NOT_FOUND",
|
|
1730
1746
|
"SCHEDULE_DRAFT_LIMIT",
|
|
1731
|
-
"SCHEDULE_OUTCOME_UNCERTAIN"
|
|
1747
|
+
"SCHEDULE_OUTCOME_UNCERTAIN",
|
|
1748
|
+
"ANALYTICS_INVALID",
|
|
1749
|
+
"ANALYTICS_UNAVAILABLE",
|
|
1750
|
+
"ANALYTICS_UNSUPPORTED"
|
|
1732
1751
|
]);
|
|
1733
1752
|
var diagnosticNames = /* @__PURE__ */ new Set([
|
|
1734
1753
|
"Error",
|
|
@@ -1878,6 +1897,10 @@ function createWorkbenchOperations(options) {
|
|
|
1878
1897
|
route("context.compact", WorkbenchSubmitRequestSchema, (data, request2) => submit(request2, data, async () => output(WorkbenchCompactResultSchema, await runtime.compact(request2.sessionId))))
|
|
1879
1898
|
);
|
|
1880
1899
|
const research = options.research;
|
|
1900
|
+
if (runtime?.analytics !== void 0) {
|
|
1901
|
+
const analytics = runtime.analytics.bind(runtime);
|
|
1902
|
+
routes.push(route("analytics.read", SessionAnalyticsRequestSchema, async (data, request2) => output(SessionAnalyticsResultSchema, await analytics(request2.sessionId, data))));
|
|
1903
|
+
}
|
|
1881
1904
|
if (research !== void 0) routes.push(
|
|
1882
1905
|
route("research.create", WorkbenchResearchCreateRequestSchema, (data, request2) => submit(request2, data, async () => output(WorkbenchResearchCreateResultSchema, {
|
|
1883
1906
|
thread: await research.create({
|
|
@@ -4097,7 +4120,7 @@ var SessionCommunicationHandler = class {
|
|
|
4097
4120
|
if (researchParent !== void 0) {
|
|
4098
4121
|
if (lifecycle !== void 0) lifecycle.preflightPhase = "isolation";
|
|
4099
4122
|
const unifiedSync = research?.chat !== void 0 && this.options.supportsResearchChat?.(clientId) === true && (request2.operation === TIMELINE_SYNC_OPERATION || request2.operation === TIMELINE_IMAGE_OPERATION || request2.operation === TIMELINE_IMAGE_BLOB_OPERATION);
|
|
4100
|
-
if (!unifiedSync && !["research.timeline", "research.send", "research.abort", "research.delete", "operation.get", "insights.read"].includes(request2.operation)) {
|
|
4123
|
+
if (!unifiedSync && !["research.timeline", "research.send", "research.abort", "research.delete", "operation.get", "insights.read", "analytics.read"].includes(request2.operation)) {
|
|
4101
4124
|
reject("research-isolated");
|
|
4102
4125
|
emit("session.communication", sessionCommunicationError(request2, {
|
|
4103
4126
|
code: "RESEARCH_SESSION_ISOLATED",
|
|
@@ -7454,7 +7477,7 @@ function canAppend(previous, item) {
|
|
|
7454
7477
|
|
|
7455
7478
|
// src/timeline-image-blob.ts
|
|
7456
7479
|
import { createHash as createHash14 } from "node:crypto";
|
|
7457
|
-
var MAX_ACTIVE_PUBLICATIONS =
|
|
7480
|
+
var MAX_ACTIVE_PUBLICATIONS = 16;
|
|
7458
7481
|
var MAX_QUEUED_PUBLICATIONS = 16;
|
|
7459
7482
|
var QUEUE_TIMEOUT_MS = 15e3;
|
|
7460
7483
|
var PUBLICATION_TIMEOUT_MS = 85e3;
|
|
@@ -8557,6 +8580,7 @@ var PcAgent = class {
|
|
|
8557
8580
|
#conversationAudience = new ConversationAudience();
|
|
8558
8581
|
#timelineIncremental;
|
|
8559
8582
|
#imageBlob;
|
|
8583
|
+
#imageClientVerified = false;
|
|
8560
8584
|
#imageStorage;
|
|
8561
8585
|
#sessionImagesEnabled;
|
|
8562
8586
|
#imagePolicyRevision = 0;
|
|
@@ -9246,16 +9270,19 @@ var PcAgent = class {
|
|
|
9246
9270
|
throw new RelayRegistrationError(ack);
|
|
9247
9271
|
}
|
|
9248
9272
|
const storage = ack.sessionImageStorage === void 0 ? void 0 : SessionImageStorageSchema.parse(ack.sessionImageStorage);
|
|
9249
|
-
|
|
9273
|
+
const clientVerifiedUploads = storage?.mode === "direct" && ack.capabilities?.includes(SESSION_IMAGE_CLIENT_VERIFIED_CAPABILITY) === true;
|
|
9274
|
+
if (JSON.stringify(storage) !== JSON.stringify(this.#imageStorage) || clientVerifiedUploads !== this.#imageClientVerified) {
|
|
9250
9275
|
this.#imagePolicyRevision += 1;
|
|
9251
9276
|
this.#imageBlob?.reset();
|
|
9252
9277
|
this.#imageStorage = storage;
|
|
9278
|
+
this.#imageClientVerified = clientVerifiedUploads;
|
|
9253
9279
|
this.#imageBlob = storage === void 0 || !SessionImageRelayUrlSchema.safeParse(this.config.relayUrl).success ? void 0 : new TimelineImageBlobPublisher(this.#timelineIncremental.images, new SessionImageUploader({
|
|
9254
9280
|
relayUrl: this.config.relayUrl,
|
|
9255
9281
|
relayToken: this.config.relayToken,
|
|
9256
9282
|
userId: this.config.userId,
|
|
9257
9283
|
machineId: this.identity.machineId,
|
|
9258
|
-
...storage
|
|
9284
|
+
...storage,
|
|
9285
|
+
clientVerifiedUploads
|
|
9259
9286
|
}));
|
|
9260
9287
|
}
|
|
9261
9288
|
this.#registrationCapabilities = JSON.stringify(hello.capabilities);
|
|
@@ -9288,6 +9315,7 @@ var PcAgent = class {
|
|
|
9288
9315
|
SESSION_COMMUNICATION_CAPABILITY,
|
|
9289
9316
|
...this.textInputWriter === void 0 ? [] : [DEVICE_TEXT_INPUT_CAPABILITY],
|
|
9290
9317
|
SESSION_IMAGE_STORAGE_CAPABILITY,
|
|
9318
|
+
SESSION_IMAGE_CLIENT_VERIFIED_CAPABILITY,
|
|
9291
9319
|
...this.#sessionImagesEnabled && this.sessionImageStorage !== void 0 ? [PC_IMAGE_BLOB_POLICY_CAPABILITY, TIMELINE_IMAGE_BLOB_CAPABILITY] : [],
|
|
9292
9320
|
...this.#peerChatEnabled && this.adapter.runPeerTurn !== void 0 ? [PC_PEER_CHAT_CAPABILITY] : [],
|
|
9293
9321
|
...this.adapter.runPeerTurn !== void 0 ? [PC_A2A_CAPABILITY] : [],
|
package/dist/runtime.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
PEER_CHAT_TIMEOUT_MS,
|
|
4
4
|
PeerChatRequestSchema,
|
|
5
5
|
PeerChatResultSchema
|
|
6
|
-
} from "./chunks/chunk-
|
|
7
|
-
import "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-USI66MEF.js";
|
|
7
|
+
import "./chunks/chunk-KBI5IWPR.js";
|
|
8
8
|
export {
|
|
9
9
|
DataDirectoryLease,
|
|
10
10
|
PEER_CHAT_TIMEOUT_MS,
|