@allin-ai/agent-client 0.1.0
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 +21 -0
- package/README.md +53 -0
- package/bin/allinai-agent +4 -0
- package/dist/capabilities/context.d.ts +16 -0
- package/dist/capabilities/context.d.ts.map +1 -0
- package/dist/capabilities/context.js +98 -0
- package/dist/capabilities/context.js.map +1 -0
- package/dist/capabilities/input.d.ts +7 -0
- package/dist/capabilities/input.d.ts.map +1 -0
- package/dist/capabilities/input.js +224 -0
- package/dist/capabilities/input.js.map +1 -0
- package/dist/capabilities/manifest.d.ts +15 -0
- package/dist/capabilities/manifest.d.ts.map +1 -0
- package/dist/capabilities/manifest.js +292 -0
- package/dist/capabilities/manifest.js.map +1 -0
- package/dist/capabilities/policy.d.ts +17 -0
- package/dist/capabilities/policy.d.ts.map +1 -0
- package/dist/capabilities/policy.js +57 -0
- package/dist/capabilities/policy.js.map +1 -0
- package/dist/capabilities/shell-host.d.ts +32 -0
- package/dist/capabilities/shell-host.d.ts.map +1 -0
- package/dist/capabilities/shell-host.js +378 -0
- package/dist/capabilities/shell-host.js.map +1 -0
- package/dist/capabilities/shell-wire.d.ts +13 -0
- package/dist/capabilities/shell-wire.d.ts.map +1 -0
- package/dist/capabilities/shell-wire.js +60 -0
- package/dist/capabilities/shell-wire.js.map +1 -0
- package/dist/capabilities/types.d.ts +46 -0
- package/dist/capabilities/types.d.ts.map +1 -0
- package/dist/capabilities/types.js +7 -0
- package/dist/capabilities/types.js.map +1 -0
- package/dist/cli/commands.d.ts +83 -0
- package/dist/cli/commands.d.ts.map +1 -0
- package/dist/cli/commands.js +638 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +7 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/client/state-store.d.ts +80 -0
- package/dist/client/state-store.d.ts.map +1 -0
- package/dist/client/state-store.js +422 -0
- package/dist/client/state-store.js.map +1 -0
- package/dist/client/supervisor.d.ts +118 -0
- package/dist/client/supervisor.d.ts.map +1 -0
- package/dist/client/supervisor.js +627 -0
- package/dist/client/supervisor.js.map +1 -0
- package/dist/client/transport.d.ts +30 -0
- package/dist/client/transport.d.ts.map +1 -0
- package/dist/client/transport.js +2 -0
- package/dist/client/transport.js.map +1 -0
- package/dist/client/types.d.ts +65 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +13 -0
- package/dist/client/types.js.map +1 -0
- package/dist/client/wire.d.ts +32 -0
- package/dist/client/wire.d.ts.map +1 -0
- package/dist/client/wire.js +302 -0
- package/dist/client/wire.js.map +1 -0
- package/dist/client/ws-transport.d.ts +54 -0
- package/dist/client/ws-transport.d.ts.map +1 -0
- package/dist/client/ws-transport.js +229 -0
- package/dist/client/ws-transport.js.map +1 -0
- package/dist/config.d.ts +38 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +125 -0
- package/dist/config.js.map +1 -0
- package/dist/control.d.ts +59 -0
- package/dist/control.d.ts.map +1 -0
- package/dist/control.js +217 -0
- package/dist/control.js.map +1 -0
- package/dist/credentials.d.ts +44 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/credentials.js +229 -0
- package/dist/credentials.js.map +1 -0
- package/dist/hub.d.ts +83 -0
- package/dist/hub.d.ts.map +1 -0
- package/dist/hub.js +412 -0
- package/dist/hub.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +47 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +175 -0
- package/dist/logger.js.map +1 -0
- package/dist/paths.d.ts +29 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +50 -0
- package/dist/paths.js.map +1 -0
- package/dist/plugins/git.d.ts +30 -0
- package/dist/plugins/git.d.ts.map +1 -0
- package/dist/plugins/git.js +80 -0
- package/dist/plugins/git.js.map +1 -0
- package/dist/plugins/manager.d.ts +41 -0
- package/dist/plugins/manager.d.ts.map +1 -0
- package/dist/plugins/manager.js +328 -0
- package/dist/plugins/manager.js.map +1 -0
- package/dist/plugins/manifest.d.ts +9 -0
- package/dist/plugins/manifest.d.ts.map +1 -0
- package/dist/plugins/manifest.js +63 -0
- package/dist/plugins/manifest.js.map +1 -0
- package/dist/plugins/types.d.ts +39 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +2 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/runtime/claude.d.ts +30 -0
- package/dist/runtime/claude.d.ts.map +1 -0
- package/dist/runtime/claude.js +163 -0
- package/dist/runtime/claude.js.map +1 -0
- package/dist/runtime/codex.d.ts +44 -0
- package/dist/runtime/codex.d.ts.map +1 -0
- package/dist/runtime/codex.js +192 -0
- package/dist/runtime/codex.js.map +1 -0
- package/dist/runtime/events.d.ts +7 -0
- package/dist/runtime/events.d.ts.map +1 -0
- package/dist/runtime/events.js +37 -0
- package/dist/runtime/events.js.map +1 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +10 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/pi.d.ts +34 -0
- package/dist/runtime/pi.d.ts.map +1 -0
- package/dist/runtime/pi.js +211 -0
- package/dist/runtime/pi.js.map +1 -0
- package/dist/runtime/registry.d.ts +16 -0
- package/dist/runtime/registry.d.ts.map +1 -0
- package/dist/runtime/registry.js +22 -0
- package/dist/runtime/registry.js.map +1 -0
- package/dist/runtime/runner-child.d.ts +2 -0
- package/dist/runtime/runner-child.d.ts.map +1 -0
- package/dist/runtime/runner-child.js +41 -0
- package/dist/runtime/runner-child.js.map +1 -0
- package/dist/runtime/runner-manager.d.ts +77 -0
- package/dist/runtime/runner-manager.d.ts.map +1 -0
- package/dist/runtime/runner-manager.js +295 -0
- package/dist/runtime/runner-manager.js.map +1 -0
- package/dist/runtime/runner-wire.d.ts +23 -0
- package/dist/runtime/runner-wire.d.ts.map +1 -0
- package/dist/runtime/runner-wire.js +93 -0
- package/dist/runtime/runner-wire.js.map +1 -0
- package/dist/runtime/types.d.ts +43 -0
- package/dist/runtime/types.d.ts.map +1 -0
- package/dist/runtime/types.js +3 -0
- package/dist/runtime/types.js.map +1 -0
- package/dist/runtime/zcode.d.ts +14 -0
- package/dist/runtime/zcode.d.ts.map +1 -0
- package/dist/runtime/zcode.js +21 -0
- package/dist/runtime/zcode.js.map +1 -0
- package/dist/service/launchd.d.ts +34 -0
- package/dist/service/launchd.d.ts.map +1 -0
- package/dist/service/launchd.js +86 -0
- package/dist/service/launchd.js.map +1 -0
- package/dist/service/systemd.d.ts +16 -0
- package/dist/service/systemd.d.ts.map +1 -0
- package/dist/service/systemd.js +89 -0
- package/dist/service/systemd.js.map +1 -0
- package/dist/wire.d.ts +24 -0
- package/dist/wire.d.ts.map +1 -0
- package/dist/wire.js +7 -0
- package/dist/wire.js.map +1 -0
- package/package.json +140 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { mkdir, unlink, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export const AGENT_SERVICE_LABEL = "ai.allin.allinai-agent";
|
|
4
|
+
const serviceFs = { mkdir, writeFile, unlink };
|
|
5
|
+
function isSafeAbsolutePath(value) {
|
|
6
|
+
return (path.isAbsolute(value) &&
|
|
7
|
+
value.length > 1 &&
|
|
8
|
+
!value.includes("\0") &&
|
|
9
|
+
!/[\r\n]/.test(value));
|
|
10
|
+
}
|
|
11
|
+
function assertDefinition(input) {
|
|
12
|
+
if (!isSafeAbsolutePath(input.executable)) {
|
|
13
|
+
throw new TypeError("Service executable must be an absolute path");
|
|
14
|
+
}
|
|
15
|
+
if (!isSafeAbsolutePath(input.configDir)) {
|
|
16
|
+
throw new TypeError("Service configDir must be an absolute path");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function xml(value) {
|
|
20
|
+
return value
|
|
21
|
+
.replaceAll("&", "&")
|
|
22
|
+
.replaceAll("<", "<")
|
|
23
|
+
.replaceAll(">", ">")
|
|
24
|
+
.replaceAll('"', """)
|
|
25
|
+
.replaceAll("'", "'");
|
|
26
|
+
}
|
|
27
|
+
/** The only macOS service destination this package will write. */
|
|
28
|
+
export function launchAgentPath(homeDir) {
|
|
29
|
+
if (!isSafeAbsolutePath(homeDir)) {
|
|
30
|
+
throw new TypeError("User homeDir must be an absolute path");
|
|
31
|
+
}
|
|
32
|
+
return path.join(homeDir, "Library", "LaunchAgents", `${AGENT_SERVICE_LABEL}.plist`);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Deterministic user-scoped launchd definition. Credentials are deliberately
|
|
36
|
+
* absent: the daemon reads the local credential store after launch.
|
|
37
|
+
*/
|
|
38
|
+
export function buildLaunchAgentPlist(input) {
|
|
39
|
+
assertDefinition(input);
|
|
40
|
+
const stdout = path.join(input.configDir, "logs", "launchd.stdout.log");
|
|
41
|
+
const stderr = path.join(input.configDir, "logs", "launchd.stderr.log");
|
|
42
|
+
return `<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n<dict>\n <key>Label</key>\n <string>${AGENT_SERVICE_LABEL}</string>\n <key>ProgramArguments</key>\n <array>\n <string>${xml(input.executable)}</string>\n <string>daemon</string>\n <string>--config-dir</string>\n <string>${xml(input.configDir)}</string>\n </array>\n <key>RunAtLoad</key>\n <true/>\n <key>KeepAlive</key>\n <true/>\n <key>ProcessType</key>\n <string>Background</string>\n <key>StandardOutPath</key>\n <string>${xml(stdout)}</string>\n <key>StandardErrorPath</key>\n <string>${xml(stderr)}</string>\n</dict>\n</plist>\n`;
|
|
43
|
+
}
|
|
44
|
+
function assertUserUid(uid) {
|
|
45
|
+
if (!Number.isSafeInteger(uid) || uid <= 0) {
|
|
46
|
+
throw new Error("Agent service installation requires a non-root user");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** Install only a LaunchAgent owned by the invoking non-root user. */
|
|
50
|
+
export async function installLaunchAgent(options) {
|
|
51
|
+
assertDefinition(options);
|
|
52
|
+
assertUserUid(options.uid);
|
|
53
|
+
const destination = launchAgentPath(options.homeDir);
|
|
54
|
+
const fs = options.fileSystem ?? serviceFs;
|
|
55
|
+
const execute = options.execute ?? defaultLaunchctl;
|
|
56
|
+
await fs.mkdir(path.dirname(destination), { recursive: true });
|
|
57
|
+
await fs.mkdir(path.join(options.configDir, "logs"), { recursive: true });
|
|
58
|
+
await fs.writeFile(destination, buildLaunchAgentPlist(options), {
|
|
59
|
+
encoding: "utf8",
|
|
60
|
+
mode: 0o644,
|
|
61
|
+
});
|
|
62
|
+
await execute("launchctl", ["bootstrap", `gui/${options.uid}`, destination]);
|
|
63
|
+
return destination;
|
|
64
|
+
}
|
|
65
|
+
/** Stop first, then remove only the exact file generated by this package. */
|
|
66
|
+
export async function uninstallLaunchAgent(options) {
|
|
67
|
+
assertUserUid(options.uid);
|
|
68
|
+
const destination = launchAgentPath(options.homeDir);
|
|
69
|
+
const fs = options.fileSystem ?? serviceFs;
|
|
70
|
+
const execute = options.execute ?? defaultLaunchctl;
|
|
71
|
+
await execute("launchctl", ["bootout", `gui/${options.uid}`, destination]);
|
|
72
|
+
await fs.unlink(destination);
|
|
73
|
+
return destination;
|
|
74
|
+
}
|
|
75
|
+
async function defaultLaunchctl(file, args) {
|
|
76
|
+
const { execFile } = await import("node:child_process");
|
|
77
|
+
await new Promise((resolve, reject) => {
|
|
78
|
+
execFile(file, [...args], { shell: false }, (error) => {
|
|
79
|
+
if (error)
|
|
80
|
+
reject(error);
|
|
81
|
+
else
|
|
82
|
+
resolve();
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=launchd.js.map
|
|
@@ -0,0 +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C;IACxD,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE;YACpD,IAAI,KAAK;gBAAE,MAAM,CAAC,KAAK,CAAC,CAAC;;gBACpB,OAAO,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { UserServiceDefinition, UserServiceExecutor, UserServiceFileSystem } from "./launchd.js";
|
|
2
|
+
export declare const SYSTEMD_USER_UNIT_NAME = "allinai-agent.service";
|
|
3
|
+
export type SystemdUserActionOptions = UserServiceDefinition & {
|
|
4
|
+
homeDir: string;
|
|
5
|
+
uid: number;
|
|
6
|
+
fileSystem?: UserServiceFileSystem;
|
|
7
|
+
execute?: UserServiceExecutor;
|
|
8
|
+
};
|
|
9
|
+
/** The only Linux unit path owned by a per-user Agent Client install. */
|
|
10
|
+
export declare function systemdUserUnitPath(homeDir: string): string;
|
|
11
|
+
/** Deterministic systemd --user unit; it never names a system-wide unit. */
|
|
12
|
+
export declare function buildSystemdUserUnit(input: UserServiceDefinition): string;
|
|
13
|
+
export declare function installSystemdUserService(options: SystemdUserActionOptions): Promise<string>;
|
|
14
|
+
export declare function uninstallSystemdUserService(options: Omit<SystemdUserActionOptions, "executable" | "configDir">): Promise<string>;
|
|
15
|
+
export declare function restartSystemdUserService(execute?: UserServiceExecutor): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=systemd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemd.d.ts","sourceRoot":"","sources":["../../src/service/systemd.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAE9D,MAAM,MAAM,wBAAwB,GAAG,qBAAqB,GAAG;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,qBAAqB,CAAC;IACnC,OAAO,CAAC,EAAE,mBAAmB,CAAC;CAC/B,CAAC;AAgCF,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAW3D;AAED,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAGzE;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,MAAM,CAAC,CAoBjB;AAED,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,IAAI,CAAC,wBAAwB,EAAE,YAAY,GAAG,WAAW,CAAC,GAClE,OAAO,CAAC,MAAM,CAAC,CAcjB;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,GAAE,mBAAsC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { mkdir, unlink, writeFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export const SYSTEMD_USER_UNIT_NAME = "allinai-agent.service";
|
|
4
|
+
const serviceFs = { mkdir, writeFile, unlink };
|
|
5
|
+
function isSafeAbsolutePath(value) {
|
|
6
|
+
return (path.isAbsolute(value) &&
|
|
7
|
+
value.length > 1 &&
|
|
8
|
+
!value.includes("\0") &&
|
|
9
|
+
!/[\r\n]/.test(value));
|
|
10
|
+
}
|
|
11
|
+
function assertDefinition(input) {
|
|
12
|
+
if (!isSafeAbsolutePath(input.executable)) {
|
|
13
|
+
throw new TypeError("Service executable must be an absolute path");
|
|
14
|
+
}
|
|
15
|
+
if (!isSafeAbsolutePath(input.configDir)) {
|
|
16
|
+
throw new TypeError("Service configDir must be an absolute path");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function assertUserUid(uid) {
|
|
20
|
+
if (!Number.isSafeInteger(uid) || uid <= 0) {
|
|
21
|
+
throw new Error("Agent service installation requires a non-root user");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function systemdEscape(value) {
|
|
25
|
+
return value.replaceAll("\\", "\\\\").replaceAll(" ", "\\x20");
|
|
26
|
+
}
|
|
27
|
+
/** The only Linux unit path owned by a per-user Agent Client install. */
|
|
28
|
+
export function systemdUserUnitPath(homeDir) {
|
|
29
|
+
if (!isSafeAbsolutePath(homeDir)) {
|
|
30
|
+
throw new TypeError("User homeDir must be an absolute path");
|
|
31
|
+
}
|
|
32
|
+
return path.join(homeDir, ".config", "systemd", "user", SYSTEMD_USER_UNIT_NAME);
|
|
33
|
+
}
|
|
34
|
+
/** Deterministic systemd --user unit; it never names a system-wide unit. */
|
|
35
|
+
export function buildSystemdUserUnit(input) {
|
|
36
|
+
assertDefinition(input);
|
|
37
|
+
return `[Unit]\nDescription=AllInAI Agent Client\nAfter=network-online.target\n\n[Service]\nType=simple\nExecStart=${systemdEscape(input.executable)} daemon --config-dir ${systemdEscape(input.configDir)}\nRestart=on-failure\nRestartSec=5\n\n[Install]\nWantedBy=default.target\n`;
|
|
38
|
+
}
|
|
39
|
+
export async function installSystemdUserService(options) {
|
|
40
|
+
assertDefinition(options);
|
|
41
|
+
assertUserUid(options.uid);
|
|
42
|
+
const destination = systemdUserUnitPath(options.homeDir);
|
|
43
|
+
const fs = options.fileSystem ?? serviceFs;
|
|
44
|
+
const execute = options.execute ?? defaultSystemctl;
|
|
45
|
+
await fs.mkdir(path.dirname(destination), { recursive: true });
|
|
46
|
+
await fs.mkdir(path.join(options.configDir, "logs"), { recursive: true });
|
|
47
|
+
await fs.writeFile(destination, buildSystemdUserUnit(options), {
|
|
48
|
+
encoding: "utf8",
|
|
49
|
+
mode: 0o644,
|
|
50
|
+
});
|
|
51
|
+
await execute("systemctl", ["--user", "daemon-reload"]);
|
|
52
|
+
await execute("systemctl", [
|
|
53
|
+
"--user",
|
|
54
|
+
"enable",
|
|
55
|
+
"--now",
|
|
56
|
+
SYSTEMD_USER_UNIT_NAME,
|
|
57
|
+
]);
|
|
58
|
+
return destination;
|
|
59
|
+
}
|
|
60
|
+
export async function uninstallSystemdUserService(options) {
|
|
61
|
+
assertUserUid(options.uid);
|
|
62
|
+
const destination = systemdUserUnitPath(options.homeDir);
|
|
63
|
+
const fs = options.fileSystem ?? serviceFs;
|
|
64
|
+
const execute = options.execute ?? defaultSystemctl;
|
|
65
|
+
await execute("systemctl", [
|
|
66
|
+
"--user",
|
|
67
|
+
"disable",
|
|
68
|
+
"--now",
|
|
69
|
+
SYSTEMD_USER_UNIT_NAME,
|
|
70
|
+
]);
|
|
71
|
+
await fs.unlink(destination);
|
|
72
|
+
await execute("systemctl", ["--user", "daemon-reload"]);
|
|
73
|
+
return destination;
|
|
74
|
+
}
|
|
75
|
+
export async function restartSystemdUserService(execute = defaultSystemctl) {
|
|
76
|
+
await execute("systemctl", ["--user", "restart", SYSTEMD_USER_UNIT_NAME]);
|
|
77
|
+
}
|
|
78
|
+
async function defaultSystemctl(file, args) {
|
|
79
|
+
const { execFile } = await import("node:child_process");
|
|
80
|
+
await new Promise((resolve, reject) => {
|
|
81
|
+
execFile(file, [...args], { shell: false }, (error) => {
|
|
82
|
+
if (error)
|
|
83
|
+
reject(error);
|
|
84
|
+
else
|
|
85
|
+
resolve();
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=systemd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"systemd.js","sourceRoot":"","sources":["../../src/service/systemd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,IAAI,MAAM,WAAW,CAAC;AA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.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Hub ↔ Agent Client protocol identity. The v2 protocol has durable
|
|
3
|
+
* `task.offer` delivery and `event.push` acknowledgements; it deliberately
|
|
4
|
+
* has no claim loop, work stealing, or legacy downlink messages.
|
|
5
|
+
*/
|
|
6
|
+
export declare const AGENT_CLIENT_PROTOCOL_VERSION = 2;
|
|
7
|
+
/** Optional embedded-Hub registration surface for node health reporting. */
|
|
8
|
+
export type HubRuntimeRegistration = {
|
|
9
|
+
runtimeId: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
protocolVersion: number;
|
|
12
|
+
};
|
|
13
|
+
export type HubRuntimeHeartbeat = {
|
|
14
|
+
runtimeId: string;
|
|
15
|
+
};
|
|
16
|
+
/** A non-executing embedded Hub audit event. Client executions use ClientEvent. */
|
|
17
|
+
export type HubRuntimeEvent = {
|
|
18
|
+
sessionId: string;
|
|
19
|
+
seq: number;
|
|
20
|
+
kind: string;
|
|
21
|
+
ts: string;
|
|
22
|
+
payload: unknown;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../src/wire.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,IAAI,CAAC;AAE/C,4EAA4E;AAC5E,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,mFAAmF;AACnF,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC"}
|
package/dist/wire.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Hub ↔ Agent Client protocol identity. The v2 protocol has durable
|
|
3
|
+
* `task.offer` delivery and `event.push` acknowledgements; it deliberately
|
|
4
|
+
* has no claim loop, work stealing, or legacy downlink messages.
|
|
5
|
+
*/
|
|
6
|
+
export const AGENT_CLIENT_PROTOCOL_VERSION = 2;
|
|
7
|
+
//# sourceMappingURL=wire.js.map
|
package/dist/wire.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../src/wire.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@allin-ai/agent-client",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Standalone persistent Agent Client: connect to a Hub, durably execute local platform agents and policy-gated capabilities, and report state upstream.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/df007df/AllInAI.git",
|
|
10
|
+
"directory": "packages/allinai-agent-client"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/df007df/AllInAI/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/df007df/AllInAI/tree/main/packages/allinai-agent-client#readme",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"agent",
|
|
18
|
+
"sdk",
|
|
19
|
+
"websocket",
|
|
20
|
+
"hub",
|
|
21
|
+
"daemon",
|
|
22
|
+
"agent-client",
|
|
23
|
+
"cli"
|
|
24
|
+
],
|
|
25
|
+
"main": "./src/index.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./src/index.ts",
|
|
28
|
+
"./wire": "./src/wire.ts",
|
|
29
|
+
"./hub": "./src/hub.ts",
|
|
30
|
+
"./logger": "./src/logger.ts",
|
|
31
|
+
"./paths": "./src/paths.ts",
|
|
32
|
+
"./config": "./src/config.ts",
|
|
33
|
+
"./credentials": "./src/credentials.ts",
|
|
34
|
+
"./control": "./src/control.ts",
|
|
35
|
+
"./runtime": "./src/runtime/index.ts",
|
|
36
|
+
"./plugins": "./src/plugins/manager.ts",
|
|
37
|
+
"./cli": "./src/cli/commands.ts",
|
|
38
|
+
"./service/launchd": "./src/service/launchd.ts",
|
|
39
|
+
"./service/systemd": "./src/service/systemd.ts"
|
|
40
|
+
},
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"exports": {
|
|
43
|
+
".": {
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"import": "./dist/index.js",
|
|
46
|
+
"default": "./dist/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./wire": {
|
|
49
|
+
"types": "./dist/wire.d.ts",
|
|
50
|
+
"import": "./dist/wire.js",
|
|
51
|
+
"default": "./dist/wire.js"
|
|
52
|
+
},
|
|
53
|
+
"./hub": {
|
|
54
|
+
"types": "./dist/hub.d.ts",
|
|
55
|
+
"import": "./dist/hub.js",
|
|
56
|
+
"default": "./dist/hub.js"
|
|
57
|
+
},
|
|
58
|
+
"./logger": {
|
|
59
|
+
"types": "./dist/logger.d.ts",
|
|
60
|
+
"import": "./dist/logger.js",
|
|
61
|
+
"default": "./dist/logger.js"
|
|
62
|
+
},
|
|
63
|
+
"./paths": {
|
|
64
|
+
"types": "./dist/paths.d.ts",
|
|
65
|
+
"import": "./dist/paths.js",
|
|
66
|
+
"default": "./dist/paths.js"
|
|
67
|
+
},
|
|
68
|
+
"./config": {
|
|
69
|
+
"types": "./dist/config.d.ts",
|
|
70
|
+
"import": "./dist/config.js",
|
|
71
|
+
"default": "./dist/config.js"
|
|
72
|
+
},
|
|
73
|
+
"./credentials": {
|
|
74
|
+
"types": "./dist/credentials.d.ts",
|
|
75
|
+
"import": "./dist/credentials.js",
|
|
76
|
+
"default": "./dist/credentials.js"
|
|
77
|
+
},
|
|
78
|
+
"./control": {
|
|
79
|
+
"types": "./dist/control.d.ts",
|
|
80
|
+
"import": "./dist/control.js",
|
|
81
|
+
"default": "./dist/control.js"
|
|
82
|
+
},
|
|
83
|
+
"./runtime": {
|
|
84
|
+
"types": "./dist/runtime/index.d.ts",
|
|
85
|
+
"import": "./dist/runtime/index.js",
|
|
86
|
+
"default": "./dist/runtime/index.js"
|
|
87
|
+
},
|
|
88
|
+
"./plugins": {
|
|
89
|
+
"types": "./dist/plugins/manager.d.ts",
|
|
90
|
+
"import": "./dist/plugins/manager.js",
|
|
91
|
+
"default": "./dist/plugins/manager.js"
|
|
92
|
+
},
|
|
93
|
+
"./cli": {
|
|
94
|
+
"types": "./dist/cli/commands.d.ts",
|
|
95
|
+
"import": "./dist/cli/commands.js",
|
|
96
|
+
"default": "./dist/cli/commands.js"
|
|
97
|
+
},
|
|
98
|
+
"./service/launchd": {
|
|
99
|
+
"types": "./dist/service/launchd.d.ts",
|
|
100
|
+
"import": "./dist/service/launchd.js",
|
|
101
|
+
"default": "./dist/service/launchd.js"
|
|
102
|
+
},
|
|
103
|
+
"./service/systemd": {
|
|
104
|
+
"types": "./dist/service/systemd.d.ts",
|
|
105
|
+
"import": "./dist/service/systemd.js",
|
|
106
|
+
"default": "./dist/service/systemd.js"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"main": "./dist/index.js",
|
|
110
|
+
"types": "./dist/index.d.ts",
|
|
111
|
+
"access": "public",
|
|
112
|
+
"registry": "https://registry.npmjs.org/"
|
|
113
|
+
},
|
|
114
|
+
"bin": {
|
|
115
|
+
"allinai-agent": "./bin/allinai-agent"
|
|
116
|
+
},
|
|
117
|
+
"files": [
|
|
118
|
+
"bin",
|
|
119
|
+
"dist"
|
|
120
|
+
],
|
|
121
|
+
"scripts": {
|
|
122
|
+
"build": "node scripts/build.mjs",
|
|
123
|
+
"test": "cd ../.. && TSX_TSCONFIG_PATH=packages/allinai-agent-client/tsconfig.json pnpm exec tsx --test 'packages/allinai-agent-client/src/**/*.test.ts'",
|
|
124
|
+
"typecheck": "tsc --noEmit",
|
|
125
|
+
"prepublishOnly": "pnpm run build && cd ../.. && TSX_TSCONFIG_PATH=packages/allinai-agent-client/tsconfig.json pnpm exec tsx --test 'packages/allinai-agent-client/src/**/*.test.ts'"
|
|
126
|
+
},
|
|
127
|
+
"dependencies": {
|
|
128
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.168",
|
|
129
|
+
"@earendil-works/pi-coding-agent": "0.85.1",
|
|
130
|
+
"@openai/codex-sdk": "^0.142.4",
|
|
131
|
+
"ws": "^8.18.0"
|
|
132
|
+
},
|
|
133
|
+
"devDependencies": {
|
|
134
|
+
"@types/ws": "^8.5.14",
|
|
135
|
+
"typescript": "^5.8.3"
|
|
136
|
+
},
|
|
137
|
+
"engines": {
|
|
138
|
+
"node": ">=22.19.0"
|
|
139
|
+
}
|
|
140
|
+
}
|