@agentknight/sdk 0.9.68 → 0.9.69
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-VJ2OUSBS.js} +41 -4
- package/dist/chunks/{chunk-FY4XTWUF.js → chunk-2D34UDII.js} +4 -13
- package/dist/chunks/{chunk-AWVC5NX4.js → chunk-5QYL6NKJ.js} +1 -1
- package/dist/chunks/{chunk-B777YB6E.js → chunk-ES2N66EH.js} +1 -1
- package/dist/chunks/{chunk-DWTXWVIA.js → chunk-F5YCEWE4.js} +3 -0
- package/dist/chunks/{chunk-CFQQOAQV.js → chunk-IRYEOV62.js} +2 -2
- package/dist/chunks/{chunk-UHRUQM4D.js → chunk-J63A5OLO.js} +1 -1
- package/dist/chunks/{chunk-Y6NCJB55.js → chunk-LA6A4TUM.js} +3 -3
- package/dist/chunks/{chunk-EDYVCZIR.js → chunk-LU73CEHE.js} +2 -2
- package/dist/chunks/chunk-MB34W52S.js +78 -0
- package/dist/chunks/{chunk-Q5OUZJCZ.js → chunk-MH7FDSTY.js} +1 -1
- package/dist/chunks/{chunk-MB3H6HEI.js → chunk-Q5NNNSU2.js} +2 -2
- package/dist/chunks/chunk-UTF7KLMJ.js +11 -0
- package/dist/chunks/{chunk-4XT65OSG.js → chunk-WAPJZKUK.js} +46 -3
- package/dist/chunks/{chunk-LCA2MWOQ.js → chunk-ZAU2MYQI.js} +2 -2
- package/dist/chunks/{claude-adapter-FQSQIYUY.js → claude-adapter-FZNLF5XN.js} +240 -27
- package/dist/chunks/{codex-adapter-TOXSRT2W.js → codex-adapter-5ZVOAT6O.js} +249 -66
- package/dist/chunks/{copilot-adapter-KUCX7XQW.js → copilot-adapter-V6RAQ4WK.js} +13 -12
- package/dist/chunks/{managed-agent-adapter-LGBRXDGP.js → managed-agent-adapter-THUSTKRW.js} +9 -7
- package/dist/chunks/{pi-adapter-RXNZSE4F.js → pi-adapter-EHCSR5I2.js} +6 -8
- package/dist/configuration.js +4 -4
- package/dist/index.d.ts +15 -8
- package/dist/index.js +35 -22
- package/dist/runtime.js +2 -2
- package/dist/session-analytics-worker.js +5 -6
- package/package.json +3 -3
- package/dist/chunks/chunk-IXGVSREH.js +0 -48
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentSelectionSchema,
|
|
3
3
|
assertSelectionSnapshotFits
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZAU2MYQI.js";
|
|
5
5
|
import {
|
|
6
6
|
isResearchSessionId
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5QYL6NKJ.js";
|
|
8
8
|
import {
|
|
9
9
|
GroupChatError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Q5NNNSU2.js";
|
|
11
11
|
import {
|
|
12
12
|
AgentModelListingError,
|
|
13
13
|
AgentSessionRenameError,
|
|
@@ -16,14 +16,14 @@ import {
|
|
|
16
16
|
UnsupportedAgentOperationError,
|
|
17
17
|
captureWorkbenchAccess,
|
|
18
18
|
validateSessionName
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IRYEOV62.js";
|
|
20
20
|
import {
|
|
21
21
|
SessionOperationError
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-J63A5OLO.js";
|
|
23
23
|
import {
|
|
24
24
|
InteractionResponseSchema,
|
|
25
25
|
SessionSummarySchema
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-F5YCEWE4.js";
|
|
27
27
|
|
|
28
28
|
// src/managed-agent-adapter.ts
|
|
29
29
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -394,6 +394,8 @@ var ManagedCodingAgentAdapter = class {
|
|
|
394
394
|
const route = this.#route(id);
|
|
395
395
|
return {
|
|
396
396
|
supportsFileAttachments: route.runtime.supportsFileAttachments === true,
|
|
397
|
+
supportsImageAttachments: route.runtime.supportsImageAttachments ?? route.runtime.supportsFileAttachments === true,
|
|
398
|
+
supportsSessionDelete: route.runtime.supportsSessionDelete === true && route.runtime.deleteSession !== void 0,
|
|
397
399
|
...route.runtime.getSessionCapabilities?.(route.nativeId) ?? {
|
|
398
400
|
agentModes: route.runtime.agentModes,
|
|
399
401
|
supportsReasoningEffort: route.runtime.supportsReasoningEffort,
|
|
@@ -694,7 +696,7 @@ var ManagedCodingAgentAdapter = class {
|
|
|
694
696
|
deleteSession(id) {
|
|
695
697
|
return this.#exclusive(async () => {
|
|
696
698
|
const route = this.#route(id);
|
|
697
|
-
if (!route.runtime.supportsSessionDelete || !route.runtime.deleteSession) {
|
|
699
|
+
if (!route.runtime.supportsSessionDelete || !route.runtime.deleteSession || route.runtime.getSessionCapabilities?.(route.nativeId).supportsSessionDelete === false) {
|
|
698
700
|
throw new UnsupportedAgentOperationError(route.provider.candidate.id, "session deletion");
|
|
699
701
|
}
|
|
700
702
|
const previous = this.#deleted;
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
stagePromptAttachments,
|
|
3
3
|
validatePromptAttachments
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ES2N66EH.js";
|
|
5
5
|
import "./chunk-35OF2ZNS.js";
|
|
6
6
|
import {
|
|
7
7
|
decodeTimelineImage,
|
|
8
|
+
latestPreviewItems,
|
|
8
9
|
normalizeImageMimeType,
|
|
9
10
|
splitTimelineImages
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
latestPreviewItems
|
|
13
|
-
} from "./chunk-IXGVSREH.js";
|
|
11
|
+
} from "./chunk-WAPJZKUK.js";
|
|
14
12
|
import {
|
|
15
13
|
AgentSessionRenameError,
|
|
16
14
|
SessionDeletionRejectedError,
|
|
17
15
|
UnsupportedAgentOperationError,
|
|
18
16
|
validateSessionName
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-IRYEOV62.js";
|
|
18
|
+
import "./chunk-J63A5OLO.js";
|
|
21
19
|
import {
|
|
22
20
|
ConversationAttachmentSchema,
|
|
23
21
|
InteractionRequestSchema,
|
|
24
22
|
REASONING_EFFORTS,
|
|
25
23
|
SESSION_TIMELINE_PAGE_SIZE
|
|
26
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-F5YCEWE4.js";
|
|
27
25
|
|
|
28
26
|
// src/pi-adapter.ts
|
|
29
27
|
import { createHash as createHash2, randomUUID } from "node:crypto";
|
package/dist/configuration.js
CHANGED
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
} from "./chunks/chunk-VIWTNPVC.js";
|
|
6
6
|
import {
|
|
7
7
|
AgentSelectionSchema
|
|
8
|
-
} from "./chunks/chunk-
|
|
8
|
+
} from "./chunks/chunk-ZAU2MYQI.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-
|
|
17
|
-
import "./chunks/chunk-
|
|
15
|
+
} from "./chunks/chunk-IRYEOV62.js";
|
|
16
|
+
import "./chunks/chunk-J63A5OLO.js";
|
|
17
|
+
import "./chunks/chunk-F5YCEWE4.js";
|
|
18
18
|
export {
|
|
19
19
|
AgentSelectionSchema,
|
|
20
20
|
CODING_AGENT_IDS,
|
package/dist/index.d.ts
CHANGED
|
@@ -528,6 +528,9 @@ declare const SessionSummarySchema: z.ZodObject<{
|
|
|
528
528
|
machineId: z.ZodString;
|
|
529
529
|
summary: z.ZodOptional<z.ZodString>;
|
|
530
530
|
renameSupported: z.ZodOptional<z.ZodBoolean>;
|
|
531
|
+
deleteSupported: z.ZodOptional<z.ZodBoolean>;
|
|
532
|
+
imageAttachmentsSupported: z.ZodOptional<z.ZodBoolean>;
|
|
533
|
+
fileAttachmentsSupported: z.ZodOptional<z.ZodBoolean>;
|
|
531
534
|
workingDirectory: z.ZodOptional<z.ZodString>;
|
|
532
535
|
gitRoot: z.ZodOptional<z.ZodString>;
|
|
533
536
|
repository: z.ZodOptional<z.ZodString>;
|
|
@@ -1925,6 +1928,16 @@ interface CodingAgentSessionCallbacks {
|
|
|
1925
1928
|
readonly toolName: string;
|
|
1926
1929
|
}): void;
|
|
1927
1930
|
}
|
|
1931
|
+
interface AgentSessionCapabilities {
|
|
1932
|
+
readonly agentModes: readonly SessionAgentMode[];
|
|
1933
|
+
readonly supportsReasoningEffort: boolean;
|
|
1934
|
+
readonly supportsContextTier?: boolean;
|
|
1935
|
+
readonly supportsFileAttachments?: boolean;
|
|
1936
|
+
readonly supportsImageAttachments?: boolean;
|
|
1937
|
+
readonly supportsSessionDelete?: boolean;
|
|
1938
|
+
readonly agentName?: string;
|
|
1939
|
+
readonly supportsPlanRead?: boolean;
|
|
1940
|
+
}
|
|
1928
1941
|
interface CodingAgentAdapter {
|
|
1929
1942
|
readonly workbench?: WorkbenchRuntime;
|
|
1930
1943
|
sessionPublicationSource?(sessionId: string): string;
|
|
@@ -1939,6 +1952,7 @@ interface CodingAgentAdapter {
|
|
|
1939
1952
|
readonly supportsAssistantPreview?: boolean;
|
|
1940
1953
|
readonly supportsSessionDelete?: boolean;
|
|
1941
1954
|
readonly supportsFileAttachments?: boolean;
|
|
1955
|
+
readonly supportsImageAttachments?: boolean;
|
|
1942
1956
|
readonly groupChatEnabled?: boolean;
|
|
1943
1957
|
setGroupChatEnabled?(enabled: boolean): Promise<void>;
|
|
1944
1958
|
setPeerChatEnabled?(enabled: boolean): Promise<void>;
|
|
@@ -1952,14 +1966,7 @@ interface CodingAgentAdapter {
|
|
|
1952
1966
|
} | undefined>;
|
|
1953
1967
|
getSessionProjectIdentity?(sessionId: string): Promise<SessionGitProject | undefined>;
|
|
1954
1968
|
listModels(sessionId?: string): Promise<AgentModelOption[]>;
|
|
1955
|
-
getSessionCapabilities?(sessionId?: string):
|
|
1956
|
-
readonly agentModes: readonly SessionAgentMode[];
|
|
1957
|
-
readonly supportsReasoningEffort: boolean;
|
|
1958
|
-
readonly supportsContextTier?: boolean;
|
|
1959
|
-
readonly supportsFileAttachments?: boolean;
|
|
1960
|
-
readonly agentName?: string;
|
|
1961
|
-
readonly supportsPlanRead?: boolean;
|
|
1962
|
-
};
|
|
1969
|
+
getSessionCapabilities?(sessionId?: string): AgentSessionCapabilities;
|
|
1963
1970
|
isSessionVisible?(sessionId: string): boolean;
|
|
1964
1971
|
getSessionConfiguration(sessionId: string): Promise<AgentSessionConfiguration>;
|
|
1965
1972
|
getSessionEnvironment(sessionId: string): Promise<SessionEnvironmentInfo>;
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
PeerChatRequestSchema,
|
|
11
11
|
PeerChatResultSchema,
|
|
12
12
|
validateDataDirectory
|
|
13
|
-
} from "./chunks/chunk-
|
|
13
|
+
} from "./chunks/chunk-MH7FDSTY.js";
|
|
14
14
|
import {
|
|
15
15
|
DeviceIdentitySchema,
|
|
16
16
|
codingAgentPresentation,
|
|
@@ -20,12 +20,11 @@ import {
|
|
|
20
20
|
AgentSelectionSchema,
|
|
21
21
|
assertSelectionSnapshotFits,
|
|
22
22
|
supportsAgentSelection
|
|
23
|
-
} from "./chunks/chunk-
|
|
23
|
+
} from "./chunks/chunk-ZAU2MYQI.js";
|
|
24
24
|
import {
|
|
25
25
|
LiveTimelineProjection,
|
|
26
26
|
OperationDiagnostics,
|
|
27
27
|
OperationMetrics,
|
|
28
|
-
PromptPreparationError,
|
|
29
28
|
SessionDirectoryError,
|
|
30
29
|
SessionDirectoryLister,
|
|
31
30
|
SessionImageUploadError,
|
|
@@ -46,7 +45,7 @@ import {
|
|
|
46
45
|
sessionRestoreFailure,
|
|
47
46
|
sessionRootIdentity,
|
|
48
47
|
validateOperationResponse
|
|
49
|
-
} from "./chunks/chunk-
|
|
48
|
+
} from "./chunks/chunk-2D34UDII.js";
|
|
50
49
|
import {
|
|
51
50
|
SessionImageRelayUrlSchema,
|
|
52
51
|
SessionImagesConfigSchema
|
|
@@ -54,18 +53,19 @@ import {
|
|
|
54
53
|
import {
|
|
55
54
|
ConversationNormalizer,
|
|
56
55
|
isDisplayableHumanMessage
|
|
57
|
-
} from "./chunks/chunk-
|
|
56
|
+
} from "./chunks/chunk-LU73CEHE.js";
|
|
58
57
|
import {
|
|
59
58
|
GroupChatError
|
|
60
|
-
} from "./chunks/chunk-
|
|
59
|
+
} from "./chunks/chunk-Q5NNNSU2.js";
|
|
61
60
|
import {
|
|
62
|
-
|
|
63
|
-
} from "./chunks/chunk-
|
|
61
|
+
PromptPreparationError
|
|
62
|
+
} from "./chunks/chunk-UTF7KLMJ.js";
|
|
64
63
|
import {
|
|
65
64
|
assistantPreview,
|
|
65
|
+
hasImageSignature,
|
|
66
66
|
isContentfulAssistant,
|
|
67
67
|
userPreview
|
|
68
|
-
} from "./chunks/chunk-
|
|
68
|
+
} from "./chunks/chunk-WAPJZKUK.js";
|
|
69
69
|
import {
|
|
70
70
|
AgentModelListingError,
|
|
71
71
|
AgentSessionRenameError,
|
|
@@ -75,11 +75,11 @@ import {
|
|
|
75
75
|
captureResearchAccess,
|
|
76
76
|
captureWorkbenchAccess,
|
|
77
77
|
validateSessionName
|
|
78
|
-
} from "./chunks/chunk-
|
|
78
|
+
} from "./chunks/chunk-IRYEOV62.js";
|
|
79
79
|
import {
|
|
80
80
|
SessionOperationError,
|
|
81
81
|
SessionOperations
|
|
82
|
-
} from "./chunks/chunk-
|
|
82
|
+
} from "./chunks/chunk-J63A5OLO.js";
|
|
83
83
|
import {
|
|
84
84
|
A2A_BODY_MAX_LENGTH,
|
|
85
85
|
A2aRelayRequestSchema,
|
|
@@ -298,7 +298,7 @@ import {
|
|
|
298
298
|
sessionCommunicationError,
|
|
299
299
|
sessionCommunicationOperationCapability,
|
|
300
300
|
workbenchCapability
|
|
301
|
-
} from "./chunks/chunk-
|
|
301
|
+
} from "./chunks/chunk-F5YCEWE4.js";
|
|
302
302
|
|
|
303
303
|
// src/initialize.ts
|
|
304
304
|
import { createHash as createHash18 } from "node:crypto";
|
|
@@ -318,7 +318,7 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
318
318
|
switch (engine.kind) {
|
|
319
319
|
case "managed": {
|
|
320
320
|
if (owner === void 0) throw new Error("Managed coding agents require the PC owner identity");
|
|
321
|
-
const { ManagedCodingAgentAdapter } = await import("./chunks/managed-agent-adapter-
|
|
321
|
+
const { ManagedCodingAgentAdapter } = await import("./chunks/managed-agent-adapter-THUSTKRW.js");
|
|
322
322
|
return new ManagedCodingAgentAdapter({
|
|
323
323
|
dataDirectory: config.dataDirectory,
|
|
324
324
|
owner,
|
|
@@ -381,7 +381,7 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
381
381
|
});
|
|
382
382
|
}
|
|
383
383
|
case "copilot": {
|
|
384
|
-
const { GithubCopilotAdapter } = await import("./chunks/copilot-adapter-
|
|
384
|
+
const { GithubCopilotAdapter } = await import("./chunks/copilot-adapter-V6RAQ4WK.js");
|
|
385
385
|
if (owner !== void 0) {
|
|
386
386
|
return new GithubCopilotAdapter(
|
|
387
387
|
void 0,
|
|
@@ -410,13 +410,13 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
410
410
|
}
|
|
411
411
|
case "pi": {
|
|
412
412
|
assertPiRuntimeSupported();
|
|
413
|
-
const { PiCodingAgentAdapter } = await import("./chunks/pi-adapter-
|
|
413
|
+
const { PiCodingAgentAdapter } = await import("./chunks/pi-adapter-EHCSR5I2.js");
|
|
414
414
|
return new PiCodingAgentAdapter(
|
|
415
415
|
engine.agentDirectory === void 0 ? {} : { agentDirectory: resolve(engine.agentDirectory) }
|
|
416
416
|
);
|
|
417
417
|
}
|
|
418
418
|
case "codex": {
|
|
419
|
-
const { CodexCodingAgentAdapter } = await import("./chunks/codex-adapter-
|
|
419
|
+
const { CodexCodingAgentAdapter } = await import("./chunks/codex-adapter-5ZVOAT6O.js");
|
|
420
420
|
return new CodexCodingAgentAdapter({
|
|
421
421
|
dataDirectory: resolve(config.dataDirectory, "coding-agents"),
|
|
422
422
|
...owner === void 0 ? {} : { nativeSessionOwner: owner },
|
|
@@ -425,7 +425,7 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
427
|
case "claude": {
|
|
428
|
-
const { ClaudeCodingAgentAdapter } = await import("./chunks/claude-adapter-
|
|
428
|
+
const { ClaudeCodingAgentAdapter } = await import("./chunks/claude-adapter-FZNLF5XN.js");
|
|
429
429
|
return new ClaudeCodingAgentAdapter({
|
|
430
430
|
dataDirectory: resolve(config.dataDirectory, "coding-agents"),
|
|
431
431
|
...engine.command === void 0 ? {} : { command: engine.command },
|
|
@@ -434,7 +434,7 @@ async function createCodingAgentAdapter(config, onDiagnostic, owner) {
|
|
|
434
434
|
});
|
|
435
435
|
}
|
|
436
436
|
case "acp": {
|
|
437
|
-
const { AcpCodingAgentAdapter } = await import("./chunks/acp-adapter-
|
|
437
|
+
const { AcpCodingAgentAdapter } = await import("./chunks/acp-adapter-VJ2OUSBS.js");
|
|
438
438
|
return new AcpCodingAgentAdapter({
|
|
439
439
|
command: engine.command,
|
|
440
440
|
args: engine.args,
|
|
@@ -4989,6 +4989,18 @@ var OperationDeduplicator = class {
|
|
|
4989
4989
|
}
|
|
4990
4990
|
};
|
|
4991
4991
|
|
|
4992
|
+
// src/service/inventory/session-controls.ts
|
|
4993
|
+
function withSessionControls(adapter, session) {
|
|
4994
|
+
const controls = adapter.getSessionCapabilities?.(session.sessionId) ?? adapter;
|
|
4995
|
+
const files = !session.groupChat && (controls.supportsFileAttachments ?? adapter.supportsFileAttachments) === true;
|
|
4996
|
+
return {
|
|
4997
|
+
...session,
|
|
4998
|
+
fileAttachmentsSupported: files,
|
|
4999
|
+
imageAttachmentsSupported: !session.groupChat && (controls.supportsImageAttachments ?? adapter.supportsImageAttachments ?? files),
|
|
5000
|
+
deleteSupported: controls.supportsSessionDelete ?? adapter.supportsSessionDelete ?? adapter.deleteSession !== void 0
|
|
5001
|
+
};
|
|
5002
|
+
}
|
|
5003
|
+
|
|
4992
5004
|
// src/service/requests/session-commands.ts
|
|
4993
5005
|
var SessionCommandsHandler = class {
|
|
4994
5006
|
constructor(options) {
|
|
@@ -5027,7 +5039,7 @@ var SessionCommandsHandler = class {
|
|
|
5027
5039
|
ok: true,
|
|
5028
5040
|
requestId: request2.requestId,
|
|
5029
5041
|
machineId,
|
|
5030
|
-
session,
|
|
5042
|
+
session: withSessionControls(adapter, session),
|
|
5031
5043
|
modelId: request2.modelId,
|
|
5032
5044
|
agentMode: request2.agentMode,
|
|
5033
5045
|
...request2.reasoningEffort === void 0 ? {} : { reasoningEffort: request2.reasoningEffort }
|
|
@@ -7006,7 +7018,7 @@ function encryptedGroupAdapter(inner, groups) {
|
|
|
7006
7018
|
abortSession: (id) => groups.owns(id) ? groups.abort(id) : inner.abortSession(id),
|
|
7007
7019
|
deleteSession: (id) => groups.owns(id) ? groups.delete(id) : inner.deleteSession?.(id) ?? Promise.reject(new Error("Session deletion is unsupported")),
|
|
7008
7020
|
renameSession: (id, name, check) => groups.owns(id) ? groups.rename(id, name, check) : inner.renameSession?.(id, name, check) ?? Promise.reject(new Error("Session rename is unsupported")),
|
|
7009
|
-
getSessionCapabilities: (id) => id !== void 0 && groups.owns(id) ? { agentModes: ["interactive"], supportsReasoningEffort: false, supportsFileAttachments: false, supportsPlanRead: false } : inner.getSessionCapabilities?.(id) ?? inner,
|
|
7021
|
+
getSessionCapabilities: (id) => id !== void 0 && groups.owns(id) ? { agentModes: ["interactive"], supportsReasoningEffort: false, supportsImageAttachments: false, supportsFileAttachments: false, supportsSessionDelete: true, supportsPlanRead: false } : inner.getSessionCapabilities?.(id) ?? inner,
|
|
7010
7022
|
getSessionConfiguration: (id) => groups.owns(id) ? Promise.resolve({ agentMode: "interactive", reasoningEffort: "default" }) : inner.getSessionConfiguration(id),
|
|
7011
7023
|
listModels: (id) => inner.listModels(id !== void 0 && groups.owns(id) ? groups.source(id) : id),
|
|
7012
7024
|
configureSession: (id, options) => {
|
|
@@ -7640,7 +7652,8 @@ var SessionInventory = class {
|
|
|
7640
7652
|
const sessions = await adapter.listSessions(userId, machineId);
|
|
7641
7653
|
const visibleSessions = sessions.filter((session) => adapter.isSessionVisible?.(session.sessionId) !== false);
|
|
7642
7654
|
const page = adapter.isSessionVisible !== void 0 && cursor === void 0 ? { sessions: visibleSessions, totalCount: visibleSessions.length, complete: true } : paginateSessions(visibleSessions, cursor);
|
|
7643
|
-
|
|
7655
|
+
const published = page.sessions.map((session) => withSessionControls(adapter, session));
|
|
7656
|
+
if (adapter.isSessionVisible !== void 0) assertSelectionSnapshotFits(published);
|
|
7644
7657
|
const snapshot = {
|
|
7645
7658
|
userId,
|
|
7646
7659
|
machineId,
|
|
@@ -7652,7 +7665,7 @@ var SessionInventory = class {
|
|
|
7652
7665
|
complete: page.complete,
|
|
7653
7666
|
totalCount: page.totalCount,
|
|
7654
7667
|
...page.nextCursor === void 0 ? {} : { nextCursor: page.nextCursor },
|
|
7655
|
-
sessions:
|
|
7668
|
+
sessions: published
|
|
7656
7669
|
};
|
|
7657
7670
|
this.#revisions.set(snapshot, revision);
|
|
7658
7671
|
return snapshot;
|
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-MH7FDSTY.js";
|
|
7
|
+
import "./chunks/chunk-F5YCEWE4.js";
|
|
8
8
|
export {
|
|
9
9
|
DataDirectoryLease,
|
|
10
10
|
PEER_CHAT_TIMEOUT_MS,
|
|
@@ -2,14 +2,13 @@ import {
|
|
|
2
2
|
AnalyticsCommandSchema,
|
|
3
3
|
AnalyticsEventSchema,
|
|
4
4
|
openSessionEventLog
|
|
5
|
-
} from "./chunks/chunk-
|
|
6
|
-
import "./chunks/chunk-
|
|
5
|
+
} from "./chunks/chunk-LA6A4TUM.js";
|
|
6
|
+
import "./chunks/chunk-LU73CEHE.js";
|
|
7
7
|
import "./chunks/chunk-35OF2ZNS.js";
|
|
8
|
-
import "./chunks/chunk-
|
|
9
|
-
import "./chunks/chunk-IXGVSREH.js";
|
|
8
|
+
import "./chunks/chunk-WAPJZKUK.js";
|
|
10
9
|
import {
|
|
11
10
|
SessionOperationError
|
|
12
|
-
} from "./chunks/chunk-
|
|
11
|
+
} from "./chunks/chunk-J63A5OLO.js";
|
|
13
12
|
import {
|
|
14
13
|
SessionAnalyticsResultSchema,
|
|
15
14
|
SessionSkillInfoSchema,
|
|
@@ -17,7 +16,7 @@ import {
|
|
|
17
16
|
WorkbenchContextSampleSchema,
|
|
18
17
|
WorkbenchTelemetrySchema,
|
|
19
18
|
WorkbenchUsageCallSchema
|
|
20
|
-
} from "./chunks/chunk-
|
|
19
|
+
} from "./chunks/chunk-F5YCEWE4.js";
|
|
21
20
|
|
|
22
21
|
// src/session-analytics-worker.ts
|
|
23
22
|
import { parentPort, workerData, isMainThread as isMainThread2 } from "node:worker_threads";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentknight/sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.69",
|
|
4
4
|
"description": "AgentKnight runtime SDK for local and remote coding sessions",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"esbuild": "0.28.2",
|
|
56
56
|
"rollup": "4.63.5",
|
|
57
57
|
"rollup-plugin-dts": "6.5.1",
|
|
58
|
-
"@agentknight/
|
|
59
|
-
"@agentknight/
|
|
58
|
+
"@agentknight/shared": "0.1.0",
|
|
59
|
+
"@agentknight/protocol": "0.1.0"
|
|
60
60
|
},
|
|
61
61
|
"optionalDependencies": {
|
|
62
62
|
"@anthropic-ai/claude-agent-sdk": "0.3.310",
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SessionAssistantPreviewSchema,
|
|
3
|
-
SessionUserPreviewSchema
|
|
4
|
-
} from "./chunk-DWTXWVIA.js";
|
|
5
|
-
|
|
6
|
-
// src/assistant-preview.ts
|
|
7
|
-
function isContentfulAssistant(item) {
|
|
8
|
-
return item.actor === "assistant" && (item.kind === "notice" && item.severity === "success" && item.title === "Task completed" && item.content.trim().length > 0 || item.kind === "assistant-message" && (item.content.trim().length > 0 || (item.attachments ?? []).some((attachment) => attachment.kind === "image")));
|
|
9
|
-
}
|
|
10
|
-
function userPreview(item) {
|
|
11
|
-
if (item.kind !== "human-message" || item.actor !== "human") return void 0;
|
|
12
|
-
return SessionUserPreviewSchema.parse({
|
|
13
|
-
id: item.id,
|
|
14
|
-
revision: item.revision,
|
|
15
|
-
timestamp: item.timestamp,
|
|
16
|
-
text: item.content.slice(0, 4096)
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
function latestPreviewItems(items) {
|
|
20
|
-
const latest = [...items].reverse();
|
|
21
|
-
return [
|
|
22
|
-
latest.find((item) => item.kind === "human-message" && item.actor === "human"),
|
|
23
|
-
latest.find(isContentfulAssistant)
|
|
24
|
-
].filter((item) => item !== void 0);
|
|
25
|
-
}
|
|
26
|
-
function assistantPreview(item, referenceItem) {
|
|
27
|
-
if (!isContentfulAssistant(item)) return void 0;
|
|
28
|
-
const referenced = referenceItem(item);
|
|
29
|
-
const attachments = referenced.kind === "assistant-message" ? (referenced.attachments ?? []).filter((attachment) => attachment.kind === "image" && attachment.imageRef === "sha256").slice(0, 4) : [];
|
|
30
|
-
if (item.content.trim().length === 0 && attachments.length === 0) return void 0;
|
|
31
|
-
return SessionAssistantPreviewSchema.parse({
|
|
32
|
-
id: item.id,
|
|
33
|
-
revision: item.revision,
|
|
34
|
-
timestamp: item.timestamp,
|
|
35
|
-
sourceEventIds: item.sourceEventIds.slice(-1),
|
|
36
|
-
text: item.content.trim().slice(0, 4096),
|
|
37
|
-
final: item.kind === "assistant-message" ? item.final : true,
|
|
38
|
-
...item.kind === "notice" ? { kind: "task-completion" } : {},
|
|
39
|
-
attachments
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export {
|
|
44
|
-
isContentfulAssistant,
|
|
45
|
-
userPreview,
|
|
46
|
-
latestPreviewItems,
|
|
47
|
-
assistantPreview
|
|
48
|
-
};
|