@xenosystem/agent-sdk 0.9.38 → 0.9.39
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/artifacts/browser.cjs +1 -1
- package/dist/artifacts/browser.d.cts +2 -2
- package/dist/artifacts/browser.d.ts +2 -2
- package/dist/artifacts/browser.js +1 -1
- package/dist/artifacts/{diff-artifact-CmhmeSu5.d.cts → diff-artifact--7QTtOxh.d.cts} +2 -1
- package/dist/artifacts/{diff-artifact-CmhmeSu5.d.ts → diff-artifact--7QTtOxh.d.ts} +2 -1
- package/dist/artifacts/index.cjs +10 -9
- package/dist/artifacts/index.d.cts +94 -3
- package/dist/artifacts/index.d.ts +94 -3
- package/dist/artifacts/index.js +10 -9
- package/dist/artifacts/metafile-cjs.json +1 -1
- package/dist/artifacts/metafile-esm.json +1 -1
- package/dist/automation/index.cjs +2 -2
- package/dist/automation/index.d.cts +2 -1
- package/dist/automation/index.d.ts +2 -1
- package/dist/automation/index.js +2 -2
- package/dist/automation/metafile-cjs.json +1 -1
- package/dist/automation/metafile-esm.json +1 -1
- package/dist/control-plane/index.cjs +8 -7
- package/dist/control-plane/index.d.cts +171 -1
- package/dist/control-plane/index.d.ts +171 -1
- package/dist/control-plane/index.js +8 -7
- package/dist/control-plane/metafile-cjs.json +1 -1
- package/dist/control-plane/metafile-esm.json +1 -1
- package/dist/coordination/index.cjs +2 -2
- package/dist/coordination/index.d.cts +85 -2
- package/dist/coordination/index.d.ts +85 -2
- package/dist/coordination/index.js +2 -2
- package/dist/coordination/metafile-cjs.json +1 -1
- package/dist/coordination/metafile-esm.json +1 -1
- package/dist/electron/index.cjs +48 -48
- package/dist/electron/index.d.cts +7 -1
- package/dist/electron/index.d.ts +7 -1
- package/dist/electron/index.js +48 -48
- package/dist/electron/metafile-cjs.json +1 -1
- package/dist/electron/metafile-esm.json +1 -1
- package/dist/index.cjs +343 -341
- package/dist/index.d.cts +443 -5
- package/dist/index.d.ts +443 -5
- package/dist/index.js +343 -341
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/oracle/index.cjs +1 -1
- package/dist/oracle/index.d.cts +2 -1
- package/dist/oracle/index.d.ts +2 -1
- package/dist/oracle/index.js +1 -1
- package/dist/oracle/metafile-cjs.json +1 -1
- package/dist/oracle/metafile-esm.json +1 -1
- package/dist/recipes/index.cjs +2 -2
- package/dist/recipes/index.js +2 -2
- package/dist/recipes/metafile-cjs.json +1 -1
- package/dist/recipes/metafile-esm.json +1 -1
- package/dist/research/index.cjs +3 -3
- package/dist/research/index.d.cts +2 -1
- package/dist/research/index.d.ts +2 -1
- package/dist/research/index.js +3 -3
- package/dist/research/metafile-cjs.json +1 -1
- package/dist/research/metafile-esm.json +1 -1
- package/dist/session/index.cjs +12 -12
- package/dist/session/index.d.cts +7 -1
- package/dist/session/index.d.ts +7 -1
- package/dist/session/index.js +9 -9
- package/dist/session/metafile-cjs.json +1 -1
- package/dist/session/metafile-esm.json +1 -1
- package/ownership/audit.mjs +6 -0
- package/package.json +1 -1
|
@@ -417,4 +417,174 @@ interface ControlPlaneLockHandle {
|
|
|
417
417
|
release: () => void;
|
|
418
418
|
}
|
|
419
419
|
declare function acquireControlPlaneLock(path: string, name: string, version: string): ControlPlaneLockHandle;
|
|
420
|
-
|
|
420
|
+
declare const PEER_SCHEMA_VERSION: 2;
|
|
421
|
+
declare const PEER_PRESENCE_TTL_MS = 30000;
|
|
422
|
+
declare const PEER_MESSAGE_DEFAULT_TTL_MS: number;
|
|
423
|
+
type PeerSurface = "cli" | "interface" | "hub" | "shell" | "other";
|
|
424
|
+
type PeerPresenceState = "idle" | "busy" | "awaiting-approval" | "offline";
|
|
425
|
+
type PeerInboundPolicy = "accept" | "hold" | "refuse";
|
|
426
|
+
type PeerMessageKind = "task" | "message" | "question" | "report";
|
|
427
|
+
type PeerDeliveryStatus = "queued" | "held" | "received" | "refused" | "expired" | "cancelled";
|
|
428
|
+
type PeerTaskStatus = "offered" | "accepted" | "running" | "completed" | "failed" | "cancelled" | "blocked" | "recovery-required";
|
|
429
|
+
type PeerPermissionPosture = "plan" | "default" | "acceptEdits" | "bypassPermissions" | "unknown";
|
|
430
|
+
interface PeerPresence {
|
|
431
|
+
schemaVersion: typeof PEER_SCHEMA_VERSION;
|
|
432
|
+
sessionId: string;
|
|
433
|
+
incarnationId: string;
|
|
434
|
+
name?: string;
|
|
435
|
+
host: string;
|
|
436
|
+
owner: string;
|
|
437
|
+
pid: number;
|
|
438
|
+
workspace: string;
|
|
439
|
+
surface: PeerSurface;
|
|
440
|
+
state: PeerPresenceState;
|
|
441
|
+
inboundPolicy: PeerInboundPolicy;
|
|
442
|
+
posture: PeerPermissionPosture;
|
|
443
|
+
capabilities: string[];
|
|
444
|
+
startedAt: string;
|
|
445
|
+
heartbeatAt: string;
|
|
446
|
+
}
|
|
447
|
+
interface PeerAddress {
|
|
448
|
+
sessionId: string;
|
|
449
|
+
incarnationId?: string;
|
|
450
|
+
name?: string;
|
|
451
|
+
host?: string;
|
|
452
|
+
workspace?: string;
|
|
453
|
+
}
|
|
454
|
+
interface PeerDelivery {
|
|
455
|
+
status: PeerDeliveryStatus;
|
|
456
|
+
at: string;
|
|
457
|
+
reason?: string;
|
|
458
|
+
incarnationId?: string;
|
|
459
|
+
}
|
|
460
|
+
interface PeerTask {
|
|
461
|
+
status: PeerTaskStatus;
|
|
462
|
+
at: string;
|
|
463
|
+
executorIncarnationId?: string;
|
|
464
|
+
startedAt?: string;
|
|
465
|
+
endedAt?: string;
|
|
466
|
+
result?: string;
|
|
467
|
+
error?: string;
|
|
468
|
+
reportMessageId?: string;
|
|
469
|
+
cancelRequestedAt?: string;
|
|
470
|
+
}
|
|
471
|
+
interface PeerMessage {
|
|
472
|
+
schemaVersion: typeof PEER_SCHEMA_VERSION;
|
|
473
|
+
messageId: string;
|
|
474
|
+
idempotencyKey?: string;
|
|
475
|
+
kind: PeerMessageKind;
|
|
476
|
+
from: PeerAddress;
|
|
477
|
+
to: PeerAddress;
|
|
478
|
+
text: string;
|
|
479
|
+
correlationId?: string;
|
|
480
|
+
causedBy?: string;
|
|
481
|
+
chainDepth: number;
|
|
482
|
+
createdAt: string;
|
|
483
|
+
updatedAt: string;
|
|
484
|
+
expiresAt: string;
|
|
485
|
+
delivery: PeerDelivery;
|
|
486
|
+
task?: PeerTask;
|
|
487
|
+
}
|
|
488
|
+
type PeerSendOutcome = {
|
|
489
|
+
status: "queued";
|
|
490
|
+
message: PeerMessage;
|
|
491
|
+
} | {
|
|
492
|
+
status: "held";
|
|
493
|
+
message: PeerMessage;
|
|
494
|
+
reason: string;
|
|
495
|
+
} | {
|
|
496
|
+
status: "refused";
|
|
497
|
+
messageId?: string;
|
|
498
|
+
reason: string;
|
|
499
|
+
};
|
|
500
|
+
interface PeerSendInput {
|
|
501
|
+
from: PeerAddress;
|
|
502
|
+
to: PeerAddress;
|
|
503
|
+
text: string;
|
|
504
|
+
kind?: PeerMessageKind;
|
|
505
|
+
correlationId?: string;
|
|
506
|
+
causedBy?: string;
|
|
507
|
+
idempotencyKey?: string;
|
|
508
|
+
ttlMs?: number;
|
|
509
|
+
}
|
|
510
|
+
interface PeerMessagingStoreOptions {
|
|
511
|
+
now?: () => number;
|
|
512
|
+
maxPerSenderPerWindow?: number;
|
|
513
|
+
windowMs?: number;
|
|
514
|
+
maxQueuedPerRecipient?: number;
|
|
515
|
+
maxHeldPerRecipient?: number;
|
|
516
|
+
maxChainDepth?: number;
|
|
517
|
+
presenceTtlMs?: number;
|
|
518
|
+
defaultTtlMs?: number;
|
|
519
|
+
}
|
|
520
|
+
declare const PEER_TASK_TERMINAL_STATUSES: readonly PeerTaskStatus[];
|
|
521
|
+
declare function isPeerTaskTerminal(status: PeerTaskStatus): boolean;
|
|
522
|
+
declare function movesTrustUpward(sender: PeerPermissionPosture, receiver: PeerPermissionPosture): boolean;
|
|
523
|
+
declare function toPeerPosture(permissionMode: string | undefined): PeerPermissionPosture;
|
|
524
|
+
declare function peerShortId(sessionId: string): string;
|
|
525
|
+
declare function renderPeerLabel(peer: Pick<PeerPresence, "sessionId" | "name">): string;
|
|
526
|
+
type PeerResolution = {
|
|
527
|
+
kind: "resolved";
|
|
528
|
+
peer: PeerPresence;
|
|
529
|
+
} | {
|
|
530
|
+
kind: "ambiguous";
|
|
531
|
+
candidates: PeerPresence[];
|
|
532
|
+
} | {
|
|
533
|
+
kind: "unknown";
|
|
534
|
+
};
|
|
535
|
+
declare function resolvePeerTarget(peers: readonly PeerPresence[], query: string, self?: string): PeerResolution;
|
|
536
|
+
declare function defaultPeerDirectory(): string;
|
|
537
|
+
declare class PeerMessagingStore {
|
|
538
|
+
readonly directory: string;
|
|
539
|
+
private readonly now;
|
|
540
|
+
private readonly options;
|
|
541
|
+
constructor(directory?: string, options?: PeerMessagingStoreOptions);
|
|
542
|
+
private presencePath;
|
|
543
|
+
private presenceLock;
|
|
544
|
+
registerSession(input: {
|
|
545
|
+
sessionId: string;
|
|
546
|
+
name?: string;
|
|
547
|
+
workspace: string;
|
|
548
|
+
surface?: PeerSurface;
|
|
549
|
+
inboundPolicy?: PeerInboundPolicy;
|
|
550
|
+
posture?: PeerPermissionPosture;
|
|
551
|
+
capabilities?: string[];
|
|
552
|
+
state?: PeerPresenceState;
|
|
553
|
+
incarnationId?: string;
|
|
554
|
+
}): PeerPresence;
|
|
555
|
+
heartbeat(sessionId: string, incarnationId: string, update?: Partial<Pick<PeerPresence, "name" | "state" | "inboundPolicy" | "posture" | "capabilities" | "workspace">>): PeerPresence | null;
|
|
556
|
+
unregisterSession(sessionId: string, incarnationId: string): boolean;
|
|
557
|
+
getPresence(sessionId: string): PeerPresence | null;
|
|
558
|
+
listSessions(options?: {
|
|
559
|
+
includeOffline?: boolean;
|
|
560
|
+
}): PeerPresence[];
|
|
561
|
+
private withLiveness;
|
|
562
|
+
private mailboxDir;
|
|
563
|
+
private messagePath;
|
|
564
|
+
private messageLock;
|
|
565
|
+
send(input: PeerSendInput): PeerSendOutcome;
|
|
566
|
+
inbox(sessionId: string): PeerMessage[];
|
|
567
|
+
listSent(sessionId: string): PeerMessage[];
|
|
568
|
+
find(messageId: string): PeerMessage | null;
|
|
569
|
+
private mutate;
|
|
570
|
+
setDelivery(messageId: string, status: PeerDeliveryStatus, detail?: {
|
|
571
|
+
reason?: string;
|
|
572
|
+
incarnationId?: string;
|
|
573
|
+
}): PeerMessage;
|
|
574
|
+
release(messageId: string): PeerMessage;
|
|
575
|
+
receive(messageId: string, incarnationId: string): PeerMessage;
|
|
576
|
+
setTask(messageId: string, status: PeerTaskStatus, detail?: {
|
|
577
|
+
executorIncarnationId?: string;
|
|
578
|
+
result?: string;
|
|
579
|
+
error?: string;
|
|
580
|
+
reportMessageId?: string;
|
|
581
|
+
}): PeerMessage;
|
|
582
|
+
requestCancel(messageId: string, reason?: string): PeerMessage;
|
|
583
|
+
expireStale(sessionId: string): PeerMessage[];
|
|
584
|
+
reconcileAbandonedTasks(sessionId: string, liveIncarnationId: string): PeerMessage[];
|
|
585
|
+
compact(olderThanMs?: number): {
|
|
586
|
+
messages: number;
|
|
587
|
+
presence: number;
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
export { AGENT_DAEMON_PROTOCOL_VERSION, AgentDaemonClient, type AgentDaemonError, type AgentDaemonHandler, type AgentDaemonRequest, type AgentDaemonResponse, AgentDaemonServer, type AgentDaemonTransport, AgentEventStore, type AgentRunAgentDefinitionRef, AgentRunController, type AgentRunControllerOptions, type AgentRunCreateInput, type AgentRunEvent, type AgentRunListOptions, type AgentRunRecord, type AgentRunSpawnResult, type AgentRunStatus, AgentRunStore, type AgentRunUsage, type ControlPlaneLockHandle, type ControlPlaneLockRecord, type MonitorEvent, MonitorManager, type MonitorSnapshot, type MonitorSource, MonitorStopTool, MonitorTool, OtelExporter, type OtelUsageAdapter, PEER_MESSAGE_DEFAULT_TTL_MS, PEER_PRESENCE_TTL_MS, PEER_SCHEMA_VERSION, PEER_TASK_TERMINAL_STATUSES, type PeerAddress, type PeerDelivery, type PeerDeliveryStatus, type PeerInboundPolicy, type PeerMessage, type PeerMessageKind, PeerMessagingStore, type PeerMessagingStoreOptions, type PeerPermissionPosture, type PeerPresence, type PeerPresenceState, type PeerResolution, type PeerSendInput, type PeerSendOutcome, type PeerSurface, type PeerTask, type PeerTaskStatus, UsageAccumulator, type UsageAttribution, type UsageEvent, UsageLedger, type UsageQuery, type UsageTotals, type WorkflowDefinition, type WorkflowEvent, type WorkflowNodeDefinition, type WorkflowNodeExecutor, type WorkflowNodeStatus, type WorkflowPlan, WorkflowPlanner, type WorkflowRunNodeRecord, type WorkflowRunRecord, type WorkflowRunStatus, WorkflowRuntime, WorkflowStore, acquireControlPlaneLock, createAgentRunId, defaultPeerDirectory, getAgentRunDir, getAgentRunStoreDir, isPeerTaskTerminal, movesTrustUpward, peerShortId, renderPeerLabel, resolvePeerTarget, toPeerPosture };
|
|
@@ -417,4 +417,174 @@ interface ControlPlaneLockHandle {
|
|
|
417
417
|
release: () => void;
|
|
418
418
|
}
|
|
419
419
|
declare function acquireControlPlaneLock(path: string, name: string, version: string): ControlPlaneLockHandle;
|
|
420
|
-
|
|
420
|
+
declare const PEER_SCHEMA_VERSION: 2;
|
|
421
|
+
declare const PEER_PRESENCE_TTL_MS = 30000;
|
|
422
|
+
declare const PEER_MESSAGE_DEFAULT_TTL_MS: number;
|
|
423
|
+
type PeerSurface = "cli" | "interface" | "hub" | "shell" | "other";
|
|
424
|
+
type PeerPresenceState = "idle" | "busy" | "awaiting-approval" | "offline";
|
|
425
|
+
type PeerInboundPolicy = "accept" | "hold" | "refuse";
|
|
426
|
+
type PeerMessageKind = "task" | "message" | "question" | "report";
|
|
427
|
+
type PeerDeliveryStatus = "queued" | "held" | "received" | "refused" | "expired" | "cancelled";
|
|
428
|
+
type PeerTaskStatus = "offered" | "accepted" | "running" | "completed" | "failed" | "cancelled" | "blocked" | "recovery-required";
|
|
429
|
+
type PeerPermissionPosture = "plan" | "default" | "acceptEdits" | "bypassPermissions" | "unknown";
|
|
430
|
+
interface PeerPresence {
|
|
431
|
+
schemaVersion: typeof PEER_SCHEMA_VERSION;
|
|
432
|
+
sessionId: string;
|
|
433
|
+
incarnationId: string;
|
|
434
|
+
name?: string;
|
|
435
|
+
host: string;
|
|
436
|
+
owner: string;
|
|
437
|
+
pid: number;
|
|
438
|
+
workspace: string;
|
|
439
|
+
surface: PeerSurface;
|
|
440
|
+
state: PeerPresenceState;
|
|
441
|
+
inboundPolicy: PeerInboundPolicy;
|
|
442
|
+
posture: PeerPermissionPosture;
|
|
443
|
+
capabilities: string[];
|
|
444
|
+
startedAt: string;
|
|
445
|
+
heartbeatAt: string;
|
|
446
|
+
}
|
|
447
|
+
interface PeerAddress {
|
|
448
|
+
sessionId: string;
|
|
449
|
+
incarnationId?: string;
|
|
450
|
+
name?: string;
|
|
451
|
+
host?: string;
|
|
452
|
+
workspace?: string;
|
|
453
|
+
}
|
|
454
|
+
interface PeerDelivery {
|
|
455
|
+
status: PeerDeliveryStatus;
|
|
456
|
+
at: string;
|
|
457
|
+
reason?: string;
|
|
458
|
+
incarnationId?: string;
|
|
459
|
+
}
|
|
460
|
+
interface PeerTask {
|
|
461
|
+
status: PeerTaskStatus;
|
|
462
|
+
at: string;
|
|
463
|
+
executorIncarnationId?: string;
|
|
464
|
+
startedAt?: string;
|
|
465
|
+
endedAt?: string;
|
|
466
|
+
result?: string;
|
|
467
|
+
error?: string;
|
|
468
|
+
reportMessageId?: string;
|
|
469
|
+
cancelRequestedAt?: string;
|
|
470
|
+
}
|
|
471
|
+
interface PeerMessage {
|
|
472
|
+
schemaVersion: typeof PEER_SCHEMA_VERSION;
|
|
473
|
+
messageId: string;
|
|
474
|
+
idempotencyKey?: string;
|
|
475
|
+
kind: PeerMessageKind;
|
|
476
|
+
from: PeerAddress;
|
|
477
|
+
to: PeerAddress;
|
|
478
|
+
text: string;
|
|
479
|
+
correlationId?: string;
|
|
480
|
+
causedBy?: string;
|
|
481
|
+
chainDepth: number;
|
|
482
|
+
createdAt: string;
|
|
483
|
+
updatedAt: string;
|
|
484
|
+
expiresAt: string;
|
|
485
|
+
delivery: PeerDelivery;
|
|
486
|
+
task?: PeerTask;
|
|
487
|
+
}
|
|
488
|
+
type PeerSendOutcome = {
|
|
489
|
+
status: "queued";
|
|
490
|
+
message: PeerMessage;
|
|
491
|
+
} | {
|
|
492
|
+
status: "held";
|
|
493
|
+
message: PeerMessage;
|
|
494
|
+
reason: string;
|
|
495
|
+
} | {
|
|
496
|
+
status: "refused";
|
|
497
|
+
messageId?: string;
|
|
498
|
+
reason: string;
|
|
499
|
+
};
|
|
500
|
+
interface PeerSendInput {
|
|
501
|
+
from: PeerAddress;
|
|
502
|
+
to: PeerAddress;
|
|
503
|
+
text: string;
|
|
504
|
+
kind?: PeerMessageKind;
|
|
505
|
+
correlationId?: string;
|
|
506
|
+
causedBy?: string;
|
|
507
|
+
idempotencyKey?: string;
|
|
508
|
+
ttlMs?: number;
|
|
509
|
+
}
|
|
510
|
+
interface PeerMessagingStoreOptions {
|
|
511
|
+
now?: () => number;
|
|
512
|
+
maxPerSenderPerWindow?: number;
|
|
513
|
+
windowMs?: number;
|
|
514
|
+
maxQueuedPerRecipient?: number;
|
|
515
|
+
maxHeldPerRecipient?: number;
|
|
516
|
+
maxChainDepth?: number;
|
|
517
|
+
presenceTtlMs?: number;
|
|
518
|
+
defaultTtlMs?: number;
|
|
519
|
+
}
|
|
520
|
+
declare const PEER_TASK_TERMINAL_STATUSES: readonly PeerTaskStatus[];
|
|
521
|
+
declare function isPeerTaskTerminal(status: PeerTaskStatus): boolean;
|
|
522
|
+
declare function movesTrustUpward(sender: PeerPermissionPosture, receiver: PeerPermissionPosture): boolean;
|
|
523
|
+
declare function toPeerPosture(permissionMode: string | undefined): PeerPermissionPosture;
|
|
524
|
+
declare function peerShortId(sessionId: string): string;
|
|
525
|
+
declare function renderPeerLabel(peer: Pick<PeerPresence, "sessionId" | "name">): string;
|
|
526
|
+
type PeerResolution = {
|
|
527
|
+
kind: "resolved";
|
|
528
|
+
peer: PeerPresence;
|
|
529
|
+
} | {
|
|
530
|
+
kind: "ambiguous";
|
|
531
|
+
candidates: PeerPresence[];
|
|
532
|
+
} | {
|
|
533
|
+
kind: "unknown";
|
|
534
|
+
};
|
|
535
|
+
declare function resolvePeerTarget(peers: readonly PeerPresence[], query: string, self?: string): PeerResolution;
|
|
536
|
+
declare function defaultPeerDirectory(): string;
|
|
537
|
+
declare class PeerMessagingStore {
|
|
538
|
+
readonly directory: string;
|
|
539
|
+
private readonly now;
|
|
540
|
+
private readonly options;
|
|
541
|
+
constructor(directory?: string, options?: PeerMessagingStoreOptions);
|
|
542
|
+
private presencePath;
|
|
543
|
+
private presenceLock;
|
|
544
|
+
registerSession(input: {
|
|
545
|
+
sessionId: string;
|
|
546
|
+
name?: string;
|
|
547
|
+
workspace: string;
|
|
548
|
+
surface?: PeerSurface;
|
|
549
|
+
inboundPolicy?: PeerInboundPolicy;
|
|
550
|
+
posture?: PeerPermissionPosture;
|
|
551
|
+
capabilities?: string[];
|
|
552
|
+
state?: PeerPresenceState;
|
|
553
|
+
incarnationId?: string;
|
|
554
|
+
}): PeerPresence;
|
|
555
|
+
heartbeat(sessionId: string, incarnationId: string, update?: Partial<Pick<PeerPresence, "name" | "state" | "inboundPolicy" | "posture" | "capabilities" | "workspace">>): PeerPresence | null;
|
|
556
|
+
unregisterSession(sessionId: string, incarnationId: string): boolean;
|
|
557
|
+
getPresence(sessionId: string): PeerPresence | null;
|
|
558
|
+
listSessions(options?: {
|
|
559
|
+
includeOffline?: boolean;
|
|
560
|
+
}): PeerPresence[];
|
|
561
|
+
private withLiveness;
|
|
562
|
+
private mailboxDir;
|
|
563
|
+
private messagePath;
|
|
564
|
+
private messageLock;
|
|
565
|
+
send(input: PeerSendInput): PeerSendOutcome;
|
|
566
|
+
inbox(sessionId: string): PeerMessage[];
|
|
567
|
+
listSent(sessionId: string): PeerMessage[];
|
|
568
|
+
find(messageId: string): PeerMessage | null;
|
|
569
|
+
private mutate;
|
|
570
|
+
setDelivery(messageId: string, status: PeerDeliveryStatus, detail?: {
|
|
571
|
+
reason?: string;
|
|
572
|
+
incarnationId?: string;
|
|
573
|
+
}): PeerMessage;
|
|
574
|
+
release(messageId: string): PeerMessage;
|
|
575
|
+
receive(messageId: string, incarnationId: string): PeerMessage;
|
|
576
|
+
setTask(messageId: string, status: PeerTaskStatus, detail?: {
|
|
577
|
+
executorIncarnationId?: string;
|
|
578
|
+
result?: string;
|
|
579
|
+
error?: string;
|
|
580
|
+
reportMessageId?: string;
|
|
581
|
+
}): PeerMessage;
|
|
582
|
+
requestCancel(messageId: string, reason?: string): PeerMessage;
|
|
583
|
+
expireStale(sessionId: string): PeerMessage[];
|
|
584
|
+
reconcileAbandonedTasks(sessionId: string, liveIncarnationId: string): PeerMessage[];
|
|
585
|
+
compact(olderThanMs?: number): {
|
|
586
|
+
messages: number;
|
|
587
|
+
presence: number;
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
export { AGENT_DAEMON_PROTOCOL_VERSION, AgentDaemonClient, type AgentDaemonError, type AgentDaemonHandler, type AgentDaemonRequest, type AgentDaemonResponse, AgentDaemonServer, type AgentDaemonTransport, AgentEventStore, type AgentRunAgentDefinitionRef, AgentRunController, type AgentRunControllerOptions, type AgentRunCreateInput, type AgentRunEvent, type AgentRunListOptions, type AgentRunRecord, type AgentRunSpawnResult, type AgentRunStatus, AgentRunStore, type AgentRunUsage, type ControlPlaneLockHandle, type ControlPlaneLockRecord, type MonitorEvent, MonitorManager, type MonitorSnapshot, type MonitorSource, MonitorStopTool, MonitorTool, OtelExporter, type OtelUsageAdapter, PEER_MESSAGE_DEFAULT_TTL_MS, PEER_PRESENCE_TTL_MS, PEER_SCHEMA_VERSION, PEER_TASK_TERMINAL_STATUSES, type PeerAddress, type PeerDelivery, type PeerDeliveryStatus, type PeerInboundPolicy, type PeerMessage, type PeerMessageKind, PeerMessagingStore, type PeerMessagingStoreOptions, type PeerPermissionPosture, type PeerPresence, type PeerPresenceState, type PeerResolution, type PeerSendInput, type PeerSendOutcome, type PeerSurface, type PeerTask, type PeerTaskStatus, UsageAccumulator, type UsageAttribution, type UsageEvent, UsageLedger, type UsageQuery, type UsageTotals, type WorkflowDefinition, type WorkflowEvent, type WorkflowNodeDefinition, type WorkflowNodeExecutor, type WorkflowNodeStatus, type WorkflowPlan, WorkflowPlanner, type WorkflowRunNodeRecord, type WorkflowRunRecord, type WorkflowRunStatus, WorkflowRuntime, WorkflowStore, acquireControlPlaneLock, createAgentRunId, defaultPeerDirectory, getAgentRunDir, getAgentRunStoreDir, isPeerTaskTerminal, movesTrustUpward, peerShortId, renderPeerLabel, resolvePeerTarget, toPeerPosture };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import{randomUUID as
|
|
2
|
-
`,{encoding:"utf8",flag:"wx"})}function
|
|
3
|
-
`,"utf8"),
|
|
4
|
-
`,"utf8"),
|
|
5
|
-
`,"utf8"),
|
|
6
|
-
`,"utf8"),
|
|
7
|
-
`,"utf8"),t}query(e={}){return
|
|
1
|
+
import{randomUUID as Qe}from"node:crypto";import{existsSync as Ge,mkdirSync as B,readFileSync as Xe,readdirSync as Ze,renameSync as Ye,rmSync as et,writeFileSync as N}from"node:fs";import{basename as pe,dirname as tt,join as w,resolve as rt}from"node:path";var D="0.9.39";import{mkdirSync as Me,readFileSync as _e,rmSync as se,writeFileSync as Ce}from"node:fs";import{hostname as oe}from"node:os";import{dirname as Oe}from"node:path";function $e(){return new Date().toISOString()}function Ne(){return new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString()}function ie(s){try{return JSON.parse(_e(s,"utf8"))}catch{return null}}function Ue(s){if(!s||s<=0)return!1;try{return process.kill(s,0),!0}catch{return!1}}function Ve(s){return s.hostname!==oe()?!0:Ue(s.pid)}function ne(s,e){Me(Oe(s),{recursive:!0}),Ce(s,JSON.stringify(e,null,2)+`
|
|
2
|
+
`,{encoding:"utf8",flag:"wx"})}function We(s,e){let t=ie(s);t?.pid!==e.pid||t.hostname!==e.hostname||se(s,{force:!0})}function x(s,e,t){let r=$e(),n={schemaVersion:1,name:e,pid:process.pid,hostname:oe(),processStartedAt:Ne(),version:t,acquiredAt:r,updatedAt:r};try{ne(s,n)}catch(o){if(o.code!=="EEXIST")throw o;let a=ie(s);if(a&&Ve(a))throw new Error(`${e} is already locked by PID ${a.pid} on ${a.hostname}.`);se(s,{force:!0}),ne(s,n)}return{record:n,release:()=>{We(s,n)}}}import{randomUUID as Le}from"node:crypto";import{appendFileSync as qe,existsSync as Fe,mkdirSync as ae,readFileSync as je}from"node:fs";import{basename as He,dirname as Je,join as Ke}from"node:path";function ue(s){return He(s).replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,96)}function ce(s){return Fe(s)?je(s,"utf8").split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(e=>{try{return JSON.parse(e)}catch{return null}}).filter(e=>e!==null):[]}var O=class{constructor(e){this.runsDir=e;ae(this.runsDir,{recursive:!0})}runsDir;pathFor(e){return Ke(this.runsDir,ue(e),"events.jsonl")}append(e,t,r={},n=new Date().toISOString()){let o=this.pathFor(e);ae(Je(o),{recursive:!0});let i=x(`${o}.lock`,`events:${ue(e)}`,D);try{let a=ce(o).reduce((R,p,c)=>Math.max(R,p.sequence??c),-1)+1,u={schemaVersion:1,eventId:`event_${Le()}`,sequence:a,runId:e,type:t,timestamp:n,payload:r};return qe(o,`${JSON.stringify(u)}
|
|
3
|
+
`,"utf8"),u}finally{i.release()}}read(e){return ce(this.pathFor(e))}tail(e,t=100){let r=Math.max(0,Math.min(1e4,Math.trunc(t)));return r===0?[]:this.read(e).slice(-r)}};import{homedir as le,platform as ze,release as Be}from"node:os";import{resolve as de}from"node:path";var ur=ze();var cr=Be(),dr=le();function v(){let s=process.env.XENO_AGENT_HOME?.trim();return s?de(s):de(le(),".xeno-agent")}var nt=1,st=w(v(),"daemon"),G=w(st,"runs");function m(){return new Date().toISOString()}function ot(s=new Date){return s.toISOString().replace(/[^0-9]/g,"").slice(0,14)}function Q(s){return s.replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,80)}function X(s){return rt(s)}function U(s){return X(s).toLowerCase()}function ge(s,e){let t=U(s),r=U(e);return t===r||t.startsWith(`${r}\\`)||t.startsWith(`${r}/`)}function it(s,e){return!!(U(s.cwd)===U(e)||s.git?.root&&ge(e,s.git.root)||s.git?.worktree&&ge(e,s.git.worktree))}function at(s){return Q(Buffer.from(X(s)).toString("base64url"))}function ut(){return{input:0,output:0,total:0}}function $(s){try{return JSON.parse(Xe(s,"utf8"))}catch{return null}}function ct(s){return s instanceof Error&&/\balready locked by PID\b/.test(s.message)}function dt(s,e){B(tt(s),{recursive:!0});let t=`${s}.${process.pid}.${Date.now()}.tmp`;N(t,JSON.stringify(e,null,2)+`
|
|
4
|
+
`,"utf8"),Ye(t,s)}function lt(s){if(!s||s<=0)return!1;try{return process.kill(s,0),!0}catch{return!1}}function pt(s){return s==="completed"||s==="failed"||s==="cancelled"||s==="interrupted"}function gt(s,e){return s.pinned!==e.pinned?s.pinned?-1:1:Date.parse(e.updatedAt)-Date.parse(s.updatedAt)}function Rr(){return G}function vr(s){return w(G,s)}function mt(s=new Date){return`run_${ot(s)}_${Qe().slice(0,8)}`}var V=class{constructor(e=G){this.runsDir=e;B(this.runsDir,{recursive:!0}),this.eventStore=new O(this.runsDir)}runsDir;eventStore;create(e){let t=mt(),r=w(this.runsDir,t);B(r,{recursive:!0});let n=m(),o=w(r,"events.jsonl"),i={schemaVersion:nt,runId:t,sessionId:t,rootRunId:t,cwd:X(e.cwd),workspaceId:at(e.cwd),prompt:e.prompt,...e.title?{title:e.title}:{},status:"starting",model:e.model,...e.effort?{effort:e.effort}:{},...e.agent?{agent:e.agent}:{},...e.git?{git:e.git}:{},permissionMode:e.permissionMode,...e.cliVersion?{createdByCliVersion:e.cliVersion}:{},createdBySdkVersion:e.sdkVersion??D,createdAt:n,updatedAt:n,lastActivityAt:n,pinned:!!e.pinned,attachedClients:0,...e.cliVersion?{cliVersion:e.cliVersion}:{},...e.sdkVersion?{sdkVersion:e.sdkVersion}:{},stdoutPath:w(r,"stdout.log"),stderrPath:w(r,"stderr.log"),eventsPath:o,usage:ut(),children:[],tags:[]};return N(i.stdoutPath,"","utf8"),N(i.stderrPath,"","utf8"),N(i.eventsPath,"","utf8"),this.write(i),this.appendEvent(t,"run_created",{cwd:i.cwd,model:i.model,...i.agent?{agent:i.agent}:{},...i.git?{git:i.git}:{},permissionMode:i.permissionMode,pinned:i.pinned}),i}get(e){let t=$(this.recordPath(e));return t?this.refreshRecordStatus(t):null}list(e={}){if(!Ge(this.runsDir))return[];let t=Ze(this.runsDir,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>{try{return this.get(r.name)}catch(n){if(ct(n))return $(this.recordPath(r.name));throw n}}).filter(r=>r!==null).filter(r=>e.all||!e.cwd||it(r,e.cwd)).filter(r=>!e.status||e.status.includes(r.status)).sort(gt);return typeof e.limit=="number"&&e.limit>0?t.slice(0,e.limit):t}markSpawned(e,t,r){return this.update(e,n=>({...n,status:"running",workerPid:t,...r?{workerVersion:r}:{},startedAt:n.startedAt??m(),lastActivityAt:m()}))}markStarted(e,t){return this.update(e,r=>({...r,status:"running",workerPid:t.pid,...t.workerVersion?{workerVersion:t.workerVersion}:{},...t.model?{model:t.model}:{},...t.effort?{effort:t.effort}:{},startedAt:r.startedAt??m(),lastActivityAt:m()}))}markCompleted(e,t){return this.update(e,r=>({...r,status:t.status,...t.statusReason?{statusReason:t.statusReason}:{},exitCode:t.exitCode??null,usage:t.usage??r.usage,endedAt:m(),lastActivityAt:m()}))}markCancelled(e,t){return this.update(e,r=>({...r,status:"cancelled",statusReason:t,endedAt:m(),lastActivityAt:m()}))}markPaused(e,t="Paused by user."){let r=this.update(e,n=>({...n,status:"paused",statusReason:t,lastActivityAt:m()}));return r&&this.appendEvent(e,"run_paused",{reason:t}),r}markResumed(e,t="Resumed by user."){let r=this.update(e,n=>{let o={...n,status:"running",statusReason:t,lastActivityAt:m()};return delete o.endedAt,delete o.exitCode,o});return r&&this.appendEvent(e,"run_resumed",{reason:t}),r}setPinned(e,t){let r=this.update(e,n=>({...n,pinned:t,lastActivityAt:m()}));return r&&this.appendEvent(e,t?"run_pinned":"run_unpinned",{pinned:t}),r}appendEvent(e,t,r={}){let n=$(this.recordPath(e)),o=this.eventStore.append(e,t,r);n&&this.update(e,i=>({...i,lastActivityAt:o.timestamp}))}readEvents(e){return this.get(e)?this.eventStore.read(e):[]}delete(e){et(w(this.runsDir,e),{recursive:!0,force:!0})}refreshRecordStatus(e){if(pt(e.status))return e;if(e.workerPid&&!lt(e.workerPid)){let t={...e,status:"failed",statusReason:"Worker process is no longer running and did not record a terminal status.",endedAt:e.endedAt??m(),updatedAt:m()};return this.write(t),t}return e}update(e,t){let r=$(this.recordPath(e));if(!r)return null;let n=t(r);return n.updatedAt=m(),this.write(n),n}write(e){let t=x(w(this.runDir(e.runId),"run.lock"),`run:${e.runId}`,D);try{dt(this.recordPath(e.runId),e)}finally{t.release()}}recordPath(e){return w(this.runsDir,Q(pe(e)),"run.json")}runDir(e){return w(this.runsDir,Q(pe(e)))}};function me(s){return s==="completed"||s==="failed"||s==="cancelled"||s==="interrupted"}var fe=class{constructor(e={}){this.options=e;this.store=e.store??new V}options;store;create(e){return this.store.create(e)}async start(e){let t=this.create(e);if(!this.options.spawn)return t;try{let r=await this.options.spawn(t),n=this.store.markSpawned(t.runId,r.pid,r.workerVersion);if(!n)throw new Error(`Run disappeared during spawn: ${t.runId}`);return this.store.appendEvent(t.runId,"run_started",{pid:r.pid}),n}catch(r){let n=r instanceof Error?r.message:String(r);throw this.store.markCompleted(t.runId,{status:"failed",statusReason:n,exitCode:null}),this.store.appendEvent(t.runId,"run_start_failed",{reason:n}),r}}get(e){return this.store.get(e)}list(e={}){return this.store.list(e)}events(e,t){let r=this.store.readEvents(e);return t===void 0?r:r.slice(-Math.max(0,Math.trunc(t)))}async stop(e,t="Stopped by user."){let r=this.store.get(e);if(!r||me(r.status))return r;await this.options.stop?.(r,t);let n=this.store.markCancelled(e,t);return n&&this.store.appendEvent(e,"run_cancelled",{reason:t}),n}async pause(e,t="Paused by user."){let r=this.store.get(e);return!r||me(r.status)||r.status==="paused"?r:(await this.options.pause?.(r,t),this.store.markPaused(e,t))}async resume(e,t="Resumed by user."){let r=this.store.get(e);return!r||r.status!=="paused"?r:(await this.options.resume?.(r,t),this.store.markResumed(e,t))}complete(e,t,r={}){let n=this.store.markCompleted(e,{status:t,...r.reason?{statusReason:r.reason}:{},...r.exitCode!==void 0?{exitCode:r.exitCode}:{},...r.usage?{usage:r.usage}:{}});return n&&this.store.appendEvent(e,`run_${t}`,{...r.reason?{reason:r.reason}:{}}),n}};import{randomUUID as ft,timingSafeEqual as ht}from"node:crypto";var b=1;function wt(s,e){if(!s)return!1;let t=Buffer.from(s),r=Buffer.from(e);return t.length===r.length&&ht(t,r)}var he=class{constructor(e={}){this.options=e}options;handlers=new Map;register(e,t){let r=e.trim();if(!r)throw new Error("Daemon method name cannot be empty.");if(this.handlers.has(r))throw new Error(`Daemon method already registered: ${r}`);return this.handlers.set(r,t),this}registerController(e){return this.register("runs.start",t=>e.start(t)).register("runs.get",t=>e.get(t.runId)).register("runs.list",t=>e.list(t??{})).register("runs.events",t=>{let r=t;return e.events(r.runId,r.limit)}).register("runs.stop",t=>{let r=t;return e.stop(r.runId,r.reason)}).register("runs.pause",t=>{let r=t;return e.pause(r.runId,r.reason)}).register("runs.resume",t=>{let r=t;return e.resume(r.runId,r.reason)})}async handle(e){if(e.protocolVersion!==b)return this.error(e.id,"PROTOCOL_MISMATCH",`Unsupported protocol version: ${e.protocolVersion}`);if(this.options.authToken&&!wt(e.authToken,this.options.authToken))return this.error(e.id,"UNAUTHORIZED","Daemon authentication failed.");let t=this.handlers.get(e.method);if(!t)return this.error(e.id,"METHOD_NOT_FOUND",`Unknown daemon method: ${e.method}`);try{return{protocolVersion:b,id:e.id,result:await t(e.params,e)}}catch(r){return this.error(e.id,"INTERNAL_ERROR",r instanceof Error?r.message:String(r))}}error(e,t,r){return{protocolVersion:b,id:e,error:{code:t,message:r}}}},we=class{constructor(e,t={}){this.transport=e;this.options=t}transport;options;async request(e,t){let r={protocolVersion:b,id:`request_${ft()}`,method:e,params:t,...this.options.authToken?{authToken:this.options.authToken}:{}},n=await this.transport(r);if(n.protocolVersion!==b||n.id!==r.id)throw new Error("Invalid daemon response identity.");if("error"in n){let o=new Error(n.error.message);throw o.code=n.error.code,o}return n.result}};import{randomUUID as ke}from"node:crypto";import{appendFileSync as kt,existsSync as Rt,mkdirSync as L,readFileSync as Pe,readdirSync as vt,renameSync as Pt,writeFileSync as yt}from"node:fs";import{basename as At,dirname as ye,join as P}from"node:path";function W(s){return At(s).replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,96)}function Z(s){try{return JSON.parse(Pe(s,"utf8"))}catch{return null}}function Re(s,e){L(ye(s),{recursive:!0});let t=`${s}.${process.pid}.${Date.now()}.tmp`;yt(t,`${JSON.stringify(e,null,2)}
|
|
5
|
+
`,"utf8"),Pt(t,s)}var T=class{plan(e){if(e.schemaVersion!==1)throw new Error("Unsupported workflow schema version.");if(!e.id.trim()||!e.name.trim())throw new Error("Workflow id and name are required.");let t=new Map;for(let i of e.nodes){if(!i.id.trim())throw new Error("Workflow node id cannot be empty.");if(t.has(i.id))throw new Error(`Duplicate workflow node: ${i.id}`);t.set(i.id,i)}for(let i of e.nodes)for(let a of i.dependsOn??[]){if(!t.has(a))throw new Error(`Workflow node ${i.id} depends on unknown node ${a}.`);if(a===i.id)throw new Error(`Workflow node ${i.id} cannot depend on itself.`)}let r=new Set(t.keys()),n=new Set,o=[];for(;r.size>0;){let i=[...r].filter(a=>(t.get(a)?.dependsOn??[]).every(u=>n.has(u))).sort();if(i.length===0)throw new Error("Workflow dependency graph contains a cycle.");o.push(i);for(let a of i)r.delete(a),n.add(a)}return{workflowId:e.id,waves:o}}},Y=class{constructor(e=P(v(),"workflows")){this.rootDir=e;L(this.definitionsDir(),{recursive:!0}),L(this.runsDir(),{recursive:!0})}rootDir;saveDefinition(e){return new T().plan(e),Re(P(this.definitionsDir(),`${W(e.id)}.json`),e),e}getDefinition(e){return Z(P(this.definitionsDir(),`${W(e)}.json`))}listDefinitions(){return vt(this.definitionsDir(),{withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(".json")).map(e=>Z(P(this.definitionsDir(),e.name))).filter(e=>e!==null)}createRun(e){new T().plan(e);let t=new Date().toISOString(),r={schemaVersion:1,runId:`workflow_run_${ke()}`,workflowId:e.id,status:"queued",createdAt:t,updatedAt:t,nodes:Object.fromEntries(e.nodes.map(n=>[n.id,{status:"pending"}]))};return this.writeRun(r),this.appendEvent(r.runId,"workflow_created",{}),r}getRun(e){return Z(this.runPath(e))}updateRun(e,t){let r=this.getRun(e);if(!r)throw new Error(`Workflow run not found: ${e}`);let n=t(r);return n.updatedAt=new Date().toISOString(),this.writeRun(n),n}appendEvent(e,t,r,n){let o={schemaVersion:1,eventId:`workflow_event_${ke()}`,runId:e,type:t,timestamp:new Date().toISOString(),...n?{nodeId:n}:{},payload:r},i=this.eventsPath(e);return L(ye(i),{recursive:!0}),kt(i,`${JSON.stringify(o)}
|
|
6
|
+
`,"utf8"),o}readEvents(e){let t=this.eventsPath(e);return Rt(t)?Pe(t,"utf8").split(/\r?\n/).filter(Boolean).flatMap(r=>{try{return[JSON.parse(r)]}catch{return[]}}):[]}writeRun(e){Re(this.runPath(e.runId),e)}definitionsDir(){return P(this.rootDir,"definitions")}runsDir(){return P(this.rootDir,"runs")}runPath(e){return P(this.runsDir(),W(e),"run.json")}eventsPath(e){return P(this.runsDir(),W(e),"events.jsonl")}},ve=class{constructor(e=new Y,t=new T){this.store=e;this.planner=t}store;planner;async run(e,t){let r=this.planner.plan(e),n=this.store.createRun(e);n=this.store.updateRun(n.runId,a=>({...a,status:"running"})),this.store.appendEvent(n.runId,"workflow_started",{waves:r.waves.length});let o=Math.max(1,Math.trunc(e.maxConcurrency??4)),i=!1;for(let a of r.waves)for(let u=0;u<a.length;u+=o){let R=a.slice(u,u+o);await Promise.all(R.map(async p=>{let c=e.nodes.find(d=>d.id===p);if((c.dependsOn??[]).some(d=>this.store.getRun(n.runId)?.nodes[d]?.status!=="completed")||i&&e.failFast!==!1){this.store.updateRun(n.runId,d=>({...d,nodes:{...d.nodes,[p]:{status:"skipped",completedAt:new Date().toISOString()}}})),this.store.appendEvent(n.runId,"node_skipped",{},p);return}let h=new Date().toISOString();n=this.store.updateRun(n.runId,d=>({...d,nodes:{...d.nodes,[p]:{status:"running",startedAt:h}}})),this.store.appendEvent(n.runId,"node_started",{},p);try{let d=await t(c,{run:n,definition:e});this.store.updateRun(n.runId,l=>({...l,nodes:{...l.nodes,[p]:{status:"completed",startedAt:h,completedAt:new Date().toISOString(),output:d}}})),this.store.appendEvent(n.runId,"node_completed",{},p)}catch(d){i=!0;let l=d instanceof Error?d.message:String(d);this.store.updateRun(n.runId,E=>({...E,nodes:{...E.nodes,[p]:{status:"failed",startedAt:h,completedAt:new Date().toISOString(),error:l}}})),this.store.appendEvent(n.runId,"node_failed",{error:l},p)}}))}return n=this.store.updateRun(n.runId,a=>({...a,status:i?"failed":"completed",completedAt:new Date().toISOString()})),this.store.appendEvent(n.runId,i?"workflow_failed":"workflow_completed",{}),n}};import{randomUUID as St}from"node:crypto";var Ae=class{constructor(e=1e4){this.maxEvents=e;if(!Number.isInteger(e)||e<1)throw new Error("maxEvents must be a positive integer.")}maxEvents;sources=new Map;events=[];register(e){if(!e.id.trim())throw new Error("Monitor source id cannot be empty.");if(this.sources.has(e.id))throw new Error(`Monitor source already registered: ${e.id}`);return this.sources.set(e.id,{source:e,running:!1}),this}async start(e,t=1e3){let r=this.require(e);if(r.running)return this.snapshot(e);await r.source.start?.(),r.running=!0,await this.poll(e);let n=Math.max(25,Math.trunc(t));return r.timer=setInterval(()=>{this.poll(e).catch(()=>{})},n),r.timer.unref?.(),this.snapshot(e)}async poll(e){let n=(await this.require(e).source.poll()).map(o=>({schemaVersion:1,eventId:`monitor_event_${St()}`,sourceId:e,type:o.type,timestamp:o.timestamp??new Date().toISOString(),payload:o.payload}));return this.events.push(...n),this.events.length>this.maxEvents&&this.events.splice(0,this.events.length-this.maxEvents),n}async stop(e){let t=this.require(e);return t.timer&&clearInterval(t.timer),t.timer=void 0,t.running&&await t.source.stop?.(),t.running=!1,this.snapshot(e)}async stopAll(){await Promise.all([...this.sources.keys()].map(e=>this.stop(e)))}snapshot(e,t=100){let r=this.require(e);return{sourceId:e,running:r.running,events:this.events.filter(n=>n.sourceId===e).slice(-Math.max(0,Math.trunc(t)))}}list(){return[...this.sources].map(([e,t])=>({sourceId:e,running:t.running}))}require(e){let t=this.sources.get(e);if(!t)throw new Error(`Monitor source not found: ${e}`);return t}},Se=class{constructor(e){this.manager=e}manager;execute(e){return this.manager.start(e.sourceId,e.intervalMs)}},xe=class{constructor(e){this.manager=e}manager;execute(e){return this.manager.stop(e.sourceId)}};import{randomUUID as xt}from"node:crypto";import{appendFileSync as It,existsSync as Et,mkdirSync as Dt,readFileSync as bt}from"node:fs";import{dirname as Tt,join as Mt}from"node:path";function y(s){return Number.isFinite(s)?Math.max(0,s??0):0}var ee=class{totalsValue={inputTokens:0,outputTokens:0,totalTokens:0,cachedInputTokens:0,estimatedCostUsd:0,events:0};add(e){let t=y(e.inputTokens),r=y(e.outputTokens);return this.totalsValue.inputTokens+=t,this.totalsValue.outputTokens+=r,this.totalsValue.totalTokens+=t+r,this.totalsValue.cachedInputTokens+=y(e.cachedInputTokens),this.totalsValue.estimatedCostUsd+=y(e.estimatedCostUsd),this.totalsValue.events+=1,this}snapshot(){return{...this.totalsValue}}};function _t(s,e){if(["runId","sessionId","workflowRunId","agentId","provider","model"].some(n=>e[n]!==void 0&&s[n]!==e[n]))return!1;let r=Date.parse(s.timestamp);return!(e.from&&r<Date.parse(e.from)||e.to&&r>Date.parse(e.to))}var Ie=class{path;constructor(e=Mt(v(),"usage","events.jsonl")){this.path=e,Dt(Tt(e),{recursive:!0})}append(e){let t={...e,schemaVersion:1,eventId:`usage_${xt()}`,timestamp:e.timestamp??new Date().toISOString(),inputTokens:y(e.inputTokens),outputTokens:y(e.outputTokens),...e.cachedInputTokens!==void 0?{cachedInputTokens:y(e.cachedInputTokens)}:{},...e.estimatedCostUsd!==void 0?{estimatedCostUsd:y(e.estimatedCostUsd)}:{}};return It(this.path,`${JSON.stringify(t)}
|
|
7
|
+
`,"utf8"),t}query(e={}){return Et(this.path)?bt(this.path,"utf8").split(/\r?\n/).filter(Boolean).flatMap(t=>{try{let r=JSON.parse(t);return _t(r,e)?[r]:[]}catch{return[]}}):[]}summarize(e={}){let t=new ee;for(let r of this.query(e))t.add(r);return t.snapshot()}},Ee=class{constructor(e){this.adapter=e}adapter;export(e){for(let t of e){let r={...t.provider?{provider:t.provider}:{},...t.model?{model:t.model}:{}};this.adapter.addCounter("xeno.usage.input_tokens",t.inputTokens,r),this.adapter.addCounter("xeno.usage.output_tokens",t.outputTokens,r),t.cachedInputTokens&&this.adapter.addCounter("xeno.usage.cached_input_tokens",t.cachedInputTokens,r),t.estimatedCostUsd&&this.adapter.addCounter("xeno.usage.estimated_cost_usd",t.estimatedCostUsd,r),this.adapter.recordEvent?.("xeno.usage.recorded",r)}}};import{randomUUID as re}from"node:crypto";import{existsSync as C,mkdirSync as q,readFileSync as Ct,readdirSync as K,renameSync as Ot,rmSync as z,statSync as $t,writeFileSync as Nt}from"node:fs";import{hostname as Ut,userInfo as Vt}from"node:os";import{join as g}from"node:path";var k=2,Wt=3e4,Lt=1440*60*1e3,De={unknown:0,plan:0,default:1,acceptEdits:2,bypassPermissions:3},M={maxPerSenderPerWindow:20,windowMs:6e4,maxQueuedPerRecipient:50,maxHeldPerRecipient:20,maxChainDepth:8},qt={queued:["held","received","refused","expired","cancelled"],held:["queued","received","refused","expired","cancelled"],received:[],refused:[],expired:[],cancelled:[]},Ft={offered:["accepted","cancelled","blocked"],accepted:["running","cancelled","blocked"],running:["completed","failed","cancelled","recovery-required"],blocked:["accepted","cancelled"],"recovery-required":["cancelled"],completed:[],failed:[],cancelled:[]},jt=["completed","failed","cancelled"];function F(s){return jt.includes(s)}function Ht(s,e){return De[s]>De[e]}function Hr(s){switch((s??"").trim()){case"plan":case"default":case"acceptEdits":case"bypassPermissions":return s;case"full-access":return"bypassPermissions";default:return"unknown"}}function Te(s){return s.replace(/[^a-z0-9]/giu,"").slice(-6).toLowerCase()||s}function te(s){let e=`[${Te(s.sessionId)}]`;return s.name?`${s.name} \u2442 ${e}`:`unnamed \u2442 ${e}`}function j(s){return s.normalize("NFC").replace(/\s+/gu," ").trim().toLowerCase()}function Jr(s,e,t){let r=e.trim();if(!r)return{kind:"unknown"};let n=s.filter(c=>c.sessionId!==t),o=n.find(c=>c.sessionId===r);if(o)return{kind:"resolved",peer:o};let i=/^(.*?)\s*(?:⑂\s*)?\[([a-z0-9]{4,})\]\s*$/iu.exec(r),a=(i?i[2]:r).toLowerCase(),u=n.filter(c=>Te(c.sessionId)===a||!i&&/^[a-z0-9]{6,}$/iu.test(r)&&c.sessionId.toLowerCase().startsWith(r.toLowerCase()));if(i){let c=i[1]?j(i[1]):"",f=u.filter(h=>!c||j(h.name??"")===c);return f.length===1?{kind:"resolved",peer:f[0]}:f.length>1?{kind:"ambiguous",candidates:f}:{kind:"unknown"}}if(u.length===1)return{kind:"resolved",peer:u[0]};if(u.length>1)return{kind:"ambiguous",candidates:u};let R=j(r),p=n.filter(c=>c.name&&j(c.name)===R);if(p.length===1)return{kind:"resolved",peer:p[0]};if(p.length>1){let c=p.filter(f=>f.state!=="offline");return c.length===1?{kind:"resolved",peer:c[0]}:{kind:"ambiguous",candidates:p}}return{kind:"unknown"}}function A(s){return new Date(s).toISOString()}function S(s){try{return JSON.parse(Ct(s,"utf8"))}catch{return null}}function H(s,e){let t=`${s}.${process.pid}.${re().slice(0,8)}.tmp`;Nt(t,`${JSON.stringify(e,null,2)}
|
|
8
|
+
`,"utf8");try{Ot(t,s)}catch(r){throw z(t,{force:!0}),r}}function I(s){let e=s.replace(/[^A-Za-z0-9._-]/gu,"_");if(!e||e==="."||e==="..")throw new Error(`Invalid identifier: ${s}`);return e}function J(s){return C(s)?K(s).filter(e=>e.endsWith(".json")).map(e=>g(s,e)):[]}var Jt=new Int32Array(new SharedArrayBuffer(4));function _(s,e,t){let r=Date.now()+5e3;for(;;){let n;try{n=x(s,e,String(k))}catch(o){if(!/already locked/u.test(o instanceof Error?o.message:String(o))||Date.now()>r)throw o;Atomics.wait(Jt,0,0,10);continue}try{return t()}finally{n.release()}}}function Kt(){return g(v(),"control-plane","peers")}var be=class{directory;now;options;constructor(e=Kt(),t={}){this.directory=e,this.now=t.now??(()=>Date.now()),this.options={maxPerSenderPerWindow:t.maxPerSenderPerWindow??M.maxPerSenderPerWindow,windowMs:t.windowMs??M.windowMs,maxQueuedPerRecipient:t.maxQueuedPerRecipient??M.maxQueuedPerRecipient,maxHeldPerRecipient:t.maxHeldPerRecipient??M.maxHeldPerRecipient,maxChainDepth:t.maxChainDepth??M.maxChainDepth,presenceTtlMs:t.presenceTtlMs??Wt,defaultTtlMs:t.defaultTtlMs??Lt},q(g(this.directory,"presence"),{recursive:!0}),q(g(this.directory,"mailbox"),{recursive:!0}),q(g(this.directory,"locks"),{recursive:!0})}presencePath(e){return g(this.directory,"presence",`${I(e)}.json`)}presenceLock(e){return g(this.directory,"locks",`presence-${I(e)}.lock`)}registerSession(e){let t=A(this.now()),r={schemaVersion:k,sessionId:e.sessionId,incarnationId:e.incarnationId??`inc_${re().replaceAll("-","").slice(0,16)}`,...e.name?{name:e.name}:{},host:Ut(),owner:zt(),pid:process.pid,workspace:e.workspace,surface:e.surface??"cli",state:e.state??"idle",inboundPolicy:e.inboundPolicy??"accept",posture:e.posture??"unknown",capabilities:[...e.capabilities??[]],startedAt:t,heartbeatAt:t};return _(this.presenceLock(e.sessionId),"peer-presence",()=>(H(this.presencePath(e.sessionId),r),r))}heartbeat(e,t,r={}){return _(this.presenceLock(e),"peer-presence",()=>{let n=S(this.presencePath(e));if(!n||n.schemaVersion!==k||n.incarnationId!==t)return null;let o={...n,...Bt(r),heartbeatAt:A(this.now())};return r.name===void 0&&"name"in r&&delete o.name,H(this.presencePath(e),o),o})}unregisterSession(e,t){return _(this.presenceLock(e),"peer-presence",()=>{let r=S(this.presencePath(e));return!r||r.incarnationId!==t?!1:(z(this.presencePath(e),{force:!0}),!0)})}getPresence(e){let t=S(this.presencePath(e));return t&&t.schemaVersion===k?this.withLiveness(t):null}listSessions(e={}){let t=[];for(let r of J(g(this.directory,"presence"))){let n=S(r);if(!n||n.schemaVersion!==k)continue;let o=this.withLiveness(n);o.state==="offline"&&e.includeOffline===!1||t.push(o)}return t.sort((r,n)=>(r.name??"").localeCompare(n.name??"")||r.sessionId.localeCompare(n.sessionId))}withLiveness(e){return Date.parse(e.heartbeatAt)+this.options.presenceTtlMs<this.now()?{...e,state:"offline"}:e}mailboxDir(e){return g(this.directory,"mailbox",I(e))}messagePath(e,t){return g(this.mailboxDir(e),`${I(t)}.json`)}messageLock(e){return g(this.directory,"locks",`message-${I(e)}.lock`)}send(e){let t=e.text.trim();if(!t)return{status:"refused",reason:"A message needs text."};if(!e.from.sessionId||!e.to.sessionId)return{status:"refused",reason:"A message needs a sender and a recipient session."};if(e.from.sessionId===e.to.sessionId)return{status:"refused",reason:"A session cannot message itself."};let r=this.getPresence(e.to.sessionId);if(!r)return{status:"refused",reason:`Unknown peer session ${e.to.sessionId}; it has never registered here.`};let n=this.getPresence(e.from.sessionId),o=this.now();if(this.listSent(e.from.sessionId).filter(l=>Date.parse(l.createdAt)>o-this.options.windowMs).length>=this.options.maxPerSenderPerWindow)return{status:"refused",reason:`Rate limit: ${this.options.maxPerSenderPerWindow} messages per ${Math.round(this.options.windowMs/1e3)}s.`};let a=0;if(e.causedBy){let l=this.find(e.causedBy);if(a=l?l.chainDepth+1:1,a>this.options.maxChainDepth)return{status:"refused",reason:`Causal chain depth ${a} exceeds ${this.options.maxChainDepth}; this exchange is looping.`}}if(e.idempotencyKey){let l=this.inbox(e.to.sessionId).find(E=>E.from.sessionId===e.from.sessionId&&E.idempotencyKey===e.idempotencyKey);if(l)return l.delivery.status==="held"?{status:"held",message:l,reason:l.delivery.reason??"held"}:{status:"queued",message:l}}let u=this.inbox(e.to.sessionId),R=u.filter(l=>l.delivery.status==="queued").length,p=u.filter(l=>l.delivery.status==="held").length,c=e.kind??"message",f=r.inboundPolicy==="hold"?`${te(r)} holds incoming messages for its human.`:r.inboundPolicy==="refuse"?void 0:n&&Ht(n.posture,r.posture)?`Sender runs with ${n.posture} and the receiver with ${r.posture}; a message never moves trust upward.`:void 0;if(r.inboundPolicy==="refuse")return{status:"refused",reason:`${te(r)} is not accepting messages.`};if(f?p>=this.options.maxHeldPerRecipient:R>=this.options.maxQueuedPerRecipient)return{status:"refused",reason:`${te(r)} has ${f?"too many held":"too many queued"} messages; try again after it drains.`};let h=A(o),d={schemaVersion:k,messageId:`msg_${re().replaceAll("-","").slice(0,20)}`,...e.idempotencyKey?{idempotencyKey:e.idempotencyKey}:{},kind:c,from:{sessionId:e.from.sessionId,...e.from.incarnationId?{incarnationId:e.from.incarnationId}:{},...e.from.name??n?.name?{name:e.from.name??n?.name}:{},...e.from.host??n?.host?{host:e.from.host??n?.host}:{},...e.from.workspace??n?.workspace?{workspace:e.from.workspace??n?.workspace}:{}},to:{sessionId:r.sessionId,...r.name?{name:r.name}:{},host:r.host,workspace:r.workspace},text:t,...e.correlationId?{correlationId:e.correlationId}:{},...e.causedBy?{causedBy:e.causedBy}:{},chainDepth:a,createdAt:h,updatedAt:h,expiresAt:A(o+(e.ttlMs??this.options.defaultTtlMs)),delivery:f?{status:"held",at:h,reason:f}:{status:"queued",at:h},...c==="task"?{task:{status:"offered",at:h}}:{}};return q(this.mailboxDir(r.sessionId),{recursive:!0}),_(this.messageLock(d.messageId),"peer-message",()=>{H(this.messagePath(r.sessionId,d.messageId),d)}),f?{status:"held",message:d,reason:f}:{status:"queued",message:d}}inbox(e){return J(this.mailboxDir(e)).map(t=>S(t)).filter(t=>!!t&&t.schemaVersion===k).sort((t,r)=>t.createdAt.localeCompare(r.createdAt)||t.messageId.localeCompare(r.messageId))}listSent(e){let t=[],r=g(this.directory,"mailbox");if(!C(r))return t;for(let n of K(r)){let o=g(r,n);if($t(o).isDirectory())for(let i of J(o)){let a=S(i);a&&a.schemaVersion===k&&a.from.sessionId===e&&t.push(a)}}return t.sort((n,o)=>n.createdAt.localeCompare(o.createdAt)||n.messageId.localeCompare(o.messageId))}find(e){let t=g(this.directory,"mailbox");if(!C(t))return null;let r=`${I(e)}.json`;for(let n of K(t)){let o=g(t,n,r);if(C(o)){let i=S(o);return i&&i.schemaVersion===k?i:null}}return null}mutate(e,t){return _(this.messageLock(e),"peer-message",()=>{let r=this.find(e);if(!r)throw new Error(`Unknown peer message ${e}.`);let n=t(r);return n.updatedAt=A(this.now()),H(this.messagePath(n.to.sessionId,n.messageId),n),n})}setDelivery(e,t,r={}){return this.mutate(e,n=>{if(!qt[n.delivery.status].includes(t))throw new Error(`Invalid peer delivery transition ${n.delivery.status} -> ${t} for ${e}.`);let o={status:t,at:A(this.now()),...r.reason?{reason:r.reason}:{},...r.incarnationId?{incarnationId:r.incarnationId}:{}},i={...n,delivery:o};return i.task&&!F(i.task.status)&&(t==="refused"||t==="expired"||t==="cancelled")&&(i.task={...i.task,status:"cancelled",at:o.at,endedAt:o.at,error:r.reason??`Delivery ${t}.`}),i})}release(e){return this.setDelivery(e,"queued",{reason:"Released by the receiving session."})}receive(e,t){return this.setDelivery(e,"received",{incarnationId:t})}setTask(e,t,r={}){return this.mutate(e,n=>{if(!n.task)throw new Error(`Peer message ${e} is a ${n.kind}, not a task.`);if(!Ft[n.task.status].includes(t))throw new Error(`Invalid peer task transition ${n.task.status} -> ${t} for ${e}.`);let o=A(this.now()),i={...n.task,status:t,at:o};return t==="running"&&(i.startedAt=o,r.executorIncarnationId&&(i.executorIncarnationId=r.executorIncarnationId)),(F(t)||t==="recovery-required")&&(i.endedAt=o),r.result!==void 0&&(i.result=r.result),r.error!==void 0&&(i.error=r.error),r.reportMessageId&&(i.reportMessageId=r.reportMessageId),{...n,task:i}})}requestCancel(e,t="Cancelled by sender."){let r=this.find(e);if(!r)throw new Error(`Unknown peer message ${e}.`);return r.delivery.status==="queued"||r.delivery.status==="held"?this.setDelivery(e,"cancelled",{reason:t}):r.task&&!F(r.task.status)?r.task.status==="offered"||r.task.status==="accepted"||r.task.status==="blocked"||r.task.status==="recovery-required"?this.setTask(e,"cancelled",{error:t}):this.mutate(e,n=>({...n,task:{...n.task,cancelRequestedAt:A(this.now())}})):r}expireStale(e){let t=this.now(),r=[];for(let n of this.inbox(e))(n.delivery.status==="queued"||n.delivery.status==="held")&&Date.parse(n.expiresAt)<=t&&r.push(this.setDelivery(n.messageId,"expired",{reason:"Not received before it expired."}));return r}reconcileAbandonedTasks(e,t){let r=[];for(let n of this.inbox(e)){let o=n.task;!o||o.status!=="running"||o.executorIncarnationId!==t&&r.push(this.setTask(n.messageId,"recovery-required",{error:`The executing process (incarnation ${o.executorIncarnationId??"unknown"}) exited before the task finished; inspect its side effects before re-delegating.`}))}return r}compact(e=10080*60*1e3){let t=this.now()-e,r=0,n=0,o=g(this.directory,"mailbox");if(C(o))for(let i of K(o))for(let a of J(g(o,i))){let u=S(a);if(!u)continue;u.delivery.status!=="queued"&&u.delivery.status!=="held"&&(!u.task||F(u.task.status)||u.task.status==="recovery-required")&&Date.parse(u.updatedAt)<t&&(z(a,{force:!0}),r+=1)}for(let i of this.listSessions())i.state==="offline"&&Date.parse(i.heartbeatAt)<t&&(z(this.presencePath(i.sessionId),{force:!0}),n+=1);return{messages:r,presence:n}}};function zt(){try{return Vt().username}catch{return process.env.USERNAME??process.env.USER??"unknown"}}function Bt(s){let e={};for(let[t,r]of Object.entries(s))r!==void 0&&(e[t]=r);return e}export{b as AGENT_DAEMON_PROTOCOL_VERSION,we as AgentDaemonClient,he as AgentDaemonServer,O as AgentEventStore,fe as AgentRunController,V as AgentRunStore,Ae as MonitorManager,xe as MonitorStopTool,Se as MonitorTool,Ee as OtelExporter,Lt as PEER_MESSAGE_DEFAULT_TTL_MS,Wt as PEER_PRESENCE_TTL_MS,k as PEER_SCHEMA_VERSION,jt as PEER_TASK_TERMINAL_STATUSES,be as PeerMessagingStore,ee as UsageAccumulator,Ie as UsageLedger,T as WorkflowPlanner,ve as WorkflowRuntime,Y as WorkflowStore,x as acquireControlPlaneLock,mt as createAgentRunId,Kt as defaultPeerDirectory,vr as getAgentRunDir,Rr as getAgentRunStoreDir,F as isPeerTaskTerminal,Ht as movesTrustUpward,Te as peerShortId,te as renderPeerLabel,Jr as resolvePeerTarget,Hr as toPeerPosture};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/control-plane/types.ts":{"bytes":2465,"imports":[],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/event-store.ts":{"bytes":2302,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"}],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/run-store.ts":{"bytes":11578,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/control-plane/event-store.ts","kind":"import-statement","original":"./event-store.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/controller.ts":{"bytes":4113,"imports":[{"path":"src/control-plane/run-store.ts","kind":"import-statement","original":"./run-store.js"}],"format":"esm"},"src/control-plane/daemon.ts":{"bytes":4922,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/workflow.ts":{"bytes":10111,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/monitor.ts":{"bytes":4008,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/usage.ts":{"bytes":5009,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/index.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/control-plane/types.ts":{"bytes":2465,"imports":[],"format":"esm"},"src/version.ts":{"bytes":195,"imports":[],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/event-store.ts":{"bytes":2302,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"}],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/run-store.ts":{"bytes":11578,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/control-plane/event-store.ts","kind":"import-statement","original":"./event-store.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/controller.ts":{"bytes":4113,"imports":[{"path":"src/control-plane/run-store.ts","kind":"import-statement","original":"./run-store.js"}],"format":"esm"},"src/control-plane/daemon.ts":{"bytes":4922,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/workflow.ts":{"bytes":10111,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/monitor.ts":{"bytes":4008,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/usage.ts":{"bytes":5009,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/peer-messaging.ts":{"bytes":35082,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"}],"format":"esm"},"src/control-plane/index.ts":{"bytes":309,"imports":[{"path":"src/control-plane/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/control-plane/run-store.ts","kind":"import-statement","original":"./run-store.js"},{"path":"src/control-plane/event-store.ts","kind":"import-statement","original":"./event-store.js"},{"path":"src/control-plane/controller.ts","kind":"import-statement","original":"./controller.js"},{"path":"src/control-plane/daemon.ts","kind":"import-statement","original":"./daemon.js"},{"path":"src/control-plane/workflow.ts","kind":"import-statement","original":"./workflow.js"},{"path":"src/control-plane/monitor.ts","kind":"import-statement","original":"./monitor.js"},{"path":"src/control-plane/usage.ts","kind":"import-statement","original":"./usage.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/control-plane/peer-messaging.ts","kind":"import-statement","original":"./peer-messaging.js"}],"format":"esm"}},"outputs":{"dist/control-plane/index.cjs":{"imports":[{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/control-plane/index.ts","inputs":{"src/control-plane/index.ts":{"bytesInOutput":804},"src/control-plane/run-store.ts":{"bytesInOutput":5458},"src/version.ts":{"bytesInOutput":15},"src/control-plane/lock.ts":{"bytesInOutput":1066},"src/control-plane/event-store.ts":{"bytesInOutput":1057},"src/utils/platform.ts":{"bytesInOutput":243},"src/control-plane/controller.ts":{"bytesInOutput":1690},"src/control-plane/daemon.ts":{"bytesInOutput":1937},"src/control-plane/workflow.ts":{"bytesInOutput":4805},"src/control-plane/monitor.ts":{"bytesInOutput":1819},"src/control-plane/usage.ts":{"bytesInOutput":2183},"src/control-plane/peer-messaging.ts":{"bytesInOutput":12949}},"bytes":35043}}}
|