@agimon-ai/po-core 0.0.0-alpha.72 → 0.0.0-alpha.73

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.
@@ -376,6 +376,7 @@ interface PoWorkflowRunState {
376
376
  readonly stage: PoWorkflowStage;
377
377
  readonly outcome?: PoWorkflowOutcome;
378
378
  readonly jobs: readonly PoWorkflowJobState[];
379
+ readonly children?: readonly PoWorkflowChildrenStatus[];
379
380
  }
380
381
  /** The parsed definition actually used, not a re-read of mutable YAML on disk. */
381
382
  interface PoWorkflowConfig {
@@ -391,6 +392,62 @@ interface PoWorkflowRunsService {
391
392
  /** Replays the latest state, including terminal state, before subsequent updates. */
392
393
  subscribe(runId: string, listener: (state: PoWorkflowRunState) => void): () => void;
393
394
  }
395
+ interface PoWorkflowChildInvocation {
396
+ readonly invocationId: string;
397
+ readonly job: string;
398
+ readonly state: 'running' | 'completed' | 'failed' | 'interrupted';
399
+ readonly sessionIds: readonly string[];
400
+ readonly startedAt: string;
401
+ readonly endedAt?: string;
402
+ readonly error?: string;
403
+ readonly usage?: PoHubSessionUsage;
404
+ }
405
+ interface PoWorkflowCriterionState {
406
+ readonly key: string;
407
+ readonly description: string;
408
+ readonly verifiedBy: string;
409
+ readonly status: 'unchecked' | 'checked' | 'not-met';
410
+ readonly feedback?: string;
411
+ readonly invocationId?: string;
412
+ }
413
+ interface PoWorkflowChildrenStatus {
414
+ readonly lead: string;
415
+ readonly continuations: number;
416
+ readonly maxContinuations: number;
417
+ readonly criteria: readonly PoWorkflowCriterionState[];
418
+ readonly invocations: readonly PoWorkflowChildInvocation[];
419
+ }
420
+ /** In-process, caller-bound capability. Never accepted from a tool or serialized. */
421
+ interface PoWorkflowChildrenSession {
422
+ readonly role: 'lead' | 'child' | 'consumer';
423
+ spawnChild?(input: {
424
+ job: string;
425
+ prompt: string;
426
+ inputs?: Record<string, string | number | boolean>;
427
+ }): Promise<PoWorkflowChildInvocation>;
428
+ childStatus?(input: {
429
+ invocationId: string;
430
+ }): Promise<PoWorkflowChildInvocation>;
431
+ children?(): Promise<PoWorkflowChildrenStatus>;
432
+ reportCriteria?(input: {
433
+ results: Record<string, {
434
+ status: 'checked' | 'not-met';
435
+ feedback?: string;
436
+ }>;
437
+ }): Promise<void>;
438
+ /** Immutable pre-review snapshot selected by the runtime, not mutable paths. */
439
+ reviewArtifacts?(): Promise<{
440
+ revision: string;
441
+ artifacts: Readonly<Record<string, string>>;
442
+ }>;
443
+ /** Returns exactly the accepted bytes, after a fresh authoritative ledger/revision check. */
444
+ acceptedArtifacts?(input: {
445
+ job: string;
446
+ }): Promise<{
447
+ revision: string;
448
+ artifacts: Readonly<Record<string, string>>;
449
+ }>;
450
+ }
394
451
  /** Bound only in the trusted step-session bootstrap, before packages mount. */
395
452
  interface PoWorkflowContextService {
396
453
  readonly run: PoWorkflowRunRef;
@@ -404,6 +461,7 @@ interface PoWorkflowContextService {
404
461
  /** Absolute path of the workflow's instructions file, read in place of the discovered AGENTS.md files. */
405
462
  readonly instructions?: string;
406
463
  readonly state: PoWorkflowRunsService;
464
+ readonly children?: PoWorkflowChildrenSession;
407
465
  }
408
466
  declare module '@deepseek-ai/cordis' {
409
467
  interface Context {
@@ -414,6 +472,20 @@ declare module '@deepseek-ai/cordis' {
414
472
  }
415
473
  }
416
474
  //#endregion
475
+ //#region src/schemas/hubChannel.d.ts
476
+ /** Exclusive usage of one session. Missing measurements are unknown, never zero. */
477
+ interface PoHubSessionUsage {
478
+ readonly tokens?: {
479
+ readonly input: number;
480
+ readonly output: number;
481
+ readonly cacheRead: number;
482
+ readonly cacheWrite: number;
483
+ readonly total: number;
484
+ };
485
+ readonly costUsd?: number;
486
+ readonly toolCount?: number;
487
+ }
488
+ //#endregion
417
489
  //#region src/schemas/packageApi.d.ts
418
490
  /** Where an API runs: inside one session's server, or in the machine-wide hub. */
419
491
  type PoApiScope = 'global' | 'workspace' | 'session';
@@ -1 +1 @@
1
- {"version":3,"file":"apiContracts.d.mts","names":["_0","_0","_0","IoContext","_0","_$__protocolContracts0.ChordMethods"],"sources":["../src/schemas/serverScope.ts","../src/schemas/approvalPrompt.ts","../src/schemas/approval.ts","../src/schemas/backgroundWork.ts","../src/schemas/platform.ts","../src/schemas/workflow.ts","../src/schemas/packageApi.ts","../src/schemas/serverBundle.ts","../src/schemas/apiContracts.ts","../src/services/apiContracts/index.ts","../src/schemas/builtinApiContracts.ts","../src/schemas/httpApiContracts.ts","../src/schemas/protocolContracts.ts","../src/schemas/sessionProtocol.ts","../src/schemas/sessionApiContracts.ts","../src/schemas/transportApiContracts.ts"],"mappings":";;;;;;;;;;UAiBiB,kBAAkB;WACxB;WACA,OAAO;;WAEP,QAAQ;;;KAQP;;UAoBK,sBAAsB;WAC5B,OAAO;EAChB,WAAW;;;UAII,oBAAoB;EACnC,QAAQ,GACN,KAAK,qBACL,cAAc,IAAI,QAAQ,IAC1B,WAAW,OAAO,aAAa,gBAC9B,QAAQ,sBAAsB;;EAEjC,IAAI,OAAO;;EAEX,MAAM,MAAM,sBAAsB;;;UAInB;WACN,OAAO;;;;;;EAMhB,QAAQ,GAAG,UAAU,kBAAkB,IAAI,OAAO,IAAI,cAAc;;EAEpE,QAAQ,GAAG,UAAU,kBAAkB,KAAK;;EAE5C,KAAK,gBAAgB,QAAQ,MAAM,MAAM,MAAM,WAAW,OAAO;;EAEjE,UAAU,gBAAgB,QAAQ,MAAM,MAAM,MAAM,WAAW,OAAO;;EAEtE,OAAO,QAAQ,gBAAgB,oBAAoB;;;YAIzC;IACR,mBAAmB;;;;;;UCxEN;WACN;WACA;WACA;aAA8B;aAAwB;;;UAGhD;WACN;;WAEA;;;;UCGM;WACN;;WAEA;WACA,WAAW;WACX;WACA,aAAa;;WAEb;;WAEA;;UAKM;WACN;WACA,WAAW;;WAEX;WACA;;;KAIC,sBAAsB,MAAM,gBAAgB,QAAQ,gBAAgB;;;;;UAM/D;EACf,OAAO,SAAS,oBAAoB;aAAmB;;EACvD,iBAAiB,MA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,KAAA,YAAA,KAAA,WAAA,KAAA,QAAA,KAAA,eAAA,KAAA,WAAA,KAAA,QAAA,KAAA,eAAA,KAAA,QAAA,KAAA,OAAA,KAAA,QAAA,KAAA,SAAA,KAAA,aAAA,KAAA,YAAA,KAAA,YAAA,KAAA,QAAA,KAAA,eAAA,KAAA,YAAA,KAAA,QAAA,KAAA,eAAA,KAAA,QAAA,KAAA,OAAA,KAAA,QAAA,KAAA,SAAA,KAAA,aAAA,KAAA,YAAA,KAAA,UAAA,KAAA,UAAA,KAAA,OAAA,KAAA,aAAA,KAAA,QAAA,KAAA,eAAA,KAAA,UAAA,KAAA,UAAA,KAAA,OAAA,KAAA,aAAA,KAAA,QAAA,KAAA,eAAA,KAAA,QAAA,KAAA,OAAA,KAAA,QAAA,KAAA,SAAA,KAAA,aAAA,KAAA,YAAA,KAAA,OAAA,KAAA,aAAA,KAAA,QAAA,KAAA,eAAA,KAAA,OAAA,KAAA,aAAA,KAAA,QAAA,KAAA,eAAA,KAAA,UAAA,KAAA,OAAA,KAAA,QAAA,KAAA,SAAA,KAAA;;qBAqCjB,wBAAsB,KAAA,QAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAwBtB,wBAAsB,KAAA,QAAA,KAAA"}
1
+ {"version":3,"file":"apiContracts.d.mts","names":["_0","_0","_0","IoContext","_0","_$__hubChannel0.PoHubSessionUsage","_$__protocolContracts0.ChordMethods"],"sources":["../src/schemas/serverScope.ts","../src/schemas/approvalPrompt.ts","../src/schemas/approval.ts","../src/schemas/backgroundWork.ts","../src/schemas/platform.ts","../src/schemas/workflow.ts","../src/schemas/hubChannel.ts","../src/schemas/packageApi.ts","../src/schemas/serverBundle.ts","../src/schemas/apiContracts.ts","../src/services/apiContracts/index.ts","../src/schemas/builtinApiContracts.ts","../src/schemas/httpApiContracts.ts","../src/schemas/protocolContracts.ts","../src/schemas/sessionProtocol.ts","../src/schemas/sessionApiContracts.ts","../src/schemas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KAAA,QAAA,KAAA,iBAAA,KAAA,QAAA,KAAA,eAAA,KAAA,QAAA,KAAA,OAAA,KAAA,QAAA,KAAA,SAAA,KAAA,aAAA,KAAA,YAAA,KAAA,WAAA,KAAA,QAAA,KAAA,eAAA,KAAA,WAAA,KAAA,QAAA,KAAA,eAAA,KAAA,QAAA,KAAA,OAAA,KAAA,QAAA,KAAA,SAAA,KAAA,aAAA,KAAA,YAAA,KAAA,YAAA,KAAA,QAAA,KAAA,eAAA,KAAA,YAAA,KAAA,QAAA,KAAA,eAAA,KAAA,QAAA,KAAA,OAAA,KAAA,QAAA,KAAA,SAAA,KAAA,aAAA,KAAA,YAAA,KAAA,UAAA,KAAA,UAAA,KAAA,OAAA,KAAA,aAAA,KAAA,QAAA,KAAA,eAAA,KAAA,UAAA,KAAA,UAAA,KAAA,OAAA,KAAA,aAAA,KAAA,QAAA,KAAA,eAAA,KAAA,QAAA,KAAA,OAAA,KAAA,QAAA,KAAA,SAAA,KAAA,aAAA,KAAA,YAAA,KAAA,OAAA,KAAA,aAAA,KAAA,QAAA,KAAA,eAAA,KAAA,OAAA,KAAA,aAAA,KAAA,QAAA,KAAA,eAAA,KAAA,UAAA,KAAA,OAAA,KAAA,QAAA,KAAA,SAAA,KAAA;;qBAqCjB,wBAAsB,KAAA,QAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAwBtB,wBAAsB,KAAA,QAAA,KAAA"}
@@ -1,3 +1,3 @@
1
1
  import { HOME_ENTITY_LIMIT, HOME_KINDS, HOME_PAGE_LIMIT, HomeContribution, HomeCoverage, HomeEntity, HomeItem, HomeKind, HomeProjection, HomeRequest, HomeSnapshot, HomeSourceStatus, parseHomeContribution, parseHomeEntity, parseHomeProjection, parseHomeSnapshot } from "./src/schemas/home.mjs";
2
- import { PO_SESSION_ATTENTION_EVENT, PoComputerUseHostBinding, PoComputerUseHostOperation, PoComputerUseHostRequest, PoComputerUseSessionAccess, PoDirectEventBus, PoDirectEventSubscriptionOptions, PoHubChannel, PoHubChannelConnection, PoHubChannelFrame, PoHubChannelHost, PoHubChannelLifecycle, PoHubChannelSource, PoHubDormantSession, PoHubReservedWorktreeProvisioner, PoHubReservedWorktreeRequest, PoHubSessionApiRequest, PoHubSessionCreateRequest, PoHubSessionExecutionState, PoHubSessionPromptOptions, PoHubSessionPromptReceipt, PoHubSessionReservations, PoHubSessionScope, PoHubSessionSelection, PoHubSessionService, PoHubWorkspace, PoPendingSessionSetup, PoSessionActivity, PoSessionAttention, PoSessionCommunicationEndpoint, PoSessionContext, PoSessionPeerDescription, REMOTE_CONVERSATION_SESSION_PROVENANCE, VOICE_ORCHESTRATOR_SESSION_PROVENANCE, WORKFLOW_DISPATCHER_SESSION_PROVENANCE, WORKFLOW_STEP_SESSION_PROVENANCE } from "./src/schemas/hubChannel.mjs";
3
- export { HOME_ENTITY_LIMIT, HOME_KINDS, HOME_PAGE_LIMIT, HomeContribution, HomeCoverage, HomeEntity, HomeItem, HomeKind, HomeProjection, HomeRequest, HomeSnapshot, HomeSourceStatus, PO_SESSION_ATTENTION_EVENT, PoComputerUseHostBinding, PoComputerUseHostOperation, PoComputerUseHostRequest, PoComputerUseSessionAccess, PoDirectEventBus, PoDirectEventSubscriptionOptions, PoHubChannel, PoHubChannelConnection, PoHubChannelFrame, PoHubChannelHost, PoHubChannelLifecycle, PoHubChannelSource, PoHubDormantSession, PoHubReservedWorktreeProvisioner, PoHubReservedWorktreeRequest, PoHubSessionApiRequest, PoHubSessionCreateRequest, PoHubSessionExecutionState, PoHubSessionPromptOptions, PoHubSessionPromptReceipt, PoHubSessionReservations, PoHubSessionScope, PoHubSessionSelection, PoHubSessionService, PoHubWorkspace, PoPendingSessionSetup, PoSessionActivity, PoSessionAttention, PoSessionCommunicationEndpoint, PoSessionContext, PoSessionPeerDescription, REMOTE_CONVERSATION_SESSION_PROVENANCE, VOICE_ORCHESTRATOR_SESSION_PROVENANCE, WORKFLOW_DISPATCHER_SESSION_PROVENANCE, WORKFLOW_STEP_SESSION_PROVENANCE, parseHomeContribution, parseHomeEntity, parseHomeProjection, parseHomeSnapshot };
2
+ import { PO_SESSION_ATTENTION_EVENT, PoComputerUseHostBinding, PoComputerUseHostOperation, PoComputerUseHostRequest, PoComputerUseSessionAccess, PoDirectEventBus, PoDirectEventSubscriptionOptions, PoHubChannel, PoHubChannelConnection, PoHubChannelFrame, PoHubChannelHost, PoHubChannelLifecycle, PoHubChannelSource, PoHubDormantSession, PoHubReservedWorktreeProvisioner, PoHubReservedWorktreeRequest, PoHubSessionApiRequest, PoHubSessionCreateRequest, PoHubSessionExecutionState, PoHubSessionPromptOptions, PoHubSessionPromptReceipt, PoHubSessionReservations, PoHubSessionScope, PoHubSessionSelection, PoHubSessionService, PoHubSessionUsage, PoHubWorkspace, PoPendingSessionSetup, PoSessionActivity, PoSessionAttention, PoSessionCommunicationEndpoint, PoSessionContext, PoSessionPeerDescription, REMOTE_CONVERSATION_SESSION_PROVENANCE, VOICE_ORCHESTRATOR_SESSION_PROVENANCE, WORKFLOW_DISPATCHER_SESSION_PROVENANCE, WORKFLOW_STEP_SESSION_PROVENANCE } from "./src/schemas/hubChannel.mjs";
3
+ export { HOME_ENTITY_LIMIT, HOME_KINDS, HOME_PAGE_LIMIT, HomeContribution, HomeCoverage, HomeEntity, HomeItem, HomeKind, HomeProjection, HomeRequest, HomeSnapshot, HomeSourceStatus, PO_SESSION_ATTENTION_EVENT, PoComputerUseHostBinding, PoComputerUseHostOperation, PoComputerUseHostRequest, PoComputerUseSessionAccess, PoDirectEventBus, PoDirectEventSubscriptionOptions, PoHubChannel, PoHubChannelConnection, PoHubChannelFrame, PoHubChannelHost, PoHubChannelLifecycle, PoHubChannelSource, PoHubDormantSession, PoHubReservedWorktreeProvisioner, PoHubReservedWorktreeRequest, PoHubSessionApiRequest, PoHubSessionCreateRequest, PoHubSessionExecutionState, PoHubSessionPromptOptions, PoHubSessionPromptReceipt, PoHubSessionReservations, PoHubSessionScope, PoHubSessionSelection, PoHubSessionService, PoHubSessionUsage, PoHubWorkspace, PoPendingSessionSetup, PoSessionActivity, PoSessionAttention, PoSessionCommunicationEndpoint, PoSessionContext, PoSessionPeerDescription, REMOTE_CONVERSATION_SESSION_PROVENANCE, VOICE_ORCHESTRATOR_SESSION_PROVENANCE, WORKFLOW_DISPATCHER_SESSION_PROVENANCE, WORKFLOW_STEP_SESSION_PROVENANCE, parseHomeContribution, parseHomeEntity, parseHomeProjection, parseHomeSnapshot };
@@ -1 +1 @@
1
- {"version":3,"file":"hubChannel.cjs","names":[],"sources":["../../../src/schemas/hubChannel.ts"],"sourcesContent":["import type { PoApprovalPrompt } from './approval';\nimport type { PoBackgroundWorkSnapshot } from './backgroundWork';\nimport type { HomeProjection } from './home';\nimport type { PoSessionStorageService } from './platform';\nimport type { PoWorkflowContextService } from './workflow';\n\n/** Compact host-wide session attention, published over the existing direct event bus. */\nexport const PO_SESSION_ATTENTION_EVENT = 'po.session.attention';\n\nexport interface PoSessionAttention {\n readonly name?: string;\n readonly phase: 'idle' | 'turn' | 'compaction' | 'retry';\n readonly awaitingInput: boolean;\n readonly settledAt?: string;\n readonly dialog?: {\n readonly id: string;\n readonly title: string;\n readonly message?: string;\n readonly purpose?: 'feedback';\n /** Present only on an approval dialog: the bounded card text, never the call's arguments. */\n readonly approval?: PoApprovalPrompt;\n };\n}\n\nexport interface PoHubChannelFrame {\n type: string;\n sessionId: string;\n payload: unknown;\n}\n\n/** Same-process lifecycle bus shared by a host's session APIs and hub channels. */\nexport interface PoDirectEventSubscriptionOptions {\n /** Replay the most recent value published for this frame and session, when one exists. */\n readonly replayLatest?: boolean;\n}\n\nexport interface PoDirectEventBus {\n publish(frameType: string, sessionId: string, payload: unknown): void;\n subscribe(\n frameType: string,\n sessionId: string,\n listener: (payload: unknown) => void,\n options?: PoDirectEventSubscriptionOptions,\n ): () => void;\n /** Drop retained state for a session after its lifecycle ends. */\n clearSession?(sessionId: string): void;\n close(): void;\n}\n\n/**\n * The extension-agnostic baseline every surface gets for one session, computed once by the\n * session host. Extensions build on it instead of re-deriving roots and relations from cwd.\n */\nexport interface PoSessionContext {\n readonly sessionId: string;\n /** Persisted workspace id, shared by every session and member checkout of the workspace. */\n readonly workspaceId: string;\n /** The admitted workspace root. It owns configuration, composition and settings. */\n readonly workspaceRoot: string;\n /**\n * The checkout the session executes in. Equals workspaceRoot unless the session runs in a\n * member checkout, such as a worktree, which may live outside the workspace folder.\n */\n readonly checkoutRoot: string;\n readonly cwd: string;\n readonly parentSessionId?: string;\n /** The spawner's label for the session. Approval policy never interprets it. */\n readonly provenance?: string;\n /** Host-set presence. Absent means interactive; tool input cannot set it. */\n readonly interaction?: 'interactive' | 'unattended';\n}\n\nexport interface PoHubSessionScope {\n sessionId: string;\n workspaceId?: string;\n cwd: string;\n /** Environment admitted for this session, when supplied by the host. */\n environment?: Readonly<Record<string, string | undefined>>;\n /** The session's baseline context, when its host knows its workspace. */\n sessionContext?: PoSessionContext;\n}\n\nexport interface PoHubReservedWorktreeRequest {\n readonly reservationId: string;\n readonly parentSessionId: string;\n readonly signal?: AbortSignal;\n}\n\nexport type PoHubReservedWorktreeProvisioner = (request: PoHubReservedWorktreeRequest) => Promise<PoHubSessionScope>;\n\n/** Selection axes a caller pins for a new session instead of the workspace defaults. */\nexport interface PoHubSessionSelection {\n readonly majorMode?: string;\n readonly minorModes?: readonly string[];\n readonly profile?: string;\n /** An empty list starts the session with no domains. */\n readonly domains?: readonly string[];\n}\n\n/**\n * Provenance of a session a workflow step opened.\n *\n * The step's conversation belongs to the workflow that ran it and is read in\n * that workflow's view, so the session rail leaves such sessions out.\n */\nexport const WORKFLOW_STEP_SESSION_PROVENANCE = 'workflow';\n\n/**\n * Provenance of a session opened to launch workflows for its parent.\n *\n * It picks and starts work, then closes; the runs it started belong to its\n * parent. Like a detached helper, it takes no row in the session rail.\n */\nexport const WORKFLOW_DISPATCHER_SESSION_PROVENANCE = 'workflow-dispatcher';\n\n/** Provenance of a conversation an external MCP client opened and drives. */\nexport const REMOTE_CONVERSATION_SESSION_PROVENANCE = 'remote-conversation';\n\n/** Provenance of the host-wide Voice conversation that relays between the person and other sessions. */\nexport const VOICE_ORCHESTRATOR_SESSION_PROVENANCE = 'voice-orchestrator';\n\n/** A stopped session that keeps its record and can be revived. */\nexport interface PoHubDormantSession {\n readonly sessionId: string;\n readonly name: string;\n readonly workspaceId: string;\n readonly sessionProvenance?: string;\n}\n\nexport interface PoHubSessionCreateRequest {\n /** Global mount only: pins a new top-level session to an admitted workspace. The host validates cwd membership. */\n readonly workspaceId?: string;\n readonly cwd: string;\n readonly name: string;\n readonly parentSessionId?: string;\n readonly sessionProvenance?: string;\n /** Trusted server-side spawner only, never accepted from public HTTP or tool input. */\n readonly interaction?: 'interactive' | 'unattended';\n readonly signal?: AbortSignal;\n /** Host-issued reservation, not a caller-chosen target session id. */\n readonly reservationId?: string;\n /** Pinned axes stay put when the workspace defaults change between turns. */\n readonly selection?: PoHubSessionSelection;\n /** Pi model selector, `provider/id`, validated like `--model`. */\n readonly model?: string;\n /** Pi thinking level, validated like `--thinking`. */\n readonly thinking?: string;\n /** Text appended to the session's system prompt, like `--append-system-prompt`. */\n readonly appendSystemPrompt?: string;\n /** Variables layered over the host environment for the new session and the tools it runs. */\n readonly environment?: Readonly<Record<string, string>>;\n /** The only tools the new session's agent may see or call, like a Team agent's `tools:` list. */\n readonly tools?: readonly string[];\n /** Trusted in-process step bootstrap only. Never accepted from a remote request or persisted. */\n readonly workflowContext?: PoWorkflowContextService;\n}\n\nexport interface PoHubSessionPromptOptions {\n readonly signal?: AbortSignal;\n /** Refuses the prompt unless the target is a direct child of this session. */\n readonly parentSessionId?: string;\n}\n\n/** A prompt the session admitted. `settled` resolves once the agent settles and rejects on a harness fault. */\nexport interface PoHubSessionPromptReceipt {\n readonly settled: Promise<void>;\n}\n\n/** Host-bound inter-session events. The source identity is attached by the hub, never by payload data. */\nexport interface PoSessionCommunicationEndpoint {\n readonly sessionId: string;\n /** Current human-readable session name, read live so renames are reflected. */\n readonly sessionName?: string;\n /** This session's own group names, read live so group edits are reflected. */\n readonly groups?: readonly string[];\n publish(targetSessionId: string, type: string, payload: unknown): boolean;\n subscribe(type: string, listener: (sourceSessionId: string, payload: unknown) => void): () => void;\n onPeerReady(listener: (peerSessionId: string) => void): () => void;\n /** Describes a live peer authorized to communicate, including same-checkout peers. */\n describePeer?(peerSessionId: string): PoSessionPeerDescription | undefined;\n /** Every ready peer this session may message right now, including ones a later group edit made reachable. */\n listPeers?(): readonly PoSessionPeerDescription[];\n close(): void;\n}\n\n/** How a session sees a peer it may message, so an agent can address it by the name a person uses. */\nexport interface PoSessionPeerDescription {\n readonly sessionId: string;\n readonly name: string;\n readonly profile?: string;\n /** Groups both sessions belong to; empty when related through parentage or checkout. */\n readonly sharedGroups: readonly string[];\n}\nexport interface PoPendingSessionSetup {\n readonly id: string;\n readonly name: string;\n readonly createdAt: string;\n readonly cwd?: string;\n readonly setupKind?: 'managed-worktree' | 'existing-directory';\n readonly status?: 'provisioning' | 'failed' | 'interrupted';\n readonly errorCode?: 'SESSION_WORKTREE_PROVISION_FAILED' | 'SESSION_UNAVAILABLE';\n}\n\n/**\n * One short line a session's extension publishes about work it runs for that\n * session, such as a background job. The host shows it on the session's rail\n * card but never interprets it.\n */\nexport interface PoSessionActivity {\n readonly label: string;\n /** The work needs the reader: the rail marks the card the way it marks a pending question. */\n readonly attention?: boolean;\n /** ISO 8601 start of the work; the rail appends the elapsed time. */\n readonly since?: string;\n}\n/** A host-owned setup can be fulfilled by any execution-directory provider. */\nexport interface PoHubSessionReservations {\n read(id: string, parentSessionId: string): { sessionId: string; cwd?: string };\n prepare(id: string, parentSessionId: string, cwd: string): Promise<{ sessionId: string; cwd: string }>;\n complete(id: string, parentSessionId: string): Promise<PoHubSessionScope>;\n}\n\n/** Authoritative execution state. Missing background coordination is unknown, not empty. */\nexport interface PoHubSessionExecutionState {\n readonly isIdle: boolean;\n readonly hasPendingMessages: boolean;\n readonly backgroundWork?: PoBackgroundWorkSnapshot;\n}\n\n/** Direct lifecycle owned by the canonical headless hub, never by a package transport. */\nexport interface PoHubSessionService {\n create(request: PoHubSessionCreateRequest): Promise<PoHubSessionScope>;\n close(sessionId: string): Promise<void>;\n isLive(sessionId: string): boolean;\n /** Reads a live child's ownership without starting a turn. */\n readExecutionState?(\n sessionId: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>,\n ): Promise<PoHubSessionExecutionState>;\n /** Starts a turn in a live session, as if its user had submitted `text`. */\n prompt?(sessionId: string, text: string, options?: PoHubSessionPromptOptions): Promise<PoHubSessionPromptReceipt>;\n /** Aborts the live session's current turn. The session stays open. */\n abort?(sessionId: string, options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>): Promise<void>;\n /**\n * Adds guidance to a live session's running turn. A session with no turn in\n * progress takes it as its next message instead.\n */\n steer?(\n sessionId: string,\n message: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>,\n ): Promise<void>;\n /**\n * Stops a live session's runtime and keeps it dormant: its history stays\n * readable where it is shown, and it can be woken later. A session that has\n * done its work no longer holds a model, tools and extensions in the host.\n */\n release?(\n sessionId: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'> & {\n /** Leave the session live unless the host can synchronously prove it has no work. */\n onlyIfIdle?: boolean;\n },\n ): Promise<void>;\n /** Global mount only: live session identities, read without starting a turn. */\n scopes?(): readonly PoHubSessionScope[];\n /** Global mount only: stopped sessions that keep their record. */\n dormant?(): readonly PoHubDormantSession[];\n /** Global mount only: reopens a stopped session under its own id. Automatic callers wait for restore readiness. */\n revive?(sessionId: string, options?: { automatic?: boolean }): Promise<void | 'revived' | 'paused' | 'not_found'>;\n readonly reservations?: PoHubSessionReservations;\n /** Provisions a host-reserved Git worktree child. This is not exposed to remote MCP clients. */\n provisionReservedWorktree?(request: PoHubReservedWorktreeRequest): Promise<PoHubSessionScope>;\n /** Core host hook. A Git provider registers its implementation while its channel is mounted. */\n registerReservedWorktreeProvisioner?(provisioner: PoHubReservedWorktreeProvisioner): () => void;\n /**\n * True when both live sessions have a direct parent-child relationship, or execute in the same\n * checkout. Remote conversations only qualify through the parent-child relationship.\n */\n canCommunicate?(sourceSessionId: string, targetSessionId: string): boolean;\n /** Core host hook. Session API construction removes this method before exposing the service to extensions. */\n bindCommunication?(sessionId: string): PoSessionCommunicationEndpoint;\n}\n\nexport interface PoHubSessionApiRequest {\n basePath: string;\n path: string;\n method: string;\n body?: string | Uint8Array<ArrayBuffer> | null;\n signal?: AbortSignal;\n /** Forwarded by the authenticated host, including content type and trace context. */\n headers?: RequestInit['headers'];\n}\n\nexport type PoComputerUseHostOperation = 'status' | 'targets' | 'activate' | 'observe' | 'act' | 'stop';\n\nexport interface PoComputerUseHostRequest {\n readonly operation: PoComputerUseHostOperation;\n readonly payload?: unknown;\n readonly signal?: AbortSignal;\n}\n\nexport interface PoComputerUseHostBinding {\n readonly available: boolean;\n /** Global opt-in, separate from the presence of a native host. */\n readonly enabled?: boolean;\n request(scope: PoHubSessionScope, request: PoComputerUseHostRequest): Promise<unknown>;\n /** Checks a proof injected by the owning Desktop process, never a renderer marker. */\n authorize?(headers: Headers): boolean;\n /** Pins a session to Desktop before asking for a native grant. Ownership is not persisted. */\n claimSession?(sessionId: string, headers?: Headers): void;\n ownsSession?(sessionId: string): boolean;\n /** Server-authenticated paired identity, checked against live native approval for this session. */\n authorizeSession?(sessionId: string, headers: Headers): boolean;\n authorizeRecording?(sessionId: string, headers: Headers): boolean;\n authorizeActivation?(headers: Headers): boolean;\n /** Own pending activation only, never general session control. */\n authorizePending?(sessionId: string, headers: Headers): boolean;\n revokeDevice?(deviceId: string): void;\n /**\n * The Desktop window, or a paired device. A `change` (asking macOS for a permission) also\n * needs the step-up activation needs. Independent of the computer-use setting.\n */\n authorizePermissions?(headers: Headers, change: boolean): boolean;\n /** Desktop's macOS permission states, after asking macOS for `permission` when it is set. */\n permissions?(permission?: string): Promise<unknown>;\n readRecording?(scope: PoHubSessionScope, artifactId: string, range: string): Promise<Response>;\n forgetSession?(sessionId: string): void;\n /** Without `sessionId` the listener hears every session's ownership change. */\n subscribe?(listener: () => void, sessionId?: string): () => void;\n close?(): void;\n}\n\n/** Narrow, host-bound access. An extension cannot select another session's identity. */\nexport interface PoComputerUseSessionAccess {\n readonly available: boolean;\n readonly enabled?: boolean;\n authorize(headers: Headers): boolean;\n authorizeRecording?(headers: Headers): boolean;\n authorizeActivation?(headers: Headers): boolean;\n authorizePending?(headers: Headers): boolean;\n claim(headers?: Headers): void;\n fetchRecording?(artifactId: string, range: string): Promise<Response>;\n subscribe(listener: () => void): () => void;\n}\n\nexport interface PoHubChannelConnection {\n connectionId: string;\n /** Host-verified native renderer proof, never copied from a channel payload. */\n desktopAuthorized?: boolean;\n /** Live session authorization evaluated by the host, never a client frame. */\n computerUseAuthorized?: boolean;\n}\n\nexport interface PoHubChannelHost {\n sessions(): readonly PoHubSessionScope[];\n /** Host facts and storage for trusted in-process channels, never client-supplied roots. */\n readonly homeDirectory?: string;\n readonly sessionStorage?: PoSessionStorageService;\n /** Canonical hub lifecycle for sessions created by channel commands. */\n sessionService?: PoHubSessionService;\n /** Same-process events emitted by session packages. */\n readonly directEvents: PoDirectEventBus;\n publish(sessionId: string, payload: unknown): void;\n publishToConnection?(connectionId: string, sessionId: string, payload: unknown): boolean;\n requestSessionApi(scope: PoHubSessionScope, request: PoHubSessionApiRequest): Promise<Response>;\n computerUse?: PoComputerUseHostBinding;\n onNotice(message: string): void;\n /** Global mount only: admits, or returns, the workspace in the host folder with this name. */\n admitWorkspace?(request: { name: string }): Promise<{ id: string; root: string }>;\n /** Global mount only: the host's admitted workspaces, read live. */\n workspaces?(): readonly PoHubWorkspace[];\n}\n\nexport interface PoHubWorkspace {\n readonly id: string;\n readonly root: string;\n readonly name?: string;\n readonly available?: boolean;\n /** The sandbox provider that runs this workspace; absent means it runs on this host. */\n readonly sandbox?: string;\n /**\n * The sandbox's live state. On a workspace that runs on this host, `unavailable` only means the sandbox\n * cannot be switched on now; its sessions still run here.\n */\n readonly sandboxState?: 'starting' | 'running' | 'stopping' | 'unavailable' | 'failed';\n readonly sandboxReason?: string;\n}\n\nexport interface PoHubChannelSource {\n payloadFor(scope: PoHubSessionScope): unknown;\n /** Read-only compact projection of already-owned state. Must not start work or add watchers. */\n homeFor?(scope: PoHubSessionScope): HomeProjection;\n sessionAdded?(scope: PoHubSessionScope): void;\n sessionRemoved?(sessionId: string): void;\n close(): void;\n}\n\nexport type PoHubChannelLifecycle = 'session' | 'hub';\n\nexport interface PoHubChannel {\n frameType: string;\n lifecycle?: PoHubChannelLifecycle;\n start(host: PoHubChannelHost): PoHubChannelSource;\n receiveWithoutSubscription?: boolean;\n receive?(scope: PoHubSessionScope, payload: unknown, connection: PoHubChannelConnection): void;\n disconnected?(connection: PoHubChannelConnection): void;\n}\n"],"mappings":";;AAOA,MAAa,6BAA6B;;;;;;;AAkG1C,MAAa,mCAAmC;;;;;;;AAQhD,MAAa,yCAAyC;;AAGtD,MAAa,yCAAyC;;AAGtD,MAAa,wCAAwC"}
1
+ {"version":3,"file":"hubChannel.cjs","names":[],"sources":["../../../src/schemas/hubChannel.ts"],"sourcesContent":["import type { PoApprovalPrompt } from './approval';\nimport type { PoBackgroundWorkSnapshot } from './backgroundWork';\nimport type { HomeProjection } from './home';\nimport type { PoSessionStorageService } from './platform';\nimport type { PoWorkflowContextService } from './workflow';\n\n/** Compact host-wide session attention, published over the existing direct event bus. */\nexport const PO_SESSION_ATTENTION_EVENT = 'po.session.attention';\n\nexport interface PoSessionAttention {\n readonly name?: string;\n readonly phase: 'idle' | 'turn' | 'compaction' | 'retry';\n readonly awaitingInput: boolean;\n readonly settledAt?: string;\n readonly dialog?: {\n readonly id: string;\n readonly title: string;\n readonly message?: string;\n readonly purpose?: 'feedback';\n /** Present only on an approval dialog: the bounded card text, never the call's arguments. */\n readonly approval?: PoApprovalPrompt;\n };\n}\n\nexport interface PoHubChannelFrame {\n type: string;\n sessionId: string;\n payload: unknown;\n}\n\n/** Same-process lifecycle bus shared by a host's session APIs and hub channels. */\nexport interface PoDirectEventSubscriptionOptions {\n /** Replay the most recent value published for this frame and session, when one exists. */\n readonly replayLatest?: boolean;\n}\n\nexport interface PoDirectEventBus {\n publish(frameType: string, sessionId: string, payload: unknown): void;\n subscribe(\n frameType: string,\n sessionId: string,\n listener: (payload: unknown) => void,\n options?: PoDirectEventSubscriptionOptions,\n ): () => void;\n /** Drop retained state for a session after its lifecycle ends. */\n clearSession?(sessionId: string): void;\n close(): void;\n}\n\n/**\n * The extension-agnostic baseline every surface gets for one session, computed once by the\n * session host. Extensions build on it instead of re-deriving roots and relations from cwd.\n */\nexport interface PoSessionContext {\n readonly sessionId: string;\n /** Persisted workspace id, shared by every session and member checkout of the workspace. */\n readonly workspaceId: string;\n /** The admitted workspace root. It owns configuration, composition and settings. */\n readonly workspaceRoot: string;\n /**\n * The checkout the session executes in. Equals workspaceRoot unless the session runs in a\n * member checkout, such as a worktree, which may live outside the workspace folder.\n */\n readonly checkoutRoot: string;\n readonly cwd: string;\n readonly parentSessionId?: string;\n /** The spawner's label for the session. Approval policy never interprets it. */\n readonly provenance?: string;\n /** Host-set presence. Absent means interactive; tool input cannot set it. */\n readonly interaction?: 'interactive' | 'unattended';\n}\n\nexport interface PoHubSessionScope {\n sessionId: string;\n workspaceId?: string;\n cwd: string;\n /** Environment admitted for this session, when supplied by the host. */\n environment?: Readonly<Record<string, string | undefined>>;\n /** The session's baseline context, when its host knows its workspace. */\n sessionContext?: PoSessionContext;\n}\n\nexport interface PoHubReservedWorktreeRequest {\n readonly reservationId: string;\n readonly parentSessionId: string;\n readonly signal?: AbortSignal;\n}\n\nexport type PoHubReservedWorktreeProvisioner = (request: PoHubReservedWorktreeRequest) => Promise<PoHubSessionScope>;\n\n/** Selection axes a caller pins for a new session instead of the workspace defaults. */\nexport interface PoHubSessionSelection {\n readonly majorMode?: string;\n readonly minorModes?: readonly string[];\n readonly profile?: string;\n /** An empty list starts the session with no domains. */\n readonly domains?: readonly string[];\n}\n\n/**\n * Provenance of a session a workflow step opened.\n *\n * The step's conversation belongs to the workflow that ran it and is read in\n * that workflow's view, so the session rail leaves such sessions out.\n */\nexport const WORKFLOW_STEP_SESSION_PROVENANCE = 'workflow';\n\n/**\n * Provenance of a session opened to launch workflows for its parent.\n *\n * It picks and starts work, then closes; the runs it started belong to its\n * parent. Like a detached helper, it takes no row in the session rail.\n */\nexport const WORKFLOW_DISPATCHER_SESSION_PROVENANCE = 'workflow-dispatcher';\n\n/** Provenance of a conversation an external MCP client opened and drives. */\nexport const REMOTE_CONVERSATION_SESSION_PROVENANCE = 'remote-conversation';\n\n/** Provenance of the host-wide Voice conversation that relays between the person and other sessions. */\nexport const VOICE_ORCHESTRATOR_SESSION_PROVENANCE = 'voice-orchestrator';\n\n/** A stopped session that keeps its record and can be revived. */\nexport interface PoHubDormantSession {\n readonly sessionId: string;\n readonly name: string;\n readonly workspaceId: string;\n readonly sessionProvenance?: string;\n}\n\nexport interface PoHubSessionCreateRequest {\n /** Global mount only: pins a new top-level session to an admitted workspace. The host validates cwd membership. */\n readonly workspaceId?: string;\n readonly cwd: string;\n readonly name: string;\n readonly parentSessionId?: string;\n readonly sessionProvenance?: string;\n /** Trusted server-side spawner only, never accepted from public HTTP or tool input. */\n readonly interaction?: 'interactive' | 'unattended';\n readonly signal?: AbortSignal;\n /** Host-issued reservation, not a caller-chosen target session id. */\n readonly reservationId?: string;\n /** Pinned axes stay put when the workspace defaults change between turns. */\n readonly selection?: PoHubSessionSelection;\n /** Pi model selector, `provider/id`, validated like `--model`. */\n readonly model?: string;\n /** Pi thinking level, validated like `--thinking`. */\n readonly thinking?: string;\n /** Text appended to the session's system prompt, like `--append-system-prompt`. */\n readonly appendSystemPrompt?: string;\n /** Variables layered over the host environment for the new session and the tools it runs. */\n readonly environment?: Readonly<Record<string, string>>;\n /** The only tools the new session's agent may see or call, like a Team agent's `tools:` list. */\n readonly tools?: readonly string[];\n /** Trusted in-process step bootstrap only. Never accepted from a remote request or persisted. */\n readonly workflowContext?: PoWorkflowContextService;\n}\n\nexport interface PoHubSessionPromptOptions {\n readonly signal?: AbortSignal;\n /** Refuses the prompt unless the target is a direct child of this session. */\n readonly parentSessionId?: string;\n}\n\n/** A prompt the session admitted. `settled` resolves once the agent settles and rejects on a harness fault. */\nexport interface PoHubSessionPromptReceipt {\n readonly settled: Promise<void>;\n}\n\n/** Host-bound inter-session events. The source identity is attached by the hub, never by payload data. */\nexport interface PoSessionCommunicationEndpoint {\n readonly sessionId: string;\n /** Current human-readable session name, read live so renames are reflected. */\n readonly sessionName?: string;\n /** This session's own group names, read live so group edits are reflected. */\n readonly groups?: readonly string[];\n publish(targetSessionId: string, type: string, payload: unknown): boolean;\n subscribe(type: string, listener: (sourceSessionId: string, payload: unknown) => void): () => void;\n onPeerReady(listener: (peerSessionId: string) => void): () => void;\n /** Describes a live peer authorized to communicate, including same-checkout peers. */\n describePeer?(peerSessionId: string): PoSessionPeerDescription | undefined;\n /** Every ready peer this session may message right now, including ones a later group edit made reachable. */\n listPeers?(): readonly PoSessionPeerDescription[];\n close(): void;\n}\n\n/** How a session sees a peer it may message, so an agent can address it by the name a person uses. */\nexport interface PoSessionPeerDescription {\n readonly sessionId: string;\n readonly name: string;\n readonly profile?: string;\n /** Groups both sessions belong to; empty when related through parentage or checkout. */\n readonly sharedGroups: readonly string[];\n}\nexport interface PoPendingSessionSetup {\n readonly id: string;\n readonly name: string;\n readonly createdAt: string;\n readonly cwd?: string;\n readonly setupKind?: 'managed-worktree' | 'existing-directory';\n readonly status?: 'provisioning' | 'failed' | 'interrupted';\n readonly errorCode?: 'SESSION_WORKTREE_PROVISION_FAILED' | 'SESSION_UNAVAILABLE';\n}\n\n/**\n * One short line a session's extension publishes about work it runs for that\n * session, such as a background job. The host shows it on the session's rail\n * card but never interprets it.\n */\nexport interface PoSessionActivity {\n readonly label: string;\n /** The work needs the reader: the rail marks the card the way it marks a pending question. */\n readonly attention?: boolean;\n /** ISO 8601 start of the work; the rail appends the elapsed time. */\n readonly since?: string;\n}\n/** A host-owned setup can be fulfilled by any execution-directory provider. */\nexport interface PoHubSessionReservations {\n read(id: string, parentSessionId: string): { sessionId: string; cwd?: string };\n prepare(id: string, parentSessionId: string, cwd: string): Promise<{ sessionId: string; cwd: string }>;\n complete(id: string, parentSessionId: string): Promise<PoHubSessionScope>;\n}\n\n/** Exclusive usage of one session. Missing measurements are unknown, never zero. */\nexport interface PoHubSessionUsage {\n readonly tokens?: {\n readonly input: number;\n readonly output: number;\n readonly cacheRead: number;\n readonly cacheWrite: number;\n readonly total: number;\n };\n readonly costUsd?: number;\n readonly toolCount?: number;\n}\n\n/** Authoritative execution state. Missing background coordination is unknown, not empty. */\nexport interface PoHubSessionExecutionState {\n readonly isIdle: boolean;\n readonly hasPendingMessages: boolean;\n readonly backgroundWork?: PoBackgroundWorkSnapshot;\n /** Own durable usage only, excluding separately owned child sessions and lanes. */\n readonly usage?: PoHubSessionUsage;\n}\n\n/** Direct lifecycle owned by the canonical headless hub, never by a package transport. */\nexport interface PoHubSessionService {\n create(request: PoHubSessionCreateRequest): Promise<PoHubSessionScope>;\n close(sessionId: string): Promise<void>;\n isLive(sessionId: string): boolean;\n /** Reads a live child's ownership without starting a turn. */\n readExecutionState?(\n sessionId: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>,\n ): Promise<PoHubSessionExecutionState>;\n /** Starts a turn in a live session, as if its user had submitted `text`. */\n prompt?(sessionId: string, text: string, options?: PoHubSessionPromptOptions): Promise<PoHubSessionPromptReceipt>;\n /** Aborts the live session's current turn. The session stays open. */\n abort?(sessionId: string, options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>): Promise<void>;\n /**\n * Adds guidance to a live session's running turn. A session with no turn in\n * progress takes it as its next message instead.\n */\n steer?(\n sessionId: string,\n message: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>,\n ): Promise<void>;\n /**\n * Stops a live session's runtime and keeps it dormant: its history stays\n * readable where it is shown, and it can be woken later. A session that has\n * done its work no longer holds a model, tools and extensions in the host.\n */\n release?(\n sessionId: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'> & {\n /** Leave the session live unless the host can synchronously prove it has no work. */\n onlyIfIdle?: boolean;\n },\n ): Promise<void>;\n /** Global mount only: live session identities, read without starting a turn. */\n scopes?(): readonly PoHubSessionScope[];\n /** Global mount only: stopped sessions that keep their record. */\n dormant?(): readonly PoHubDormantSession[];\n /** Global mount only: reopens a stopped session under its own id. Automatic callers wait for restore readiness. */\n revive?(sessionId: string, options?: { automatic?: boolean }): Promise<void | 'revived' | 'paused' | 'not_found'>;\n readonly reservations?: PoHubSessionReservations;\n /** Provisions a host-reserved Git worktree child. This is not exposed to remote MCP clients. */\n provisionReservedWorktree?(request: PoHubReservedWorktreeRequest): Promise<PoHubSessionScope>;\n /** Core host hook. A Git provider registers its implementation while its channel is mounted. */\n registerReservedWorktreeProvisioner?(provisioner: PoHubReservedWorktreeProvisioner): () => void;\n /**\n * True when both live sessions have a direct parent-child relationship, or execute in the same\n * checkout. Remote conversations only qualify through the parent-child relationship.\n */\n canCommunicate?(sourceSessionId: string, targetSessionId: string): boolean;\n /** Core host hook. Session API construction removes this method before exposing the service to extensions. */\n bindCommunication?(sessionId: string): PoSessionCommunicationEndpoint;\n}\n\nexport interface PoHubSessionApiRequest {\n basePath: string;\n path: string;\n method: string;\n body?: string | Uint8Array<ArrayBuffer> | null;\n signal?: AbortSignal;\n /** Forwarded by the authenticated host, including content type and trace context. */\n headers?: RequestInit['headers'];\n}\n\nexport type PoComputerUseHostOperation = 'status' | 'targets' | 'activate' | 'observe' | 'act' | 'stop';\n\nexport interface PoComputerUseHostRequest {\n readonly operation: PoComputerUseHostOperation;\n readonly payload?: unknown;\n readonly signal?: AbortSignal;\n}\n\nexport interface PoComputerUseHostBinding {\n readonly available: boolean;\n /** Global opt-in, separate from the presence of a native host. */\n readonly enabled?: boolean;\n request(scope: PoHubSessionScope, request: PoComputerUseHostRequest): Promise<unknown>;\n /** Checks a proof injected by the owning Desktop process, never a renderer marker. */\n authorize?(headers: Headers): boolean;\n /** Pins a session to Desktop before asking for a native grant. Ownership is not persisted. */\n claimSession?(sessionId: string, headers?: Headers): void;\n ownsSession?(sessionId: string): boolean;\n /** Server-authenticated paired identity, checked against live native approval for this session. */\n authorizeSession?(sessionId: string, headers: Headers): boolean;\n authorizeRecording?(sessionId: string, headers: Headers): boolean;\n authorizeActivation?(headers: Headers): boolean;\n /** Own pending activation only, never general session control. */\n authorizePending?(sessionId: string, headers: Headers): boolean;\n revokeDevice?(deviceId: string): void;\n /**\n * The Desktop window, or a paired device. A `change` (asking macOS for a permission) also\n * needs the step-up activation needs. Independent of the computer-use setting.\n */\n authorizePermissions?(headers: Headers, change: boolean): boolean;\n /** Desktop's macOS permission states, after asking macOS for `permission` when it is set. */\n permissions?(permission?: string): Promise<unknown>;\n readRecording?(scope: PoHubSessionScope, artifactId: string, range: string): Promise<Response>;\n forgetSession?(sessionId: string): void;\n /** Without `sessionId` the listener hears every session's ownership change. */\n subscribe?(listener: () => void, sessionId?: string): () => void;\n close?(): void;\n}\n\n/** Narrow, host-bound access. An extension cannot select another session's identity. */\nexport interface PoComputerUseSessionAccess {\n readonly available: boolean;\n readonly enabled?: boolean;\n authorize(headers: Headers): boolean;\n authorizeRecording?(headers: Headers): boolean;\n authorizeActivation?(headers: Headers): boolean;\n authorizePending?(headers: Headers): boolean;\n claim(headers?: Headers): void;\n fetchRecording?(artifactId: string, range: string): Promise<Response>;\n subscribe(listener: () => void): () => void;\n}\n\nexport interface PoHubChannelConnection {\n connectionId: string;\n /** Host-verified native renderer proof, never copied from a channel payload. */\n desktopAuthorized?: boolean;\n /** Live session authorization evaluated by the host, never a client frame. */\n computerUseAuthorized?: boolean;\n}\n\nexport interface PoHubChannelHost {\n sessions(): readonly PoHubSessionScope[];\n /** Host facts and storage for trusted in-process channels, never client-supplied roots. */\n readonly homeDirectory?: string;\n readonly sessionStorage?: PoSessionStorageService;\n /** Canonical hub lifecycle for sessions created by channel commands. */\n sessionService?: PoHubSessionService;\n /** Same-process events emitted by session packages. */\n readonly directEvents: PoDirectEventBus;\n publish(sessionId: string, payload: unknown): void;\n publishToConnection?(connectionId: string, sessionId: string, payload: unknown): boolean;\n requestSessionApi(scope: PoHubSessionScope, request: PoHubSessionApiRequest): Promise<Response>;\n computerUse?: PoComputerUseHostBinding;\n onNotice(message: string): void;\n /** Global mount only: admits, or returns, the workspace in the host folder with this name. */\n admitWorkspace?(request: { name: string }): Promise<{ id: string; root: string }>;\n /** Global mount only: the host's admitted workspaces, read live. */\n workspaces?(): readonly PoHubWorkspace[];\n}\n\nexport interface PoHubWorkspace {\n readonly id: string;\n readonly root: string;\n readonly name?: string;\n readonly available?: boolean;\n /** The sandbox provider that runs this workspace; absent means it runs on this host. */\n readonly sandbox?: string;\n /**\n * The sandbox's live state. On a workspace that runs on this host, `unavailable` only means the sandbox\n * cannot be switched on now; its sessions still run here.\n */\n readonly sandboxState?: 'starting' | 'running' | 'stopping' | 'unavailable' | 'failed';\n readonly sandboxReason?: string;\n}\n\nexport interface PoHubChannelSource {\n payloadFor(scope: PoHubSessionScope): unknown;\n /** Read-only compact projection of already-owned state. Must not start work or add watchers. */\n homeFor?(scope: PoHubSessionScope): HomeProjection;\n sessionAdded?(scope: PoHubSessionScope): void;\n sessionRemoved?(sessionId: string): void;\n close(): void;\n}\n\nexport type PoHubChannelLifecycle = 'session' | 'hub';\n\nexport interface PoHubChannel {\n frameType: string;\n lifecycle?: PoHubChannelLifecycle;\n start(host: PoHubChannelHost): PoHubChannelSource;\n receiveWithoutSubscription?: boolean;\n receive?(scope: PoHubSessionScope, payload: unknown, connection: PoHubChannelConnection): void;\n disconnected?(connection: PoHubChannelConnection): void;\n}\n"],"mappings":";;AAOA,MAAa,6BAA6B;;;;;;;AAkG1C,MAAa,mCAAmC;;;;;;;AAQhD,MAAa,yCAAyC;;AAGtD,MAAa,yCAAyC;;AAGtD,MAAa,wCAAwC"}
@@ -201,11 +201,25 @@ export interface PoHubSessionReservations {
201
201
  }>;
202
202
  complete(id: string, parentSessionId: string): Promise<PoHubSessionScope>;
203
203
  }
204
+ /** Exclusive usage of one session. Missing measurements are unknown, never zero. */
205
+ export interface PoHubSessionUsage {
206
+ readonly tokens?: {
207
+ readonly input: number;
208
+ readonly output: number;
209
+ readonly cacheRead: number;
210
+ readonly cacheWrite: number;
211
+ readonly total: number;
212
+ };
213
+ readonly costUsd?: number;
214
+ readonly toolCount?: number;
215
+ }
204
216
  /** Authoritative execution state. Missing background coordination is unknown, not empty. */
205
217
  export interface PoHubSessionExecutionState {
206
218
  readonly isIdle: boolean;
207
219
  readonly hasPendingMessages: boolean;
208
220
  readonly backgroundWork?: PoBackgroundWorkSnapshot;
221
+ /** Own durable usage only, excluding separately owned child sessions and lanes. */
222
+ readonly usage?: PoHubSessionUsage;
209
223
  }
210
224
  /** Direct lifecycle owned by the canonical headless hub, never by a package transport. */
211
225
  export interface PoHubSessionService {
@@ -1 +1 @@
1
- {"version":3,"file":"hubChannel.d.mts","names":[],"sources":["../../../src/schemas/hubChannel.ts"],"mappings":";;;;;;;;qBAOa;iBAEI;WACN;WACA;WACA;WACA;WACA;aACE;aACA;aACA;aACA;;aAEA,WAAW;;;iBAIP;EACf;EACA;EACA;;;iBAIe;;WAEN;;iBAGM;EACf,QAAQ,mBAAmB,mBAAmB;EAC9C,UACE,mBACA,mBACA,WAAW,2BACX,UAAU;;EAGZ,cAAc;EACd;;;;;;iBAOe;WACN;;WAEA;;WAEA;;;;;WAKA;WACA;WACA;;WAEA;;WAEA;;iBAGM;EACf;EACA;EACA;;EAEA,cAAc,SAAS;;EAEvB,iBAAiB;;iBAGF;WACN;WACA;WACA,SAAS;;YAGR,oCAAoC,SAAS,iCAAiC,QAAQ;;iBAGjF;WACN;WACA;WACA;;WAEA;;;;;;;;qBASE;;;;;;;qBAQA;;qBAGA;;qBAGA;;iBAGI;WACN;WACA;WACA;W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kBAAkB,OAAO,mBAAmB,SAAS,yBAAyB,QAAQ;EACtF,cAAc;EACd,SAAS;;EAET,gBAAgB;IAAW;MAAiB;IAAU;IAAY;;;EAElE,wBAAwB;;iBAGT;WACN;WACA;WACA;WACA;;WAEA;;;;;WAKA;WACA;;iBAGM;EACf,WAAW,OAAO;;EAElB,SAAS,OAAO,oBAAoB;EACpC,cAAc,OAAO;EACrB,gBAAgB;EAChB;;YAGU;iBAEK;EACf;EACA,YAAY;EACZ,MAAM,MAAM,mBAAmB;EAC/B;EACA,SAAS,OAAO,mBAAmB,kBAAkB,YAAY;EACjE,cAAc,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"hubChannel.mjs","names":[],"sources":["../../../src/schemas/hubChannel.ts"],"sourcesContent":["import type { PoApprovalPrompt } from './approval';\nimport type { PoBackgroundWorkSnapshot } from './backgroundWork';\nimport type { HomeProjection } from './home';\nimport type { PoSessionStorageService } from './platform';\nimport type { PoWorkflowContextService } from './workflow';\n\n/** Compact host-wide session attention, published over the existing direct event bus. */\nexport const PO_SESSION_ATTENTION_EVENT = 'po.session.attention';\n\nexport interface PoSessionAttention {\n readonly name?: string;\n readonly phase: 'idle' | 'turn' | 'compaction' | 'retry';\n readonly awaitingInput: boolean;\n readonly settledAt?: string;\n readonly dialog?: {\n readonly id: string;\n readonly title: string;\n readonly message?: string;\n readonly purpose?: 'feedback';\n /** Present only on an approval dialog: the bounded card text, never the call's arguments. */\n readonly approval?: PoApprovalPrompt;\n };\n}\n\nexport interface PoHubChannelFrame {\n type: string;\n sessionId: string;\n payload: unknown;\n}\n\n/** Same-process lifecycle bus shared by a host's session APIs and hub channels. */\nexport interface PoDirectEventSubscriptionOptions {\n /** Replay the most recent value published for this frame and session, when one exists. */\n readonly replayLatest?: boolean;\n}\n\nexport interface PoDirectEventBus {\n publish(frameType: string, sessionId: string, payload: unknown): void;\n subscribe(\n frameType: string,\n sessionId: string,\n listener: (payload: unknown) => void,\n options?: PoDirectEventSubscriptionOptions,\n ): () => void;\n /** Drop retained state for a session after its lifecycle ends. */\n clearSession?(sessionId: string): void;\n close(): void;\n}\n\n/**\n * The extension-agnostic baseline every surface gets for one session, computed once by the\n * session host. Extensions build on it instead of re-deriving roots and relations from cwd.\n */\nexport interface PoSessionContext {\n readonly sessionId: string;\n /** Persisted workspace id, shared by every session and member checkout of the workspace. */\n readonly workspaceId: string;\n /** The admitted workspace root. It owns configuration, composition and settings. */\n readonly workspaceRoot: string;\n /**\n * The checkout the session executes in. Equals workspaceRoot unless the session runs in a\n * member checkout, such as a worktree, which may live outside the workspace folder.\n */\n readonly checkoutRoot: string;\n readonly cwd: string;\n readonly parentSessionId?: string;\n /** The spawner's label for the session. Approval policy never interprets it. */\n readonly provenance?: string;\n /** Host-set presence. Absent means interactive; tool input cannot set it. */\n readonly interaction?: 'interactive' | 'unattended';\n}\n\nexport interface PoHubSessionScope {\n sessionId: string;\n workspaceId?: string;\n cwd: string;\n /** Environment admitted for this session, when supplied by the host. */\n environment?: Readonly<Record<string, string | undefined>>;\n /** The session's baseline context, when its host knows its workspace. */\n sessionContext?: PoSessionContext;\n}\n\nexport interface PoHubReservedWorktreeRequest {\n readonly reservationId: string;\n readonly parentSessionId: string;\n readonly signal?: AbortSignal;\n}\n\nexport type PoHubReservedWorktreeProvisioner = (request: PoHubReservedWorktreeRequest) => Promise<PoHubSessionScope>;\n\n/** Selection axes a caller pins for a new session instead of the workspace defaults. */\nexport interface PoHubSessionSelection {\n readonly majorMode?: string;\n readonly minorModes?: readonly string[];\n readonly profile?: string;\n /** An empty list starts the session with no domains. */\n readonly domains?: readonly string[];\n}\n\n/**\n * Provenance of a session a workflow step opened.\n *\n * The step's conversation belongs to the workflow that ran it and is read in\n * that workflow's view, so the session rail leaves such sessions out.\n */\nexport const WORKFLOW_STEP_SESSION_PROVENANCE = 'workflow';\n\n/**\n * Provenance of a session opened to launch workflows for its parent.\n *\n * It picks and starts work, then closes; the runs it started belong to its\n * parent. Like a detached helper, it takes no row in the session rail.\n */\nexport const WORKFLOW_DISPATCHER_SESSION_PROVENANCE = 'workflow-dispatcher';\n\n/** Provenance of a conversation an external MCP client opened and drives. */\nexport const REMOTE_CONVERSATION_SESSION_PROVENANCE = 'remote-conversation';\n\n/** Provenance of the host-wide Voice conversation that relays between the person and other sessions. */\nexport const VOICE_ORCHESTRATOR_SESSION_PROVENANCE = 'voice-orchestrator';\n\n/** A stopped session that keeps its record and can be revived. */\nexport interface PoHubDormantSession {\n readonly sessionId: string;\n readonly name: string;\n readonly workspaceId: string;\n readonly sessionProvenance?: string;\n}\n\nexport interface PoHubSessionCreateRequest {\n /** Global mount only: pins a new top-level session to an admitted workspace. The host validates cwd membership. */\n readonly workspaceId?: string;\n readonly cwd: string;\n readonly name: string;\n readonly parentSessionId?: string;\n readonly sessionProvenance?: string;\n /** Trusted server-side spawner only, never accepted from public HTTP or tool input. */\n readonly interaction?: 'interactive' | 'unattended';\n readonly signal?: AbortSignal;\n /** Host-issued reservation, not a caller-chosen target session id. */\n readonly reservationId?: string;\n /** Pinned axes stay put when the workspace defaults change between turns. */\n readonly selection?: PoHubSessionSelection;\n /** Pi model selector, `provider/id`, validated like `--model`. */\n readonly model?: string;\n /** Pi thinking level, validated like `--thinking`. */\n readonly thinking?: string;\n /** Text appended to the session's system prompt, like `--append-system-prompt`. */\n readonly appendSystemPrompt?: string;\n /** Variables layered over the host environment for the new session and the tools it runs. */\n readonly environment?: Readonly<Record<string, string>>;\n /** The only tools the new session's agent may see or call, like a Team agent's `tools:` list. */\n readonly tools?: readonly string[];\n /** Trusted in-process step bootstrap only. Never accepted from a remote request or persisted. */\n readonly workflowContext?: PoWorkflowContextService;\n}\n\nexport interface PoHubSessionPromptOptions {\n readonly signal?: AbortSignal;\n /** Refuses the prompt unless the target is a direct child of this session. */\n readonly parentSessionId?: string;\n}\n\n/** A prompt the session admitted. `settled` resolves once the agent settles and rejects on a harness fault. */\nexport interface PoHubSessionPromptReceipt {\n readonly settled: Promise<void>;\n}\n\n/** Host-bound inter-session events. The source identity is attached by the hub, never by payload data. */\nexport interface PoSessionCommunicationEndpoint {\n readonly sessionId: string;\n /** Current human-readable session name, read live so renames are reflected. */\n readonly sessionName?: string;\n /** This session's own group names, read live so group edits are reflected. */\n readonly groups?: readonly string[];\n publish(targetSessionId: string, type: string, payload: unknown): boolean;\n subscribe(type: string, listener: (sourceSessionId: string, payload: unknown) => void): () => void;\n onPeerReady(listener: (peerSessionId: string) => void): () => void;\n /** Describes a live peer authorized to communicate, including same-checkout peers. */\n describePeer?(peerSessionId: string): PoSessionPeerDescription | undefined;\n /** Every ready peer this session may message right now, including ones a later group edit made reachable. */\n listPeers?(): readonly PoSessionPeerDescription[];\n close(): void;\n}\n\n/** How a session sees a peer it may message, so an agent can address it by the name a person uses. */\nexport interface PoSessionPeerDescription {\n readonly sessionId: string;\n readonly name: string;\n readonly profile?: string;\n /** Groups both sessions belong to; empty when related through parentage or checkout. */\n readonly sharedGroups: readonly string[];\n}\nexport interface PoPendingSessionSetup {\n readonly id: string;\n readonly name: string;\n readonly createdAt: string;\n readonly cwd?: string;\n readonly setupKind?: 'managed-worktree' | 'existing-directory';\n readonly status?: 'provisioning' | 'failed' | 'interrupted';\n readonly errorCode?: 'SESSION_WORKTREE_PROVISION_FAILED' | 'SESSION_UNAVAILABLE';\n}\n\n/**\n * One short line a session's extension publishes about work it runs for that\n * session, such as a background job. The host shows it on the session's rail\n * card but never interprets it.\n */\nexport interface PoSessionActivity {\n readonly label: string;\n /** The work needs the reader: the rail marks the card the way it marks a pending question. */\n readonly attention?: boolean;\n /** ISO 8601 start of the work; the rail appends the elapsed time. */\n readonly since?: string;\n}\n/** A host-owned setup can be fulfilled by any execution-directory provider. */\nexport interface PoHubSessionReservations {\n read(id: string, parentSessionId: string): { sessionId: string; cwd?: string };\n prepare(id: string, parentSessionId: string, cwd: string): Promise<{ sessionId: string; cwd: string }>;\n complete(id: string, parentSessionId: string): Promise<PoHubSessionScope>;\n}\n\n/** Authoritative execution state. Missing background coordination is unknown, not empty. */\nexport interface PoHubSessionExecutionState {\n readonly isIdle: boolean;\n readonly hasPendingMessages: boolean;\n readonly backgroundWork?: PoBackgroundWorkSnapshot;\n}\n\n/** Direct lifecycle owned by the canonical headless hub, never by a package transport. */\nexport interface PoHubSessionService {\n create(request: PoHubSessionCreateRequest): Promise<PoHubSessionScope>;\n close(sessionId: string): Promise<void>;\n isLive(sessionId: string): boolean;\n /** Reads a live child's ownership without starting a turn. */\n readExecutionState?(\n sessionId: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>,\n ): Promise<PoHubSessionExecutionState>;\n /** Starts a turn in a live session, as if its user had submitted `text`. */\n prompt?(sessionId: string, text: string, options?: PoHubSessionPromptOptions): Promise<PoHubSessionPromptReceipt>;\n /** Aborts the live session's current turn. The session stays open. */\n abort?(sessionId: string, options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>): Promise<void>;\n /**\n * Adds guidance to a live session's running turn. A session with no turn in\n * progress takes it as its next message instead.\n */\n steer?(\n sessionId: string,\n message: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>,\n ): Promise<void>;\n /**\n * Stops a live session's runtime and keeps it dormant: its history stays\n * readable where it is shown, and it can be woken later. A session that has\n * done its work no longer holds a model, tools and extensions in the host.\n */\n release?(\n sessionId: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'> & {\n /** Leave the session live unless the host can synchronously prove it has no work. */\n onlyIfIdle?: boolean;\n },\n ): Promise<void>;\n /** Global mount only: live session identities, read without starting a turn. */\n scopes?(): readonly PoHubSessionScope[];\n /** Global mount only: stopped sessions that keep their record. */\n dormant?(): readonly PoHubDormantSession[];\n /** Global mount only: reopens a stopped session under its own id. Automatic callers wait for restore readiness. */\n revive?(sessionId: string, options?: { automatic?: boolean }): Promise<void | 'revived' | 'paused' | 'not_found'>;\n readonly reservations?: PoHubSessionReservations;\n /** Provisions a host-reserved Git worktree child. This is not exposed to remote MCP clients. */\n provisionReservedWorktree?(request: PoHubReservedWorktreeRequest): Promise<PoHubSessionScope>;\n /** Core host hook. A Git provider registers its implementation while its channel is mounted. */\n registerReservedWorktreeProvisioner?(provisioner: PoHubReservedWorktreeProvisioner): () => void;\n /**\n * True when both live sessions have a direct parent-child relationship, or execute in the same\n * checkout. Remote conversations only qualify through the parent-child relationship.\n */\n canCommunicate?(sourceSessionId: string, targetSessionId: string): boolean;\n /** Core host hook. Session API construction removes this method before exposing the service to extensions. */\n bindCommunication?(sessionId: string): PoSessionCommunicationEndpoint;\n}\n\nexport interface PoHubSessionApiRequest {\n basePath: string;\n path: string;\n method: string;\n body?: string | Uint8Array<ArrayBuffer> | null;\n signal?: AbortSignal;\n /** Forwarded by the authenticated host, including content type and trace context. */\n headers?: RequestInit['headers'];\n}\n\nexport type PoComputerUseHostOperation = 'status' | 'targets' | 'activate' | 'observe' | 'act' | 'stop';\n\nexport interface PoComputerUseHostRequest {\n readonly operation: PoComputerUseHostOperation;\n readonly payload?: unknown;\n readonly signal?: AbortSignal;\n}\n\nexport interface PoComputerUseHostBinding {\n readonly available: boolean;\n /** Global opt-in, separate from the presence of a native host. */\n readonly enabled?: boolean;\n request(scope: PoHubSessionScope, request: PoComputerUseHostRequest): Promise<unknown>;\n /** Checks a proof injected by the owning Desktop process, never a renderer marker. */\n authorize?(headers: Headers): boolean;\n /** Pins a session to Desktop before asking for a native grant. Ownership is not persisted. */\n claimSession?(sessionId: string, headers?: Headers): void;\n ownsSession?(sessionId: string): boolean;\n /** Server-authenticated paired identity, checked against live native approval for this session. */\n authorizeSession?(sessionId: string, headers: Headers): boolean;\n authorizeRecording?(sessionId: string, headers: Headers): boolean;\n authorizeActivation?(headers: Headers): boolean;\n /** Own pending activation only, never general session control. */\n authorizePending?(sessionId: string, headers: Headers): boolean;\n revokeDevice?(deviceId: string): void;\n /**\n * The Desktop window, or a paired device. A `change` (asking macOS for a permission) also\n * needs the step-up activation needs. Independent of the computer-use setting.\n */\n authorizePermissions?(headers: Headers, change: boolean): boolean;\n /** Desktop's macOS permission states, after asking macOS for `permission` when it is set. */\n permissions?(permission?: string): Promise<unknown>;\n readRecording?(scope: PoHubSessionScope, artifactId: string, range: string): Promise<Response>;\n forgetSession?(sessionId: string): void;\n /** Without `sessionId` the listener hears every session's ownership change. */\n subscribe?(listener: () => void, sessionId?: string): () => void;\n close?(): void;\n}\n\n/** Narrow, host-bound access. An extension cannot select another session's identity. */\nexport interface PoComputerUseSessionAccess {\n readonly available: boolean;\n readonly enabled?: boolean;\n authorize(headers: Headers): boolean;\n authorizeRecording?(headers: Headers): boolean;\n authorizeActivation?(headers: Headers): boolean;\n authorizePending?(headers: Headers): boolean;\n claim(headers?: Headers): void;\n fetchRecording?(artifactId: string, range: string): Promise<Response>;\n subscribe(listener: () => void): () => void;\n}\n\nexport interface PoHubChannelConnection {\n connectionId: string;\n /** Host-verified native renderer proof, never copied from a channel payload. */\n desktopAuthorized?: boolean;\n /** Live session authorization evaluated by the host, never a client frame. */\n computerUseAuthorized?: boolean;\n}\n\nexport interface PoHubChannelHost {\n sessions(): readonly PoHubSessionScope[];\n /** Host facts and storage for trusted in-process channels, never client-supplied roots. */\n readonly homeDirectory?: string;\n readonly sessionStorage?: PoSessionStorageService;\n /** Canonical hub lifecycle for sessions created by channel commands. */\n sessionService?: PoHubSessionService;\n /** Same-process events emitted by session packages. */\n readonly directEvents: PoDirectEventBus;\n publish(sessionId: string, payload: unknown): void;\n publishToConnection?(connectionId: string, sessionId: string, payload: unknown): boolean;\n requestSessionApi(scope: PoHubSessionScope, request: PoHubSessionApiRequest): Promise<Response>;\n computerUse?: PoComputerUseHostBinding;\n onNotice(message: string): void;\n /** Global mount only: admits, or returns, the workspace in the host folder with this name. */\n admitWorkspace?(request: { name: string }): Promise<{ id: string; root: string }>;\n /** Global mount only: the host's admitted workspaces, read live. */\n workspaces?(): readonly PoHubWorkspace[];\n}\n\nexport interface PoHubWorkspace {\n readonly id: string;\n readonly root: string;\n readonly name?: string;\n readonly available?: boolean;\n /** The sandbox provider that runs this workspace; absent means it runs on this host. */\n readonly sandbox?: string;\n /**\n * The sandbox's live state. On a workspace that runs on this host, `unavailable` only means the sandbox\n * cannot be switched on now; its sessions still run here.\n */\n readonly sandboxState?: 'starting' | 'running' | 'stopping' | 'unavailable' | 'failed';\n readonly sandboxReason?: string;\n}\n\nexport interface PoHubChannelSource {\n payloadFor(scope: PoHubSessionScope): unknown;\n /** Read-only compact projection of already-owned state. Must not start work or add watchers. */\n homeFor?(scope: PoHubSessionScope): HomeProjection;\n sessionAdded?(scope: PoHubSessionScope): void;\n sessionRemoved?(sessionId: string): void;\n close(): void;\n}\n\nexport type PoHubChannelLifecycle = 'session' | 'hub';\n\nexport interface PoHubChannel {\n frameType: string;\n lifecycle?: PoHubChannelLifecycle;\n start(host: PoHubChannelHost): PoHubChannelSource;\n receiveWithoutSubscription?: boolean;\n receive?(scope: PoHubSessionScope, payload: unknown, connection: PoHubChannelConnection): void;\n disconnected?(connection: PoHubChannelConnection): void;\n}\n"],"mappings":";;AAOA,MAAa,6BAA6B;;;;;;;AAkG1C,MAAa,mCAAmC;;;;;;;AAQhD,MAAa,yCAAyC;;AAGtD,MAAa,yCAAyC;;AAGtD,MAAa,wCAAwC"}
1
+ {"version":3,"file":"hubChannel.mjs","names":[],"sources":["../../../src/schemas/hubChannel.ts"],"sourcesContent":["import type { PoApprovalPrompt } from './approval';\nimport type { PoBackgroundWorkSnapshot } from './backgroundWork';\nimport type { HomeProjection } from './home';\nimport type { PoSessionStorageService } from './platform';\nimport type { PoWorkflowContextService } from './workflow';\n\n/** Compact host-wide session attention, published over the existing direct event bus. */\nexport const PO_SESSION_ATTENTION_EVENT = 'po.session.attention';\n\nexport interface PoSessionAttention {\n readonly name?: string;\n readonly phase: 'idle' | 'turn' | 'compaction' | 'retry';\n readonly awaitingInput: boolean;\n readonly settledAt?: string;\n readonly dialog?: {\n readonly id: string;\n readonly title: string;\n readonly message?: string;\n readonly purpose?: 'feedback';\n /** Present only on an approval dialog: the bounded card text, never the call's arguments. */\n readonly approval?: PoApprovalPrompt;\n };\n}\n\nexport interface PoHubChannelFrame {\n type: string;\n sessionId: string;\n payload: unknown;\n}\n\n/** Same-process lifecycle bus shared by a host's session APIs and hub channels. */\nexport interface PoDirectEventSubscriptionOptions {\n /** Replay the most recent value published for this frame and session, when one exists. */\n readonly replayLatest?: boolean;\n}\n\nexport interface PoDirectEventBus {\n publish(frameType: string, sessionId: string, payload: unknown): void;\n subscribe(\n frameType: string,\n sessionId: string,\n listener: (payload: unknown) => void,\n options?: PoDirectEventSubscriptionOptions,\n ): () => void;\n /** Drop retained state for a session after its lifecycle ends. */\n clearSession?(sessionId: string): void;\n close(): void;\n}\n\n/**\n * The extension-agnostic baseline every surface gets for one session, computed once by the\n * session host. Extensions build on it instead of re-deriving roots and relations from cwd.\n */\nexport interface PoSessionContext {\n readonly sessionId: string;\n /** Persisted workspace id, shared by every session and member checkout of the workspace. */\n readonly workspaceId: string;\n /** The admitted workspace root. It owns configuration, composition and settings. */\n readonly workspaceRoot: string;\n /**\n * The checkout the session executes in. Equals workspaceRoot unless the session runs in a\n * member checkout, such as a worktree, which may live outside the workspace folder.\n */\n readonly checkoutRoot: string;\n readonly cwd: string;\n readonly parentSessionId?: string;\n /** The spawner's label for the session. Approval policy never interprets it. */\n readonly provenance?: string;\n /** Host-set presence. Absent means interactive; tool input cannot set it. */\n readonly interaction?: 'interactive' | 'unattended';\n}\n\nexport interface PoHubSessionScope {\n sessionId: string;\n workspaceId?: string;\n cwd: string;\n /** Environment admitted for this session, when supplied by the host. */\n environment?: Readonly<Record<string, string | undefined>>;\n /** The session's baseline context, when its host knows its workspace. */\n sessionContext?: PoSessionContext;\n}\n\nexport interface PoHubReservedWorktreeRequest {\n readonly reservationId: string;\n readonly parentSessionId: string;\n readonly signal?: AbortSignal;\n}\n\nexport type PoHubReservedWorktreeProvisioner = (request: PoHubReservedWorktreeRequest) => Promise<PoHubSessionScope>;\n\n/** Selection axes a caller pins for a new session instead of the workspace defaults. */\nexport interface PoHubSessionSelection {\n readonly majorMode?: string;\n readonly minorModes?: readonly string[];\n readonly profile?: string;\n /** An empty list starts the session with no domains. */\n readonly domains?: readonly string[];\n}\n\n/**\n * Provenance of a session a workflow step opened.\n *\n * The step's conversation belongs to the workflow that ran it and is read in\n * that workflow's view, so the session rail leaves such sessions out.\n */\nexport const WORKFLOW_STEP_SESSION_PROVENANCE = 'workflow';\n\n/**\n * Provenance of a session opened to launch workflows for its parent.\n *\n * It picks and starts work, then closes; the runs it started belong to its\n * parent. Like a detached helper, it takes no row in the session rail.\n */\nexport const WORKFLOW_DISPATCHER_SESSION_PROVENANCE = 'workflow-dispatcher';\n\n/** Provenance of a conversation an external MCP client opened and drives. */\nexport const REMOTE_CONVERSATION_SESSION_PROVENANCE = 'remote-conversation';\n\n/** Provenance of the host-wide Voice conversation that relays between the person and other sessions. */\nexport const VOICE_ORCHESTRATOR_SESSION_PROVENANCE = 'voice-orchestrator';\n\n/** A stopped session that keeps its record and can be revived. */\nexport interface PoHubDormantSession {\n readonly sessionId: string;\n readonly name: string;\n readonly workspaceId: string;\n readonly sessionProvenance?: string;\n}\n\nexport interface PoHubSessionCreateRequest {\n /** Global mount only: pins a new top-level session to an admitted workspace. The host validates cwd membership. */\n readonly workspaceId?: string;\n readonly cwd: string;\n readonly name: string;\n readonly parentSessionId?: string;\n readonly sessionProvenance?: string;\n /** Trusted server-side spawner only, never accepted from public HTTP or tool input. */\n readonly interaction?: 'interactive' | 'unattended';\n readonly signal?: AbortSignal;\n /** Host-issued reservation, not a caller-chosen target session id. */\n readonly reservationId?: string;\n /** Pinned axes stay put when the workspace defaults change between turns. */\n readonly selection?: PoHubSessionSelection;\n /** Pi model selector, `provider/id`, validated like `--model`. */\n readonly model?: string;\n /** Pi thinking level, validated like `--thinking`. */\n readonly thinking?: string;\n /** Text appended to the session's system prompt, like `--append-system-prompt`. */\n readonly appendSystemPrompt?: string;\n /** Variables layered over the host environment for the new session and the tools it runs. */\n readonly environment?: Readonly<Record<string, string>>;\n /** The only tools the new session's agent may see or call, like a Team agent's `tools:` list. */\n readonly tools?: readonly string[];\n /** Trusted in-process step bootstrap only. Never accepted from a remote request or persisted. */\n readonly workflowContext?: PoWorkflowContextService;\n}\n\nexport interface PoHubSessionPromptOptions {\n readonly signal?: AbortSignal;\n /** Refuses the prompt unless the target is a direct child of this session. */\n readonly parentSessionId?: string;\n}\n\n/** A prompt the session admitted. `settled` resolves once the agent settles and rejects on a harness fault. */\nexport interface PoHubSessionPromptReceipt {\n readonly settled: Promise<void>;\n}\n\n/** Host-bound inter-session events. The source identity is attached by the hub, never by payload data. */\nexport interface PoSessionCommunicationEndpoint {\n readonly sessionId: string;\n /** Current human-readable session name, read live so renames are reflected. */\n readonly sessionName?: string;\n /** This session's own group names, read live so group edits are reflected. */\n readonly groups?: readonly string[];\n publish(targetSessionId: string, type: string, payload: unknown): boolean;\n subscribe(type: string, listener: (sourceSessionId: string, payload: unknown) => void): () => void;\n onPeerReady(listener: (peerSessionId: string) => void): () => void;\n /** Describes a live peer authorized to communicate, including same-checkout peers. */\n describePeer?(peerSessionId: string): PoSessionPeerDescription | undefined;\n /** Every ready peer this session may message right now, including ones a later group edit made reachable. */\n listPeers?(): readonly PoSessionPeerDescription[];\n close(): void;\n}\n\n/** How a session sees a peer it may message, so an agent can address it by the name a person uses. */\nexport interface PoSessionPeerDescription {\n readonly sessionId: string;\n readonly name: string;\n readonly profile?: string;\n /** Groups both sessions belong to; empty when related through parentage or checkout. */\n readonly sharedGroups: readonly string[];\n}\nexport interface PoPendingSessionSetup {\n readonly id: string;\n readonly name: string;\n readonly createdAt: string;\n readonly cwd?: string;\n readonly setupKind?: 'managed-worktree' | 'existing-directory';\n readonly status?: 'provisioning' | 'failed' | 'interrupted';\n readonly errorCode?: 'SESSION_WORKTREE_PROVISION_FAILED' | 'SESSION_UNAVAILABLE';\n}\n\n/**\n * One short line a session's extension publishes about work it runs for that\n * session, such as a background job. The host shows it on the session's rail\n * card but never interprets it.\n */\nexport interface PoSessionActivity {\n readonly label: string;\n /** The work needs the reader: the rail marks the card the way it marks a pending question. */\n readonly attention?: boolean;\n /** ISO 8601 start of the work; the rail appends the elapsed time. */\n readonly since?: string;\n}\n/** A host-owned setup can be fulfilled by any execution-directory provider. */\nexport interface PoHubSessionReservations {\n read(id: string, parentSessionId: string): { sessionId: string; cwd?: string };\n prepare(id: string, parentSessionId: string, cwd: string): Promise<{ sessionId: string; cwd: string }>;\n complete(id: string, parentSessionId: string): Promise<PoHubSessionScope>;\n}\n\n/** Exclusive usage of one session. Missing measurements are unknown, never zero. */\nexport interface PoHubSessionUsage {\n readonly tokens?: {\n readonly input: number;\n readonly output: number;\n readonly cacheRead: number;\n readonly cacheWrite: number;\n readonly total: number;\n };\n readonly costUsd?: number;\n readonly toolCount?: number;\n}\n\n/** Authoritative execution state. Missing background coordination is unknown, not empty. */\nexport interface PoHubSessionExecutionState {\n readonly isIdle: boolean;\n readonly hasPendingMessages: boolean;\n readonly backgroundWork?: PoBackgroundWorkSnapshot;\n /** Own durable usage only, excluding separately owned child sessions and lanes. */\n readonly usage?: PoHubSessionUsage;\n}\n\n/** Direct lifecycle owned by the canonical headless hub, never by a package transport. */\nexport interface PoHubSessionService {\n create(request: PoHubSessionCreateRequest): Promise<PoHubSessionScope>;\n close(sessionId: string): Promise<void>;\n isLive(sessionId: string): boolean;\n /** Reads a live child's ownership without starting a turn. */\n readExecutionState?(\n sessionId: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>,\n ): Promise<PoHubSessionExecutionState>;\n /** Starts a turn in a live session, as if its user had submitted `text`. */\n prompt?(sessionId: string, text: string, options?: PoHubSessionPromptOptions): Promise<PoHubSessionPromptReceipt>;\n /** Aborts the live session's current turn. The session stays open. */\n abort?(sessionId: string, options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>): Promise<void>;\n /**\n * Adds guidance to a live session's running turn. A session with no turn in\n * progress takes it as its next message instead.\n */\n steer?(\n sessionId: string,\n message: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'>,\n ): Promise<void>;\n /**\n * Stops a live session's runtime and keeps it dormant: its history stays\n * readable where it is shown, and it can be woken later. A session that has\n * done its work no longer holds a model, tools and extensions in the host.\n */\n release?(\n sessionId: string,\n options?: Pick<PoHubSessionPromptOptions, 'parentSessionId'> & {\n /** Leave the session live unless the host can synchronously prove it has no work. */\n onlyIfIdle?: boolean;\n },\n ): Promise<void>;\n /** Global mount only: live session identities, read without starting a turn. */\n scopes?(): readonly PoHubSessionScope[];\n /** Global mount only: stopped sessions that keep their record. */\n dormant?(): readonly PoHubDormantSession[];\n /** Global mount only: reopens a stopped session under its own id. Automatic callers wait for restore readiness. */\n revive?(sessionId: string, options?: { automatic?: boolean }): Promise<void | 'revived' | 'paused' | 'not_found'>;\n readonly reservations?: PoHubSessionReservations;\n /** Provisions a host-reserved Git worktree child. This is not exposed to remote MCP clients. */\n provisionReservedWorktree?(request: PoHubReservedWorktreeRequest): Promise<PoHubSessionScope>;\n /** Core host hook. A Git provider registers its implementation while its channel is mounted. */\n registerReservedWorktreeProvisioner?(provisioner: PoHubReservedWorktreeProvisioner): () => void;\n /**\n * True when both live sessions have a direct parent-child relationship, or execute in the same\n * checkout. Remote conversations only qualify through the parent-child relationship.\n */\n canCommunicate?(sourceSessionId: string, targetSessionId: string): boolean;\n /** Core host hook. Session API construction removes this method before exposing the service to extensions. */\n bindCommunication?(sessionId: string): PoSessionCommunicationEndpoint;\n}\n\nexport interface PoHubSessionApiRequest {\n basePath: string;\n path: string;\n method: string;\n body?: string | Uint8Array<ArrayBuffer> | null;\n signal?: AbortSignal;\n /** Forwarded by the authenticated host, including content type and trace context. */\n headers?: RequestInit['headers'];\n}\n\nexport type PoComputerUseHostOperation = 'status' | 'targets' | 'activate' | 'observe' | 'act' | 'stop';\n\nexport interface PoComputerUseHostRequest {\n readonly operation: PoComputerUseHostOperation;\n readonly payload?: unknown;\n readonly signal?: AbortSignal;\n}\n\nexport interface PoComputerUseHostBinding {\n readonly available: boolean;\n /** Global opt-in, separate from the presence of a native host. */\n readonly enabled?: boolean;\n request(scope: PoHubSessionScope, request: PoComputerUseHostRequest): Promise<unknown>;\n /** Checks a proof injected by the owning Desktop process, never a renderer marker. */\n authorize?(headers: Headers): boolean;\n /** Pins a session to Desktop before asking for a native grant. Ownership is not persisted. */\n claimSession?(sessionId: string, headers?: Headers): void;\n ownsSession?(sessionId: string): boolean;\n /** Server-authenticated paired identity, checked against live native approval for this session. */\n authorizeSession?(sessionId: string, headers: Headers): boolean;\n authorizeRecording?(sessionId: string, headers: Headers): boolean;\n authorizeActivation?(headers: Headers): boolean;\n /** Own pending activation only, never general session control. */\n authorizePending?(sessionId: string, headers: Headers): boolean;\n revokeDevice?(deviceId: string): void;\n /**\n * The Desktop window, or a paired device. A `change` (asking macOS for a permission) also\n * needs the step-up activation needs. Independent of the computer-use setting.\n */\n authorizePermissions?(headers: Headers, change: boolean): boolean;\n /** Desktop's macOS permission states, after asking macOS for `permission` when it is set. */\n permissions?(permission?: string): Promise<unknown>;\n readRecording?(scope: PoHubSessionScope, artifactId: string, range: string): Promise<Response>;\n forgetSession?(sessionId: string): void;\n /** Without `sessionId` the listener hears every session's ownership change. */\n subscribe?(listener: () => void, sessionId?: string): () => void;\n close?(): void;\n}\n\n/** Narrow, host-bound access. An extension cannot select another session's identity. */\nexport interface PoComputerUseSessionAccess {\n readonly available: boolean;\n readonly enabled?: boolean;\n authorize(headers: Headers): boolean;\n authorizeRecording?(headers: Headers): boolean;\n authorizeActivation?(headers: Headers): boolean;\n authorizePending?(headers: Headers): boolean;\n claim(headers?: Headers): void;\n fetchRecording?(artifactId: string, range: string): Promise<Response>;\n subscribe(listener: () => void): () => void;\n}\n\nexport interface PoHubChannelConnection {\n connectionId: string;\n /** Host-verified native renderer proof, never copied from a channel payload. */\n desktopAuthorized?: boolean;\n /** Live session authorization evaluated by the host, never a client frame. */\n computerUseAuthorized?: boolean;\n}\n\nexport interface PoHubChannelHost {\n sessions(): readonly PoHubSessionScope[];\n /** Host facts and storage for trusted in-process channels, never client-supplied roots. */\n readonly homeDirectory?: string;\n readonly sessionStorage?: PoSessionStorageService;\n /** Canonical hub lifecycle for sessions created by channel commands. */\n sessionService?: PoHubSessionService;\n /** Same-process events emitted by session packages. */\n readonly directEvents: PoDirectEventBus;\n publish(sessionId: string, payload: unknown): void;\n publishToConnection?(connectionId: string, sessionId: string, payload: unknown): boolean;\n requestSessionApi(scope: PoHubSessionScope, request: PoHubSessionApiRequest): Promise<Response>;\n computerUse?: PoComputerUseHostBinding;\n onNotice(message: string): void;\n /** Global mount only: admits, or returns, the workspace in the host folder with this name. */\n admitWorkspace?(request: { name: string }): Promise<{ id: string; root: string }>;\n /** Global mount only: the host's admitted workspaces, read live. */\n workspaces?(): readonly PoHubWorkspace[];\n}\n\nexport interface PoHubWorkspace {\n readonly id: string;\n readonly root: string;\n readonly name?: string;\n readonly available?: boolean;\n /** The sandbox provider that runs this workspace; absent means it runs on this host. */\n readonly sandbox?: string;\n /**\n * The sandbox's live state. On a workspace that runs on this host, `unavailable` only means the sandbox\n * cannot be switched on now; its sessions still run here.\n */\n readonly sandboxState?: 'starting' | 'running' | 'stopping' | 'unavailable' | 'failed';\n readonly sandboxReason?: string;\n}\n\nexport interface PoHubChannelSource {\n payloadFor(scope: PoHubSessionScope): unknown;\n /** Read-only compact projection of already-owned state. Must not start work or add watchers. */\n homeFor?(scope: PoHubSessionScope): HomeProjection;\n sessionAdded?(scope: PoHubSessionScope): void;\n sessionRemoved?(sessionId: string): void;\n close(): void;\n}\n\nexport type PoHubChannelLifecycle = 'session' | 'hub';\n\nexport interface PoHubChannel {\n frameType: string;\n lifecycle?: PoHubChannelLifecycle;\n start(host: PoHubChannelHost): PoHubChannelSource;\n receiveWithoutSubscription?: boolean;\n receive?(scope: PoHubSessionScope, payload: unknown, connection: PoHubChannelConnection): void;\n disconnected?(connection: PoHubChannelConnection): void;\n}\n"],"mappings":";;AAOA,MAAa,6BAA6B;;;;;;;AAkG1C,MAAa,mCAAmC;;;;;;;AAQhD,MAAa,yCAAyC;;AAGtD,MAAa,yCAAyC;;AAGtD,MAAa,wCAAwC"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.cjs","names":["Type"],"sources":["../../../src/schemas/workflow.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\nimport { type Static, Type } from 'typebox';\n\nexport const PO_WORKFLOW_LAUNCH_SERVICE = 'po/workflow-launch';\nexport const PO_WORKFLOW_DEFINITION_SOURCES_SERVICE = 'po/workflow-definition-sources';\nexport const PO_WORKFLOW_RUNS_SERVICE = 'po/workflow-runs';\nexport const PO_WORKFLOW_CONTEXT_SERVICE = 'po/workflow-context';\n\n/** A source-relative definition, never an arbitrary host path. */\nexport const PoWorkflowDefinitionRefSchema = Type.Object(\n {\n source: Type.String({ minLength: 1 }),\n key: Type.String({\n minLength: 1,\n pattern: '^(?!/)(?!.*\\\\\\\\)(?!.*:)(?!.*[\\\\u0000-\\\\u001f\\\\u007f])(?!.*(?:^|/)\\\\.{1,2}(?:/|$))[^/]+(?:/[^/]+)*$',\n }),\n },\n { additionalProperties: false },\n);\nexport type PoWorkflowDefinitionRef = Static<typeof PoWorkflowDefinitionRefSchema>;\n\n/** Registration receipt. runId fences a runKey that can be reused later. */\nexport const PoWorkflowRunRefSchema = Type.Object(\n {\n runId: Type.String({ minLength: 1 }),\n ownerSessionId: Type.String({ minLength: 1 }),\n runKey: Type.String({ minLength: 1 }),\n registryWorkspace: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n);\nexport type PoWorkflowRunRef = Static<typeof PoWorkflowRunRefSchema>;\n\nexport interface PoWorkflowLaunchOverrides {\n readonly runner?: string;\n readonly command?: string;\n readonly choice?: string;\n readonly job?: string;\n readonly inputs?: Readonly<Record<string, string>>;\n readonly env?: Readonly<Record<string, string>>;\n readonly prompt?: string;\n readonly name?: string;\n}\n\n/** Session-owned. Rejection means no observable registration was accepted. */\nexport interface PoWorkflowLaunchService {\n launch(definition: PoWorkflowDefinitionRef, overrides?: PoWorkflowLaunchOverrides): Promise<PoWorkflowRunRef>;\n}\n\nexport interface PoWorkflowDefinitionSource {\n readonly source: string;\n /** An admitted, materialized absolute directory. Registration does not fetch it. */\n readonly directory: string;\n}\n\nexport interface PoWorkflowDefinitionSourceHandle {\n readonly source: string;\n readonly generation: string;\n dispose(): void;\n}\n\n/** Workspace-owned registry. Disposal withdraws only the handle's registration. */\nexport interface PoWorkflowDefinitionSourcesService {\n register(contribution: PoWorkflowDefinitionSource): PoWorkflowDefinitionSourceHandle;\n list(): readonly PoWorkflowDefinitionSource[];\n subscribe(listener: (sources: readonly PoWorkflowDefinitionSource[]) => void): () => void;\n}\n\nexport type PoWorkflowStage = 'running' | 'completed' | 'error';\nexport type PoWorkflowOutcome = 'success' | 'skipped' | 'failed' | 'interrupted';\nexport type PoWorkflowProgressState =\n | 'pending'\n | 'running'\n | 'completed'\n | 'skipped'\n | 'failed'\n | 'pause_requested'\n | 'paused'\n | 'resumed';\n\nexport interface PoWorkflowStepState {\n readonly name: string;\n readonly status: PoWorkflowProgressState;\n readonly ref?: { readonly kind: string; readonly id: string; readonly label?: string };\n readonly reason?: string;\n}\n\nexport interface PoWorkflowJobState {\n readonly name: string;\n readonly phase: 'pre' | 'job' | 'post';\n readonly status: PoWorkflowProgressState;\n readonly steps: readonly PoWorkflowStepState[];\n}\n\nexport interface PoWorkflowRunState {\n readonly run: PoWorkflowRunRef;\n readonly stage: PoWorkflowStage;\n readonly outcome?: PoWorkflowOutcome;\n readonly jobs: readonly PoWorkflowJobState[];\n}\n\n/** The parsed definition actually used, not a re-read of mutable YAML on disk. */\nexport interface PoWorkflowConfig {\n readonly definition: PoWorkflowDefinitionRef;\n readonly revision: string;\n /** Engine-owned YAML vocabulary. Core does not import or implement the parser. */\n readonly workflow: Readonly<Record<string, unknown>>;\n}\n\n/** Owner-authoritative views, or an authorized projection for a launcher. */\nexport interface PoWorkflowRunsService {\n readConfig(runId: string): Promise<PoWorkflowConfig | undefined>;\n readState(runId: string): Promise<PoWorkflowRunState | undefined>;\n /** Replays the latest state, including terminal state, before subsequent updates. */\n subscribe(runId: string, listener: (state: PoWorkflowRunState) => void): () => void;\n}\n\n/** Bound only in the trusted step-session bootstrap, before packages mount. */\nexport interface PoWorkflowContextService {\n readonly run: PoWorkflowRunRef;\n readonly job: string;\n readonly step: string;\n readonly attempt: number;\n readonly config: PoWorkflowConfig;\n readonly jobEnvironment: Readonly<Record<string, string>>;\n readonly stepEnvironment: Readonly<Record<string, string>>;\n readonly traceparent?: string;\n /** Absolute path of the workflow's instructions file, read in place of the discovered AGENTS.md files. */\n readonly instructions?: string;\n readonly state: PoWorkflowRunsService;\n}\n\n// These are in-process capabilities, not remote session-create fields or durable records.\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/workflow-launch': PoWorkflowLaunchService;\n 'po/workflow-definition-sources': PoWorkflowDefinitionSourcesService;\n 'po/workflow-runs': PoWorkflowRunsService;\n 'po/workflow-context': PoWorkflowContextService;\n }\n}\n\nexport function readPoWorkflowLaunchService(context: Context): PoWorkflowLaunchService | undefined {\n return context.get(PO_WORKFLOW_LAUNCH_SERVICE) as PoWorkflowLaunchService | undefined;\n}\n\nexport function readPoWorkflowDefinitionSourcesService(\n context: Context,\n): PoWorkflowDefinitionSourcesService | undefined {\n return context.get(PO_WORKFLOW_DEFINITION_SOURCES_SERVICE) as PoWorkflowDefinitionSourcesService | undefined;\n}\n\nexport function readPoWorkflowRunsService(context: Context): PoWorkflowRunsService | undefined {\n return context.get(PO_WORKFLOW_RUNS_SERVICE) as PoWorkflowRunsService | undefined;\n}\n\nexport function readPoWorkflowContextService(context: Context): PoWorkflowContextService | undefined {\n return context.get(PO_WORKFLOW_CONTEXT_SERVICE) as PoWorkflowContextService | undefined;\n}\n"],"mappings":";;AAGA,MAAa,6BAA6B;AAC1C,MAAa,yCAAyC;AACtD,MAAa,2BAA2B;AACxC,MAAa,8BAA8B;;AAG3C,MAAa,gCAAgCA,QAAAA,KAAK,OAChD;CACE,QAAQA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACpC,KAAKA,QAAAA,KAAK,OAAO;EACf,WAAW;EACX,SAAS;CACX,CAAC;AACH,GACA,EAAE,sBAAsB,MAAM,CAChC;;AAIA,MAAa,yBAAyBA,QAAAA,KAAK,OACzC;CACE,OAAOA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACnC,gBAAgBA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CAC5C,QAAQA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACpC,mBAAmBA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AACjD,GACA,EAAE,sBAAsB,MAAM,CAChC;AAgHA,SAAgB,4BAA4B,SAAuD;CACjG,OAAO,QAAQ,IAAI,0BAA0B;AAC/C;AAEA,SAAgB,uCACd,SACgD;CAChD,OAAO,QAAQ,IAAI,sCAAsC;AAC3D;AAEA,SAAgB,0BAA0B,SAAqD;CAC7F,OAAO,QAAQ,IAAI,wBAAwB;AAC7C;AAEA,SAAgB,6BAA6B,SAAwD;CACnG,OAAO,QAAQ,IAAI,2BAA2B;AAChD"}
1
+ {"version":3,"file":"workflow.cjs","names":["Type"],"sources":["../../../src/schemas/workflow.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\nimport { type Static, Type } from 'typebox';\n\nexport const PO_WORKFLOW_LAUNCH_SERVICE = 'po/workflow-launch';\nexport const PO_WORKFLOW_DEFINITION_SOURCES_SERVICE = 'po/workflow-definition-sources';\nexport const PO_WORKFLOW_RUNS_SERVICE = 'po/workflow-runs';\nexport const PO_WORKFLOW_CONTEXT_SERVICE = 'po/workflow-context';\n\n/** A source-relative definition, never an arbitrary host path. */\nexport const PoWorkflowDefinitionRefSchema = Type.Object(\n {\n source: Type.String({ minLength: 1 }),\n key: Type.String({\n minLength: 1,\n pattern: '^(?!/)(?!.*\\\\\\\\)(?!.*:)(?!.*[\\\\u0000-\\\\u001f\\\\u007f])(?!.*(?:^|/)\\\\.{1,2}(?:/|$))[^/]+(?:/[^/]+)*$',\n }),\n },\n { additionalProperties: false },\n);\nexport type PoWorkflowDefinitionRef = Static<typeof PoWorkflowDefinitionRefSchema>;\n\n/** Registration receipt. runId fences a runKey that can be reused later. */\nexport const PoWorkflowRunRefSchema = Type.Object(\n {\n runId: Type.String({ minLength: 1 }),\n ownerSessionId: Type.String({ minLength: 1 }),\n runKey: Type.String({ minLength: 1 }),\n registryWorkspace: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n);\nexport type PoWorkflowRunRef = Static<typeof PoWorkflowRunRefSchema>;\n\nexport interface PoWorkflowLaunchOverrides {\n readonly runner?: string;\n readonly command?: string;\n readonly choice?: string;\n readonly job?: string;\n readonly inputs?: Readonly<Record<string, string>>;\n readonly env?: Readonly<Record<string, string>>;\n readonly prompt?: string;\n readonly name?: string;\n}\n\n/** Session-owned. Rejection means no observable registration was accepted. */\nexport interface PoWorkflowLaunchService {\n launch(definition: PoWorkflowDefinitionRef, overrides?: PoWorkflowLaunchOverrides): Promise<PoWorkflowRunRef>;\n}\n\nexport interface PoWorkflowDefinitionSource {\n readonly source: string;\n /** An admitted, materialized absolute directory. Registration does not fetch it. */\n readonly directory: string;\n}\n\nexport interface PoWorkflowDefinitionSourceHandle {\n readonly source: string;\n readonly generation: string;\n dispose(): void;\n}\n\n/** Workspace-owned registry. Disposal withdraws only the handle's registration. */\nexport interface PoWorkflowDefinitionSourcesService {\n register(contribution: PoWorkflowDefinitionSource): PoWorkflowDefinitionSourceHandle;\n list(): readonly PoWorkflowDefinitionSource[];\n subscribe(listener: (sources: readonly PoWorkflowDefinitionSource[]) => void): () => void;\n}\n\nexport type PoWorkflowStage = 'running' | 'completed' | 'error';\nexport type PoWorkflowOutcome = 'success' | 'skipped' | 'failed' | 'interrupted';\nexport type PoWorkflowProgressState =\n | 'pending'\n | 'running'\n | 'completed'\n | 'skipped'\n | 'failed'\n | 'pause_requested'\n | 'paused'\n | 'resumed';\n\nexport interface PoWorkflowStepState {\n readonly name: string;\n readonly status: PoWorkflowProgressState;\n readonly ref?: { readonly kind: string; readonly id: string; readonly label?: string };\n readonly reason?: string;\n}\n\nexport interface PoWorkflowJobState {\n readonly name: string;\n readonly phase: 'pre' | 'job' | 'post';\n readonly status: PoWorkflowProgressState;\n readonly steps: readonly PoWorkflowStepState[];\n}\n\nexport interface PoWorkflowRunState {\n readonly run: PoWorkflowRunRef;\n readonly stage: PoWorkflowStage;\n readonly outcome?: PoWorkflowOutcome;\n readonly jobs: readonly PoWorkflowJobState[];\n readonly children?: readonly PoWorkflowChildrenStatus[];\n}\n\n/** The parsed definition actually used, not a re-read of mutable YAML on disk. */\nexport interface PoWorkflowConfig {\n readonly definition: PoWorkflowDefinitionRef;\n readonly revision: string;\n /** Engine-owned YAML vocabulary. Core does not import or implement the parser. */\n readonly workflow: Readonly<Record<string, unknown>>;\n}\n\n/** Owner-authoritative views, or an authorized projection for a launcher. */\nexport interface PoWorkflowRunsService {\n readConfig(runId: string): Promise<PoWorkflowConfig | undefined>;\n readState(runId: string): Promise<PoWorkflowRunState | undefined>;\n /** Replays the latest state, including terminal state, before subsequent updates. */\n subscribe(runId: string, listener: (state: PoWorkflowRunState) => void): () => void;\n}\n\nexport interface PoWorkflowChildInvocation {\n readonly invocationId: string;\n readonly job: string;\n readonly state: 'running' | 'completed' | 'failed' | 'interrupted';\n readonly sessionIds: readonly string[];\n readonly startedAt: string;\n readonly endedAt?: string;\n readonly error?: string;\n readonly usage?: import('./hubChannel').PoHubSessionUsage;\n}\n\nexport interface PoWorkflowCriterionState {\n readonly key: string;\n readonly description: string;\n readonly verifiedBy: string;\n readonly status: 'unchecked' | 'checked' | 'not-met';\n readonly feedback?: string;\n readonly invocationId?: string;\n}\n\nexport interface PoWorkflowChildrenStatus {\n readonly lead: string;\n readonly continuations: number;\n readonly maxContinuations: number;\n readonly criteria: readonly PoWorkflowCriterionState[];\n readonly invocations: readonly PoWorkflowChildInvocation[];\n}\n\n/** In-process, caller-bound capability. Never accepted from a tool or serialized. */\nexport interface PoWorkflowChildrenSession {\n readonly role: 'lead' | 'child' | 'consumer';\n spawnChild?(input: {\n job: string;\n prompt: string;\n inputs?: Record<string, string | number | boolean>;\n }): Promise<PoWorkflowChildInvocation>;\n childStatus?(input: { invocationId: string }): Promise<PoWorkflowChildInvocation>;\n children?(): Promise<PoWorkflowChildrenStatus>;\n reportCriteria?(input: {\n results: Record<string, { status: 'checked' | 'not-met'; feedback?: string }>;\n }): Promise<void>;\n /** Immutable pre-review snapshot selected by the runtime, not mutable paths. */\n reviewArtifacts?(): Promise<{ revision: string; artifacts: Readonly<Record<string, string>> }>;\n /** Returns exactly the accepted bytes, after a fresh authoritative ledger/revision check. */\n acceptedArtifacts?(input: {\n job: string;\n }): Promise<{ revision: string; artifacts: Readonly<Record<string, string>> }>;\n}\n\n/** Bound only in the trusted step-session bootstrap, before packages mount. */\nexport interface PoWorkflowContextService {\n readonly run: PoWorkflowRunRef;\n readonly job: string;\n readonly step: string;\n readonly attempt: number;\n readonly config: PoWorkflowConfig;\n readonly jobEnvironment: Readonly<Record<string, string>>;\n readonly stepEnvironment: Readonly<Record<string, string>>;\n readonly traceparent?: string;\n /** Absolute path of the workflow's instructions file, read in place of the discovered AGENTS.md files. */\n readonly instructions?: string;\n readonly state: PoWorkflowRunsService;\n readonly children?: PoWorkflowChildrenSession;\n}\n\n// These are in-process capabilities, not remote session-create fields or durable records.\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/workflow-launch': PoWorkflowLaunchService;\n 'po/workflow-definition-sources': PoWorkflowDefinitionSourcesService;\n 'po/workflow-runs': PoWorkflowRunsService;\n 'po/workflow-context': PoWorkflowContextService;\n }\n}\n\nexport function readPoWorkflowLaunchService(context: Context): PoWorkflowLaunchService | undefined {\n return context.get(PO_WORKFLOW_LAUNCH_SERVICE) as PoWorkflowLaunchService | undefined;\n}\n\nexport function readPoWorkflowDefinitionSourcesService(\n context: Context,\n): PoWorkflowDefinitionSourcesService | undefined {\n return context.get(PO_WORKFLOW_DEFINITION_SOURCES_SERVICE) as PoWorkflowDefinitionSourcesService | undefined;\n}\n\nexport function readPoWorkflowRunsService(context: Context): PoWorkflowRunsService | undefined {\n return context.get(PO_WORKFLOW_RUNS_SERVICE) as PoWorkflowRunsService | undefined;\n}\n\nexport function readPoWorkflowContextService(context: Context): PoWorkflowContextService | undefined {\n return context.get(PO_WORKFLOW_CONTEXT_SERVICE) as PoWorkflowContextService | undefined;\n}\n"],"mappings":";;AAGA,MAAa,6BAA6B;AAC1C,MAAa,yCAAyC;AACtD,MAAa,2BAA2B;AACxC,MAAa,8BAA8B;;AAG3C,MAAa,gCAAgCA,QAAAA,KAAK,OAChD;CACE,QAAQA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACpC,KAAKA,QAAAA,KAAK,OAAO;EACf,WAAW;EACX,SAAS;CACX,CAAC;AACH,GACA,EAAE,sBAAsB,MAAM,CAChC;;AAIA,MAAa,yBAAyBA,QAAAA,KAAK,OACzC;CACE,OAAOA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACnC,gBAAgBA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CAC5C,QAAQA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACpC,mBAAmBA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AACjD,GACA,EAAE,sBAAsB,MAAM,CAChC;AAmKA,SAAgB,4BAA4B,SAAuD;CACjG,OAAO,QAAQ,IAAI,0BAA0B;AAC/C;AAEA,SAAgB,uCACd,SACgD;CAChD,OAAO,QAAQ,IAAI,sCAAsC;AAC3D;AAEA,SAAgB,0BAA0B,SAAqD;CAC7F,OAAO,QAAQ,IAAI,wBAAwB;AAC7C;AAEA,SAAgB,6BAA6B,SAAwD;CACnG,OAAO,QAAQ,IAAI,2BAA2B;AAChD"}
@@ -1,3 +1,4 @@
1
+ import { PoHubSessionUsage } from "./hubChannel.mjs";
1
2
  import { Static, Type } from "typebox";
2
3
  import { Context } from "@deepseek-ai/cordis";
3
4
  //#region src/schemas/workflow.d.ts
@@ -73,6 +74,7 @@ export interface PoWorkflowRunState {
73
74
  readonly stage: PoWorkflowStage;
74
75
  readonly outcome?: PoWorkflowOutcome;
75
76
  readonly jobs: readonly PoWorkflowJobState[];
77
+ readonly children?: readonly PoWorkflowChildrenStatus[];
76
78
  }
77
79
  /** The parsed definition actually used, not a re-read of mutable YAML on disk. */
78
80
  export interface PoWorkflowConfig {
@@ -88,6 +90,62 @@ export interface PoWorkflowRunsService {
88
90
  /** Replays the latest state, including terminal state, before subsequent updates. */
89
91
  subscribe(runId: string, listener: (state: PoWorkflowRunState) => void): () => void;
90
92
  }
93
+ export interface PoWorkflowChildInvocation {
94
+ readonly invocationId: string;
95
+ readonly job: string;
96
+ readonly state: 'running' | 'completed' | 'failed' | 'interrupted';
97
+ readonly sessionIds: readonly string[];
98
+ readonly startedAt: string;
99
+ readonly endedAt?: string;
100
+ readonly error?: string;
101
+ readonly usage?: PoHubSessionUsage;
102
+ }
103
+ export interface PoWorkflowCriterionState {
104
+ readonly key: string;
105
+ readonly description: string;
106
+ readonly verifiedBy: string;
107
+ readonly status: 'unchecked' | 'checked' | 'not-met';
108
+ readonly feedback?: string;
109
+ readonly invocationId?: string;
110
+ }
111
+ export interface PoWorkflowChildrenStatus {
112
+ readonly lead: string;
113
+ readonly continuations: number;
114
+ readonly maxContinuations: number;
115
+ readonly criteria: readonly PoWorkflowCriterionState[];
116
+ readonly invocations: readonly PoWorkflowChildInvocation[];
117
+ }
118
+ /** In-process, caller-bound capability. Never accepted from a tool or serialized. */
119
+ export interface PoWorkflowChildrenSession {
120
+ readonly role: 'lead' | 'child' | 'consumer';
121
+ spawnChild?(input: {
122
+ job: string;
123
+ prompt: string;
124
+ inputs?: Record<string, string | number | boolean>;
125
+ }): Promise<PoWorkflowChildInvocation>;
126
+ childStatus?(input: {
127
+ invocationId: string;
128
+ }): Promise<PoWorkflowChildInvocation>;
129
+ children?(): Promise<PoWorkflowChildrenStatus>;
130
+ reportCriteria?(input: {
131
+ results: Record<string, {
132
+ status: 'checked' | 'not-met';
133
+ feedback?: string;
134
+ }>;
135
+ }): Promise<void>;
136
+ /** Immutable pre-review snapshot selected by the runtime, not mutable paths. */
137
+ reviewArtifacts?(): Promise<{
138
+ revision: string;
139
+ artifacts: Readonly<Record<string, string>>;
140
+ }>;
141
+ /** Returns exactly the accepted bytes, after a fresh authoritative ledger/revision check. */
142
+ acceptedArtifacts?(input: {
143
+ job: string;
144
+ }): Promise<{
145
+ revision: string;
146
+ artifacts: Readonly<Record<string, string>>;
147
+ }>;
148
+ }
91
149
  /** Bound only in the trusted step-session bootstrap, before packages mount. */
92
150
  export interface PoWorkflowContextService {
93
151
  readonly run: PoWorkflowRunRef;
@@ -101,6 +159,7 @@ export interface PoWorkflowContextService {
101
159
  /** Absolute path of the workflow's instructions file, read in place of the discovered AGENTS.md files. */
102
160
  readonly instructions?: string;
103
161
  readonly state: PoWorkflowRunsService;
162
+ readonly children?: PoWorkflowChildrenSession;
104
163
  }
105
164
  declare module '@deepseek-ai/cordis' {
106
165
  interface Context {
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.d.mts","names":[],"sources":["../../../src/schemas/workflow.ts"],"mappings":";;;qBAGa;qBACA;qBACA;qBACA;;qBAGA,+BAA6B,KAAA;;;;YAU9B,0BAA0B,cAAc;;qBAGvC,wBAAsB,KAAA;;;;;;YASvB,mBAAmB,cAAc;iBAE5B;WACN;WACA;WACA;WACA;WACA,SAAS,SAAS;WAClB,MAAM,SAAS;WACf;WACA;;;iBAIM;EACf,OAAO,YAAY,yBAAyB,YAAY,4BAA4B,QAAQ;;iBAG7E;WACN;;WAEA;;iBAGM;WACN;WACA;EACT;;;iBAIe;EACf,SAAS,cAAc,6BAA6B;EACpD,iBAAiB;EACjB,UAAU,WAAW,kBAAkB;;YAG7B;YACA;YACA;iBAUK;WACN;WACA,QAAQ;WACR;aAAiB;aAAuB;aAAqB;;WAC7D;;iBAGM;WACN;WACA;WACA,QAAQ;WACR,gBAAgB;;iBAGV;WACN,KAAK;WACL,OAAO;WACP,UAAU;WACV,eAAe;;;iBAIT;WACN,YAAY;WACZ;;WAEA,UAAU,SAAS;;;iBAIb;EACf,WAAW,gBAAgB,QAAQ;EACnC,UAAU,gBAAgB,QAAQ;;EAElC,UAAU,eAAe,WAAW,OAAO;;;iBAI5B;WACN,KAAK;WACL;WACA;WACA;WACA,QAAQ;WACR,gBAAgB,SAAS;WACzB,iBAAiB,SAAS;WAC1B;;WAEA;WACA,OAAO;;;YAKN;IACR,sBAAsB;IACtB,kCAAkC;IAClC,oBAAoB;IACpB,uBAAuB;;;wBAIX,4BAA4B,SAAS,UAAU;wBAI/C,uCACd,SAAS,UACR;wBAIa,0BAA0B,SAAS,UAAU;wBAI7C,6BAA6B,SAAS,UAAU"}
1
+ {"version":3,"file":"workflow.d.mts","names":["_$__hubChannel0.PoHubSessionUsage"],"sources":["../../../src/schemas/workflow.ts"],"mappings":";;;;qBAGa;qBACA;qBACA;qBACA;;qBAGA,+BAA6B,KAAA;;;;YAU9B,0BAA0B,cAAc;;qBAGvC,wBAAsB,KAAA;;;;;;YASvB,mBAAmB,cAAc;iBAE5B;WACN;WACA;WACA;WACA;WACA,SAAS,SAAS;WAClB,MAAM,SAAS;WACf;WACA;;;iBAIM;EACf,OAAO,YAAY,yBAAyB,YAAY,4BAA4B,QAAQ;;iBAG7E;WACN;;WAEA;;iBAGM;WACN;WACA;EACT;;;iBAIe;EACf,SAAS,cAAc,6BAA6B;EACpD,iBAAiB;EACjB,UAAU,WAAW,kBAAkB;;YAG7B;YACA;YACA;iBAUK;WACN;WACA,QAAQ;WACR;aAAiB;aAAuB;aAAqB;;WAC7D;;iBAGM;WACN;WACA;WACA,QAAQ;WACR,gBAAgB;;iBAGV;WACN,KAAK;WACL,OAAO;WACP,UAAU;WACV,eAAe;WACf,oBAAoB;;;iBAId;WACN,YAAY;WACZ;;WAEA,UAAU,SAAS;;;iBAIb;EACf,WAAW,gBAAgB,QAAQ;EACnC,UAAU,gBAAgB,QAAQ;;EAElC,UAAU,eAAe,WAAW,OAAO;;iBAG5B;WACN;WACA;WACA;WACA;WACA;WACA;WACA;WACA,QARMA;;iBAWA;WACN;WACA;WACA;WACA;WACA;WACA;;iBAGM;WACN;WACA;WACA;WACA,mBAAmB;WACnB,sBAAsB;;;iBAIhB;WACN;EACT,YAAY;IACV;IACA;IACA,SAAS;MACP,QAAQ;EACZ,aAAa;IAAS;MAAyB,QAAQ;EACvD,aAAa,QAAQ;EACrB,gBAAgB;IACd,SAAS;MAAiB;MAA+B;;MACvD;;EAEJ,oBAAoB;IAAU;IAAkB,WAAW,SAAS;;;EAEpE,mBAAmB;IACjB;MACE;IAAU;IAAkB,WAAW,SAAS;;;;iBAIrC;WACN,KAAK;WACL;WACA;WACA;WACA,QAAQ;WACR,gBAAgB,SAAS;WACzB,iBAAiB,SAAS;WAC1B;;WAEA;WACA,OAAO;WACP,WAAW;;;YAKV;IACR,sBAAsB;IACtB,kCAAkC;IAClC,oBAAoB;IACpB,uBAAuB;;;wBAIX,4BAA4B,SAAS,UAAU;wBAI/C,uCACd,SAAS,UACR;wBAIa,0BAA0B,SAAS,UAAU;wBAI7C,6BAA6B,SAAS,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.mjs","names":[],"sources":["../../../src/schemas/workflow.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\nimport { type Static, Type } from 'typebox';\n\nexport const PO_WORKFLOW_LAUNCH_SERVICE = 'po/workflow-launch';\nexport const PO_WORKFLOW_DEFINITION_SOURCES_SERVICE = 'po/workflow-definition-sources';\nexport const PO_WORKFLOW_RUNS_SERVICE = 'po/workflow-runs';\nexport const PO_WORKFLOW_CONTEXT_SERVICE = 'po/workflow-context';\n\n/** A source-relative definition, never an arbitrary host path. */\nexport const PoWorkflowDefinitionRefSchema = Type.Object(\n {\n source: Type.String({ minLength: 1 }),\n key: Type.String({\n minLength: 1,\n pattern: '^(?!/)(?!.*\\\\\\\\)(?!.*:)(?!.*[\\\\u0000-\\\\u001f\\\\u007f])(?!.*(?:^|/)\\\\.{1,2}(?:/|$))[^/]+(?:/[^/]+)*$',\n }),\n },\n { additionalProperties: false },\n);\nexport type PoWorkflowDefinitionRef = Static<typeof PoWorkflowDefinitionRefSchema>;\n\n/** Registration receipt. runId fences a runKey that can be reused later. */\nexport const PoWorkflowRunRefSchema = Type.Object(\n {\n runId: Type.String({ minLength: 1 }),\n ownerSessionId: Type.String({ minLength: 1 }),\n runKey: Type.String({ minLength: 1 }),\n registryWorkspace: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n);\nexport type PoWorkflowRunRef = Static<typeof PoWorkflowRunRefSchema>;\n\nexport interface PoWorkflowLaunchOverrides {\n readonly runner?: string;\n readonly command?: string;\n readonly choice?: string;\n readonly job?: string;\n readonly inputs?: Readonly<Record<string, string>>;\n readonly env?: Readonly<Record<string, string>>;\n readonly prompt?: string;\n readonly name?: string;\n}\n\n/** Session-owned. Rejection means no observable registration was accepted. */\nexport interface PoWorkflowLaunchService {\n launch(definition: PoWorkflowDefinitionRef, overrides?: PoWorkflowLaunchOverrides): Promise<PoWorkflowRunRef>;\n}\n\nexport interface PoWorkflowDefinitionSource {\n readonly source: string;\n /** An admitted, materialized absolute directory. Registration does not fetch it. */\n readonly directory: string;\n}\n\nexport interface PoWorkflowDefinitionSourceHandle {\n readonly source: string;\n readonly generation: string;\n dispose(): void;\n}\n\n/** Workspace-owned registry. Disposal withdraws only the handle's registration. */\nexport interface PoWorkflowDefinitionSourcesService {\n register(contribution: PoWorkflowDefinitionSource): PoWorkflowDefinitionSourceHandle;\n list(): readonly PoWorkflowDefinitionSource[];\n subscribe(listener: (sources: readonly PoWorkflowDefinitionSource[]) => void): () => void;\n}\n\nexport type PoWorkflowStage = 'running' | 'completed' | 'error';\nexport type PoWorkflowOutcome = 'success' | 'skipped' | 'failed' | 'interrupted';\nexport type PoWorkflowProgressState =\n | 'pending'\n | 'running'\n | 'completed'\n | 'skipped'\n | 'failed'\n | 'pause_requested'\n | 'paused'\n | 'resumed';\n\nexport interface PoWorkflowStepState {\n readonly name: string;\n readonly status: PoWorkflowProgressState;\n readonly ref?: { readonly kind: string; readonly id: string; readonly label?: string };\n readonly reason?: string;\n}\n\nexport interface PoWorkflowJobState {\n readonly name: string;\n readonly phase: 'pre' | 'job' | 'post';\n readonly status: PoWorkflowProgressState;\n readonly steps: readonly PoWorkflowStepState[];\n}\n\nexport interface PoWorkflowRunState {\n readonly run: PoWorkflowRunRef;\n readonly stage: PoWorkflowStage;\n readonly outcome?: PoWorkflowOutcome;\n readonly jobs: readonly PoWorkflowJobState[];\n}\n\n/** The parsed definition actually used, not a re-read of mutable YAML on disk. */\nexport interface PoWorkflowConfig {\n readonly definition: PoWorkflowDefinitionRef;\n readonly revision: string;\n /** Engine-owned YAML vocabulary. Core does not import or implement the parser. */\n readonly workflow: Readonly<Record<string, unknown>>;\n}\n\n/** Owner-authoritative views, or an authorized projection for a launcher. */\nexport interface PoWorkflowRunsService {\n readConfig(runId: string): Promise<PoWorkflowConfig | undefined>;\n readState(runId: string): Promise<PoWorkflowRunState | undefined>;\n /** Replays the latest state, including terminal state, before subsequent updates. */\n subscribe(runId: string, listener: (state: PoWorkflowRunState) => void): () => void;\n}\n\n/** Bound only in the trusted step-session bootstrap, before packages mount. */\nexport interface PoWorkflowContextService {\n readonly run: PoWorkflowRunRef;\n readonly job: string;\n readonly step: string;\n readonly attempt: number;\n readonly config: PoWorkflowConfig;\n readonly jobEnvironment: Readonly<Record<string, string>>;\n readonly stepEnvironment: Readonly<Record<string, string>>;\n readonly traceparent?: string;\n /** Absolute path of the workflow's instructions file, read in place of the discovered AGENTS.md files. */\n readonly instructions?: string;\n readonly state: PoWorkflowRunsService;\n}\n\n// These are in-process capabilities, not remote session-create fields or durable records.\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/workflow-launch': PoWorkflowLaunchService;\n 'po/workflow-definition-sources': PoWorkflowDefinitionSourcesService;\n 'po/workflow-runs': PoWorkflowRunsService;\n 'po/workflow-context': PoWorkflowContextService;\n }\n}\n\nexport function readPoWorkflowLaunchService(context: Context): PoWorkflowLaunchService | undefined {\n return context.get(PO_WORKFLOW_LAUNCH_SERVICE) as PoWorkflowLaunchService | undefined;\n}\n\nexport function readPoWorkflowDefinitionSourcesService(\n context: Context,\n): PoWorkflowDefinitionSourcesService | undefined {\n return context.get(PO_WORKFLOW_DEFINITION_SOURCES_SERVICE) as PoWorkflowDefinitionSourcesService | undefined;\n}\n\nexport function readPoWorkflowRunsService(context: Context): PoWorkflowRunsService | undefined {\n return context.get(PO_WORKFLOW_RUNS_SERVICE) as PoWorkflowRunsService | undefined;\n}\n\nexport function readPoWorkflowContextService(context: Context): PoWorkflowContextService | undefined {\n return context.get(PO_WORKFLOW_CONTEXT_SERVICE) as PoWorkflowContextService | undefined;\n}\n"],"mappings":";;AAGA,MAAa,6BAA6B;AAC1C,MAAa,yCAAyC;AACtD,MAAa,2BAA2B;AACxC,MAAa,8BAA8B;;AAG3C,MAAa,gCAAgC,KAAK,OAChD;CACE,QAAQ,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACpC,KAAK,KAAK,OAAO;EACf,WAAW;EACX,SAAS;CACX,CAAC;AACH,GACA,EAAE,sBAAsB,MAAM,CAChC;;AAIA,MAAa,yBAAyB,KAAK,OACzC;CACE,OAAO,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACnC,gBAAgB,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CAC5C,QAAQ,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACpC,mBAAmB,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AACjD,GACA,EAAE,sBAAsB,MAAM,CAChC;AAgHA,SAAgB,4BAA4B,SAAuD;CACjG,OAAO,QAAQ,IAAI,0BAA0B;AAC/C;AAEA,SAAgB,uCACd,SACgD;CAChD,OAAO,QAAQ,IAAI,sCAAsC;AAC3D;AAEA,SAAgB,0BAA0B,SAAqD;CAC7F,OAAO,QAAQ,IAAI,wBAAwB;AAC7C;AAEA,SAAgB,6BAA6B,SAAwD;CACnG,OAAO,QAAQ,IAAI,2BAA2B;AAChD"}
1
+ {"version":3,"file":"workflow.mjs","names":[],"sources":["../../../src/schemas/workflow.ts"],"sourcesContent":["import type { Context } from '@deepseek-ai/cordis';\nimport { type Static, Type } from 'typebox';\n\nexport const PO_WORKFLOW_LAUNCH_SERVICE = 'po/workflow-launch';\nexport const PO_WORKFLOW_DEFINITION_SOURCES_SERVICE = 'po/workflow-definition-sources';\nexport const PO_WORKFLOW_RUNS_SERVICE = 'po/workflow-runs';\nexport const PO_WORKFLOW_CONTEXT_SERVICE = 'po/workflow-context';\n\n/** A source-relative definition, never an arbitrary host path. */\nexport const PoWorkflowDefinitionRefSchema = Type.Object(\n {\n source: Type.String({ minLength: 1 }),\n key: Type.String({\n minLength: 1,\n pattern: '^(?!/)(?!.*\\\\\\\\)(?!.*:)(?!.*[\\\\u0000-\\\\u001f\\\\u007f])(?!.*(?:^|/)\\\\.{1,2}(?:/|$))[^/]+(?:/[^/]+)*$',\n }),\n },\n { additionalProperties: false },\n);\nexport type PoWorkflowDefinitionRef = Static<typeof PoWorkflowDefinitionRefSchema>;\n\n/** Registration receipt. runId fences a runKey that can be reused later. */\nexport const PoWorkflowRunRefSchema = Type.Object(\n {\n runId: Type.String({ minLength: 1 }),\n ownerSessionId: Type.String({ minLength: 1 }),\n runKey: Type.String({ minLength: 1 }),\n registryWorkspace: Type.String({ minLength: 1 }),\n },\n { additionalProperties: false },\n);\nexport type PoWorkflowRunRef = Static<typeof PoWorkflowRunRefSchema>;\n\nexport interface PoWorkflowLaunchOverrides {\n readonly runner?: string;\n readonly command?: string;\n readonly choice?: string;\n readonly job?: string;\n readonly inputs?: Readonly<Record<string, string>>;\n readonly env?: Readonly<Record<string, string>>;\n readonly prompt?: string;\n readonly name?: string;\n}\n\n/** Session-owned. Rejection means no observable registration was accepted. */\nexport interface PoWorkflowLaunchService {\n launch(definition: PoWorkflowDefinitionRef, overrides?: PoWorkflowLaunchOverrides): Promise<PoWorkflowRunRef>;\n}\n\nexport interface PoWorkflowDefinitionSource {\n readonly source: string;\n /** An admitted, materialized absolute directory. Registration does not fetch it. */\n readonly directory: string;\n}\n\nexport interface PoWorkflowDefinitionSourceHandle {\n readonly source: string;\n readonly generation: string;\n dispose(): void;\n}\n\n/** Workspace-owned registry. Disposal withdraws only the handle's registration. */\nexport interface PoWorkflowDefinitionSourcesService {\n register(contribution: PoWorkflowDefinitionSource): PoWorkflowDefinitionSourceHandle;\n list(): readonly PoWorkflowDefinitionSource[];\n subscribe(listener: (sources: readonly PoWorkflowDefinitionSource[]) => void): () => void;\n}\n\nexport type PoWorkflowStage = 'running' | 'completed' | 'error';\nexport type PoWorkflowOutcome = 'success' | 'skipped' | 'failed' | 'interrupted';\nexport type PoWorkflowProgressState =\n | 'pending'\n | 'running'\n | 'completed'\n | 'skipped'\n | 'failed'\n | 'pause_requested'\n | 'paused'\n | 'resumed';\n\nexport interface PoWorkflowStepState {\n readonly name: string;\n readonly status: PoWorkflowProgressState;\n readonly ref?: { readonly kind: string; readonly id: string; readonly label?: string };\n readonly reason?: string;\n}\n\nexport interface PoWorkflowJobState {\n readonly name: string;\n readonly phase: 'pre' | 'job' | 'post';\n readonly status: PoWorkflowProgressState;\n readonly steps: readonly PoWorkflowStepState[];\n}\n\nexport interface PoWorkflowRunState {\n readonly run: PoWorkflowRunRef;\n readonly stage: PoWorkflowStage;\n readonly outcome?: PoWorkflowOutcome;\n readonly jobs: readonly PoWorkflowJobState[];\n readonly children?: readonly PoWorkflowChildrenStatus[];\n}\n\n/** The parsed definition actually used, not a re-read of mutable YAML on disk. */\nexport interface PoWorkflowConfig {\n readonly definition: PoWorkflowDefinitionRef;\n readonly revision: string;\n /** Engine-owned YAML vocabulary. Core does not import or implement the parser. */\n readonly workflow: Readonly<Record<string, unknown>>;\n}\n\n/** Owner-authoritative views, or an authorized projection for a launcher. */\nexport interface PoWorkflowRunsService {\n readConfig(runId: string): Promise<PoWorkflowConfig | undefined>;\n readState(runId: string): Promise<PoWorkflowRunState | undefined>;\n /** Replays the latest state, including terminal state, before subsequent updates. */\n subscribe(runId: string, listener: (state: PoWorkflowRunState) => void): () => void;\n}\n\nexport interface PoWorkflowChildInvocation {\n readonly invocationId: string;\n readonly job: string;\n readonly state: 'running' | 'completed' | 'failed' | 'interrupted';\n readonly sessionIds: readonly string[];\n readonly startedAt: string;\n readonly endedAt?: string;\n readonly error?: string;\n readonly usage?: import('./hubChannel').PoHubSessionUsage;\n}\n\nexport interface PoWorkflowCriterionState {\n readonly key: string;\n readonly description: string;\n readonly verifiedBy: string;\n readonly status: 'unchecked' | 'checked' | 'not-met';\n readonly feedback?: string;\n readonly invocationId?: string;\n}\n\nexport interface PoWorkflowChildrenStatus {\n readonly lead: string;\n readonly continuations: number;\n readonly maxContinuations: number;\n readonly criteria: readonly PoWorkflowCriterionState[];\n readonly invocations: readonly PoWorkflowChildInvocation[];\n}\n\n/** In-process, caller-bound capability. Never accepted from a tool or serialized. */\nexport interface PoWorkflowChildrenSession {\n readonly role: 'lead' | 'child' | 'consumer';\n spawnChild?(input: {\n job: string;\n prompt: string;\n inputs?: Record<string, string | number | boolean>;\n }): Promise<PoWorkflowChildInvocation>;\n childStatus?(input: { invocationId: string }): Promise<PoWorkflowChildInvocation>;\n children?(): Promise<PoWorkflowChildrenStatus>;\n reportCriteria?(input: {\n results: Record<string, { status: 'checked' | 'not-met'; feedback?: string }>;\n }): Promise<void>;\n /** Immutable pre-review snapshot selected by the runtime, not mutable paths. */\n reviewArtifacts?(): Promise<{ revision: string; artifacts: Readonly<Record<string, string>> }>;\n /** Returns exactly the accepted bytes, after a fresh authoritative ledger/revision check. */\n acceptedArtifacts?(input: {\n job: string;\n }): Promise<{ revision: string; artifacts: Readonly<Record<string, string>> }>;\n}\n\n/** Bound only in the trusted step-session bootstrap, before packages mount. */\nexport interface PoWorkflowContextService {\n readonly run: PoWorkflowRunRef;\n readonly job: string;\n readonly step: string;\n readonly attempt: number;\n readonly config: PoWorkflowConfig;\n readonly jobEnvironment: Readonly<Record<string, string>>;\n readonly stepEnvironment: Readonly<Record<string, string>>;\n readonly traceparent?: string;\n /** Absolute path of the workflow's instructions file, read in place of the discovered AGENTS.md files. */\n readonly instructions?: string;\n readonly state: PoWorkflowRunsService;\n readonly children?: PoWorkflowChildrenSession;\n}\n\n// These are in-process capabilities, not remote session-create fields or durable records.\ndeclare module '@deepseek-ai/cordis' {\n interface Context {\n 'po/workflow-launch': PoWorkflowLaunchService;\n 'po/workflow-definition-sources': PoWorkflowDefinitionSourcesService;\n 'po/workflow-runs': PoWorkflowRunsService;\n 'po/workflow-context': PoWorkflowContextService;\n }\n}\n\nexport function readPoWorkflowLaunchService(context: Context): PoWorkflowLaunchService | undefined {\n return context.get(PO_WORKFLOW_LAUNCH_SERVICE) as PoWorkflowLaunchService | undefined;\n}\n\nexport function readPoWorkflowDefinitionSourcesService(\n context: Context,\n): PoWorkflowDefinitionSourcesService | undefined {\n return context.get(PO_WORKFLOW_DEFINITION_SOURCES_SERVICE) as PoWorkflowDefinitionSourcesService | undefined;\n}\n\nexport function readPoWorkflowRunsService(context: Context): PoWorkflowRunsService | undefined {\n return context.get(PO_WORKFLOW_RUNS_SERVICE) as PoWorkflowRunsService | undefined;\n}\n\nexport function readPoWorkflowContextService(context: Context): PoWorkflowContextService | undefined {\n return context.get(PO_WORKFLOW_CONTEXT_SERVICE) as PoWorkflowContextService | undefined;\n}\n"],"mappings":";;AAGA,MAAa,6BAA6B;AAC1C,MAAa,yCAAyC;AACtD,MAAa,2BAA2B;AACxC,MAAa,8BAA8B;;AAG3C,MAAa,gCAAgC,KAAK,OAChD;CACE,QAAQ,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACpC,KAAK,KAAK,OAAO;EACf,WAAW;EACX,SAAS;CACX,CAAC;AACH,GACA,EAAE,sBAAsB,MAAM,CAChC;;AAIA,MAAa,yBAAyB,KAAK,OACzC;CACE,OAAO,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACnC,gBAAgB,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CAC5C,QAAQ,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;CACpC,mBAAmB,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AACjD,GACA,EAAE,sBAAsB,MAAM,CAChC;AAmKA,SAAgB,4BAA4B,SAAuD;CACjG,OAAO,QAAQ,IAAI,0BAA0B;AAC/C;AAEA,SAAgB,uCACd,SACgD;CAChD,OAAO,QAAQ,IAAI,sCAAsC;AAC3D;AAEA,SAAgB,0BAA0B,SAAqD;CAC7F,OAAO,QAAQ,IAAI,wBAAwB;AAC7C;AAEA,SAAgB,6BAA6B,SAAwD;CACnG,OAAO,QAAQ,IAAI,2BAA2B;AAChD"}