@byok-sdk/client 0.8.0-beta.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,8 @@
1
- import { type AgentRef } from '@byok-sdk/protocol';
1
+ import { type AgentHomeProjectionOutcome, type AgentHomeProjectionPayload, type AgentRef } from '@byok-sdk/protocol';
2
2
  export type { AgentRef } from '@byok-sdk/protocol';
3
3
  export declare const AGENT_HOME_DIRECTORY = "agents";
4
4
  export declare const AGENT_HOME_INTERNAL_DIRECTORY = ".byok";
5
+ export declare const AGENT_HOME_PROJECTION_STATE_FILE = "agent-home-projection.json";
5
6
  export declare class AgentHomeError extends Error {
6
7
  constructor(message: string);
7
8
  }
@@ -34,15 +35,24 @@ export interface AgentHomeResolution {
34
35
  export interface AgentHomeProjectionInput extends AgentHomeResolution {
35
36
  readonly cwd: string;
36
37
  }
38
+ export interface AgentHomeProjectionApplyInput extends AgentHomeProjectionInput {
39
+ readonly requestId: string;
40
+ readonly projectionHash: string;
41
+ readonly projection: unknown;
42
+ }
37
43
  /**
38
44
  * Optional downstream projection hook. The SDK supplies the canonical home;
39
45
  * the host supplies opaque, redacted product content and never joins
40
46
  * `agents/<agentId>` itself. The SDK does not parse the projected content.
41
47
  */
42
48
  export interface AgentHomeProjection {
43
- prepare(input: AgentHomeProjectionInput): void | Promise<void>;
49
+ /** Optional creation/task-time host preparation retained as a distinct lifecycle. */
50
+ prepare?(input: AgentHomeProjectionInput): void | Promise<void>;
51
+ /** Task-free opaque projection consumer. Its successful return means its own bytes are durable. */
52
+ apply?(input: AgentHomeProjectionApplyInput): void | Promise<void>;
44
53
  }
45
54
  export type AgentHomeProjectionFunction = (input: AgentHomeProjectionInput) => void | Promise<void>;
55
+ export type AgentHomeProjectionApplyFunction = (input: AgentHomeProjectionApplyInput) => void | Promise<void>;
46
56
  export interface AgentHomeLease {
47
57
  readonly leaseId: string;
48
58
  readonly agentRef: AgentRef;
@@ -102,5 +112,14 @@ export declare class AgentHomeManager {
102
112
  acquire(agentRef: AgentRef): Promise<AgentHomeBinding>;
103
113
  /** Initialize only after any requested session exact-match has succeeded. */
104
114
  initialize(binding: AgentHomeBinding): Promise<void>;
115
+ supportsTaskFreeProjection(): boolean;
116
+ /**
117
+ * Apply one task-free projection under the same canonical-home writer lease
118
+ * used by Agent execution. Only a successful host hook followed by the
119
+ * SDK-owned fsynced ordering record can return `applied`.
120
+ */
121
+ project(input: AgentHomeProjectionPayload): Promise<AgentHomeProjectionOutcome>;
105
122
  }
106
123
  export declare function createAgentHomeProjection(prepare: AgentHomeProjectionFunction): AgentHomeProjection;
124
+ /** Create only the task-free opaque projection consumer; no task-time fallback is inferred. */
125
+ export declare function createAgentHomeProjectionConsumer(apply: AgentHomeProjectionApplyFunction): AgentHomeProjection;