@agentage/platform 0.2.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/dist/constants.d.ts +9 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +106 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Default heartbeat interval (ms) */
|
|
2
|
+
export declare const HEARTBEAT_INTERVAL = 30000;
|
|
3
|
+
/** Machine is considered offline after this many missed heartbeats (ms) */
|
|
4
|
+
export declare const OFFLINE_THRESHOLD: number;
|
|
5
|
+
/** WebSocket reconnect delay base (ms) — with exponential backoff */
|
|
6
|
+
export declare const WS_RECONNECT_BASE = 1000;
|
|
7
|
+
/** WebSocket reconnect delay max (ms) */
|
|
8
|
+
export declare const WS_RECONNECT_MAX = 30000;
|
|
9
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,eAAO,MAAM,kBAAkB,QAAS,CAAC;AAEzC,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,QAAyB,CAAC;AAExD,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,OAAQ,CAAC;AAEvC,yCAAyC;AACzC,eAAO,MAAM,gBAAgB,QAAS,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Default heartbeat interval (ms) */
|
|
2
|
+
export const HEARTBEAT_INTERVAL = 30_000;
|
|
3
|
+
/** Machine is considered offline after this many missed heartbeats (ms) */
|
|
4
|
+
export const OFFLINE_THRESHOLD = 3 * HEARTBEAT_INTERVAL; // 90_000
|
|
5
|
+
/** WebSocket reconnect delay base (ms) — with exponential backoff */
|
|
6
|
+
export const WS_RECONNECT_BASE = 1_000;
|
|
7
|
+
/** WebSocket reconnect delay max (ms) */
|
|
8
|
+
export const WS_RECONNECT_MAX = 30_000;
|
|
9
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAEzC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,SAAS;AAElE,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEvC,yCAAyC;AACzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { Machine, Heartbeat, AgentInfo, MachineRegisterRequest, MachineRegisterResponse, HeartbeatRequest, HeartbeatResponse, Command, WsExecuteRequest, WsExecuteAccepted, WsExecuteRejected, WsRunEvent, WsRunStateChange, WsCancel, WsSendInput, WsHubMessage, WsDaemonMessage, WsMessage, } from './types.js';
|
|
2
|
+
export { HEARTBEAT_INTERVAL, OFFLINE_THRESHOLD, WS_RECONNECT_BASE, WS_RECONNECT_MAX, } from './constants.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,OAAO,EACP,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,eAAe,EACf,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { AgentManifest, Run, RunEvent, RunInput } from '@agentage/core';
|
|
2
|
+
/** Machine info — sent by daemon on registration */
|
|
3
|
+
export interface Machine {
|
|
4
|
+
/** Unique machine ID (generated by daemon on first run, persisted locally) */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Human-readable name (hostname or user-provided) */
|
|
7
|
+
name: string;
|
|
8
|
+
/** OS platform */
|
|
9
|
+
platform: 'darwin' | 'win32' | 'linux';
|
|
10
|
+
/** CPU architecture */
|
|
11
|
+
arch: 'x64' | 'arm64';
|
|
12
|
+
/** Daemon version */
|
|
13
|
+
daemonVersion: string;
|
|
14
|
+
/** Agent manifests discovered on this machine (from factories) */
|
|
15
|
+
agents: AgentManifest[];
|
|
16
|
+
/** Online status (derived from heartbeat — set by hub, not daemon) */
|
|
17
|
+
status: 'online' | 'offline';
|
|
18
|
+
/** Last heartbeat timestamp (Unix ms, set by hub) */
|
|
19
|
+
lastSeenAt: number;
|
|
20
|
+
}
|
|
21
|
+
/** Heartbeat payload — sent by daemon periodically */
|
|
22
|
+
export interface Heartbeat {
|
|
23
|
+
machineId: string;
|
|
24
|
+
/** Updated agent list (in case agents changed since last heartbeat) */
|
|
25
|
+
agents: AgentManifest[];
|
|
26
|
+
/** Currently active run IDs on this machine */
|
|
27
|
+
activeRunIds: string[];
|
|
28
|
+
/** Machine resource snapshot (optional) */
|
|
29
|
+
resources?: {
|
|
30
|
+
cpuUsage?: number;
|
|
31
|
+
memoryUsedMb?: number;
|
|
32
|
+
memoryTotalMb?: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Agent as seen from the hub — manifest + which machine it's on */
|
|
36
|
+
export interface AgentInfo extends AgentManifest {
|
|
37
|
+
machineId: string;
|
|
38
|
+
machineName: string;
|
|
39
|
+
machineStatus: 'online' | 'offline';
|
|
40
|
+
}
|
|
41
|
+
export interface MachineRegisterRequest {
|
|
42
|
+
machine: Omit<Machine, 'status' | 'lastSeenAt'>;
|
|
43
|
+
authToken: string;
|
|
44
|
+
}
|
|
45
|
+
export interface MachineRegisterResponse {
|
|
46
|
+
machineId: string;
|
|
47
|
+
/** Token for WebSocket connection */
|
|
48
|
+
connectionToken: string;
|
|
49
|
+
}
|
|
50
|
+
export type HeartbeatRequest = Heartbeat;
|
|
51
|
+
export interface HeartbeatResponse {
|
|
52
|
+
/** Pending commands for this machine */
|
|
53
|
+
pendingCommands: Command[];
|
|
54
|
+
}
|
|
55
|
+
export interface Command {
|
|
56
|
+
id: string;
|
|
57
|
+
type: 'cancel' | 'input';
|
|
58
|
+
runId: string;
|
|
59
|
+
/** Input text for 'input' type */
|
|
60
|
+
payload?: string;
|
|
61
|
+
}
|
|
62
|
+
/** Execute an agent on this machine (hub → daemon) */
|
|
63
|
+
export interface WsExecuteRequest {
|
|
64
|
+
type: 'execute';
|
|
65
|
+
requestId: string;
|
|
66
|
+
agentName: string;
|
|
67
|
+
input: RunInput;
|
|
68
|
+
}
|
|
69
|
+
/** Cancel a running execution (hub → daemon) */
|
|
70
|
+
export interface WsCancel {
|
|
71
|
+
type: 'cancel';
|
|
72
|
+
runId: string;
|
|
73
|
+
}
|
|
74
|
+
/** Send input to a waiting agent (hub → daemon) */
|
|
75
|
+
export interface WsSendInput {
|
|
76
|
+
type: 'input';
|
|
77
|
+
runId: string;
|
|
78
|
+
text: string;
|
|
79
|
+
}
|
|
80
|
+
/** Execution accepted — run created (daemon → hub) */
|
|
81
|
+
export interface WsExecuteAccepted {
|
|
82
|
+
type: 'execute_accepted';
|
|
83
|
+
requestId: string;
|
|
84
|
+
runId: string;
|
|
85
|
+
}
|
|
86
|
+
/** Execution rejected — agent not found, busy, etc. (daemon → hub) */
|
|
87
|
+
export interface WsExecuteRejected {
|
|
88
|
+
type: 'execute_rejected';
|
|
89
|
+
requestId: string;
|
|
90
|
+
reason: string;
|
|
91
|
+
}
|
|
92
|
+
/** Run event — streamed during execution (daemon → hub) */
|
|
93
|
+
export interface WsRunEvent {
|
|
94
|
+
type: 'run_event';
|
|
95
|
+
runId: string;
|
|
96
|
+
event: RunEvent;
|
|
97
|
+
}
|
|
98
|
+
/** Run state changed — full run record (daemon → hub) */
|
|
99
|
+
export interface WsRunStateChange {
|
|
100
|
+
type: 'run_state';
|
|
101
|
+
run: Run;
|
|
102
|
+
}
|
|
103
|
+
export type WsHubMessage = WsExecuteRequest | WsCancel | WsSendInput;
|
|
104
|
+
export type WsDaemonMessage = WsExecuteAccepted | WsExecuteRejected | WsRunEvent | WsRunStateChange;
|
|
105
|
+
export type WsMessage = WsHubMessage | WsDaemonMessage;
|
|
106
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE7E,oDAAoD;AACpD,MAAM,WAAW,OAAO;IACtB,8EAA8E;IAC9E,EAAE,EAAE,MAAM,CAAC;IAEX,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IAEb,kBAAkB;IAClB,QAAQ,EAAE,Q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AAe,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agentage/platform",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Daemon/hub protocol types for the Agentage platform",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": ["dist"],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=22.0.0",
|
|
17
|
+
"npm": ">=10.0.0"
|
|
18
|
+
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"@agentage/core": "^0.2.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc",
|
|
25
|
+
"type-check": "tsc --noEmit",
|
|
26
|
+
"lint": "eslint src",
|
|
27
|
+
"lint:fix": "eslint src --fix",
|
|
28
|
+
"format": "prettier --write \"src/**/*.ts\" \"!src/**/*.d.ts\"",
|
|
29
|
+
"format:check": "prettier --check \"src/**/*.ts\" \"!src/**/*.d.ts\"",
|
|
30
|
+
"test": "vitest run",
|
|
31
|
+
"test:watch": "vitest",
|
|
32
|
+
"test:coverage": "vitest run --coverage",
|
|
33
|
+
"clean": "rm -rf dist *.tsbuildinfo coverage src/**/*.d.ts",
|
|
34
|
+
"verify": "npm run type-check && npm run lint && npm run format:check && npm run build"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"agentage",
|
|
38
|
+
"platform",
|
|
39
|
+
"daemon",
|
|
40
|
+
"hub",
|
|
41
|
+
"protocol"
|
|
42
|
+
],
|
|
43
|
+
"author": "Agentage",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/agentage/agentkit.git",
|
|
48
|
+
"directory": "packages/platform"
|
|
49
|
+
},
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/agentage/agentkit/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/agentage/agentkit/tree/master/packages/platform#readme"
|
|
54
|
+
}
|