@agentknight/sdk 0.9.53 → 0.9.56
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/LICENSE +201 -201
- package/dist/chunks/{acp-adapter-LJQBDWYK.js → acp-adapter-HUNUQGUF.js} +3 -3
- package/dist/chunks/{chunk-2CNJAMAN.js → chunk-5J7BK2Y7.js} +1 -1
- package/dist/chunks/{chunk-6YFGVYI5.js → chunk-6ZPE7VIE.js} +432 -44
- package/dist/chunks/{chunk-HJCNQM4M.js → chunk-E7QL4CBT.js} +1 -1
- package/dist/chunks/{chunk-XL6UB4C3.js → chunk-HFVA7ZOD.js} +2 -2
- package/dist/chunks/chunk-IJPJQF7S.js +16 -0
- package/dist/chunks/{chunk-UZFIXIAS.js → chunk-K5CMKBW6.js} +392 -365
- package/dist/chunks/{chunk-ML6Q2MYH.js → chunk-L3A736SO.js} +1 -1
- package/dist/chunks/{chunk-AAZH6QGV.js → chunk-NTFNQYQ3.js} +2 -2
- package/dist/chunks/{chunk-EFRYPUKX.js → chunk-XPHAIOKN.js} +7 -21
- package/dist/chunks/{chunk-6DYWE5PL.js → chunk-Z5STULMQ.js} +1 -1
- package/dist/chunks/{claude-adapter-UWVOXYNG.js → claude-adapter-G6YTPXRP.js} +3 -3
- package/dist/chunks/{codex-adapter-44N7DBRH.js → codex-adapter-ELYJE2A2.js} +3 -3
- package/dist/chunks/{copilot-adapter-ZM7EUBZ5.js → copilot-adapter-2QAIOSEK.js} +22 -10
- package/dist/chunks/{managed-agent-adapter-5TIM4PBR.js → managed-agent-adapter-KEXZFLGA.js} +5 -5
- package/dist/chunks/{pi-adapter-NADD52CV.js → pi-adapter-5BFIJTPD.js} +3 -3
- package/dist/configuration.js +8 -6
- package/dist/index.d.ts +2 -1
- package/dist/index.js +435 -487
- package/dist/runtime.js +2 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CODING_AGENT_IDS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-L3A736SO.js";
|
|
4
4
|
import {
|
|
5
5
|
SECURE_MESSAGE_MAX_CIPHERTEXT_LENGTH
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K5CMKBW6.js";
|
|
7
7
|
|
|
8
8
|
// src/agent-selection.ts
|
|
9
9
|
import { z } from "zod";
|
|
@@ -14,26 +14,14 @@ function codingAgentPresentation(agentId) {
|
|
|
14
14
|
return Object.hasOwn(presentations, agentId) ? presentations[agentId] : fallback;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
// src/config.ts
|
|
18
|
-
import { z } from "zod";
|
|
19
|
-
var SessionImagesConfigSchema = z.object({
|
|
20
|
-
allowUnencryptedStorage: z.literal(true),
|
|
21
|
-
storageAccount: z.string().regex(/^[a-z0-9]{3,24}$/u),
|
|
22
|
-
storageContainer: z.string().min(3).max(63).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/u)
|
|
23
|
-
}).strict();
|
|
24
|
-
var SessionImageRelayUrlSchema = z.url().refine((value) => {
|
|
25
|
-
const url = new URL(value);
|
|
26
|
-
return /^https:\/\/[^/?#\\@\s\x00-\x1f\x7f]+\/?$/iu.test(value) && url.protocol === "https:" && url.username === "" && url.password === "" && url.pathname === "/" && url.search === "" && url.hash === "";
|
|
27
|
-
}, "Session images require an HTTPS Relay origin without a path, credentials, query or fragment").transform((value) => new URL(value).origin);
|
|
28
|
-
|
|
29
17
|
// src/device-identity.ts
|
|
30
|
-
import { z
|
|
31
|
-
var DeviceIdentitySchema =
|
|
32
|
-
schemaVersion:
|
|
33
|
-
machineId:
|
|
34
|
-
stableDeviceId:
|
|
35
|
-
machineName:
|
|
36
|
-
createdAt:
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
var DeviceIdentitySchema = z.object({
|
|
20
|
+
schemaVersion: z.literal(2),
|
|
21
|
+
machineId: z.uuid(),
|
|
22
|
+
stableDeviceId: z.uuid(),
|
|
23
|
+
machineName: z.string().trim().min(1).max(120),
|
|
24
|
+
createdAt: z.iso.datetime({ offset: true })
|
|
37
25
|
});
|
|
38
26
|
|
|
39
27
|
// src/relay-authorization.ts
|
|
@@ -48,8 +36,6 @@ async function relayRequestToken(config) {
|
|
|
48
36
|
|
|
49
37
|
export {
|
|
50
38
|
codingAgentPresentation,
|
|
51
|
-
SessionImagesConfigSchema,
|
|
52
|
-
SessionImageRelayUrlSchema,
|
|
53
39
|
DeviceIdentitySchema,
|
|
54
40
|
relayRequestToken
|
|
55
41
|
};
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
} from "./chunk-T6226JFS.js";
|
|
4
4
|
import {
|
|
5
5
|
latestPreviewItems
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5J7BK2Y7.js";
|
|
7
7
|
import {
|
|
8
8
|
UnsupportedAgentOperationError,
|
|
9
9
|
validateSessionName
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-L3A736SO.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-K5CMKBW6.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-5J7BK2Y7.js";
|
|
4
4
|
import {
|
|
5
5
|
UnsupportedAgentOperationError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-L3A736SO.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-K5CMKBW6.js";
|
|
13
13
|
|
|
14
14
|
// src/codex-adapter.ts
|
|
15
15
|
import { randomUUID } from "node:crypto";
|
|
@@ -18,25 +18,26 @@ import {
|
|
|
18
18
|
recordTimelineSyncDiagnostic,
|
|
19
19
|
resolveGitProjectIdentity,
|
|
20
20
|
sanitizeGitRemoteUrl
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-6ZPE7VIE.js";
|
|
22
|
+
import "./chunk-IJPJQF7S.js";
|
|
22
23
|
import {
|
|
23
24
|
assertMainSessionId,
|
|
24
25
|
isResearchSessionId
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-E7QL4CBT.js";
|
|
26
27
|
import {
|
|
27
28
|
GroupChatError,
|
|
28
29
|
GroupChatMessageSchema,
|
|
29
30
|
GroupChatRuntime
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-HFVA7ZOD.js";
|
|
31
32
|
import {
|
|
32
33
|
isContentfulAssistant
|
|
33
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-5J7BK2Y7.js";
|
|
34
35
|
import {
|
|
35
36
|
AgentSessionRenameError,
|
|
36
37
|
SessionOperationError,
|
|
37
38
|
TimelinePageBudgetError,
|
|
38
39
|
validateSessionName
|
|
39
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-L3A736SO.js";
|
|
40
41
|
import {
|
|
41
42
|
ConversationItemSchema,
|
|
42
43
|
CopilotModelOptionSchema,
|
|
@@ -57,7 +58,7 @@ import {
|
|
|
57
58
|
WorkbenchScheduleEntrySchema,
|
|
58
59
|
WorkbenchScheduleProposalSchema,
|
|
59
60
|
WorkbenchScheduleSnapshotSchema
|
|
60
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-K5CMKBW6.js";
|
|
61
62
|
|
|
62
63
|
// src/copilot-adapter.ts
|
|
63
64
|
import { createHash as createHash4, randomUUID as randomUUID6 } from "node:crypto";
|
|
@@ -2501,7 +2502,10 @@ var SessionSchedules = class {
|
|
|
2501
2502
|
}
|
|
2502
2503
|
return { connection, session, schedule: session.rpc.schedule, invoke: session.rpc.commands.invoke };
|
|
2503
2504
|
}
|
|
2504
|
-
|
|
2505
|
+
snapshot(sessionId) {
|
|
2506
|
+
return this.#snapshot(sessionId, true);
|
|
2507
|
+
}
|
|
2508
|
+
async #snapshot(sessionId, readHistory) {
|
|
2505
2509
|
this.options.assertAvailable(sessionId);
|
|
2506
2510
|
const connection = this.options.current(sessionId);
|
|
2507
2511
|
const drafts = await this.#drafts.list(sessionId);
|
|
@@ -2518,7 +2522,10 @@ var SessionSchedules = class {
|
|
|
2518
2522
|
});
|
|
2519
2523
|
}
|
|
2520
2524
|
const { session, schedule } = await this.#active(sessionId);
|
|
2521
|
-
const [native, history] = await Promise.all([
|
|
2525
|
+
const [native, history] = await Promise.all([
|
|
2526
|
+
schedule.list(),
|
|
2527
|
+
readHistory ? session.getEvents?.() : void 0
|
|
2528
|
+
]);
|
|
2522
2529
|
this.#check(sessionId, connection);
|
|
2523
2530
|
const entries = NativeList.parse(native).entries.map(({ tz, at, ...entry }) => ({
|
|
2524
2531
|
...entry,
|
|
@@ -2532,7 +2539,10 @@ var SessionSchedules = class {
|
|
|
2532
2539
|
sampledAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2533
2540
|
timezone: new Intl.DateTimeFormat("en").resolvedOptions().timeZone,
|
|
2534
2541
|
...workingDirectory === void 0 ? {} : { workingDirectory },
|
|
2535
|
-
...projectScheduleHistory(history ?? [])
|
|
2542
|
+
...readHistory ? projectScheduleHistory(history ?? []) : {
|
|
2543
|
+
results: this.#cache.get(sessionId)?.results ?? [],
|
|
2544
|
+
historyTruncated: true
|
|
2545
|
+
}
|
|
2536
2546
|
});
|
|
2537
2547
|
if (entries.length > 0) this.#activePlans.add(sessionId);
|
|
2538
2548
|
else this.#activePlans.delete(sessionId);
|
|
@@ -2678,7 +2688,9 @@ var SessionSchedules = class {
|
|
|
2678
2688
|
assertAccess?.();
|
|
2679
2689
|
if (result.entry !== void 0 && result.entry.id !== id) throw new Error("Native schedule identity mismatch");
|
|
2680
2690
|
this.#check(sessionId, connection);
|
|
2681
|
-
const snapshot = await this
|
|
2691
|
+
const snapshot = await this.#snapshot(sessionId, false);
|
|
2692
|
+
this.#check(sessionId, connection);
|
|
2693
|
+
assertAccess?.();
|
|
2682
2694
|
if (snapshot.entries.some((entry) => entry.id === id)) throw new Error("Native schedule is still present");
|
|
2683
2695
|
this.options.changed(sessionId);
|
|
2684
2696
|
return { snapshot, removed: result.entry !== void 0 };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AgentSelectionSchema,
|
|
3
3
|
assertSelectionSnapshotFits
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NTFNQYQ3.js";
|
|
5
5
|
import {
|
|
6
6
|
isResearchSessionId
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-E7QL4CBT.js";
|
|
8
8
|
import {
|
|
9
9
|
GroupChatError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HFVA7ZOD.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-L3A736SO.js";
|
|
20
20
|
import {
|
|
21
21
|
InteractionResponseSchema,
|
|
22
22
|
SessionSummarySchema
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-K5CMKBW6.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-5J7BK2Y7.js";
|
|
4
4
|
import {
|
|
5
5
|
AgentSessionRenameError,
|
|
6
6
|
UnsupportedAgentOperationError,
|
|
7
7
|
validateSessionName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-L3A736SO.js";
|
|
9
9
|
import {
|
|
10
10
|
InteractionRequestSchema,
|
|
11
11
|
REASONING_EFFORTS,
|
|
12
12
|
SESSION_TIMELINE_PAGE_SIZE
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-K5CMKBW6.js";
|
|
14
14
|
|
|
15
15
|
// src/pi-adapter.ts
|
|
16
16
|
import { createHash as createHash2, randomUUID } from "node:crypto";
|
package/dist/configuration.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeviceIdentitySchema,
|
|
3
|
-
SessionImageRelayUrlSchema,
|
|
4
|
-
SessionImagesConfigSchema,
|
|
5
3
|
codingAgentPresentation,
|
|
6
4
|
relayRequestToken
|
|
7
|
-
} from "./chunks/chunk-
|
|
5
|
+
} from "./chunks/chunk-XPHAIOKN.js";
|
|
8
6
|
import {
|
|
9
7
|
AgentSelectionSchema
|
|
10
|
-
} from "./chunks/chunk-
|
|
8
|
+
} from "./chunks/chunk-NTFNQYQ3.js";
|
|
9
|
+
import {
|
|
10
|
+
SessionImageRelayUrlSchema,
|
|
11
|
+
SessionImagesConfigSchema
|
|
12
|
+
} from "./chunks/chunk-IJPJQF7S.js";
|
|
11
13
|
import {
|
|
12
14
|
CODING_AGENT_IDS
|
|
13
|
-
} from "./chunks/chunk-
|
|
14
|
-
import "./chunks/chunk-
|
|
15
|
+
} from "./chunks/chunk-L3A736SO.js";
|
|
16
|
+
import "./chunks/chunk-K5CMKBW6.js";
|
|
15
17
|
export {
|
|
16
18
|
AgentSelectionSchema,
|
|
17
19
|
CODING_AGENT_IDS,
|
package/dist/index.d.ts
CHANGED
|
@@ -2095,12 +2095,13 @@ declare const UploaderConfigSchema: z.ZodObject<{
|
|
|
2095
2095
|
}, z.core.$strip>;
|
|
2096
2096
|
type SessionImageUploaderConfig = z.input<typeof UploaderConfigSchema>;
|
|
2097
2097
|
type Stage = "config" | "source" | "reserve" | "put" | "complete";
|
|
2098
|
-
type SessionImageUploadErrorCode = "IMAGE_CONFIG_INVALID" | "IMAGE_CONTENT_INVALID" | "IMAGE_CAPACITY_EXCEEDED" | "IMAGE_UPLOADER_CLOSED" | "IMAGE_ABORTED" | "IMAGE_TIMEOUT" | "IMAGE_NETWORK_ERROR" | "IMAGE_HTTP_ERROR" | "IMAGE_RESPONSE_INVALID" | "IMAGE_RESPONSE_TOO_LARGE" | "IMAGE_UPLOAD_TARGET_INVALID" | "IMAGE_UPLOAD_EXPIRED" | "IMAGE_COMMIT_MISMATCH" | "IMAGE_COMPLETION_FAILED" | "IMAGE_ACCESS_REVOKED" | "IMAGE_STORAGE_UNAVAILABLE";
|
|
2098
|
+
type SessionImageUploadErrorCode = "IMAGE_CONFIG_INVALID" | "IMAGE_CONTENT_INVALID" | "IMAGE_CAPACITY_EXCEEDED" | "IMAGE_UPLOADER_CLOSED" | "IMAGE_ABORTED" | "IMAGE_TIMEOUT" | "IMAGE_NETWORK_ERROR" | "IMAGE_HTTP_ERROR" | "IMAGE_RESPONSE_INVALID" | "IMAGE_RESPONSE_TOO_LARGE" | "IMAGE_UPLOAD_TARGET_INVALID" | "IMAGE_UPLOAD_EXPIRED" | "IMAGE_COMMIT_MISMATCH" | "IMAGE_COMPLETION_FAILED" | "IMAGE_ACCESS_REVOKED" | "IMAGE_STORAGE_UNAVAILABLE" | "IMAGE_QUOTA_EXCEEDED" | "IMAGE_BUSY";
|
|
2099
2099
|
/** Safe to log: never retains a response body, URL, token, or raw transport/schema error. */
|
|
2100
2100
|
declare class SessionImageUploadError extends Error {
|
|
2101
2101
|
readonly code: SessionImageUploadErrorCode;
|
|
2102
2102
|
readonly stage: Stage;
|
|
2103
2103
|
readonly status?: number | undefined;
|
|
2104
|
+
retryAfterMs?: number;
|
|
2104
2105
|
constructor(code: SessionImageUploadErrorCode, stage: Stage, status?: number | undefined, cause?: unknown);
|
|
2105
2106
|
}
|
|
2106
2107
|
/** Uploads already-derived WebP bytes only. Consent and session authorization belong to the caller. */
|