@agentknight/sdk 0.9.68 → 0.9.72
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-RZX5SUB3.js → acp-adapter-PCNN2NAJ.js} +41 -4
- package/dist/chunks/{chunk-Y6NCJB55.js → chunk-23BKGY5J.js} +4 -4
- package/dist/chunks/{chunk-UHRUQM4D.js → chunk-2UHBY25U.js} +1 -1
- package/dist/chunks/{chunk-CFQQOAQV.js → chunk-36KL4FSH.js} +2 -2
- package/dist/chunks/{chunk-FY4XTWUF.js → chunk-5BDFZ3AS.js} +4 -13
- package/dist/chunks/{chunk-DWTXWVIA.js → chunk-5FJJZCP6.js} +683 -629
- package/dist/chunks/{chunk-B777YB6E.js → chunk-DXHAKWGO.js} +2 -2
- package/dist/chunks/{chunk-35OF2ZNS.js → chunk-E5VHBC55.js} +14 -0
- package/dist/chunks/{chunk-MB3H6HEI.js → chunk-FQ26TSDG.js} +2 -2
- package/dist/chunks/{chunk-Q5OUZJCZ.js → chunk-GRUDMHEJ.js} +1 -1
- package/dist/chunks/{chunk-AWVC5NX4.js → chunk-I42IONUU.js} +1 -1
- package/dist/chunks/{chunk-4XT65OSG.js → chunk-KPHWVNKP.js} +46 -3
- package/dist/chunks/{chunk-EDYVCZIR.js → chunk-PAJZL5ST.js} +7 -2
- package/dist/chunks/{chunk-LCA2MWOQ.js → chunk-TFUSRA2B.js} +2 -2
- package/dist/chunks/chunk-UTF7KLMJ.js +11 -0
- package/dist/chunks/chunk-VEJLENEQ.js +174 -0
- package/dist/chunks/chunk-VOR4AECB.js +78 -0
- package/dist/chunks/{claude-adapter-FQSQIYUY.js → claude-adapter-A4LPYQ2Z.js} +296 -223
- package/dist/chunks/{codex-adapter-TOXSRT2W.js → codex-adapter-AFGS7MPX.js} +249 -66
- package/dist/chunks/{copilot-adapter-KUCX7XQW.js → copilot-adapter-NXJTI2HY.js} +27 -70
- package/dist/chunks/{managed-agent-adapter-LGBRXDGP.js → managed-agent-adapter-4C2PWD4V.js} +9 -7
- package/dist/chunks/{pi-adapter-RXNZSE4F.js → pi-adapter-EZOIK5RA.js} +7 -9
- package/dist/configuration.js +4 -4
- package/dist/index.d.ts +153 -8
- package/dist/index.js +183 -57
- package/dist/runtime.js +2 -2
- package/dist/session-analytics-worker.js +6 -7
- package/package.json +2 -3
- package/dist/chunks/chunk-IXGVSREH.js +0 -48
- package/dist/chunks/chunk-T6226JFS.js +0 -55
|
@@ -1,16 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
projectNativeImage
|
|
3
|
+
} from "./chunk-VOR4AECB.js";
|
|
4
|
+
import "./chunk-UTF7KLMJ.js";
|
|
5
|
+
import "./chunk-DXHAKWGO.js";
|
|
6
|
+
import "./chunk-E5VHBC55.js";
|
|
1
7
|
import {
|
|
2
8
|
latestPreviewItems
|
|
3
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KPHWVNKP.js";
|
|
4
10
|
import {
|
|
5
11
|
UnsupportedAgentOperationError
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-36KL4FSH.js";
|
|
13
|
+
import "./chunk-2UHBY25U.js";
|
|
8
14
|
import {
|
|
9
15
|
ConversationItemSchema,
|
|
10
16
|
PromptImageAttachmentSchema,
|
|
11
17
|
SESSION_TIMELINE_PAGE_SIZE,
|
|
12
18
|
SessionSummarySchema
|
|
13
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5FJJZCP6.js";
|
|
14
20
|
|
|
15
21
|
// src/acp-adapter.ts
|
|
16
22
|
import { spawn } from "node:child_process";
|
|
@@ -131,6 +137,9 @@ var AcpCodingAgentAdapter = class {
|
|
|
131
137
|
get supportsSessionDelete() {
|
|
132
138
|
return this.#capabilities.sessionCapabilities?.delete != null;
|
|
133
139
|
}
|
|
140
|
+
get supportsImageAttachments() {
|
|
141
|
+
return this.#capabilities.promptCapabilities?.image === true;
|
|
142
|
+
}
|
|
134
143
|
async canUpgrade() {
|
|
135
144
|
return this.#started && !this.#stopping && this.#fatalError === void 0 && this.#permissions.size === 0 && [...this.#sessions.values()].every((session) => session.active === void 0 && session.queue.length === 0 && session.loading === void 0 && !session.writeInProgress && session.persistenceError === void 0 && !session.items.some((item) => item.kind === "activity-group" && item.status === "running"));
|
|
136
145
|
}
|
|
@@ -719,6 +728,10 @@ var AcpCodingAgentAdapter = class {
|
|
|
719
728
|
const turnId = session.active?.id;
|
|
720
729
|
if (!turnId) return;
|
|
721
730
|
if (update.sessionUpdate === "agent_message_chunk") {
|
|
731
|
+
if (update.content.type === "image") {
|
|
732
|
+
this.#projectImage(session, turnId, update.messageId ?? "message", update.content);
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
722
735
|
if (update.content.type !== "text") {
|
|
723
736
|
this.#notice(session, turnId, "warning", "Unsupported agent content", update.content.type);
|
|
724
737
|
return;
|
|
@@ -757,6 +770,13 @@ var AcpCodingAgentAdapter = class {
|
|
|
757
770
|
timestamp: step?.timestamp ?? previous?.timestamp ?? base.timestamp
|
|
758
771
|
}]
|
|
759
772
|
});
|
|
773
|
+
if (status === "completed") {
|
|
774
|
+
for (const block of update.content ?? []) {
|
|
775
|
+
if (block.type === "content" && block.content.type === "image") {
|
|
776
|
+
this.#projectImage(session, turnId, update.toolCallId, block.content);
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
}
|
|
760
780
|
} else if (update.sessionUpdate === "plan") {
|
|
761
781
|
const id = hash(`${session.summary.sessionId}:plan`);
|
|
762
782
|
const previous = session.items.find((item) => item.id === id);
|
|
@@ -775,6 +795,23 @@ var AcpCodingAgentAdapter = class {
|
|
|
775
795
|
});
|
|
776
796
|
}
|
|
777
797
|
}
|
|
798
|
+
#projectImage(session, turnId, source, image) {
|
|
799
|
+
const attachment = projectNativeImage(image.data, image.mimeType);
|
|
800
|
+
if (!attachment) {
|
|
801
|
+
this.#notice(session, turnId, "warning", "Unsupported agent image", "The image format or size is not supported");
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
const id = hash(`${turnId}:image:${source}:${attachment.sha256}`);
|
|
805
|
+
if (session.items.some((item) => item.id === id)) return;
|
|
806
|
+
this.#upsert(session, {
|
|
807
|
+
...this.#base(id, turnId),
|
|
808
|
+
kind: "assistant-message",
|
|
809
|
+
actor: "assistant",
|
|
810
|
+
content: "",
|
|
811
|
+
final: true,
|
|
812
|
+
attachments: [attachment]
|
|
813
|
+
});
|
|
814
|
+
}
|
|
778
815
|
#permission(request, signal) {
|
|
779
816
|
const session = this.#sessions.get(request.sessionId);
|
|
780
817
|
if (!session?.active || session.active.cancelled || this.#stopping || signal.aborted) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConversationNormalizer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PAJZL5ST.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveCopilotSessionDirectory
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-E5VHBC55.js";
|
|
7
7
|
import {
|
|
8
8
|
isContentfulAssistant
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KPHWVNKP.js";
|
|
10
10
|
import {
|
|
11
11
|
SessionAnalyticsRequestSchema,
|
|
12
12
|
SessionTimelinePageSchema
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-5FJJZCP6.js";
|
|
14
14
|
|
|
15
15
|
// src/session-analytics-messages.ts
|
|
16
16
|
import { z } from "zod";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SessionOperationError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2UHBY25U.js";
|
|
4
4
|
import {
|
|
5
5
|
SESSION_NAME_MAX_LENGTH,
|
|
6
6
|
SessionNameSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5FJJZCP6.js";
|
|
8
8
|
|
|
9
9
|
// src/coding-agent-adapter.ts
|
|
10
10
|
var CODING_AGENT_IDS = ["copilot", "pi", "codex", "claude", "acp"];
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
ConversationNormalizer,
|
|
7
7
|
ConversationToolLifecycles,
|
|
8
8
|
assistantMessageId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PAJZL5ST.js";
|
|
10
10
|
import {
|
|
11
11
|
isContentfulAssistant
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KPHWVNKP.js";
|
|
13
13
|
import {
|
|
14
14
|
SessionOperationError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2UHBY25U.js";
|
|
16
16
|
import {
|
|
17
17
|
IdSchema,
|
|
18
18
|
SESSION_DIRECTORY_LIST_OPERATION,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
WorkbenchReasoningPageSchema,
|
|
49
49
|
WorkbenchReasoningRequestSchema,
|
|
50
50
|
isSafeSessionDirectoryPath
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-5FJJZCP6.js";
|
|
52
52
|
|
|
53
53
|
// src/session-image-uploader.ts
|
|
54
54
|
import { createHash } from "node:crypto";
|
|
@@ -1611,14 +1611,6 @@ async function resolveGitProjectIdentity(workingDirectory, env = gitEnvironment(
|
|
|
1611
1611
|
};
|
|
1612
1612
|
}
|
|
1613
1613
|
|
|
1614
|
-
// src/prompt-preparation-error.ts
|
|
1615
|
-
var PromptPreparationError = class extends Error {
|
|
1616
|
-
constructor(cause) {
|
|
1617
|
-
super(cause instanceof Error ? cause.message : "Prompt preparation failed", { cause });
|
|
1618
|
-
this.name = "PromptPreparationError";
|
|
1619
|
-
}
|
|
1620
|
-
};
|
|
1621
|
-
|
|
1622
1614
|
// src/session-project-identity.ts
|
|
1623
1615
|
import { realpath as realpath3, stat as stat2 } from "node:fs/promises";
|
|
1624
1616
|
import { isAbsolute as isAbsolute3 } from "node:path";
|
|
@@ -2371,7 +2363,6 @@ export {
|
|
|
2371
2363
|
sanitizeGitRemoteUrl,
|
|
2372
2364
|
NotGitDirectoryError,
|
|
2373
2365
|
resolveGitProjectIdentity,
|
|
2374
|
-
PromptPreparationError,
|
|
2375
2366
|
SESSION_PROJECT_IDENTITY_CONCURRENCY,
|
|
2376
2367
|
SessionProjectIdentityError,
|
|
2377
2368
|
SessionProjectIdentityReader,
|