@agentknight/sdk 0.9.44 → 0.9.46
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-JKSOVQJ7.js → acp-adapter-3CQCDP5H.js} +3 -3
- package/dist/chunks/{chunk-UNRPSTRM.js → chunk-7A2SQAZ7.js} +1 -1
- package/dist/chunks/{chunk-4UAMAGVT.js → chunk-DCY33KQC.js} +2 -2
- package/dist/chunks/{chunk-W6TZVD7W.js → chunk-DUMC5F2D.js} +338 -317
- package/dist/chunks/{chunk-ZGO2OSQZ.js → chunk-GRXWNM6S.js} +1 -1
- package/dist/chunks/{chunk-EWXFUECA.js → chunk-MUKGV7IE.js} +4 -4
- package/dist/chunks/{chunk-LRSHP7WN.js → chunk-OPUBIQCO.js} +2 -2
- package/dist/chunks/{chunk-AK3YVBEP.js → chunk-QBKKQQCB.js} +1 -1
- package/dist/chunks/{chunk-ZST7M4CD.js → chunk-TKIZWXMQ.js} +1 -1
- package/dist/chunks/{claude-adapter-A5EFNV5S.js → claude-adapter-CBEKRKPT.js} +3 -3
- package/dist/chunks/{codex-adapter-MMQK47KY.js → codex-adapter-IR5E7AMV.js} +3 -3
- package/dist/chunks/{copilot-adapter-Y5W4ZUFD.js → copilot-adapter-7IACBBQ6.js} +26 -15
- package/dist/chunks/{managed-agent-adapter-HDLOSSHZ.js → managed-agent-adapter-UYLBGRNG.js} +5 -5
- package/dist/chunks/{pi-adapter-6EF6Z5CP.js → pi-adapter-5PZT5YQN.js} +3 -3
- package/dist/index.js +13 -13
- package/dist/runtime.js +2 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isContentfulAssistant
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QBKKQQCB.js";
|
|
4
4
|
import {
|
|
5
5
|
SessionOperationError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7A2SQAZ7.js";
|
|
7
7
|
import {
|
|
8
8
|
CONVERSATION_SOURCE_ID_LIMIT,
|
|
9
9
|
SESSION_DIRECTORY_LIST_OPERATION,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
WorkbenchInsightsSchema,
|
|
24
24
|
WorkbenchQueueMutationResultSchema,
|
|
25
25
|
WorkbenchQueueSnapshotSchema
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DUMC5F2D.js";
|
|
27
27
|
|
|
28
28
|
// src/operation-diagnostics.ts
|
|
29
29
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
@@ -515,7 +515,7 @@ function isDisplayableHumanMessage(event) {
|
|
|
515
515
|
return false;
|
|
516
516
|
}
|
|
517
517
|
const source = event.data.source;
|
|
518
|
-
return event.data.isAutopilotContinuation !== true && (source === void 0 || source === "user" || source === "mobile");
|
|
518
|
+
return event.data.isAutopilotContinuation !== true && (source === void 0 || source === "user" || source === "mobile" || /^schedule-[1-9]\d*$/.test(source));
|
|
519
519
|
}
|
|
520
520
|
function projectAttachment(attachment) {
|
|
521
521
|
switch (attachment.type) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentSessionRenameError,
|
|
3
3
|
validateSessionName
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7A2SQAZ7.js";
|
|
5
5
|
import {
|
|
6
6
|
ConversationItemSchema,
|
|
7
7
|
GroupChatInfoSchema,
|
|
8
8
|
GroupChatParticipantSchema,
|
|
9
9
|
SESSION_TIMELINE_PAGE_SIZE,
|
|
10
10
|
SessionSummarySchema
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DUMC5F2D.js";
|
|
12
12
|
|
|
13
13
|
// src/group-chat.ts
|
|
14
14
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
} from "./chunk-EIFNERXM.js";
|
|
4
4
|
import {
|
|
5
5
|
latestPreviewItems
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QBKKQQCB.js";
|
|
7
7
|
import {
|
|
8
8
|
UnsupportedAgentOperationError,
|
|
9
9
|
validateSessionName
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7A2SQAZ7.js";
|
|
11
11
|
import {
|
|
12
12
|
ConversationItemSchema,
|
|
13
13
|
InteractionRequestSchema,
|
|
14
14
|
InteractionResponseSchema,
|
|
15
15
|
SESSION_TIMELINE_PAGE_SIZE,
|
|
16
16
|
SessionSummarySchema
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DUMC5F2D.js";
|
|
18
18
|
|
|
19
19
|
// src/claude-adapter.ts
|
|
20
20
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
latestPreviewItems
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QBKKQQCB.js";
|
|
4
4
|
import {
|
|
5
5
|
UnsupportedAgentOperationError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7A2SQAZ7.js";
|
|
7
7
|
import {
|
|
8
8
|
ConversationItemSchema,
|
|
9
9
|
InteractionRequestSchema,
|
|
10
10
|
SESSION_TIMELINE_PAGE_SIZE,
|
|
11
11
|
SessionSummarySchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DUMC5F2D.js";
|
|
13
13
|
|
|
14
14
|
// src/codex-adapter.ts
|
|
15
15
|
import { randomUUID } from "node:crypto";
|
|
@@ -18,25 +18,25 @@ import {
|
|
|
18
18
|
recordTimelineSyncDiagnostic,
|
|
19
19
|
resolveGitProjectIdentity,
|
|
20
20
|
sanitizeGitRemoteUrl
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MUKGV7IE.js";
|
|
22
22
|
import {
|
|
23
23
|
assertMainSessionId,
|
|
24
24
|
isResearchSessionId
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-TKIZWXMQ.js";
|
|
26
26
|
import {
|
|
27
27
|
GroupChatError,
|
|
28
28
|
GroupChatMessageSchema,
|
|
29
29
|
GroupChatRuntime
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-OPUBIQCO.js";
|
|
31
31
|
import {
|
|
32
32
|
isContentfulAssistant
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-QBKKQQCB.js";
|
|
34
34
|
import {
|
|
35
35
|
AgentSessionRenameError,
|
|
36
36
|
SessionOperationError,
|
|
37
37
|
TimelinePageBudgetError,
|
|
38
38
|
validateSessionName
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-7A2SQAZ7.js";
|
|
40
40
|
import {
|
|
41
41
|
ConversationItemSchema,
|
|
42
42
|
CopilotModelOptionSchema,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
WorkbenchScheduleEntrySchema,
|
|
58
58
|
WorkbenchScheduleProposalSchema,
|
|
59
59
|
WorkbenchScheduleSnapshotSchema
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-DUMC5F2D.js";
|
|
61
61
|
|
|
62
62
|
// src/copilot-adapter.ts
|
|
63
63
|
import { createHash as createHash4, randomUUID as randomUUID6 } from "node:crypto";
|
|
@@ -2340,6 +2340,12 @@ var Event = z4.object({
|
|
|
2340
2340
|
source: z4.string().optional(),
|
|
2341
2341
|
content: z4.string().optional(),
|
|
2342
2342
|
interactionId: z4.string().optional(),
|
|
2343
|
+
turnId: z4.string().optional(),
|
|
2344
|
+
messageId: z4.string().optional(),
|
|
2345
|
+
originatingMessageId: z4.string().optional(),
|
|
2346
|
+
apiCallId: z4.string().optional(),
|
|
2347
|
+
chunkIndex: z4.number().int().nonnegative().optional(),
|
|
2348
|
+
chunkCount: z4.number().int().positive().optional(),
|
|
2343
2349
|
parentToolCallId: z4.string().optional(),
|
|
2344
2350
|
delivery: z4.string().optional(),
|
|
2345
2351
|
toolRequests: z4.array(z4.unknown()).optional()
|
|
@@ -2372,12 +2378,17 @@ function projectScheduleHistory(input) {
|
|
|
2372
2378
|
const previousBoundary = events.slice(0, index).reverse().find((event) => ["session.idle", "session.start", "user.message", "assistant.turn_start"].includes(event.type));
|
|
2373
2379
|
const idleDelivery = trigger.data.delivery === "idle" || trigger.data.delivery === void 0 && ["session.idle", "session.start"].includes(previousBoundary?.type ?? "");
|
|
2374
2380
|
const associated = !merged && idleDelivery && inputs.length === 1 && inputs[0]?.id === trigger.id;
|
|
2375
|
-
const replies = associated ? span.filter((event) => event.type === "assistant.message"
|
|
2376
|
-
const
|
|
2381
|
+
const replies = associated ? span.filter((event) => event.type === "assistant.message") : [];
|
|
2382
|
+
const lastMessage = replies.at(-1);
|
|
2377
2383
|
const lastErrorIndex = span.reduce((last, event, position) => event.type === "session.error" ? position : last, -1);
|
|
2378
|
-
const lastReplyIndex =
|
|
2379
|
-
const
|
|
2380
|
-
const
|
|
2384
|
+
const lastReplyIndex = lastMessage === void 0 ? -1 : span.indexOf(lastMessage);
|
|
2385
|
+
const responseId = lastMessage?.data.apiCallId ?? lastMessage?.data.messageId;
|
|
2386
|
+
const response = responseId === void 0 ? replies.slice(-1) : replies.filter((event) => (event.data.apiCallId ?? event.data.messageId) === responseId);
|
|
2387
|
+
const chunkCount = lastMessage?.data.chunkCount;
|
|
2388
|
+
const complete = chunkCount === void 0 ? lastMessage?.data.chunkIndex === void 0 : lastMessage?.data.chunkIndex === chunkCount - 1 && new Set(response.map((event) => event.data.chunkIndex).filter((index2) => index2 !== void 0 && index2 < chunkCount)).size === chunkCount;
|
|
2389
|
+
const finished = span.some((event, position) => position > lastReplyIndex && (event.type === "session.idle" || event.type === "assistant.turn_end" && lastMessage?.data.turnId !== void 0 && event.data.turnId === lastMessage.data.turnId));
|
|
2390
|
+
const finalResponse = lastMessage !== void 0 && complete && finished && response.every((event) => event.data.interactionId === trigger.data.interactionId && (event.data.originatingMessageId === void 0 || event.data.originatingMessageId === trigger.data.messageId)) && response.every((event) => (event.data.toolRequests?.length ?? 0) === 0) && response.some((event) => event.data.content?.trim()) && lastReplyIndex > lastErrorIndex && !span.some((event, position) => position > lastReplyIndex && (event.type === "tool.execution_start" || event.type === "assistant.turn_start"));
|
|
2391
|
+
const explicitError = associated && lastErrorIndex >= 0 && !finalResponse;
|
|
2381
2392
|
const idle = span.some((event) => event.type === "session.idle");
|
|
2382
2393
|
const newerInput = span.some((event) => event.type === "user.message" && !event.data.source?.startsWith("skill-"));
|
|
2383
2394
|
return {
|
|
@@ -2386,10 +2397,10 @@ function projectScheduleHistory(input) {
|
|
|
2386
2397
|
triggerEventId: trigger.id,
|
|
2387
2398
|
time: trigger.timestamp,
|
|
2388
2399
|
prompt: (trigger.data.content ?? "").slice(0, 16e3),
|
|
2389
|
-
status: merged ? "merged" : explicitError ? "error" :
|
|
2390
|
-
|
|
2391
|
-
reply:
|
|
2392
|
-
replyEventId:
|
|
2400
|
+
status: merged ? "merged" : explicitError ? "error" : finalResponse ? "reply" : idle || newerInput || !associated ? "unknown" : "pending",
|
|
2401
|
+
...!finalResponse || lastMessage === void 0 ? {} : {
|
|
2402
|
+
reply: response.map((event) => event.data.content ?? "").filter(Boolean).join("\n\n").slice(0, 16e3),
|
|
2403
|
+
replyEventId: lastMessage.id
|
|
2393
2404
|
},
|
|
2394
2405
|
// Native error bodies can contain paths, credentials, or tool arguments.
|
|
2395
2406
|
...explicitError ? { error: "The session reported an error. Open the chat for details." } : {}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentSelectionSchema,
|
|
3
3
|
assertSelectionSnapshotFits
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DCY33KQC.js";
|
|
5
5
|
import {
|
|
6
6
|
isResearchSessionId
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TKIZWXMQ.js";
|
|
8
8
|
import {
|
|
9
9
|
GroupChatError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OPUBIQCO.js";
|
|
11
11
|
import {
|
|
12
12
|
AgentModelListingError,
|
|
13
13
|
AgentSessionRenameError,
|
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
UnsupportedAgentOperationError,
|
|
17
17
|
captureWorkbenchAccess,
|
|
18
18
|
validateSessionName
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7A2SQAZ7.js";
|
|
20
20
|
import {
|
|
21
21
|
InteractionResponseSchema,
|
|
22
22
|
SessionSummarySchema
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-DUMC5F2D.js";
|
|
24
24
|
|
|
25
25
|
// src/managed-agent-adapter.ts
|
|
26
26
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
latestPreviewItems
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QBKKQQCB.js";
|
|
4
4
|
import {
|
|
5
5
|
AgentSessionRenameError,
|
|
6
6
|
UnsupportedAgentOperationError,
|
|
7
7
|
validateSessionName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7A2SQAZ7.js";
|
|
9
9
|
import {
|
|
10
10
|
InteractionRequestSchema,
|
|
11
11
|
REASONING_EFFORTS,
|
|
12
12
|
SESSION_TIMELINE_PAGE_SIZE
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DUMC5F2D.js";
|
|
14
14
|
|
|
15
15
|
// src/pi-adapter.ts
|
|
16
16
|
import { createHash as createHash2, randomUUID } from "node:crypto";
|
package/dist/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
PeerChatRequestSchema,
|
|
5
5
|
PeerChatResultSchema,
|
|
6
6
|
validateDataDirectory
|
|
7
|
-
} from "./chunks/chunk-
|
|
7
|
+
} from "./chunks/chunk-GRXWNM6S.js";
|
|
8
8
|
import {
|
|
9
9
|
AgentSelectionSchema,
|
|
10
10
|
assertSelectionSnapshotFits,
|
|
11
11
|
supportsAgentSelection
|
|
12
|
-
} from "./chunks/chunk-
|
|
12
|
+
} from "./chunks/chunk-DCY33KQC.js";
|
|
13
13
|
import {
|
|
14
14
|
ConversationNormalizer,
|
|
15
15
|
LiveTimelineProjection,
|
|
@@ -31,11 +31,11 @@ import {
|
|
|
31
31
|
resolveGitProjectIdentity,
|
|
32
32
|
sessionRestoreFailure,
|
|
33
33
|
validateOperationResponse
|
|
34
|
-
} from "./chunks/chunk-
|
|
34
|
+
} from "./chunks/chunk-MUKGV7IE.js";
|
|
35
35
|
import {
|
|
36
36
|
GROUP_CHAT_MAX_TURNS,
|
|
37
37
|
GroupChatError
|
|
38
|
-
} from "./chunks/chunk-
|
|
38
|
+
} from "./chunks/chunk-OPUBIQCO.js";
|
|
39
39
|
import {
|
|
40
40
|
detectClaude,
|
|
41
41
|
detectCopilot,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
assistantPreview,
|
|
47
47
|
isContentfulAssistant,
|
|
48
48
|
userPreview
|
|
49
|
-
} from "./chunks/chunk-
|
|
49
|
+
} from "./chunks/chunk-QBKKQQCB.js";
|
|
50
50
|
import {
|
|
51
51
|
AgentModelListingError,
|
|
52
52
|
AgentSessionRenameError,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
UnsupportedAgentOperationError,
|
|
58
58
|
captureResearchAccess,
|
|
59
59
|
captureWorkbenchAccess
|
|
60
|
-
} from "./chunks/chunk-
|
|
60
|
+
} from "./chunks/chunk-7A2SQAZ7.js";
|
|
61
61
|
import {
|
|
62
62
|
A2aRelayRequestSchema,
|
|
63
63
|
A2aRelayResponseSchema,
|
|
@@ -241,7 +241,7 @@ import {
|
|
|
241
241
|
sessionCommunicationError,
|
|
242
242
|
sessionCommunicationOperationCapability,
|
|
243
243
|
workbenchCapability
|
|
244
|
-
} from "./chunks/chunk-
|
|
244
|
+
} from "./chunks/chunk-DUMC5F2D.js";
|
|
245
245
|
|
|
246
246
|
// src/initialize.ts
|
|
247
247
|
import { createHash as createHash16 } from "node:crypto";
|
|
@@ -279,7 +279,7 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
279
279
|
switch (engine.kind) {
|
|
280
280
|
case "managed": {
|
|
281
281
|
if (owner === void 0) throw new Error("Managed coding agents require the PC owner identity");
|
|
282
|
-
const { ManagedCodingAgentAdapter } = await import("./chunks/managed-agent-adapter-
|
|
282
|
+
const { ManagedCodingAgentAdapter } = await import("./chunks/managed-agent-adapter-UYLBGRNG.js");
|
|
283
283
|
return new ManagedCodingAgentAdapter({
|
|
284
284
|
dataDirectory: config.dataDirectory,
|
|
285
285
|
owner,
|
|
@@ -336,7 +336,7 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
case "copilot": {
|
|
339
|
-
const { GithubCopilotAdapter } = await import("./chunks/copilot-adapter-
|
|
339
|
+
const { GithubCopilotAdapter } = await import("./chunks/copilot-adapter-7IACBBQ6.js");
|
|
340
340
|
if (owner !== void 0) {
|
|
341
341
|
return new GithubCopilotAdapter(void 0, void 0, void 0, {
|
|
342
342
|
dataDirectory: config.dataDirectory,
|
|
@@ -356,13 +356,13 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
356
356
|
}
|
|
357
357
|
case "pi": {
|
|
358
358
|
assertPiRuntimeSupported();
|
|
359
|
-
const { PiCodingAgentAdapter } = await import("./chunks/pi-adapter-
|
|
359
|
+
const { PiCodingAgentAdapter } = await import("./chunks/pi-adapter-5PZT5YQN.js");
|
|
360
360
|
return new PiCodingAgentAdapter(
|
|
361
361
|
engine.agentDirectory === void 0 ? {} : { agentDirectory: resolve(engine.agentDirectory) }
|
|
362
362
|
);
|
|
363
363
|
}
|
|
364
364
|
case "codex": {
|
|
365
|
-
const { CodexCodingAgentAdapter } = await import("./chunks/codex-adapter-
|
|
365
|
+
const { CodexCodingAgentAdapter } = await import("./chunks/codex-adapter-IR5E7AMV.js");
|
|
366
366
|
return new CodexCodingAgentAdapter({
|
|
367
367
|
dataDirectory: resolve(config.dataDirectory, "coding-agents"),
|
|
368
368
|
...engine.command === void 0 ? {} : { command: engine.command },
|
|
@@ -370,14 +370,14 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
372
|
case "claude": {
|
|
373
|
-
const { ClaudeCodingAgentAdapter } = await import("./chunks/claude-adapter-
|
|
373
|
+
const { ClaudeCodingAgentAdapter } = await import("./chunks/claude-adapter-CBEKRKPT.js");
|
|
374
374
|
return new ClaudeCodingAgentAdapter({
|
|
375
375
|
dataDirectory: resolve(config.dataDirectory, "coding-agents"),
|
|
376
376
|
...onDiagnostic === void 0 ? {} : { onDiagnostic }
|
|
377
377
|
});
|
|
378
378
|
}
|
|
379
379
|
case "acp": {
|
|
380
|
-
const { AcpCodingAgentAdapter } = await import("./chunks/acp-adapter-
|
|
380
|
+
const { AcpCodingAgentAdapter } = await import("./chunks/acp-adapter-3CQCDP5H.js");
|
|
381
381
|
return new AcpCodingAgentAdapter({
|
|
382
382
|
command: engine.command,
|
|
383
383
|
args: engine.args,
|
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-GRXWNM6S.js";
|
|
7
|
+
import "./chunks/chunk-DUMC5F2D.js";
|
|
8
8
|
export {
|
|
9
9
|
DataDirectoryLease,
|
|
10
10
|
PEER_CHAT_TIMEOUT_MS,
|