@agent-relay/sdk 2.3.13 → 3.0.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/README.md +68 -838
- package/bin/agent-relay-broker +0 -0
- package/dist/__tests__/contract-fixtures.test.d.ts +2 -0
- package/dist/__tests__/contract-fixtures.test.d.ts.map +1 -0
- package/dist/__tests__/contract-fixtures.test.js +85 -0
- package/dist/__tests__/contract-fixtures.test.js.map +1 -0
- package/dist/__tests__/facade.test.d.ts +2 -0
- package/dist/__tests__/facade.test.d.ts.map +1 -0
- package/dist/__tests__/facade.test.js +257 -0
- package/dist/__tests__/facade.test.js.map +1 -0
- package/dist/__tests__/integration.test.d.ts +2 -0
- package/dist/__tests__/integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration.test.js +164 -0
- package/dist/__tests__/integration.test.js.map +1 -0
- package/dist/__tests__/pty.test.d.ts +2 -0
- package/dist/__tests__/pty.test.d.ts.map +1 -0
- package/dist/__tests__/pty.test.js +20 -0
- package/dist/__tests__/pty.test.js.map +1 -0
- package/dist/__tests__/quickstart.test.d.ts +2 -0
- package/dist/__tests__/quickstart.test.d.ts.map +1 -0
- package/dist/__tests__/quickstart.test.js +176 -0
- package/dist/__tests__/quickstart.test.js.map +1 -0
- package/dist/__tests__/spawn-from-env.test.d.ts +2 -0
- package/dist/__tests__/spawn-from-env.test.d.ts.map +1 -0
- package/dist/__tests__/spawn-from-env.test.js +206 -0
- package/dist/__tests__/spawn-from-env.test.js.map +1 -0
- package/dist/__tests__/unit.test.d.ts +2 -0
- package/dist/__tests__/unit.test.d.ts.map +1 -0
- package/dist/__tests__/unit.test.js +311 -0
- package/dist/__tests__/unit.test.js.map +1 -0
- package/dist/browser.d.ts +16 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +19 -0
- package/dist/browser.js.map +1 -0
- package/dist/client.d.ts +138 -526
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +407 -1509
- package/dist/client.js.map +1 -1
- package/dist/consensus-helpers.d.ts +103 -0
- package/dist/consensus-helpers.d.ts.map +1 -0
- package/dist/consensus-helpers.js +147 -0
- package/dist/consensus-helpers.js.map +1 -0
- package/dist/consensus.d.ts +72 -0
- package/dist/consensus.d.ts.map +1 -0
- package/dist/consensus.js +378 -0
- package/dist/consensus.js.map +1 -0
- package/dist/examples/demo.d.ts +2 -0
- package/dist/examples/demo.d.ts.map +1 -0
- package/dist/examples/demo.js +63 -0
- package/dist/examples/demo.js.map +1 -0
- package/dist/examples/example.d.ts +2 -0
- package/dist/examples/example.d.ts.map +1 -0
- package/dist/examples/example.js +80 -0
- package/dist/examples/example.js.map +1 -0
- package/dist/examples/quickstart.d.ts +2 -0
- package/dist/examples/quickstart.d.ts.map +1 -0
- package/dist/examples/quickstart.js +56 -0
- package/dist/examples/quickstart.js.map +1 -0
- package/dist/examples/ralph-loop.d.ts +2 -0
- package/dist/examples/ralph-loop.d.ts.map +1 -0
- package/dist/examples/ralph-loop.js +281 -0
- package/dist/examples/ralph-loop.js.map +1 -0
- package/dist/examples/workflow-superiority.d.ts +32 -0
- package/dist/examples/workflow-superiority.d.ts.map +1 -0
- package/dist/examples/workflow-superiority.js +1421 -0
- package/dist/examples/workflow-superiority.js.map +1 -0
- package/dist/index.d.ts +13 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -26
- package/dist/index.js.map +1 -1
- package/dist/logs.d.ts +70 -25
- package/dist/logs.d.ts.map +1 -1
- package/dist/logs.js +238 -42
- package/dist/logs.js.map +1 -1
- package/dist/models.d.ts +9 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +17 -0
- package/dist/models.js.map +1 -0
- package/dist/protocol.d.ts +366 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +2 -0
- package/dist/protocol.js.map +1 -0
- package/dist/pty.d.ts +8 -0
- package/dist/pty.d.ts.map +1 -0
- package/dist/pty.js +26 -0
- package/dist/pty.js.map +1 -0
- package/dist/relay-adapter.d.ts +139 -0
- package/dist/relay-adapter.d.ts.map +1 -0
- package/dist/relay-adapter.js +210 -0
- package/dist/relay-adapter.js.map +1 -0
- package/dist/relay.d.ts +277 -0
- package/dist/relay.d.ts.map +1 -0
- package/dist/relay.js +853 -0
- package/dist/relay.js.map +1 -0
- package/dist/shadow.d.ts +101 -0
- package/dist/shadow.d.ts.map +1 -0
- package/dist/shadow.js +174 -0
- package/dist/shadow.js.map +1 -0
- package/dist/spawn-from-env.d.ts +77 -0
- package/dist/spawn-from-env.d.ts.map +1 -0
- package/dist/spawn-from-env.js +172 -0
- package/dist/spawn-from-env.js.map +1 -0
- package/dist/workflows/barrier.d.ts +72 -0
- package/dist/workflows/barrier.d.ts.map +1 -0
- package/dist/workflows/barrier.js +162 -0
- package/dist/workflows/barrier.js.map +1 -0
- package/dist/workflows/builder.d.ts +114 -0
- package/dist/workflows/builder.d.ts.map +1 -0
- package/dist/workflows/builder.js +201 -0
- package/dist/workflows/builder.js.map +1 -0
- package/dist/workflows/cli.d.ts +11 -0
- package/dist/workflows/cli.d.ts.map +1 -0
- package/dist/workflows/cli.js +144 -0
- package/dist/workflows/cli.js.map +1 -0
- package/dist/workflows/coordinator.d.ts +73 -0
- package/dist/workflows/coordinator.d.ts.map +1 -0
- package/dist/workflows/coordinator.js +647 -0
- package/dist/workflows/coordinator.js.map +1 -0
- package/dist/workflows/custom-steps.d.ts +73 -0
- package/dist/workflows/custom-steps.d.ts.map +1 -0
- package/dist/workflows/custom-steps.js +321 -0
- package/dist/workflows/custom-steps.js.map +1 -0
- package/dist/workflows/dry-run-format.d.ts +6 -0
- package/dist/workflows/dry-run-format.d.ts.map +1 -0
- package/dist/workflows/dry-run-format.js +68 -0
- package/dist/workflows/dry-run-format.js.map +1 -0
- package/dist/workflows/file-db.d.ts +33 -0
- package/dist/workflows/file-db.d.ts.map +1 -0
- package/dist/workflows/file-db.js +108 -0
- package/dist/workflows/file-db.js.map +1 -0
- package/dist/workflows/index.d.ts +15 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +15 -0
- package/dist/workflows/index.js.map +1 -0
- package/dist/workflows/memory-db.d.ts +17 -0
- package/dist/workflows/memory-db.d.ts.map +1 -0
- package/dist/workflows/memory-db.js +33 -0
- package/dist/workflows/memory-db.js.map +1 -0
- package/dist/workflows/run.d.ts +38 -0
- package/dist/workflows/run.d.ts.map +1 -0
- package/dist/workflows/run.js +25 -0
- package/dist/workflows/run.js.map +1 -0
- package/dist/workflows/runner.d.ts +320 -0
- package/dist/workflows/runner.d.ts.map +1 -0
- package/dist/workflows/runner.js +2821 -0
- package/dist/workflows/runner.js.map +1 -0
- package/dist/workflows/state.d.ts +77 -0
- package/dist/workflows/state.d.ts.map +1 -0
- package/dist/workflows/state.js +140 -0
- package/dist/workflows/state.js.map +1 -0
- package/dist/workflows/templates.d.ts +47 -0
- package/dist/workflows/templates.d.ts.map +1 -0
- package/dist/workflows/templates.js +405 -0
- package/dist/workflows/templates.js.map +1 -0
- package/dist/workflows/trajectory.d.ts +87 -0
- package/dist/workflows/trajectory.d.ts.map +1 -0
- package/dist/workflows/trajectory.js +441 -0
- package/dist/workflows/trajectory.js.map +1 -0
- package/dist/workflows/types.d.ts +306 -0
- package/dist/workflows/types.d.ts.map +1 -0
- package/dist/workflows/types.js +23 -0
- package/dist/workflows/types.js.map +1 -0
- package/dist/workflows/validator.d.ts +11 -0
- package/dist/workflows/validator.d.ts.map +1 -0
- package/dist/workflows/validator.js +128 -0
- package/dist/workflows/validator.js.map +1 -0
- package/package.json +59 -53
- package/dist/discovery.d.ts +0 -10
- package/dist/discovery.d.ts.map +0 -1
- package/dist/discovery.js +0 -22
- package/dist/discovery.js.map +0 -1
- package/dist/errors.d.ts +0 -9
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -9
- package/dist/errors.js.map +0 -1
- package/dist/protocol/index.d.ts +0 -8
- package/dist/protocol/index.d.ts.map +0 -1
- package/dist/protocol/index.js +0 -8
- package/dist/protocol/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-superiority.js","sourceRoot":"","sources":["../../src/examples/workflow-superiority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,iFAAiF;AAEjF,MAAM,aAAa,GAAG,4BAA4B,CAAC;AACnD,MAAM,UAAU,GAAG,GAAG,aAAa,WAAW,CAAC;AAC/C,MAAM,WAAW,GAAG,GAAG,aAAa,YAAY,CAAC;AACjD,MAAM,YAAY,GAAG,GAAG,aAAa,aAAa,CAAC;AACnD,MAAM,WAAW,GAAG,GAAG,aAAa,cAAc,CAAC;AACnD,MAAM,UAAU,GAAG,GAAG,aAAa,WAAW,CAAC;AAC/C,MAAM,SAAS,GAAG,GAAG,aAAa,eAAe,CAAC;AAClD,MAAM,WAAW,GAAG,GAAG,aAAa,iBAAiB,CAAC;AACtD,MAAM,YAAY,GAAG,GAAG,aAAa,aAAa,CAAC;AACnD,MAAM,SAAS,GAAG,GAAG,aAAa,eAAe,CAAC;AAElD,wEAAwE;AACxE,2EAA2E;AAC3E,uEAAuE;AAEvE,iFAAiF;AAEjF,MAAM,OAAO,GAAG,CAAC,KAAoB,EAAQ,EAAE;IAC7C,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACpC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,aAAa;YAChB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,2BAA2B,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;YAC5D,MAAM;QACR,KAAK,eAAe;YAClB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,0BAA0B,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;YAC3D,MAAM;QACR,KAAK,YAAY;YACf,OAAO,CAAC,KAAK,CAAC,IAAI,E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,CAAC,MAAM,EAAE,CAAC,CAAC;AAC7C,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AACzC,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;AACnD,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;AAC9C,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;AAChD,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,WAAW,IAAI,GAAG,EAAE,CAAC,CAAC;AACzD,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;IACjB,OAAO,CAAC,KAAK,CAAC,gBAAgB,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
export { RelayClient, type ClientState, type ClientConfig, type SyncOptions, type RequestOptions, type RequestResponse, type SpawnResult, } from './client.js';
|
|
16
|
-
export { PROTOCOL_VERSION, type MessageType, type PayloadKind, type Envelope, type EntityType, type SendPayload, type SendMeta, type SyncMeta, type DeliveryInfo, type AckPayload, type ErrorCode, type ErrorPayload, type SpeakOnTrigger, type ShadowConfig, type SpawnPayload, type SpawnResultPayload, type ReleasePayload, type ReleaseResultPayload, type AgentReadyPayload, type ChannelMessagePayload, type ChannelJoinPayload, type ChannelLeavePayload, type MessageAttachment, type StatusResponsePayload, type InboxMessage, type MessagesResponsePayload, type AgentInfo, type HealthResponsePayload, type CrashRecord, type AlertRecord, type MetricsResponsePayload, type AgentMetrics, type ConsensusType, type VoteValue, type ProposalStatus, type CreateProposalOptions, type VoteOptions, } from './protocol/index.js';
|
|
17
|
-
export { encodeFrame, encodeFrameLegacy, FrameParser, MAX_FRAME_BYTES, } from './protocol/index.js';
|
|
18
|
-
export { getLogs, listLoggedAgents, type GetLogsOptions, type LogsResult, } from './logs.js';
|
|
19
|
-
export { discoverSocket, discoverAgentName, detectCloudWorkspace, isCloudWorkspace, getCloudSocketPath, getCloudOutboxPath, getConnectionInfo, getCloudEnvironmentSummary, cloudApiRequest, getWorkspaceStatus, type DiscoveryResult, type CloudWorkspace, type CloudConnectionOptions, type CloudConnectionInfo, } from './discovery.js';
|
|
20
|
-
export { RelayError, DaemonNotRunningError, AgentNotFoundError, TimeoutError, ConnectionError, ChannelNotFoundError, SpawnError, } from './errors.js';
|
|
1
|
+
export * from './protocol.js';
|
|
2
|
+
export * from './client.js';
|
|
3
|
+
export * from './models.js';
|
|
4
|
+
export { RelayCast, RelayError, AgentClient } from '@relaycast/sdk';
|
|
5
|
+
export type { RelayCastOptions, ClientOptions } from '@relaycast/sdk';
|
|
6
|
+
export * from './pty.js';
|
|
7
|
+
export * from './relay.js';
|
|
8
|
+
export * from './logs.js';
|
|
9
|
+
export * from './consensus.js';
|
|
10
|
+
export * from './shadow.js';
|
|
11
|
+
export * from './relay-adapter.js';
|
|
12
|
+
export * from './workflows/index.js';
|
|
13
|
+
export * from './spawn-from-env.js';
|
|
21
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACpE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACtE,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
// Main client (Node.js, Unix sockets)
|
|
16
|
-
export { RelayClient, } from './client.js';
|
|
17
|
-
// Protocol types (re-export for convenience)
|
|
18
|
-
export { PROTOCOL_VERSION, } from './protocol/index.js';
|
|
19
|
-
// Framing utilities
|
|
20
|
-
export { encodeFrame, encodeFrameLegacy, FrameParser, MAX_FRAME_BYTES, } from './protocol/index.js';
|
|
21
|
-
// Log utilities (file-based, doesn't require connection)
|
|
22
|
-
export { getLogs, listLoggedAgents, } from './logs.js';
|
|
23
|
-
// Discovery (socket discovery, cloud workspace detection, agent identity)
|
|
24
|
-
export { discoverSocket, discoverAgentName, detectCloudWorkspace, isCloudWorkspace, getCloudSocketPath, getCloudOutboxPath, getConnectionInfo, getCloudEnvironmentSummary, cloudApiRequest, getWorkspaceStatus, } from './discovery.js';
|
|
25
|
-
// Error types
|
|
26
|
-
export { RelayError, DaemonNotRunningError, AgentNotFoundError, TimeoutError, ConnectionError, ChannelNotFoundError, SpawnError, } from './errors.js';
|
|
1
|
+
export * from './protocol.js';
|
|
2
|
+
export * from './client.js';
|
|
3
|
+
export * from './models.js';
|
|
4
|
+
export { RelayCast, RelayError, AgentClient } from '@relaycast/sdk';
|
|
5
|
+
export * from './pty.js';
|
|
6
|
+
export * from './relay.js';
|
|
7
|
+
export * from './logs.js';
|
|
8
|
+
export * from './consensus.js';
|
|
9
|
+
export * from './shadow.js';
|
|
10
|
+
export * from './relay-adapter.js';
|
|
11
|
+
export * from './workflows/index.js';
|
|
12
|
+
export * from './spawn-from-env.js';
|
|
27
13
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEpE,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC"}
|
package/dist/logs.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Log reading utilities for
|
|
2
|
+
* Log reading utilities for the broker SDK.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Options for reading agent logs.
|
|
4
|
+
* Reads agent logs from the local filesystem at
|
|
5
|
+
* `.agent-relay/worker-logs/{agent}.log`.
|
|
8
6
|
*/
|
|
9
7
|
export interface GetLogsOptions {
|
|
10
8
|
/** Directory containing worker logs. Defaults to `.agent-relay/worker-logs` in cwd. */
|
|
@@ -12,50 +10,97 @@ export interface GetLogsOptions {
|
|
|
12
10
|
/** Number of lines to return from the end. Default: 50 */
|
|
13
11
|
lines?: number;
|
|
14
12
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Result of a logs query.
|
|
17
|
-
*/
|
|
18
13
|
export interface LogsResult {
|
|
19
|
-
/** Agent name */
|
|
20
14
|
agent: string;
|
|
21
|
-
/** Log content */
|
|
22
15
|
content: string;
|
|
23
|
-
/** Whether log file exists */
|
|
24
16
|
found: boolean;
|
|
25
|
-
/** Number of lines returned */
|
|
26
17
|
lineCount: number;
|
|
18
|
+
/** Other agents that have log files (populated when `found` is false). */
|
|
19
|
+
availableAgents?: string[];
|
|
20
|
+
}
|
|
21
|
+
export type LogFollowEvent = {
|
|
22
|
+
type: "subscribed";
|
|
23
|
+
agent: string;
|
|
24
|
+
} | {
|
|
25
|
+
type: "history";
|
|
26
|
+
agent: string;
|
|
27
|
+
lines: string[];
|
|
28
|
+
} | {
|
|
29
|
+
type: "log";
|
|
30
|
+
agent: string;
|
|
31
|
+
content: string;
|
|
32
|
+
} | {
|
|
33
|
+
type: "error";
|
|
34
|
+
agent: string;
|
|
35
|
+
error: string;
|
|
36
|
+
availableAgents?: string[];
|
|
37
|
+
};
|
|
38
|
+
export interface FollowLogsOptions {
|
|
39
|
+
/** Directory containing worker logs. Defaults to `.agent-relay/worker-logs` in cwd. */
|
|
40
|
+
logsDir?: string;
|
|
41
|
+
/** Poll interval in ms for new log content. Default: 1000 */
|
|
42
|
+
pollMs?: number;
|
|
43
|
+
/** Number of history lines to emit on initial subscribe. Default: 200 */
|
|
44
|
+
historyLines?: number;
|
|
45
|
+
/**
|
|
46
|
+
* If true, subscribe even if the log file is not present yet.
|
|
47
|
+
* A `subscribed` + empty `history` event is emitted and follow continues.
|
|
48
|
+
*/
|
|
49
|
+
allowMissing?: boolean;
|
|
50
|
+
/** Event sink for subscribe/history/log/error events. */
|
|
51
|
+
onEvent: (event: LogFollowEvent) => void;
|
|
52
|
+
}
|
|
53
|
+
export interface LogFollowHandle {
|
|
54
|
+
unsubscribe: () => void;
|
|
27
55
|
}
|
|
28
56
|
/**
|
|
29
57
|
* Get logs for a specific agent.
|
|
30
58
|
*
|
|
31
59
|
* @example
|
|
32
|
-
* ```
|
|
33
|
-
* import { getLogs } from
|
|
60
|
+
* ```ts
|
|
61
|
+
* import { getLogs } from "agent-relay/broker";
|
|
34
62
|
*
|
|
35
|
-
* const result = await getLogs(
|
|
63
|
+
* const result = await getLogs("Worker1", { lines: 100 });
|
|
36
64
|
* if (result.found) {
|
|
37
65
|
* console.log(result.content);
|
|
38
66
|
* }
|
|
39
67
|
* ```
|
|
40
|
-
*
|
|
41
|
-
* @param agent - Agent name
|
|
42
|
-
* @param options - Options for reading logs
|
|
43
|
-
* @returns Log content and metadata
|
|
44
68
|
*/
|
|
45
69
|
export declare function getLogs(agent: string, options?: GetLogsOptions): Promise<LogsResult>;
|
|
70
|
+
/**
|
|
71
|
+
* Follow an agent log file by polling local filesystem for appended content.
|
|
72
|
+
*
|
|
73
|
+
* Emits:
|
|
74
|
+
* - `subscribed` once
|
|
75
|
+
* - `history` once (initial tail)
|
|
76
|
+
* - `log` for incremental content
|
|
77
|
+
* - `error` if subscription cannot be established
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```ts
|
|
81
|
+
* import { followLogs } from "agent-relay/broker";
|
|
82
|
+
*
|
|
83
|
+
* const handle = followLogs("Worker1", {
|
|
84
|
+
* historyLines: 100,
|
|
85
|
+
* onEvent(event) {
|
|
86
|
+
* if (event.type === "log") console.log(event.content);
|
|
87
|
+
* },
|
|
88
|
+
* });
|
|
89
|
+
*
|
|
90
|
+
* setTimeout(() => handle.unsubscribe(), 30_000);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare function followLogs(agent: string, options: FollowLogsOptions): LogFollowHandle;
|
|
46
94
|
/**
|
|
47
95
|
* List all agents that have log files.
|
|
48
96
|
*
|
|
49
97
|
* @example
|
|
50
|
-
* ```
|
|
51
|
-
* import { listLoggedAgents } from
|
|
98
|
+
* ```ts
|
|
99
|
+
* import { listLoggedAgents } from "agent-relay/broker";
|
|
52
100
|
*
|
|
53
101
|
* const agents = await listLoggedAgents();
|
|
54
|
-
* console.log(
|
|
102
|
+
* console.log("Agents with logs:", agents);
|
|
55
103
|
* ```
|
|
56
|
-
*
|
|
57
|
-
* @param logsDir - Directory containing worker logs
|
|
58
|
-
* @returns Array of agent names
|
|
59
104
|
*/
|
|
60
105
|
export declare function listLoggedAgents(logsDir?: string): Promise<string[]>;
|
|
61
106
|
//# sourceMappingURL=logs.d.ts.map
|
package/dist/logs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../src/logs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../src/logs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,WAAW,cAAc;IAC7B,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEhF,MAAM,WAAW,iBAAiB;IAChC,uFAAuF;IACvF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,yDAAyD;IACzD,OAAO,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AA+GD;;;;;;;;;;;;GAYG;AACH,wBAAsB,OAAO,CAC3B,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,UAAU,CAAC,CAuBrB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,eAAe,CAwGrF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAW1E"}
|
package/dist/logs.js
CHANGED
|
@@ -1,92 +1,288 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Log reading utilities for
|
|
2
|
+
* Log reading utilities for the broker SDK.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
|
|
6
|
-
import { readFile, readdir, stat } from 'node:fs/promises';
|
|
7
|
-
import { join } from 'node:path';
|
|
8
|
-
/**
|
|
9
|
-
* Get the default logs directory path.
|
|
4
|
+
* Reads agent logs from the local filesystem at
|
|
5
|
+
* `.agent-relay/worker-logs/{agent}.log`.
|
|
10
6
|
*/
|
|
7
|
+
import { open, readdir, stat } from "node:fs/promises";
|
|
8
|
+
import { join, resolve, sep } from "node:path";
|
|
9
|
+
const DEFAULT_LOG_FOLLOW_POLL_MS = 1000;
|
|
10
|
+
const DEFAULT_LOG_HISTORY_LINES = 200;
|
|
11
11
|
function getDefaultLogsDir() {
|
|
12
|
-
return join(process.cwd(),
|
|
12
|
+
return join(process.cwd(), ".agent-relay", "team", "worker-logs");
|
|
13
|
+
}
|
|
14
|
+
function splitLogLines(content) {
|
|
15
|
+
if (!content)
|
|
16
|
+
return [];
|
|
17
|
+
const lines = content.split("\n");
|
|
18
|
+
if (lines.length > 0 && lines[lines.length - 1] === "") {
|
|
19
|
+
lines.pop();
|
|
20
|
+
}
|
|
21
|
+
return lines;
|
|
13
22
|
}
|
|
14
23
|
/**
|
|
15
|
-
* Read the last N lines from a file.
|
|
24
|
+
* Read the last N lines from a file by scanning backward from the end.
|
|
25
|
+
*
|
|
26
|
+
* Unlike the naive readFile+split approach, this only reads as much of the
|
|
27
|
+
* file as needed — important for large log files that can grow to many MB.
|
|
16
28
|
*/
|
|
17
29
|
async function tailFile(filePath, lines) {
|
|
30
|
+
const CHUNK_SIZE = 8192;
|
|
31
|
+
let fh;
|
|
32
|
+
try {
|
|
33
|
+
fh = await open(filePath, "r");
|
|
34
|
+
const { size } = await fh.stat();
|
|
35
|
+
if (size === 0)
|
|
36
|
+
return "";
|
|
37
|
+
// For small files, just read the whole thing
|
|
38
|
+
if (size <= CHUNK_SIZE) {
|
|
39
|
+
const buf = Buffer.alloc(size);
|
|
40
|
+
await fh.read(buf, 0, size, 0);
|
|
41
|
+
const content = buf.toString("utf-8");
|
|
42
|
+
const allLines = content.split("\n");
|
|
43
|
+
// Strip trailing empty element from trailing newline
|
|
44
|
+
if (allLines.length > 0 && allLines[allLines.length - 1] === "") {
|
|
45
|
+
allLines.pop();
|
|
46
|
+
}
|
|
47
|
+
return allLines.slice(-lines).join("\n");
|
|
48
|
+
}
|
|
49
|
+
// For large files, read backward in chunks
|
|
50
|
+
let remaining = lines;
|
|
51
|
+
let position = size;
|
|
52
|
+
const chunks = [];
|
|
53
|
+
let foundLines = 0;
|
|
54
|
+
let trailingNewline = false;
|
|
55
|
+
while (position > 0 && foundLines <= remaining) {
|
|
56
|
+
const readSize = Math.min(CHUNK_SIZE, position);
|
|
57
|
+
position -= readSize;
|
|
58
|
+
const buf = Buffer.alloc(readSize);
|
|
59
|
+
await fh.read(buf, 0, readSize, position);
|
|
60
|
+
chunks.unshift(buf);
|
|
61
|
+
// Count newlines in this chunk
|
|
62
|
+
for (let i = buf.length - 1; i >= 0; i--) {
|
|
63
|
+
if (buf[i] === 0x0a) {
|
|
64
|
+
// Skip trailing newline at very end of file
|
|
65
|
+
if (position + i === size - 1) {
|
|
66
|
+
trailingNewline = true;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
foundLines++;
|
|
70
|
+
if (foundLines > remaining)
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const combined = Buffer.concat(chunks).toString("utf-8");
|
|
76
|
+
const allLines = combined.split("\n");
|
|
77
|
+
// Strip trailing empty element from trailing newline
|
|
78
|
+
if (trailingNewline && allLines.length > 0 && allLines[allLines.length - 1] === "") {
|
|
79
|
+
allLines.pop();
|
|
80
|
+
}
|
|
81
|
+
return allLines.slice(-lines).join("\n");
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return "";
|
|
85
|
+
}
|
|
86
|
+
finally {
|
|
87
|
+
await fh?.close();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async function readFileDelta(filePath, offset) {
|
|
91
|
+
let fh;
|
|
18
92
|
try {
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
|
|
93
|
+
fh = await open(filePath, "r");
|
|
94
|
+
const { size } = await fh.stat();
|
|
95
|
+
const start = size < offset ? 0 : offset;
|
|
96
|
+
if (size <= start) {
|
|
97
|
+
return { nextOffset: start, content: "" };
|
|
98
|
+
}
|
|
99
|
+
const length = size - start;
|
|
100
|
+
const buffer = Buffer.alloc(length);
|
|
101
|
+
await fh.read(buffer, 0, length, start);
|
|
102
|
+
return { nextOffset: size, content: buffer.toString("utf-8") };
|
|
23
103
|
}
|
|
24
104
|
catch {
|
|
25
|
-
return
|
|
105
|
+
return { nextOffset: offset, content: "" };
|
|
106
|
+
}
|
|
107
|
+
finally {
|
|
108
|
+
await fh?.close();
|
|
26
109
|
}
|
|
27
110
|
}
|
|
28
111
|
/**
|
|
29
112
|
* Get logs for a specific agent.
|
|
30
113
|
*
|
|
31
114
|
* @example
|
|
32
|
-
* ```
|
|
33
|
-
* import { getLogs } from
|
|
115
|
+
* ```ts
|
|
116
|
+
* import { getLogs } from "agent-relay/broker";
|
|
34
117
|
*
|
|
35
|
-
* const result = await getLogs(
|
|
118
|
+
* const result = await getLogs("Worker1", { lines: 100 });
|
|
36
119
|
* if (result.found) {
|
|
37
120
|
* console.log(result.content);
|
|
38
121
|
* }
|
|
39
122
|
* ```
|
|
40
|
-
*
|
|
41
|
-
* @param agent - Agent name
|
|
42
|
-
* @param options - Options for reading logs
|
|
43
|
-
* @returns Log content and metadata
|
|
44
123
|
*/
|
|
45
124
|
export async function getLogs(agent, options = {}) {
|
|
46
125
|
const logsDir = options.logsDir ?? getDefaultLogsDir();
|
|
47
126
|
const lines = options.lines ?? 50;
|
|
48
127
|
const logFile = join(logsDir, `${agent}.log`);
|
|
128
|
+
// Prevent path traversal — resolved path must stay inside logsDir
|
|
129
|
+
const resolvedLog = resolve(logFile);
|
|
130
|
+
const resolvedDir = resolve(logsDir);
|
|
131
|
+
if (!resolvedLog.startsWith(resolvedDir + sep)) {
|
|
132
|
+
return { agent, content: "", found: false, lineCount: 0 };
|
|
133
|
+
}
|
|
49
134
|
try {
|
|
50
135
|
await stat(logFile);
|
|
51
136
|
const content = await tailFile(logFile, lines);
|
|
52
|
-
const lineCount = content ? content.split(
|
|
53
|
-
return {
|
|
54
|
-
agent,
|
|
55
|
-
content,
|
|
56
|
-
found: true,
|
|
57
|
-
lineCount,
|
|
58
|
-
};
|
|
137
|
+
const lineCount = content ? content.split("\n").length : 0;
|
|
138
|
+
return { agent, content, found: true, lineCount };
|
|
59
139
|
}
|
|
60
140
|
catch {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
found: false,
|
|
65
|
-
lineCount: 0,
|
|
66
|
-
};
|
|
141
|
+
// Agent not found — list available agents to help the caller
|
|
142
|
+
const availableAgents = await listLoggedAgents(logsDir);
|
|
143
|
+
return { agent, content: "", found: false, lineCount: 0, availableAgents };
|
|
67
144
|
}
|
|
68
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Follow an agent log file by polling local filesystem for appended content.
|
|
148
|
+
*
|
|
149
|
+
* Emits:
|
|
150
|
+
* - `subscribed` once
|
|
151
|
+
* - `history` once (initial tail)
|
|
152
|
+
* - `log` for incremental content
|
|
153
|
+
* - `error` if subscription cannot be established
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```ts
|
|
157
|
+
* import { followLogs } from "agent-relay/broker";
|
|
158
|
+
*
|
|
159
|
+
* const handle = followLogs("Worker1", {
|
|
160
|
+
* historyLines: 100,
|
|
161
|
+
* onEvent(event) {
|
|
162
|
+
* if (event.type === "log") console.log(event.content);
|
|
163
|
+
* },
|
|
164
|
+
* });
|
|
165
|
+
*
|
|
166
|
+
* setTimeout(() => handle.unsubscribe(), 30_000);
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
export function followLogs(agent, options) {
|
|
170
|
+
const logsDir = options.logsDir ?? getDefaultLogsDir();
|
|
171
|
+
const pollMs = Math.max(50, options.pollMs ?? DEFAULT_LOG_FOLLOW_POLL_MS);
|
|
172
|
+
const historyLines = Math.max(0, options.historyLines ?? DEFAULT_LOG_HISTORY_LINES);
|
|
173
|
+
const allowMissing = options.allowMissing ?? false;
|
|
174
|
+
const logFile = join(logsDir, `${agent}.log`);
|
|
175
|
+
const emit = (event) => {
|
|
176
|
+
if (disposed)
|
|
177
|
+
return;
|
|
178
|
+
options.onEvent(event);
|
|
179
|
+
};
|
|
180
|
+
let disposed = false;
|
|
181
|
+
let offset = 0;
|
|
182
|
+
let interval;
|
|
183
|
+
let pollInFlight = false;
|
|
184
|
+
const stop = () => {
|
|
185
|
+
disposed = true;
|
|
186
|
+
if (interval) {
|
|
187
|
+
clearInterval(interval);
|
|
188
|
+
interval = undefined;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
const startPolling = () => {
|
|
192
|
+
if (disposed || interval)
|
|
193
|
+
return;
|
|
194
|
+
interval = setInterval(() => {
|
|
195
|
+
void pollOnce();
|
|
196
|
+
}, pollMs);
|
|
197
|
+
};
|
|
198
|
+
const pollOnce = async () => {
|
|
199
|
+
if (disposed || pollInFlight)
|
|
200
|
+
return;
|
|
201
|
+
pollInFlight = true;
|
|
202
|
+
try {
|
|
203
|
+
const delta = await readFileDelta(logFile, offset);
|
|
204
|
+
offset = delta.nextOffset;
|
|
205
|
+
if (delta.content) {
|
|
206
|
+
emit({ type: "log", agent, content: delta.content });
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
finally {
|
|
210
|
+
pollInFlight = false;
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
void (async () => {
|
|
214
|
+
const resolvedLog = resolve(logFile);
|
|
215
|
+
const resolvedDir = resolve(logsDir);
|
|
216
|
+
if (!resolvedLog.startsWith(resolvedDir + sep)) {
|
|
217
|
+
emit({
|
|
218
|
+
type: "error",
|
|
219
|
+
agent,
|
|
220
|
+
error: "Invalid agent name for log path",
|
|
221
|
+
});
|
|
222
|
+
stop();
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
try {
|
|
226
|
+
const history = await getLogs(agent, {
|
|
227
|
+
logsDir,
|
|
228
|
+
lines: historyLines,
|
|
229
|
+
});
|
|
230
|
+
if (!history.found && !allowMissing) {
|
|
231
|
+
emit({
|
|
232
|
+
type: "error",
|
|
233
|
+
agent,
|
|
234
|
+
error: `No local logs for '${agent}'.`,
|
|
235
|
+
availableAgents: history.availableAgents,
|
|
236
|
+
});
|
|
237
|
+
stop();
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
emit({ type: "subscribed", agent });
|
|
241
|
+
emit({
|
|
242
|
+
type: "history",
|
|
243
|
+
agent,
|
|
244
|
+
lines: splitLogLines(history.content),
|
|
245
|
+
});
|
|
246
|
+
try {
|
|
247
|
+
const logStats = await stat(logFile);
|
|
248
|
+
offset = logStats.size;
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
offset = 0;
|
|
252
|
+
}
|
|
253
|
+
startPolling();
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
emit({
|
|
257
|
+
type: "error",
|
|
258
|
+
agent,
|
|
259
|
+
error: `Failed to follow logs for '${agent}'.`,
|
|
260
|
+
});
|
|
261
|
+
stop();
|
|
262
|
+
}
|
|
263
|
+
})();
|
|
264
|
+
return {
|
|
265
|
+
unsubscribe: stop,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
69
268
|
/**
|
|
70
269
|
* List all agents that have log files.
|
|
71
270
|
*
|
|
72
271
|
* @example
|
|
73
|
-
* ```
|
|
74
|
-
* import { listLoggedAgents } from
|
|
272
|
+
* ```ts
|
|
273
|
+
* import { listLoggedAgents } from "agent-relay/broker";
|
|
75
274
|
*
|
|
76
275
|
* const agents = await listLoggedAgents();
|
|
77
|
-
* console.log(
|
|
276
|
+
* console.log("Agents with logs:", agents);
|
|
78
277
|
* ```
|
|
79
|
-
*
|
|
80
|
-
* @param logsDir - Directory containing worker logs
|
|
81
|
-
* @returns Array of agent names
|
|
82
278
|
*/
|
|
83
279
|
export async function listLoggedAgents(logsDir) {
|
|
84
280
|
const dir = logsDir ?? getDefaultLogsDir();
|
|
85
281
|
try {
|
|
86
282
|
const files = await readdir(dir);
|
|
87
283
|
return files
|
|
88
|
-
.filter((f) => f.endsWith(
|
|
89
|
-
.map((f) => f.
|
|
284
|
+
.filter((f) => f.endsWith(".log"))
|
|
285
|
+
.map((f) => f.slice(0, -4));
|
|
90
286
|
}
|
|
91
287
|
catch {
|
|
92
288
|
return [];
|
package/dist/logs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../src/logs.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../src/logs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AA4C/C,MAAM,0BAA0B,GAAG,IAAI,CAAC;AACxC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAEtC,SAAS,iBAAiB;IACxB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,aAAa,CAAC,OAAe;IACpC,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACxB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;QACvD,KAAK,CAAC,GAAG,EAAE,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,KAAK,UAAU,QAAQ,CAAC,QAAgB,EAAE,KAAa;IACrD,MA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,IAAI,CAAC,OAAO,CAAC,CAAC;gBACrC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC;YACzB,CAAC;YAAC,MAAM,CAAC;gBACP,MAAM,GAAG,CAAC,CAAC;YACb,CAAC;YAED,YAAY,EAAE,CAAC;QACjB,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,CAAC;gBACH,IAAI,EAAE,OAAO;gBACb,KAAK;gBACL,KAAK,EAAE,8BAA8B,KAAK,IAAI;aAC/C,CAAC,CAAC;YACH,IAAI,EAAE,CAAC;QACT,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO;QACL,WAAW,EAAE,IAAI;KAClB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAAgB;IACrD,MAAM,GAAG,GAAG,OAAO,IAAI,iBAAiB,EAAE,CAAC;IAE3C,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;QACjC,OAAO,KAAK;aACT,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;aACjC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/models.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model and CLI Constants
|
|
3
|
+
*
|
|
4
|
+
* Re-exports from @agent-relay/config package.
|
|
5
|
+
* Source of truth: packages/shared/cli-registry.yaml
|
|
6
|
+
* Run `npm run codegen:models` after editing the YAML.
|
|
7
|
+
*/
|
|
8
|
+
export { CLIs, CLIVersions, CLIRegistry, ClaudeModels, CodexModels, GeminiModels, CursorModels, Models, DefaultModels, CLAUDE_MODEL_OPTIONS, CODEX_MODEL_OPTIONS, GEMINI_MODEL_OPTIONS, CURSOR_MODEL_OPTIONS, ModelOptions, SwarmPatterns, type CLI, type ClaudeModel, type CodexModel, type GeminiModel, type CursorModel, type ModelOption, } from '@agent-relay/config';
|
|
9
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAEL,IAAI,EACJ,WAAW,EACX,WAAW,EAEX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,aAAa,EAEb,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EAEZ,aAAa,EAEb,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,qBAAqB,CAAC"}
|
package/dist/models.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model and CLI Constants
|
|
3
|
+
*
|
|
4
|
+
* Re-exports from @agent-relay/config package.
|
|
5
|
+
* Source of truth: packages/shared/cli-registry.yaml
|
|
6
|
+
* Run `npm run codegen:models` after editing the YAML.
|
|
7
|
+
*/
|
|
8
|
+
export {
|
|
9
|
+
// CLI tools and versions
|
|
10
|
+
CLIs, CLIVersions, CLIRegistry,
|
|
11
|
+
// Model constants
|
|
12
|
+
ClaudeModels, CodexModels, GeminiModels, CursorModels, Models, DefaultModels,
|
|
13
|
+
// Model options for UI dropdowns
|
|
14
|
+
CLAUDE_MODEL_OPTIONS, CODEX_MODEL_OPTIONS, GEMINI_MODEL_OPTIONS, CURSOR_MODEL_OPTIONS, ModelOptions,
|
|
15
|
+
// Swarm patterns (type is in workflows/types.ts)
|
|
16
|
+
SwarmPatterns, } from '@agent-relay/config';
|
|
17
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO;AACL,yBAAyB;AACzB,IAAI,EACJ,WAAW,EACX,WAAW;AACX,kBAAkB;AAClB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,aAAa;AACb,iCAAiC;AACjC,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,YAAY;AACZ,iDAAiD;AACjD,aAAa,GAQd,MAAM,qBAAqB,CAAC"}
|