@agentknight/client 0.9.57 → 0.9.59
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/README.md +17 -4
- package/dist/chunks/{aad-relay-login-ZG4FN7LM.js → aad-relay-login-SAFMTR5U.js} +2 -2
- package/dist/chunks/{chunk-RL6LR7TK.js → chunk-7G6J645I.js} +1 -1
- package/dist/chunks/{chunk-CG5LD6VF.js → chunk-ANVWLKOO.js} +1 -1
- package/dist/chunks/{chunk-RSYKNJHT.js → chunk-UVAF42HQ.js} +988 -774
- package/dist/chunks/{chunk-WZIU4HVH.js → chunk-WMAAFZJ3.js} +3 -9
- package/dist/chunks/{chunk-CTJU4IKL.js → chunk-ZNDJBPQD.js} +11 -7
- package/dist/chunks/{local-sessions-NLGDAJ2G.js → local-sessions-FLTWEBAI.js} +1 -1
- package/dist/chunks/{runtime-CTACRJCK.js → runtime-QUFPIXMR.js} +1 -1
- package/dist/chunks/{start-client-C3PCBF25.js → start-client-TO5VFFM5.js} +23 -12
- package/dist/chunks/{stop-client-PHRAMW5R.js → stop-client-OXQVYCBB.js} +1 -1
- package/dist/chunks/{upgrade-4IKPYFYS.js → upgrade-UFKH6YNE.js} +2 -2
- package/dist/cli.js +6 -6
- package/dist/upgrade-worker.js +264 -61
- package/package.json +4 -4
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
resolveUpgradeVersion,
|
|
10
10
|
runNpm,
|
|
11
11
|
updateJobState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ANVWLKOO.js";
|
|
13
13
|
import "./chunk-CNWBK4LE.js";
|
|
14
14
|
import {
|
|
15
15
|
processExists,
|
|
16
16
|
readRuntimeDescriptor,
|
|
17
17
|
requestRuntime
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-WMAAFZJ3.js";
|
|
19
19
|
import {
|
|
20
20
|
readOptionalJson,
|
|
21
21
|
writePrivateJson
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
readAppVersion,
|
|
4
4
|
toErrorDetails
|
|
5
|
-
} from "./chunks/chunk-
|
|
5
|
+
} from "./chunks/chunk-7G6J645I.js";
|
|
6
6
|
|
|
7
7
|
// src/index.ts
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
@@ -192,7 +192,7 @@ async function main() {
|
|
|
192
192
|
for (const warning of resolved.warnings ?? []) process.stderr.write(`AgentKnight: ${warning}
|
|
193
193
|
`);
|
|
194
194
|
if (cliOptions.command === "peer-chat") {
|
|
195
|
-
const { processExists, readRuntimeDescriptor, requestPeerChat } = await import("./chunks/runtime-
|
|
195
|
+
const { processExists, readRuntimeDescriptor, requestPeerChat } = await import("./chunks/runtime-QUFPIXMR.js");
|
|
196
196
|
const descriptor = await readRuntimeDescriptor(resolved.dataDirectory);
|
|
197
197
|
if (descriptor === void 0 || !processExists(descriptor.pid)) {
|
|
198
198
|
throw new Error("No Agent is running for this home. Start the Agent before using peer-chat.");
|
|
@@ -214,14 +214,14 @@ async function main() {
|
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
216
|
if (cliOptions.command === "stop") {
|
|
217
|
-
const { stopClient } = await import("./chunks/stop-client-
|
|
217
|
+
const { stopClient } = await import("./chunks/stop-client-OXQVYCBB.js");
|
|
218
218
|
await stopClient(resolved.dataDirectory, cliOptions.expectedPid);
|
|
219
219
|
process.stdout.write(cliOptions.json ? `${JSON.stringify({ state: "stopped" })}
|
|
220
220
|
` : "PC Agent stopped.\n");
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
223
|
if (cliOptions.command === "status") {
|
|
224
|
-
const [{ processExists, readRuntimeDescriptor, requestRuntime }, { readLastUpgrade, readUpgradeState }] = await Promise.all([import("./chunks/runtime-
|
|
224
|
+
const [{ processExists, readRuntimeDescriptor, requestRuntime }, { readLastUpgrade, readUpgradeState }] = await Promise.all([import("./chunks/runtime-QUFPIXMR.js"), import("./chunks/upgrade-state-QXZT3TTS.js")]);
|
|
225
225
|
const descriptor = await readRuntimeDescriptor(resolved.dataDirectory);
|
|
226
226
|
const runtime = descriptor === void 0 || !processExists(descriptor.pid) ? void 0 : await requestRuntime(descriptor, "status");
|
|
227
227
|
const lastUpgrade = await readLastUpgrade(resolved.dataDirectory);
|
|
@@ -244,7 +244,7 @@ async function main() {
|
|
|
244
244
|
return;
|
|
245
245
|
}
|
|
246
246
|
if (cliOptions.command === "upgrade") {
|
|
247
|
-
const { upgrade } = await import("./chunks/upgrade-
|
|
247
|
+
const { upgrade } = await import("./chunks/upgrade-UFKH6YNE.js");
|
|
248
248
|
await upgrade({
|
|
249
249
|
dataDirectory: resolved.dataDirectory,
|
|
250
250
|
currentVersion: appVersion,
|
|
@@ -255,7 +255,7 @@ async function main() {
|
|
|
255
255
|
});
|
|
256
256
|
return;
|
|
257
257
|
}
|
|
258
|
-
const { startClient } = await import("./chunks/start-client-
|
|
258
|
+
const { startClient } = await import("./chunks/start-client-TO5VFFM5.js");
|
|
259
259
|
await startClient(appVersion, cliOptions, resolved, fileURLToPath(import.meta.url));
|
|
260
260
|
}
|
|
261
261
|
await main().catch((error) => {
|
package/dist/upgrade-worker.js
CHANGED
|
@@ -9322,8 +9322,8 @@ function ko_default() {
|
|
|
9322
9322
|
}
|
|
9323
9323
|
|
|
9324
9324
|
// ../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/lt.js
|
|
9325
|
-
var capitalizeFirstCharacter = (
|
|
9326
|
-
return
|
|
9325
|
+
var capitalizeFirstCharacter = (text2) => {
|
|
9326
|
+
return text2.charAt(0).toUpperCase() + text2.slice(1);
|
|
9327
9327
|
};
|
|
9328
9328
|
function getUnitTypeFromNumber(number4) {
|
|
9329
9329
|
const abs = Math.abs(number4);
|
|
@@ -19948,8 +19948,8 @@ async function findNpmCli(options) {
|
|
|
19948
19948
|
}
|
|
19949
19949
|
throw new Error("Cannot locate npm-cli.js. Install Node.js with npm and make it available on PATH.");
|
|
19950
19950
|
}
|
|
19951
|
-
function redactDiagnostics(
|
|
19952
|
-
let result =
|
|
19951
|
+
function redactDiagnostics(text2, env) {
|
|
19952
|
+
let result = text2.replace(/\b(https?:\/\/)[^/@\s]+@/gi, "$1[redacted]@").replace(/\b(Bearer|Basic)\s+[a-zA-Z0-9+/_=.-]+/gi, "$1 [redacted]").replace(/((?:"?(?:_authToken|_auth|password|passwd|access_token|token|authorization)"?)\s*[:=]\s*)(?:"[^"]*"|'[^']*'|[^\s,;]+)/gi, "$1[redacted]").replace(/\bnpm_[a-zA-Z0-9]{20,}\b/g, "[redacted]");
|
|
19953
19953
|
for (const [name, value] of Object.entries(env)) {
|
|
19954
19954
|
if (value && /token|secret|password|passwd|auth/i.test(name)) result = result.split(value).join("[redacted]");
|
|
19955
19955
|
}
|
|
@@ -20192,7 +20192,7 @@ async function installPreparedPackage(options) {
|
|
|
20192
20192
|
import { createConnection, createServer } from "node:net";
|
|
20193
20193
|
import { join as join5, resolve as resolve3 } from "node:path";
|
|
20194
20194
|
|
|
20195
|
-
// ../../shared/sdk/dist/chunks/chunk-
|
|
20195
|
+
// ../../shared/sdk/dist/chunks/chunk-LO4ZRE77.js
|
|
20196
20196
|
var IdSchema = external_exports.string().trim().min(1).max(256);
|
|
20197
20197
|
var IsoDateSchema = external_exports.iso.datetime({ offset: true });
|
|
20198
20198
|
var Base64UrlKeyIdSchema = external_exports.string().regex(/^[A-Za-z0-9_-]{22}$/u, "Expected a 16-byte base64url key ID");
|
|
@@ -21920,23 +21920,86 @@ var PeerDeliverySchema = external_exports.object({
|
|
|
21920
21920
|
sourceMachineId: IdSchema,
|
|
21921
21921
|
message: PeerMessageSchema
|
|
21922
21922
|
}).strict();
|
|
21923
|
+
var SessionCommunicationIdSchema = external_exports.string().min(1).max(256).refine((value) => value === value.trim(), "Expected an unpadded identity");
|
|
21924
|
+
var SessionCommunicationIdentityShape = {
|
|
21925
|
+
requestId: SessionCommunicationIdSchema,
|
|
21926
|
+
machineId: SessionCommunicationIdSchema,
|
|
21927
|
+
sessionId: SessionCommunicationIdSchema,
|
|
21928
|
+
operation: external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/u),
|
|
21929
|
+
version: external_exports.number().int().positive().max(2147483647)
|
|
21930
|
+
};
|
|
21931
|
+
var SessionCommunicationDataSchema = external_exports.record(external_exports.string(), external_exports.json());
|
|
21932
|
+
var SessionCommunicationRequestSchema = external_exports.object({
|
|
21933
|
+
...SessionCommunicationIdentityShape,
|
|
21934
|
+
kind: external_exports.literal("request"),
|
|
21935
|
+
data: SessionCommunicationDataSchema
|
|
21936
|
+
}).strict();
|
|
21937
|
+
var SessionCommunicationResponseSchema = external_exports.object({
|
|
21938
|
+
...SessionCommunicationIdentityShape,
|
|
21939
|
+
kind: external_exports.literal("response"),
|
|
21940
|
+
data: SessionCommunicationDataSchema
|
|
21941
|
+
}).strict();
|
|
21942
|
+
var SessionCommunicationErrorSchema = external_exports.object({
|
|
21943
|
+
...SessionCommunicationIdentityShape,
|
|
21944
|
+
kind: external_exports.literal("error"),
|
|
21945
|
+
error: ProtocolFailureSchema
|
|
21946
|
+
}).strict();
|
|
21947
|
+
var SessionCommunicationSchema = external_exports.discriminatedUnion("kind", [
|
|
21948
|
+
SessionCommunicationRequestSchema,
|
|
21949
|
+
SessionCommunicationResponseSchema,
|
|
21950
|
+
SessionCommunicationErrorSchema
|
|
21951
|
+
]);
|
|
21952
|
+
function sessionCommunicationOperationCapability(operation, version2) {
|
|
21953
|
+
return `${operation}.v${version2}`;
|
|
21954
|
+
}
|
|
21955
|
+
var ENCRYPTED_PEER_AUTHORIZE_OPERATION = "peer.authorize";
|
|
21956
|
+
var ENCRYPTED_PEER_VERSION = 1;
|
|
21957
|
+
var ENCRYPTED_PEER_AUTHORIZE_CAPABILITY = sessionCommunicationOperationCapability(ENCRYPTED_PEER_AUTHORIZE_OPERATION, ENCRYPTED_PEER_VERSION);
|
|
21958
|
+
var ENCRYPTED_PEER_MAX_LENGTH = 36e4;
|
|
21959
|
+
var GroupIdSchema = external_exports.uuid().refine((id) => id === id.toLowerCase(), "Expected a canonical group ID");
|
|
21960
|
+
var EncryptedPeerAuthorizationSchema = external_exports.object({
|
|
21961
|
+
groupId: GroupIdSchema,
|
|
21962
|
+
peerMachineId: IdSchema,
|
|
21963
|
+
peerSessionId: IdSchema,
|
|
21964
|
+
key: external_exports.string().regex(/^[A-Za-z0-9_-]{43}$/u)
|
|
21965
|
+
}).strict();
|
|
21966
|
+
var EncryptedPeerAuthorizationResultSchema = external_exports.object({
|
|
21967
|
+
groupId: GroupIdSchema,
|
|
21968
|
+
keyId: external_exports.string().regex(/^[A-Za-z0-9_-]{22}$/u)
|
|
21969
|
+
}).strict();
|
|
21970
|
+
var ENCRYPTED_GROUP_CREATE_OPERATION = "group-chat.create-encrypted";
|
|
21971
|
+
var ENCRYPTED_GROUP_CREATE_CAPABILITY = sessionCommunicationOperationCapability(ENCRYPTED_GROUP_CREATE_OPERATION, ENCRYPTED_PEER_VERSION);
|
|
21972
|
+
var EncryptedGroupCreateSchema = external_exports.object({
|
|
21973
|
+
groupId: GroupIdSchema,
|
|
21974
|
+
peerMachineId: IdSchema,
|
|
21975
|
+
peerSessionId: IdSchema,
|
|
21976
|
+
peerTitle: external_exports.string().trim().min(1).max(260)
|
|
21977
|
+
}).strict();
|
|
21978
|
+
var EncryptedPeerMessageSchema = SecureMessageSchema.refine((message) => message.sender === "pc" && message.event === "session.communication" && message.recipientClientId !== void 0 && message.ciphertext.length <= ENCRYPTED_PEER_MAX_LENGTH, "Expected a bounded, addressed encrypted peer message");
|
|
21923
21979
|
var A2A_BODY_MAX_LENGTH = 65536;
|
|
21924
21980
|
var A2aRelayRequestSchema = external_exports.object({
|
|
21925
21981
|
userId: IdSchema,
|
|
21926
21982
|
sourceMachineId: IdSchema,
|
|
21927
21983
|
targetSessionId: IdSchema,
|
|
21928
21984
|
endpointUrl: external_exports.url().max(2048),
|
|
21929
|
-
kind: external_exports.enum(["card", "rpc"]),
|
|
21930
|
-
body: external_exports.string().max(
|
|
21985
|
+
kind: external_exports.enum(["card", "rpc", "encrypted"]),
|
|
21986
|
+
body: external_exports.string().max(ENCRYPTED_PEER_MAX_LENGTH + 4096),
|
|
21931
21987
|
protocolVersion: external_exports.string().max(32).optional()
|
|
21932
|
-
}).strict().refine((request) => request.kind
|
|
21988
|
+
}).strict().refine((request) => request.kind === "encrypted" || request.body.length <= A2A_BODY_MAX_LENGTH, {
|
|
21989
|
+
path: ["body"],
|
|
21990
|
+
message: "Plaintext A2A body exceeds the text budget"
|
|
21991
|
+
}).refine((request) => request.kind !== "card" || request.body === "", {
|
|
21933
21992
|
path: ["body"],
|
|
21934
21993
|
message: "Agent card requests must have an empty body"
|
|
21935
21994
|
});
|
|
21936
21995
|
var A2aRelayResponseSchema = external_exports.object({
|
|
21937
21996
|
status: external_exports.number().int().min(200).max(599),
|
|
21938
|
-
body: external_exports.string().max(
|
|
21939
|
-
|
|
21997
|
+
body: external_exports.string().max(ENCRYPTED_PEER_MAX_LENGTH + 4096),
|
|
21998
|
+
encrypted: external_exports.literal(true).optional()
|
|
21999
|
+
}).strict().refine((response) => response.encrypted === true || response.body.length <= A2A_BODY_MAX_LENGTH, {
|
|
22000
|
+
path: ["body"],
|
|
22001
|
+
message: "Plaintext A2A response exceeds the text budget"
|
|
22002
|
+
});
|
|
21940
22003
|
var BROWSER_OPEN_URL_MAX_LENGTH = 8192;
|
|
21941
22004
|
var BrowserOpenUrlParamsSchema = external_exports.strictObject({
|
|
21942
22005
|
url: external_exports.string().min(1).max(BROWSER_OPEN_URL_MAX_LENGTH).refine((value) => {
|
|
@@ -21963,38 +22026,6 @@ var DeviceTextInputResultSchema = external_exports.object({
|
|
|
21963
22026
|
pasteAttempted: external_exports.boolean(),
|
|
21964
22027
|
pasteShortcutSent: external_exports.boolean()
|
|
21965
22028
|
}).strict().refine((result) => (!result.pasteAttempted || result.clipboardUpdated) && (!result.pasteShortcutSent || result.pasteAttempted));
|
|
21966
|
-
var SessionCommunicationIdSchema = external_exports.string().min(1).max(256).refine((value) => value === value.trim(), "Expected an unpadded identity");
|
|
21967
|
-
var SessionCommunicationIdentityShape = {
|
|
21968
|
-
requestId: SessionCommunicationIdSchema,
|
|
21969
|
-
machineId: SessionCommunicationIdSchema,
|
|
21970
|
-
sessionId: SessionCommunicationIdSchema,
|
|
21971
|
-
operation: external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/u),
|
|
21972
|
-
version: external_exports.number().int().positive().max(2147483647)
|
|
21973
|
-
};
|
|
21974
|
-
var SessionCommunicationDataSchema = external_exports.record(external_exports.string(), external_exports.json());
|
|
21975
|
-
var SessionCommunicationRequestSchema = external_exports.object({
|
|
21976
|
-
...SessionCommunicationIdentityShape,
|
|
21977
|
-
kind: external_exports.literal("request"),
|
|
21978
|
-
data: SessionCommunicationDataSchema
|
|
21979
|
-
}).strict();
|
|
21980
|
-
var SessionCommunicationResponseSchema = external_exports.object({
|
|
21981
|
-
...SessionCommunicationIdentityShape,
|
|
21982
|
-
kind: external_exports.literal("response"),
|
|
21983
|
-
data: SessionCommunicationDataSchema
|
|
21984
|
-
}).strict();
|
|
21985
|
-
var SessionCommunicationErrorSchema = external_exports.object({
|
|
21986
|
-
...SessionCommunicationIdentityShape,
|
|
21987
|
-
kind: external_exports.literal("error"),
|
|
21988
|
-
error: ProtocolFailureSchema
|
|
21989
|
-
}).strict();
|
|
21990
|
-
var SessionCommunicationSchema = external_exports.discriminatedUnion("kind", [
|
|
21991
|
-
SessionCommunicationRequestSchema,
|
|
21992
|
-
SessionCommunicationResponseSchema,
|
|
21993
|
-
SessionCommunicationErrorSchema
|
|
21994
|
-
]);
|
|
21995
|
-
function sessionCommunicationOperationCapability(operation, version2) {
|
|
21996
|
-
return `${operation}.v${version2}`;
|
|
21997
|
-
}
|
|
21998
22029
|
var SESSION_PROJECT_IDENTITY_MAX_PATH_LENGTH = 32768;
|
|
21999
22030
|
var SESSION_PROJECT_IDENTITY_MAX_RESPONSE_BYTES = 640 * 1024;
|
|
22000
22031
|
var SESSION_DIRECTORY_MAX_PATH_LENGTH = 1024;
|
|
@@ -22039,22 +22070,26 @@ var SessionDirectoryListRequestSchema = external_exports.object({
|
|
|
22039
22070
|
requestId: IdSchema,
|
|
22040
22071
|
machineId: IdSchema,
|
|
22041
22072
|
sessionId: IdSchema,
|
|
22042
|
-
path: external_exports.string().max(SESSION_DIRECTORY_MAX_PATH_LENGTH)
|
|
22073
|
+
path: external_exports.string().max(SESSION_DIRECTORY_MAX_PATH_LENGTH),
|
|
22074
|
+
space: external_exports.literal("session").optional()
|
|
22043
22075
|
}).strict();
|
|
22044
22076
|
var SessionDirectoryEntrySchema = external_exports.object({
|
|
22045
22077
|
name: external_exports.string().min(1).max(255),
|
|
22046
22078
|
kind: external_exports.enum(["directory", "file", "blocked"])
|
|
22047
22079
|
}).strict();
|
|
22048
|
-
var SessionDirectoryListDataSchema = SessionDirectoryListRequestSchema.pick({ path: true });
|
|
22080
|
+
var SessionDirectoryListDataSchema = SessionDirectoryListRequestSchema.pick({ path: true, space: true });
|
|
22049
22081
|
var SessionDirectoryListResultDataSchema = external_exports.object({
|
|
22050
22082
|
path: external_exports.string().max(SESSION_DIRECTORY_MAX_PATH_LENGTH),
|
|
22051
22083
|
rootRevision: external_exports.string().min(1).max(128),
|
|
22052
|
-
entries: external_exports.array(SessionDirectoryEntrySchema).max(SESSION_DIRECTORY_MAX_ENTRIES)
|
|
22084
|
+
entries: external_exports.array(SessionDirectoryEntrySchema).max(SESSION_DIRECTORY_MAX_ENTRIES),
|
|
22085
|
+
rootPath: external_exports.string().min(1).max(SESSION_PROJECT_IDENTITY_MAX_PATH_LENGTH).optional()
|
|
22053
22086
|
}).strict();
|
|
22054
|
-
var SessionDirectoryListResponseSchema = SessionDirectoryListRequestSchema.extend({
|
|
22087
|
+
var SessionDirectoryListResponseSchema = SessionDirectoryListRequestSchema.omit({ space: true }).extend({
|
|
22055
22088
|
rootRevision: external_exports.string().min(1).max(128).optional(),
|
|
22056
22089
|
entries: external_exports.array(SessionDirectoryEntrySchema).max(SESSION_DIRECTORY_MAX_ENTRIES).optional(),
|
|
22057
|
-
error: ProtocolFailureSchema.optional()
|
|
22090
|
+
error: ProtocolFailureSchema.optional(),
|
|
22091
|
+
space: external_exports.literal("session").optional(),
|
|
22092
|
+
rootPath: external_exports.string().min(1).max(SESSION_PROJECT_IDENTITY_MAX_PATH_LENGTH).optional()
|
|
22058
22093
|
}).superRefine((response, context) => {
|
|
22059
22094
|
if (response.error === void 0 ? response.entries === void 0 || response.rootRevision === void 0 : response.entries !== void 0 || response.rootRevision !== void 0) {
|
|
22060
22095
|
context.addIssue({ code: "custom", message: "Expected directory success or failure" });
|
|
@@ -22062,7 +22097,8 @@ var SessionDirectoryListResponseSchema = SessionDirectoryListRequestSchema.exten
|
|
|
22062
22097
|
});
|
|
22063
22098
|
var SessionFileReadDataSchema = external_exports.object({
|
|
22064
22099
|
path: external_exports.string().min(1).max(SESSION_DIRECTORY_MAX_PATH_LENGTH).refine(isSafeSessionDirectoryPath),
|
|
22065
|
-
rootRevision: external_exports.string().regex(/^[A-Za-z0-9_-]{43}$/u)
|
|
22100
|
+
rootRevision: external_exports.string().regex(/^[A-Za-z0-9_-]{43}$/u),
|
|
22101
|
+
space: external_exports.literal("session").optional()
|
|
22066
22102
|
}).strict();
|
|
22067
22103
|
function fileResultSchema(mediaTypes, extended2) {
|
|
22068
22104
|
const maxOriginal = extended2 ? SESSION_FILE_V2_MAX_ORIGINAL_BYTES : SESSION_FILE_MAX_ORIGINAL_BYTES;
|
|
@@ -22191,7 +22227,8 @@ var SESSION_RESOURCE_MEDIA_TYPES = [
|
|
|
22191
22227
|
];
|
|
22192
22228
|
var SessionResourceReadDataSchema = external_exports.object({
|
|
22193
22229
|
path: external_exports.string().min(1).max(SESSION_DIRECTORY_MAX_PATH_LENGTH).refine(isSafeSessionDirectoryPath),
|
|
22194
|
-
rootRevision: external_exports.string().regex(/^[A-Za-z0-9_-]{43}$/u)
|
|
22230
|
+
rootRevision: external_exports.string().regex(/^[A-Za-z0-9_-]{43}$/u),
|
|
22231
|
+
space: external_exports.literal("session").optional()
|
|
22195
22232
|
}).strict();
|
|
22196
22233
|
var SessionResourceReadResultDataSchema = external_exports.object({
|
|
22197
22234
|
path: SessionResourceReadDataSchema.shape.path,
|
|
@@ -22586,6 +22623,7 @@ var WORKBENCH_OPERATIONS = [
|
|
|
22586
22623
|
"queue.snapshot",
|
|
22587
22624
|
"queue.mutate",
|
|
22588
22625
|
"insights.read",
|
|
22626
|
+
"reasoning.read",
|
|
22589
22627
|
"analytics.read",
|
|
22590
22628
|
"context.compact",
|
|
22591
22629
|
...SCHEDULE_OPERATIONS
|
|
@@ -22721,7 +22759,66 @@ var WorkbenchContextSchema = external_exports.object({
|
|
|
22721
22759
|
tokenLimit: Count,
|
|
22722
22760
|
systemTokens: Count.optional(),
|
|
22723
22761
|
conversationTokens: Count.optional(),
|
|
22724
|
-
toolTokens: Count.optional()
|
|
22762
|
+
toolTokens: Count.optional(),
|
|
22763
|
+
displayLimit: Count.optional(),
|
|
22764
|
+
compactionThreshold: Count.optional()
|
|
22765
|
+
}).strict();
|
|
22766
|
+
var WorkbenchContextSourceSchema = external_exports.object({
|
|
22767
|
+
id: Id2,
|
|
22768
|
+
kind: Id2,
|
|
22769
|
+
label: external_exports.string().min(1).max(256),
|
|
22770
|
+
tokens: Count,
|
|
22771
|
+
parentId: Id2.optional()
|
|
22772
|
+
}).strict();
|
|
22773
|
+
var WorkbenchContextSampleSchema = external_exports.object({
|
|
22774
|
+
id: Id2,
|
|
22775
|
+
timestamp: external_exports.iso.datetime(),
|
|
22776
|
+
tokens: Count,
|
|
22777
|
+
limit: Count,
|
|
22778
|
+
messages: Count
|
|
22779
|
+
}).strict();
|
|
22780
|
+
var WorkbenchCompactionSchema = external_exports.object({
|
|
22781
|
+
id: Id2,
|
|
22782
|
+
timestamp: external_exports.iso.datetime(),
|
|
22783
|
+
success: external_exports.boolean(),
|
|
22784
|
+
before: Count.optional(),
|
|
22785
|
+
after: Count.optional(),
|
|
22786
|
+
removed: Count.optional(),
|
|
22787
|
+
messagesRemoved: Count.optional(),
|
|
22788
|
+
trigger: Id2.optional(),
|
|
22789
|
+
basis: Id2.optional(),
|
|
22790
|
+
durationMs: external_exports.number().finite().nonnegative().optional(),
|
|
22791
|
+
inputTokens: Count.optional(),
|
|
22792
|
+
outputTokens: Count.optional()
|
|
22793
|
+
}).strict();
|
|
22794
|
+
var WorkbenchUsageCallSchema = external_exports.object({
|
|
22795
|
+
id: Id2,
|
|
22796
|
+
timestamp: external_exports.iso.datetime(),
|
|
22797
|
+
model: Id2,
|
|
22798
|
+
agentId: Id2.optional(),
|
|
22799
|
+
input: Count.optional(),
|
|
22800
|
+
output: Count.optional(),
|
|
22801
|
+
cache: Count.optional(),
|
|
22802
|
+
requestBytes: Count.optional(),
|
|
22803
|
+
wireBytes: Count.optional(),
|
|
22804
|
+
durationMs: external_exports.number().finite().nonnegative().optional(),
|
|
22805
|
+
firstOutputMs: external_exports.number().finite().nonnegative().optional()
|
|
22806
|
+
}).strict();
|
|
22807
|
+
var WorkbenchTelemetrySchema = external_exports.object({
|
|
22808
|
+
since: external_exports.iso.datetime(),
|
|
22809
|
+
observedSince: external_exports.iso.datetime(),
|
|
22810
|
+
dropped: Count,
|
|
22811
|
+
gapSince: external_exports.iso.datetime().optional(),
|
|
22812
|
+
truncated: external_exports.boolean(),
|
|
22813
|
+
samples: external_exports.array(WorkbenchContextSampleSchema).max(120),
|
|
22814
|
+
compactions: external_exports.array(WorkbenchCompactionSchema).max(40),
|
|
22815
|
+
calls: external_exports.array(WorkbenchUsageCallSchema).max(120)
|
|
22816
|
+
}).strict();
|
|
22817
|
+
var WorkbenchStorageSchema = external_exports.object({
|
|
22818
|
+
bytes: Count,
|
|
22819
|
+
files: Count,
|
|
22820
|
+
sampledAt: external_exports.iso.datetime(),
|
|
22821
|
+
partial: external_exports.boolean()
|
|
22725
22822
|
}).strict();
|
|
22726
22823
|
var WorkbenchInsightsSchema = external_exports.object({
|
|
22727
22824
|
sampledAt: external_exports.iso.datetime(),
|
|
@@ -22734,13 +22831,43 @@ var WorkbenchInsightsSchema = external_exports.object({
|
|
|
22734
22831
|
models: external_exports.array(WorkbenchModelUsageSchema).max(100),
|
|
22735
22832
|
context: WorkbenchContextSchema.optional(),
|
|
22736
22833
|
canCompact: external_exports.boolean(),
|
|
22737
|
-
compactUnavailableReason: external_exports.string().max(1024).optional()
|
|
22834
|
+
compactUnavailableReason: external_exports.string().max(1024).optional(),
|
|
22835
|
+
composition: external_exports.array(WorkbenchTokenMetricSchema).max(8).optional(),
|
|
22836
|
+
sources: external_exports.array(WorkbenchContextSourceSchema).max(24).optional(),
|
|
22837
|
+
sourcesTruncated: external_exports.boolean().optional(),
|
|
22838
|
+
heaviestMessages: external_exports.array(WorkbenchContextSourceSchema).max(10).optional(),
|
|
22839
|
+
compactionCount: Count.optional(),
|
|
22840
|
+
telemetry: WorkbenchTelemetrySchema.optional(),
|
|
22841
|
+
storage: WorkbenchStorageSchema.optional()
|
|
22738
22842
|
}).strict();
|
|
22739
22843
|
var WorkbenchCompactResultSchema = external_exports.object({
|
|
22740
22844
|
success: external_exports.boolean(),
|
|
22741
22845
|
tokensRemoved: Count,
|
|
22742
22846
|
messagesRemoved: Count
|
|
22743
22847
|
}).strict();
|
|
22848
|
+
var WORKBENCH_REASONING_PAGE_SIZE = 20;
|
|
22849
|
+
var WORKBENCH_REASONING_TEXT_LIMIT = 5e4;
|
|
22850
|
+
var WorkbenchReasoningRequestSchema = external_exports.object({
|
|
22851
|
+
cursor: external_exports.string().min(1).max(8192).optional()
|
|
22852
|
+
}).strict();
|
|
22853
|
+
var WorkbenchReasoningBlockSchema = external_exports.object({
|
|
22854
|
+
id: Id2,
|
|
22855
|
+
timestamp: external_exports.iso.datetime(),
|
|
22856
|
+
agentId: Id2.optional(),
|
|
22857
|
+
content: external_exports.string().max(WORKBENCH_REASONING_TEXT_LIMIT),
|
|
22858
|
+
truncated: external_exports.boolean()
|
|
22859
|
+
}).strict();
|
|
22860
|
+
var WorkbenchDecisionNodeSchema = WorkbenchReasoningBlockSchema.extend({
|
|
22861
|
+
kind: external_exports.enum(["rationale", "plan", "tool", "subagent", "response", "compaction"]),
|
|
22862
|
+
title: external_exports.string().min(1).max(256),
|
|
22863
|
+
status: external_exports.enum(["recorded", "started", "completed", "failed"])
|
|
22864
|
+
}).strict();
|
|
22865
|
+
var WorkbenchReasoningPageSchema = external_exports.object({
|
|
22866
|
+
blocks: external_exports.array(WorkbenchReasoningBlockSchema).max(WORKBENCH_REASONING_PAGE_SIZE),
|
|
22867
|
+
cursor: external_exports.string().min(1).max(8192),
|
|
22868
|
+
hasMore: external_exports.boolean(),
|
|
22869
|
+
nodes: external_exports.array(WorkbenchDecisionNodeSchema).max(WORKBENCH_REASONING_PAGE_SIZE).optional()
|
|
22870
|
+
}).strict();
|
|
22744
22871
|
var WorkbenchAndroidSchemas = {
|
|
22745
22872
|
WorkbenchOperationGet: WorkbenchOperationGetSchema,
|
|
22746
22873
|
WorkbenchOperationStatus: WorkbenchOperationStatusSchema,
|
|
@@ -22767,8 +22894,18 @@ var WorkbenchAndroidSchemas = {
|
|
|
22767
22894
|
WorkbenchTokenMetric: WorkbenchTokenMetricSchema,
|
|
22768
22895
|
WorkbenchModelUsage: WorkbenchModelUsageSchema,
|
|
22769
22896
|
WorkbenchContext: WorkbenchContextSchema,
|
|
22897
|
+
WorkbenchContextSource: WorkbenchContextSourceSchema,
|
|
22898
|
+
WorkbenchContextSample: WorkbenchContextSampleSchema,
|
|
22899
|
+
WorkbenchCompaction: WorkbenchCompactionSchema,
|
|
22900
|
+
WorkbenchUsageCall: WorkbenchUsageCallSchema,
|
|
22901
|
+
WorkbenchTelemetry: WorkbenchTelemetrySchema,
|
|
22902
|
+
WorkbenchStorage: WorkbenchStorageSchema,
|
|
22770
22903
|
WorkbenchInsights: WorkbenchInsightsSchema,
|
|
22771
|
-
WorkbenchCompactResult: WorkbenchCompactResultSchema
|
|
22904
|
+
WorkbenchCompactResult: WorkbenchCompactResultSchema,
|
|
22905
|
+
WorkbenchReasoningRequest: WorkbenchReasoningRequestSchema,
|
|
22906
|
+
WorkbenchReasoningBlock: WorkbenchReasoningBlockSchema,
|
|
22907
|
+
WorkbenchDecisionNode: WorkbenchDecisionNodeSchema,
|
|
22908
|
+
WorkbenchReasoningPage: WorkbenchReasoningPageSchema
|
|
22772
22909
|
};
|
|
22773
22910
|
var Count2 = external_exports.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
|
|
22774
22911
|
var DateKey = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
|
|
@@ -22919,6 +23056,18 @@ var RelayFeaturesSchema = external_exports.object({
|
|
|
22919
23056
|
}).strict();
|
|
22920
23057
|
var RelayFeatureAndroidSchemas = { RelayFeatures: RelayFeaturesSchema };
|
|
22921
23058
|
var secret = external_exports.string().min(1).max(16384).regex(/^[^\s]+$/);
|
|
23059
|
+
var WebModelReasoningSchema = external_exports.enum(["minimal", "low", "medium", "high", "xhigh", "max"]);
|
|
23060
|
+
var WebModelImageSchema = external_exports.object({
|
|
23061
|
+
type: external_exports.literal("image_url"),
|
|
23062
|
+
image_url: external_exports.object({ url: external_exports.string().max(6e5).regex(/^data:image\/(?:png|jpeg|webp);base64,[A-Za-z0-9+/]+={0,2}$/) }).strict()
|
|
23063
|
+
}).strict();
|
|
23064
|
+
var WebModelUserContentSchema = external_exports.union([
|
|
23065
|
+
external_exports.string().max(2e5),
|
|
23066
|
+
external_exports.array(external_exports.union([
|
|
23067
|
+
external_exports.object({ type: external_exports.literal("text"), text: external_exports.string().max(2e5) }).strict(),
|
|
23068
|
+
WebModelImageSchema
|
|
23069
|
+
])).min(1).max(5)
|
|
23070
|
+
]);
|
|
22922
23071
|
var ToolCallSchema = external_exports.object({
|
|
22923
23072
|
id: external_exports.string().min(1).max(256),
|
|
22924
23073
|
type: external_exports.literal("function"),
|
|
@@ -22926,7 +23075,8 @@ var ToolCallSchema = external_exports.object({
|
|
|
22926
23075
|
}).strict();
|
|
22927
23076
|
var WebCopilotCompletionSchema = external_exports.object({
|
|
22928
23077
|
messages: external_exports.array(external_exports.union([
|
|
22929
|
-
external_exports.object({ role: external_exports.
|
|
23078
|
+
external_exports.object({ role: external_exports.literal("system"), content: external_exports.string().max(2e5) }).strict(),
|
|
23079
|
+
external_exports.object({ role: external_exports.literal("user"), content: WebModelUserContentSchema }).strict(),
|
|
22930
23080
|
external_exports.object({
|
|
22931
23081
|
role: external_exports.literal("assistant"),
|
|
22932
23082
|
content: external_exports.string().max(2e5).nullable().optional(),
|
|
@@ -22941,7 +23091,8 @@ var WebCopilotCompletionSchema = external_exports.object({
|
|
|
22941
23091
|
description: external_exports.string().max(4e3),
|
|
22942
23092
|
parameters: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
22943
23093
|
}).strict()
|
|
22944
|
-
}).strict()).min(1).max(
|
|
23094
|
+
}).strict()).min(1).max(32).optional(),
|
|
23095
|
+
reasoning_effort: WebModelReasoningSchema.optional(),
|
|
22945
23096
|
stream: external_exports.literal(false)
|
|
22946
23097
|
}).strict();
|
|
22947
23098
|
var WebCopilotActionSchema = external_exports.discriminatedUnion("action", [
|
|
@@ -22974,9 +23125,59 @@ var WebCopilotPollSchema = external_exports.discriminatedUnion("state", [
|
|
|
22974
23125
|
external_exports.object({ state: external_exports.literal("slow_down"), interval: external_exports.number().int().positive().max(300).optional() }),
|
|
22975
23126
|
external_exports.object({ state: external_exports.literal("complete"), token: secret })
|
|
22976
23127
|
]);
|
|
22977
|
-
var
|
|
22978
|
-
|
|
23128
|
+
var WebCopilotModelSchema = external_exports.object({
|
|
23129
|
+
id: external_exports.string().min(1).max(256),
|
|
23130
|
+
name: external_exports.string().min(1).max(256),
|
|
23131
|
+
api: external_exports.enum(["chat", "responses"]).optional(),
|
|
23132
|
+
// Older Relays advertised only tool-capable, text-only chat models.
|
|
23133
|
+
supportsTools: external_exports.boolean().optional(),
|
|
23134
|
+
supportsImages: external_exports.boolean().optional(),
|
|
23135
|
+
reasoningEfforts: external_exports.array(WebModelReasoningSchema).max(6).optional()
|
|
23136
|
+
});
|
|
23137
|
+
var WebCopilotModelsSchema = external_exports.object({ models: external_exports.array(WebCopilotModelSchema).max(512) });
|
|
23138
|
+
var text = (max) => external_exports.string().trim().min(1).max(max).regex(/^[^\u0000-\u001f\u007f]+$/u);
|
|
23139
|
+
var WebResearchActionSchema = external_exports.discriminatedUnion("action", [
|
|
23140
|
+
external_exports.object({ action: external_exports.literal("status") }).strict(),
|
|
23141
|
+
external_exports.object({ action: external_exports.literal("search"), query: text(300), kind: external_exports.enum(["web", "news", "code"]) }).strict(),
|
|
23142
|
+
external_exports.object({
|
|
23143
|
+
action: external_exports.literal("github"),
|
|
23144
|
+
repository: text(200).regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u).refine((value) => value.split("/").every((part) => part !== "." && part !== "..")),
|
|
23145
|
+
path: text(1024).refine((value) => !value.includes("\\") && value.split("/").every((part) => part !== "." && part !== "..")).optional(),
|
|
23146
|
+
ref: text(200).optional()
|
|
23147
|
+
}).strict()
|
|
23148
|
+
]);
|
|
23149
|
+
var WebResearchRequestSchema = external_exports.object({
|
|
23150
|
+
clientId: external_exports.string().min(1).max(256),
|
|
23151
|
+
mobileCredential: external_exports.string().min(64).max(8192),
|
|
23152
|
+
proof: MobileIdentityProofSchema,
|
|
23153
|
+
request: WebResearchActionSchema
|
|
23154
|
+
}).strict();
|
|
23155
|
+
var WebResearchSourceSchema = external_exports.object({
|
|
23156
|
+
title: external_exports.string().max(500),
|
|
23157
|
+
url: external_exports.string().url().max(4096),
|
|
23158
|
+
publishedAt: external_exports.string().optional(),
|
|
23159
|
+
snippet: external_exports.string().max(2e3).optional()
|
|
22979
23160
|
});
|
|
23161
|
+
var WebResearchResultSchema = external_exports.discriminatedUnion("kind", [
|
|
23162
|
+
external_exports.object({
|
|
23163
|
+
kind: external_exports.literal("search"),
|
|
23164
|
+
provider: external_exports.string(),
|
|
23165
|
+
retrievedAt: external_exports.string(),
|
|
23166
|
+
coverage: external_exports.string(),
|
|
23167
|
+
results: external_exports.array(WebResearchSourceSchema).max(10)
|
|
23168
|
+
}),
|
|
23169
|
+
external_exports.object({
|
|
23170
|
+
kind: external_exports.literal("github"),
|
|
23171
|
+
repository: external_exports.string(),
|
|
23172
|
+
path: external_exports.string(),
|
|
23173
|
+
results: external_exports.array(WebResearchSourceSchema).length(1),
|
|
23174
|
+
coverage: external_exports.string(),
|
|
23175
|
+
entries: external_exports.array(external_exports.object({ name: external_exports.string(), path: external_exports.string(), type: external_exports.string(), sha: external_exports.string() })).max(50).optional(),
|
|
23176
|
+
content: external_exports.string().max(16e3).optional(),
|
|
23177
|
+
sha: external_exports.string().optional(),
|
|
23178
|
+
truncated: external_exports.boolean()
|
|
23179
|
+
})
|
|
23180
|
+
]);
|
|
22980
23181
|
var AndroidProtocolSchemas = {
|
|
22981
23182
|
SessionImageStorage: SessionImageStorageSchema,
|
|
22982
23183
|
MobileIdentityProof: MobileIdentityProofSchema,
|
|
@@ -23050,6 +23251,9 @@ var AndroidProtocolSchemas = {
|
|
|
23050
23251
|
GroupChatInfo: GroupChatInfoSchema,
|
|
23051
23252
|
GroupChatCreateData: GroupChatCreateDataSchema,
|
|
23052
23253
|
GroupChatCreateResultData: GroupChatCreateResultDataSchema,
|
|
23254
|
+
EncryptedPeerAuthorization: EncryptedPeerAuthorizationSchema,
|
|
23255
|
+
EncryptedPeerAuthorizationResult: EncryptedPeerAuthorizationResultSchema,
|
|
23256
|
+
EncryptedGroupCreate: EncryptedGroupCreateSchema,
|
|
23053
23257
|
SessionsSnapshot: SessionsSnapshotSchema,
|
|
23054
23258
|
SessionListRequest: SessionListRequestSchema,
|
|
23055
23259
|
SessionListResult: SessionListResultSchema,
|
|
@@ -23105,13 +23309,14 @@ var AndroidProtocolSchemas = {
|
|
|
23105
23309
|
ProtocolError: ProtocolErrorSchema
|
|
23106
23310
|
};
|
|
23107
23311
|
|
|
23108
|
-
// ../../shared/sdk/dist/chunks/chunk-
|
|
23312
|
+
// ../../shared/sdk/dist/chunks/chunk-AREU4R62.js
|
|
23109
23313
|
var OwnerSchema = external_exports.object({ pid: external_exports.number().int().positive(), instanceId: external_exports.uuid().optional() });
|
|
23110
23314
|
var PeerChatRequestSchema = external_exports.object({
|
|
23111
23315
|
sessionId: IdSchema,
|
|
23112
23316
|
targetMachineId: IdSchema,
|
|
23113
23317
|
targetSessionId: IdSchema,
|
|
23114
|
-
prompt: external_exports.string().trim().min(1).max(16e3)
|
|
23318
|
+
prompt: external_exports.string().trim().min(1).max(16e3),
|
|
23319
|
+
encryptedGroupId: external_exports.uuid().optional()
|
|
23115
23320
|
});
|
|
23116
23321
|
var PeerConversationSchema = external_exports.object({
|
|
23117
23322
|
contextId: IdSchema,
|
|
@@ -23230,7 +23435,6 @@ function exchangeRuntime(descriptor, request, select, timeoutMs, maxResponseByte
|
|
|
23230
23435
|
let data = "";
|
|
23231
23436
|
let completed = false;
|
|
23232
23437
|
const cleanup = () => {
|
|
23233
|
-
clearTimeout(timeout);
|
|
23234
23438
|
signal?.removeEventListener("abort", abort);
|
|
23235
23439
|
};
|
|
23236
23440
|
const fail = (error62) => {
|
|
@@ -23242,8 +23446,7 @@ function exchangeRuntime(descriptor, request, select, timeoutMs, maxResponseByte
|
|
|
23242
23446
|
};
|
|
23243
23447
|
const abort = () => fail(signal?.reason instanceof Error ? signal.reason : new Error("Peer chat cancelled."));
|
|
23244
23448
|
const onTimeout = () => fail(new Error(`Agent ${request.command} request timed out.`));
|
|
23245
|
-
|
|
23246
|
-
if (request.command !== "peer-chat") socket.setTimeout(timeoutMs, onTimeout);
|
|
23449
|
+
socket.setTimeout(timeoutMs, onTimeout);
|
|
23247
23450
|
signal?.addEventListener("abort", abort, { once: true });
|
|
23248
23451
|
socket.on("error", fail);
|
|
23249
23452
|
socket.on("connect", () => socket.write(`${JSON.stringify(request)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentknight/client",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.59",
|
|
4
4
|
"description": "AgentKnight PC Agent CLI for remote coding sessions",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"qrcode": "1.5.4",
|
|
46
46
|
"qrcode-terminal": "0.12.0",
|
|
47
47
|
"zod": "4.6.5",
|
|
48
|
-
"@agentknight/sdk": "0.9.
|
|
48
|
+
"@agentknight/sdk": "0.9.59"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@tailwindcss/node": "4.3.3",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"sharp": "0.35.5",
|
|
58
58
|
"socket.io-client": "4.8.4",
|
|
59
59
|
"tailwindcss": "4.3.3",
|
|
60
|
-
"@agentknight/
|
|
61
|
-
"@agentknight/
|
|
60
|
+
"@agentknight/shared": "0.1.0",
|
|
61
|
+
"@agentknight/protocol": "0.1.0"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|