@nifrajs/agent-app 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -0
- package/dist/client.d.ts +150 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +340 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/transport.d.ts +61 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +145 -0
- package/dist/transport.js.map +1 -0
- package/dist/view-models.d.ts +283 -0
- package/dist/view-models.d.ts.map +1 -0
- package/dist/view-models.js +579 -0
- package/dist/view-models.js.map +1 -0
- package/package.json +49 -0
- package/src/client.ts +465 -0
- package/src/index.ts +74 -0
- package/src/transport.ts +179 -0
- package/src/view-models.ts +919 -0
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @nifrajs/agent-app
|
|
2
|
+
|
|
3
|
+
A presentation-safe browser SDK for Nifra agent hosts.
|
|
4
|
+
|
|
5
|
+
This package depends on **only** `@nifrajs/agent-protocol`. It pulls in no backend, model provider,
|
|
6
|
+
storage, or UI framework, so it can be bundled into browser-facing code without dragging a private
|
|
7
|
+
engine or payload content across the boundary. Everything it surfaces upward is a content-free view
|
|
8
|
+
model: identifiers, lifecycle statuses, counters, and opaque references. A prompt becomes a character
|
|
9
|
+
count; a tool result becomes an `ok` flag and an error *code*; a compaction becomes before/after token
|
|
10
|
+
counts.
|
|
11
|
+
|
|
12
|
+
## What it does
|
|
13
|
+
|
|
14
|
+
- **Feature negotiation.** On session creation the client intersects the features it can drive with the
|
|
15
|
+
capabilities the host advertises, and gates the matching operations behind `requireFeature`.
|
|
16
|
+
- **Caller auth.** An optional `authorize` hook mints a bearer token per request. The token is placed
|
|
17
|
+
on the outgoing `Authorization` header and never stored on the transport, copied into a result, or
|
|
18
|
+
written to a log.
|
|
19
|
+
- **Ordered, deduplicated streaming.** A turn arrives as an ordered stream of `AgentEventView`s.
|
|
20
|
+
Out-of-order and redelivered frames are reordered and de-duplicated by sequence; a bounded buffer
|
|
21
|
+
skips an unfilled gap rather than stalling.
|
|
22
|
+
- **Cursor resume.** A persisted log can be replayed from a cursor. A cursor whose next record was
|
|
23
|
+
evicted from the retained window asks the caller to resync.
|
|
24
|
+
- **Approvals and handoffs.** Pending approvals list as identifiers; decisions and handoff outcomes go
|
|
25
|
+
back through negotiated commands.
|
|
26
|
+
- **Run Studio views.** Run graphs, retry/recovery timelines, eval comparisons, and fault-injection
|
|
27
|
+
rows consume only protocol evidence and bounded replay references.
|
|
28
|
+
- **Escape hatch.** `command()` reaches host-specific surfaces outside the negotiated contract and
|
|
29
|
+
still returns a bounded `CommandOutcome` - it never throws the credential.
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
import { AgentAppClient, HttpAgentTransport } from "@nifrajs/agent-app"
|
|
35
|
+
|
|
36
|
+
const transport = new HttpAgentTransport({
|
|
37
|
+
endpoint: "http://127.0.0.1:8787",
|
|
38
|
+
authorize: () => currentToken(), // per-request; never stored
|
|
39
|
+
})
|
|
40
|
+
const client = new AgentAppClient(transport)
|
|
41
|
+
|
|
42
|
+
const session = await client.createSession()
|
|
43
|
+
if (client.supports("resume")) {
|
|
44
|
+
const replay = await client.resume({ cursor: lastCursor })
|
|
45
|
+
// replay.entries: { seq, at, type }[] - no payloads
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
for await (const view of client.send("summarize the diff")) {
|
|
49
|
+
// view is content-free: e.g. { kind: "assistant.delta", seq, chars }
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Boundary
|
|
54
|
+
|
|
55
|
+
The transport receives the host's full event stream in order to derive counts, but the client's public
|
|
56
|
+
output is projected to content-free view models. That projection is the seam: an application built on
|
|
57
|
+
this SDK can render progress and resolve interactions, and cannot reconstruct a prompt, tool payload,
|
|
58
|
+
model completion, diagnostic report, or filesystem path. The `scripts/check-agent-boundary.ts` gate
|
|
59
|
+
enforces that this package imports nothing but `@nifrajs/agent-protocol`.
|
|
60
|
+
|
|
61
|
+
The SDK is transport-neutral and opt-in: it does not retain payloads, provide identity or tenancy,
|
|
62
|
+
claim a remote security boundary, or imply durable delivery. Production hosts own authorization,
|
|
63
|
+
retention, and adapter policy.
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT
|
|
68
|
+
|
|
69
|
+
For AI agents, see [`LLM.md`](./LLM.md) and the full corpus
|
|
70
|
+
[`../../llms-full.txt`](../../llms-full.txt).
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Agent App client: a presentation-safe façade over an agent host.
|
|
3
|
+
*
|
|
4
|
+
* It negotiates the feature set with the host on session creation, drives turns as an ordered,
|
|
5
|
+
* deduplicated stream of content-free {@link AgentEventView}s, resumes a persisted log by cursor with
|
|
6
|
+
* gap detection, and resolves approvals and handoffs. Everything it returns upward is a view model -
|
|
7
|
+
* identifiers, statuses, counters, opaque references - so an untyped browser app built on this client
|
|
8
|
+
* can never touch prompt text, tool payloads, model output, or filesystem paths. Host-specific surfaces
|
|
9
|
+
* beyond the negotiated contract are reachable through the raw {@link AgentAppClient.command} escape
|
|
10
|
+
* hatch, which still returns a bounded {@link CommandOutcome} and never leaks the caller credential.
|
|
11
|
+
*/
|
|
12
|
+
import { type BoundaryCommand, type DecisionCoordinate } from "@nifrajs/agent-protocol";
|
|
13
|
+
import type { AgentTransport, CommandOutcome } from "./transport.js";
|
|
14
|
+
import { type AgentEventView, type HandoffView, type RunView, type SessionView } from "./view-models.js";
|
|
15
|
+
/** Interaction features the client knows how to drive. A host grants the subset it supports. */
|
|
16
|
+
export declare const AGENT_APP_FEATURES: readonly ["approvals", "checkpoint", "fork", "handoff", "inbox", "reload", "resume", "workflows"];
|
|
17
|
+
export declare class AgentAppError extends Error {
|
|
18
|
+
constructor(message: string);
|
|
19
|
+
}
|
|
20
|
+
export interface AgentAppClientOptions {
|
|
21
|
+
/** Features the client will request at negotiation. Defaults to {@link AGENT_APP_FEATURES}. */
|
|
22
|
+
readonly features?: readonly string[];
|
|
23
|
+
/** Bound on out-of-order live events held before a gap is skipped. Forwarded to the event buffer. */
|
|
24
|
+
readonly maxPending?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface CreateSessionInput {
|
|
27
|
+
readonly cwd?: string;
|
|
28
|
+
readonly backend?: string;
|
|
29
|
+
readonly capabilities?: readonly string[];
|
|
30
|
+
readonly sessionId?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ResumeInput {
|
|
33
|
+
/** Last delivered seq. Omit or pass `-1` to replay the whole retained window. */
|
|
34
|
+
readonly cursor?: number;
|
|
35
|
+
readonly limit?: number;
|
|
36
|
+
}
|
|
37
|
+
/** One persisted log record reduced to ordering and a type label - never its payload. */
|
|
38
|
+
export interface ReplayEntryView {
|
|
39
|
+
readonly seq: number;
|
|
40
|
+
readonly at: number;
|
|
41
|
+
readonly type: string;
|
|
42
|
+
}
|
|
43
|
+
export type ReplayResult = {
|
|
44
|
+
readonly status: "ok";
|
|
45
|
+
readonly nextCursor: number;
|
|
46
|
+
readonly entries: readonly ReplayEntryView[];
|
|
47
|
+
readonly session?: SessionView;
|
|
48
|
+
} | {
|
|
49
|
+
readonly status: "resync_required";
|
|
50
|
+
readonly reason: string;
|
|
51
|
+
readonly earliest: number;
|
|
52
|
+
readonly latest: number;
|
|
53
|
+
};
|
|
54
|
+
export interface PendingApprovalView {
|
|
55
|
+
readonly approvalId: string;
|
|
56
|
+
readonly action: string;
|
|
57
|
+
readonly capability: string;
|
|
58
|
+
readonly turnId?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface ResolveHandoffInput {
|
|
61
|
+
readonly runId: string;
|
|
62
|
+
readonly nodeId: string;
|
|
63
|
+
readonly accept: boolean;
|
|
64
|
+
readonly reason?: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* One pending decision boundary in the inbox, projected to structural coordinates and a state only.
|
|
68
|
+
* It never carries a prompt, a free-text reason, tool data, model output, a diagnostic, or an
|
|
69
|
+
* artifact - just enough identity for the UI to address the exact boundary a decision resolves.
|
|
70
|
+
*/
|
|
71
|
+
export interface BoundaryItemView {
|
|
72
|
+
readonly kind: "approval" | "handoff";
|
|
73
|
+
readonly requestId: string;
|
|
74
|
+
readonly runId: string;
|
|
75
|
+
readonly nodeId: string;
|
|
76
|
+
readonly capability: string;
|
|
77
|
+
readonly vector: number;
|
|
78
|
+
readonly expiresAt: number;
|
|
79
|
+
readonly state: string;
|
|
80
|
+
/** Opaque owner role once a handoff is assigned. */
|
|
81
|
+
readonly to?: string;
|
|
82
|
+
}
|
|
83
|
+
/** The bounded outcome of a boundary decision: the resulting item, or a content-free refusal code. */
|
|
84
|
+
export type BoundaryDecisionResult = {
|
|
85
|
+
readonly ok: true;
|
|
86
|
+
readonly item: BoundaryItemView;
|
|
87
|
+
} | {
|
|
88
|
+
readonly ok: false;
|
|
89
|
+
readonly code: string;
|
|
90
|
+
};
|
|
91
|
+
export declare class AgentAppClient {
|
|
92
|
+
private readonly transport;
|
|
93
|
+
private readonly requested;
|
|
94
|
+
private readonly maxPending;
|
|
95
|
+
private currentSession;
|
|
96
|
+
private granted;
|
|
97
|
+
constructor(transport: AgentTransport, options?: AgentAppClientOptions);
|
|
98
|
+
/** The current session view, or `undefined` before {@link createSession}/{@link resume}. */
|
|
99
|
+
get session(): SessionView | undefined;
|
|
100
|
+
/** Features the host granted at negotiation. */
|
|
101
|
+
get features(): readonly string[];
|
|
102
|
+
supports(feature: string): boolean;
|
|
103
|
+
requireFeature(feature: string): void;
|
|
104
|
+
/** Open a session and negotiate the feature set against the host's advertised capabilities. */
|
|
105
|
+
createSession(input?: CreateSessionInput): Promise<SessionView>;
|
|
106
|
+
/**
|
|
107
|
+
* Stream a turn as ordered, deduplicated view models. The underlying transport receives the host's
|
|
108
|
+
* full event stream, but every value yielded here is content-free.
|
|
109
|
+
*/
|
|
110
|
+
send(message: string, options?: {
|
|
111
|
+
signal?: AbortSignal;
|
|
112
|
+
}): AsyncIterable<AgentEventView>;
|
|
113
|
+
/** Resume a persisted log by cursor. A cursor whose next record was evicted asks for a resync. */
|
|
114
|
+
resume(input?: ResumeInput): Promise<ReplayResult>;
|
|
115
|
+
/** List approvals awaiting a decision, projected to their identifiers only. */
|
|
116
|
+
listApprovals(): Promise<readonly PendingApprovalView[]>;
|
|
117
|
+
/** Approve or decline a pending approval. Returns the host's recorded decision. */
|
|
118
|
+
resolveApproval(approvalId: string, approved: boolean, reason?: string): Promise<boolean>;
|
|
119
|
+
/** Accept or decline a handoff. Returns the resulting handoff view when the host reports one. */
|
|
120
|
+
resolveHandoff(input: ResolveHandoffInput): Promise<HandoffView | undefined>;
|
|
121
|
+
/**
|
|
122
|
+
* List every pending decision boundary (approvals and handoffs) as content-free item views. Gated
|
|
123
|
+
* on the negotiated `inbox` feature.
|
|
124
|
+
*/
|
|
125
|
+
listBoundaries(): Promise<readonly BoundaryItemView[]>;
|
|
126
|
+
/** Inspect one boundary by request id, projected to a content-free item view. */
|
|
127
|
+
inspectBoundary(requestId: string): Promise<BoundaryItemView | undefined>;
|
|
128
|
+
/**
|
|
129
|
+
* Drive one boundary command against its exact coordinate. Because the full {@link DecisionCoordinate}
|
|
130
|
+
* (run, node, capability, request id, vector, expiry) rides on every call, a decision can only ever
|
|
131
|
+
* resolve the boundary it names - never a different item - and the host fails a stale or mismatched
|
|
132
|
+
* coordinate closed. `assign` carries the owner role in `to`.
|
|
133
|
+
*/
|
|
134
|
+
decideBoundary(command: BoundaryCommand, coordinate: DecisionCoordinate, options?: {
|
|
135
|
+
readonly to?: string;
|
|
136
|
+
}): Promise<BoundaryDecisionResult>;
|
|
137
|
+
/** Fetch a run snapshot by id, projected to a content-free {@link RunView}. */
|
|
138
|
+
runSnapshot(runId: string): Promise<RunView>;
|
|
139
|
+
/** Cancel the active turn / stop the session. */
|
|
140
|
+
cancel(reason?: string): Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* Escape hatch for host-specific commands outside the negotiated contract. Returns a bounded
|
|
143
|
+
* {@link CommandOutcome}; the caller is responsible for keeping whatever it renders content-free.
|
|
144
|
+
*/
|
|
145
|
+
command<T = unknown>(method: string, params?: unknown, signal?: AbortSignal): Promise<CommandOutcome<T>>;
|
|
146
|
+
private adoptSnapshot;
|
|
147
|
+
private expectSnapshot;
|
|
148
|
+
private decodeResume;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAIxB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpE,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,WAAW,EAEhB,KAAK,OAAO,EACZ,KAAK,WAAW,EAKjB,MAAM,kBAAkB,CAAA;AAEzB,gGAAgG;AAChG,eAAO,MAAM,kBAAkB,mGASrB,CAAA;AAEV,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI5B;AAED,MAAM,WAAW,qBAAqB;IACpC,+FAA+F;IAC/F,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,qGAAqG;IACrG,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,YAAY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jB,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAQ7B,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,YAAY;CA6CrB"}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Agent App client: a presentation-safe façade over an agent host.
|
|
3
|
+
*
|
|
4
|
+
* It negotiates the feature set with the host on session creation, drives turns as an ordered,
|
|
5
|
+
* deduplicated stream of content-free {@link AgentEventView}s, resumes a persisted log by cursor with
|
|
6
|
+
* gap detection, and resolves approvals and handoffs. Everything it returns upward is a view model -
|
|
7
|
+
* identifiers, statuses, counters, opaque references - so an untyped browser app built on this client
|
|
8
|
+
* can never touch prompt text, tool payloads, model output, or filesystem paths. Host-specific surfaces
|
|
9
|
+
* beyond the negotiated contract are reachable through the raw {@link AgentAppClient.command} escape
|
|
10
|
+
* hatch, which still returns a bounded {@link CommandOutcome} and never leaks the caller credential.
|
|
11
|
+
*/
|
|
12
|
+
import { negotiateFeatures, parseHandoffSnapshot, parseRunSnapshot, } from "@nifrajs/agent-protocol";
|
|
13
|
+
import { OrderedEventBuffer, toEventView, toHandoffView, toRunView, toSessionView, } from "./view-models.js";
|
|
14
|
+
/** Interaction features the client knows how to drive. A host grants the subset it supports. */
|
|
15
|
+
export const AGENT_APP_FEATURES = [
|
|
16
|
+
"approvals",
|
|
17
|
+
"checkpoint",
|
|
18
|
+
"fork",
|
|
19
|
+
"handoff",
|
|
20
|
+
"inbox",
|
|
21
|
+
"reload",
|
|
22
|
+
"resume",
|
|
23
|
+
"workflows",
|
|
24
|
+
];
|
|
25
|
+
export class AgentAppError extends Error {
|
|
26
|
+
constructor(message) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.name = "AgentAppError";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export class AgentAppClient {
|
|
32
|
+
transport;
|
|
33
|
+
requested;
|
|
34
|
+
maxPending;
|
|
35
|
+
currentSession;
|
|
36
|
+
granted = new Set();
|
|
37
|
+
constructor(transport, options) {
|
|
38
|
+
this.transport = transport;
|
|
39
|
+
this.requested = options?.features ?? AGENT_APP_FEATURES;
|
|
40
|
+
this.maxPending = options?.maxPending;
|
|
41
|
+
}
|
|
42
|
+
/** The current session view, or `undefined` before {@link createSession}/{@link resume}. */
|
|
43
|
+
get session() {
|
|
44
|
+
return this.currentSession;
|
|
45
|
+
}
|
|
46
|
+
/** Features the host granted at negotiation. */
|
|
47
|
+
get features() {
|
|
48
|
+
return [...this.granted];
|
|
49
|
+
}
|
|
50
|
+
supports(feature) {
|
|
51
|
+
return this.granted.has(feature);
|
|
52
|
+
}
|
|
53
|
+
requireFeature(feature) {
|
|
54
|
+
if (!this.granted.has(feature))
|
|
55
|
+
throw new AgentAppError(`host did not grant the "${feature}" feature`);
|
|
56
|
+
}
|
|
57
|
+
/** Open a session and negotiate the feature set against the host's advertised capabilities. */
|
|
58
|
+
async createSession(input = {}) {
|
|
59
|
+
const outcome = await this.transport.command({
|
|
60
|
+
method: "session.create",
|
|
61
|
+
params: input,
|
|
62
|
+
});
|
|
63
|
+
const snapshot = this.expectSnapshot(outcome, "session.create");
|
|
64
|
+
this.adoptSnapshot(snapshot);
|
|
65
|
+
return this.currentSession;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Stream a turn as ordered, deduplicated view models. The underlying transport receives the host's
|
|
69
|
+
* full event stream, but every value yielded here is content-free.
|
|
70
|
+
*/
|
|
71
|
+
async *send(message, options) {
|
|
72
|
+
if (this.currentSession === undefined)
|
|
73
|
+
throw new AgentAppError("createSession must be called before send");
|
|
74
|
+
const buffer = new OrderedEventBuffer({
|
|
75
|
+
from: this.currentSession.lastSeq,
|
|
76
|
+
...(this.maxPending === undefined ? {} : { maxPending: this.maxPending }),
|
|
77
|
+
});
|
|
78
|
+
const stream = this.transport.stream({
|
|
79
|
+
method: "turn.send",
|
|
80
|
+
params: { message },
|
|
81
|
+
...(options?.signal ? { signal: options.signal } : {}),
|
|
82
|
+
});
|
|
83
|
+
for await (const event of stream) {
|
|
84
|
+
for (const view of buffer.offer(toEventView(event)))
|
|
85
|
+
yield view;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** Resume a persisted log by cursor. A cursor whose next record was evicted asks for a resync. */
|
|
89
|
+
async resume(input = {}) {
|
|
90
|
+
this.requireFeature("resume");
|
|
91
|
+
const params = { cursor: input.cursor ?? -1 };
|
|
92
|
+
if (input.limit !== undefined)
|
|
93
|
+
params.limit = input.limit;
|
|
94
|
+
const outcome = await this.transport.command({ method: "session.events", params });
|
|
95
|
+
if (!outcome.ok)
|
|
96
|
+
throw commandError("session.events", outcome);
|
|
97
|
+
return this.decodeResume(outcome.value);
|
|
98
|
+
}
|
|
99
|
+
/** List approvals awaiting a decision, projected to their identifiers only. */
|
|
100
|
+
async listApprovals() {
|
|
101
|
+
this.requireFeature("approvals");
|
|
102
|
+
const outcome = await this.transport.command({ method: "approval.list" });
|
|
103
|
+
if (!outcome.ok)
|
|
104
|
+
throw commandError("approval.list", outcome);
|
|
105
|
+
const pending = isRecord(outcome.value) ? outcome.value.pending : undefined;
|
|
106
|
+
if (!Array.isArray(pending))
|
|
107
|
+
return [];
|
|
108
|
+
const views = [];
|
|
109
|
+
for (const item of pending) {
|
|
110
|
+
if (!isRecord(item))
|
|
111
|
+
continue;
|
|
112
|
+
const { approvalId, action, capability, turnId } = item;
|
|
113
|
+
if (typeof approvalId !== "string" ||
|
|
114
|
+
typeof action !== "string" ||
|
|
115
|
+
typeof capability !== "string")
|
|
116
|
+
continue;
|
|
117
|
+
views.push(Object.freeze({
|
|
118
|
+
approvalId,
|
|
119
|
+
action,
|
|
120
|
+
capability,
|
|
121
|
+
...(typeof turnId === "string" ? { turnId } : {}),
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
return views;
|
|
125
|
+
}
|
|
126
|
+
/** Approve or decline a pending approval. Returns the host's recorded decision. */
|
|
127
|
+
async resolveApproval(approvalId, approved, reason) {
|
|
128
|
+
this.requireFeature("approvals");
|
|
129
|
+
const outcome = await this.transport.command({
|
|
130
|
+
method: "approval.resolve",
|
|
131
|
+
params: { approvalId, approved, ...(reason === undefined ? {} : { reason }) },
|
|
132
|
+
});
|
|
133
|
+
if (!outcome.ok)
|
|
134
|
+
throw commandError("approval.resolve", outcome);
|
|
135
|
+
return isRecord(outcome.value) && outcome.value.approved === true;
|
|
136
|
+
}
|
|
137
|
+
/** Accept or decline a handoff. Returns the resulting handoff view when the host reports one. */
|
|
138
|
+
async resolveHandoff(input) {
|
|
139
|
+
this.requireFeature("handoff");
|
|
140
|
+
const outcome = await this.transport.command({
|
|
141
|
+
method: "handoff.resolve",
|
|
142
|
+
params: {
|
|
143
|
+
runId: input.runId,
|
|
144
|
+
nodeId: input.nodeId,
|
|
145
|
+
accept: input.accept,
|
|
146
|
+
...(input.reason === undefined ? {} : { reason: input.reason }),
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
if (!outcome.ok)
|
|
150
|
+
throw commandError("handoff.resolve", outcome);
|
|
151
|
+
if (!isRecord(outcome.value) || outcome.value.handoff === undefined)
|
|
152
|
+
return undefined;
|
|
153
|
+
return toHandoffView(parseHandoffSnapshot(outcome.value.handoff));
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* List every pending decision boundary (approvals and handoffs) as content-free item views. Gated
|
|
157
|
+
* on the negotiated `inbox` feature.
|
|
158
|
+
*/
|
|
159
|
+
async listBoundaries() {
|
|
160
|
+
this.requireFeature("inbox");
|
|
161
|
+
const outcome = await this.transport.command({ method: "boundary.list" });
|
|
162
|
+
if (!outcome.ok)
|
|
163
|
+
throw commandError("boundary.list", outcome);
|
|
164
|
+
const items = isRecord(outcome.value) ? outcome.value.items : undefined;
|
|
165
|
+
if (!Array.isArray(items))
|
|
166
|
+
return [];
|
|
167
|
+
const views = [];
|
|
168
|
+
for (const item of items) {
|
|
169
|
+
const view = toBoundaryItemView(item);
|
|
170
|
+
if (view !== undefined)
|
|
171
|
+
views.push(view);
|
|
172
|
+
}
|
|
173
|
+
return Object.freeze(views);
|
|
174
|
+
}
|
|
175
|
+
/** Inspect one boundary by request id, projected to a content-free item view. */
|
|
176
|
+
async inspectBoundary(requestId) {
|
|
177
|
+
this.requireFeature("inbox");
|
|
178
|
+
const outcome = await this.transport.command({
|
|
179
|
+
method: "boundary.inspect",
|
|
180
|
+
params: { requestId },
|
|
181
|
+
});
|
|
182
|
+
if (!outcome.ok)
|
|
183
|
+
throw commandError("boundary.inspect", outcome);
|
|
184
|
+
const source = isRecord(outcome.value) && outcome.value.item !== undefined
|
|
185
|
+
? outcome.value.item
|
|
186
|
+
: outcome.value;
|
|
187
|
+
return toBoundaryItemView(source);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Drive one boundary command against its exact coordinate. Because the full {@link DecisionCoordinate}
|
|
191
|
+
* (run, node, capability, request id, vector, expiry) rides on every call, a decision can only ever
|
|
192
|
+
* resolve the boundary it names - never a different item - and the host fails a stale or mismatched
|
|
193
|
+
* coordinate closed. `assign` carries the owner role in `to`.
|
|
194
|
+
*/
|
|
195
|
+
async decideBoundary(command, coordinate, options) {
|
|
196
|
+
this.requireFeature("inbox");
|
|
197
|
+
const outcome = await this.transport.command({
|
|
198
|
+
method: `boundary.${command}`,
|
|
199
|
+
params: { coordinate, ...(options?.to === undefined ? {} : { to: options.to }) },
|
|
200
|
+
});
|
|
201
|
+
if (!outcome.ok)
|
|
202
|
+
throw commandError(`boundary.${command}`, outcome);
|
|
203
|
+
if (isRecord(outcome.value) && typeof outcome.value.rejected === "string")
|
|
204
|
+
return { ok: false, code: outcome.value.rejected };
|
|
205
|
+
const item = toBoundaryItemView(isRecord(outcome.value) && outcome.value.item !== undefined
|
|
206
|
+
? outcome.value.item
|
|
207
|
+
: outcome.value);
|
|
208
|
+
if (item === undefined)
|
|
209
|
+
return { ok: false, code: "invalid_response" };
|
|
210
|
+
return { ok: true, item };
|
|
211
|
+
}
|
|
212
|
+
/** Fetch a run snapshot by id, projected to a content-free {@link RunView}. */
|
|
213
|
+
async runSnapshot(runId) {
|
|
214
|
+
const outcome = await this.transport.command({
|
|
215
|
+
method: "run.snapshot",
|
|
216
|
+
params: { runId },
|
|
217
|
+
});
|
|
218
|
+
if (!outcome.ok)
|
|
219
|
+
throw commandError("run.snapshot", outcome);
|
|
220
|
+
const value = isRecord(outcome.value) && outcome.value.snapshot !== undefined
|
|
221
|
+
? outcome.value.snapshot
|
|
222
|
+
: outcome.value;
|
|
223
|
+
return toRunView(parseRunSnapshot(value));
|
|
224
|
+
}
|
|
225
|
+
/** Cancel the active turn / stop the session. */
|
|
226
|
+
async cancel(reason) {
|
|
227
|
+
const outcome = await this.transport.command({
|
|
228
|
+
method: "session.stop",
|
|
229
|
+
params: reason === undefined ? {} : { reason },
|
|
230
|
+
});
|
|
231
|
+
if (!outcome.ok)
|
|
232
|
+
throw commandError("session.stop", outcome);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Escape hatch for host-specific commands outside the negotiated contract. Returns a bounded
|
|
236
|
+
* {@link CommandOutcome}; the caller is responsible for keeping whatever it renders content-free.
|
|
237
|
+
*/
|
|
238
|
+
command(method, params, signal) {
|
|
239
|
+
return this.transport.command({
|
|
240
|
+
method,
|
|
241
|
+
...(params === undefined ? {} : { params }),
|
|
242
|
+
...(signal ? { signal } : {}),
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
adoptSnapshot(snapshot) {
|
|
246
|
+
this.currentSession = toSessionView(snapshot);
|
|
247
|
+
this.granted = new Set(negotiateFeatures(snapshot.capabilities, this.requested).granted);
|
|
248
|
+
}
|
|
249
|
+
expectSnapshot(outcome, method) {
|
|
250
|
+
if (!outcome.ok)
|
|
251
|
+
throw commandError(method, outcome);
|
|
252
|
+
const value = outcome.value;
|
|
253
|
+
if (!isRecord(value) ||
|
|
254
|
+
typeof value.id !== "string" ||
|
|
255
|
+
typeof value.backend !== "string" ||
|
|
256
|
+
typeof value.status !== "string" ||
|
|
257
|
+
typeof value.createdAt !== "number" ||
|
|
258
|
+
typeof value.updatedAt !== "number" ||
|
|
259
|
+
typeof value.lastSeq !== "number" ||
|
|
260
|
+
!Array.isArray(value.capabilities))
|
|
261
|
+
throw new AgentAppError(`${method} did not return a session snapshot`);
|
|
262
|
+
return value;
|
|
263
|
+
}
|
|
264
|
+
decodeResume(value) {
|
|
265
|
+
if (!isRecord(value))
|
|
266
|
+
throw new AgentAppError("session.events returned a non-object");
|
|
267
|
+
const resume = isRecord(value.resume) ? value.resume : value;
|
|
268
|
+
const session = isRecord(value.snapshot) && typeof value.snapshot.id === "string"
|
|
269
|
+
? toSessionView(value.snapshot)
|
|
270
|
+
: undefined;
|
|
271
|
+
if (resume.status === "resync_required") {
|
|
272
|
+
return Object.freeze({
|
|
273
|
+
status: "resync_required",
|
|
274
|
+
reason: typeof resume.reason === "string" ? resume.reason : "stale_cursor",
|
|
275
|
+
earliest: typeof resume.earliest === "number" ? resume.earliest : 0,
|
|
276
|
+
latest: typeof resume.latest === "number" ? resume.latest : 0,
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
const source = Array.isArray(resume.events)
|
|
280
|
+
? resume.events
|
|
281
|
+
: Array.isArray(value.entries)
|
|
282
|
+
? value.entries
|
|
283
|
+
: [];
|
|
284
|
+
const entries = [];
|
|
285
|
+
for (const item of source) {
|
|
286
|
+
if (!isRecord(item))
|
|
287
|
+
continue;
|
|
288
|
+
if (typeof item.seq !== "number" ||
|
|
289
|
+
typeof item.at !== "number" ||
|
|
290
|
+
typeof item.type !== "string")
|
|
291
|
+
continue;
|
|
292
|
+
entries.push(Object.freeze({ seq: item.seq, at: item.at, type: item.type }));
|
|
293
|
+
}
|
|
294
|
+
const tail = entries.at(-1);
|
|
295
|
+
const nextCursor = typeof resume.nextCursor === "number"
|
|
296
|
+
? resume.nextCursor
|
|
297
|
+
: typeof resume.cursor === "number"
|
|
298
|
+
? resume.cursor
|
|
299
|
+
: (tail?.seq ?? -1);
|
|
300
|
+
return Object.freeze({
|
|
301
|
+
status: "ok",
|
|
302
|
+
nextCursor,
|
|
303
|
+
entries,
|
|
304
|
+
...(session === undefined ? {} : { session }),
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
function commandError(method, outcome) {
|
|
309
|
+
return new AgentAppError(`${method} failed (${outcome.status}): ${outcome.error}`);
|
|
310
|
+
}
|
|
311
|
+
function isRecord(value) {
|
|
312
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
313
|
+
}
|
|
314
|
+
/** Project a raw boundary record to a content-free {@link BoundaryItemView}, or drop it if malformed. */
|
|
315
|
+
function toBoundaryItemView(value) {
|
|
316
|
+
if (!isRecord(value))
|
|
317
|
+
return undefined;
|
|
318
|
+
const { kind, requestId, runId, nodeId, capability, vector, expiresAt, state, to } = value;
|
|
319
|
+
if ((kind !== "approval" && kind !== "handoff") ||
|
|
320
|
+
typeof requestId !== "string" ||
|
|
321
|
+
typeof runId !== "string" ||
|
|
322
|
+
typeof nodeId !== "string" ||
|
|
323
|
+
typeof capability !== "string" ||
|
|
324
|
+
typeof vector !== "number" ||
|
|
325
|
+
typeof expiresAt !== "number" ||
|
|
326
|
+
typeof state !== "string")
|
|
327
|
+
return undefined;
|
|
328
|
+
return Object.freeze({
|
|
329
|
+
kind,
|
|
330
|
+
requestId,
|
|
331
|
+
runId,
|
|
332
|
+
nodeId,
|
|
333
|
+
capability,
|
|
334
|
+
vector,
|
|
335
|
+
expiresAt,
|
|
336
|
+
state,
|
|
337
|
+
...(typeof to === "string" ? { to } : {}),
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["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B,IAAI;QACJ,SAAS;QACT,KAAK;QACL,MAAM;QACN,UAAU;QACV,MAAM;QACN,SAAS;QACT,KAAK;QACL,GAAG,CAAC,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1C,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@nifrajs/agent-app` - a presentation-safe browser SDK for Nifra agent hosts.
|
|
3
|
+
*
|
|
4
|
+
* This package depends only on `@nifrajs/agent-protocol`. It has no backend, provider, storage, model,
|
|
5
|
+
* or UI-framework dependency, so it can be bundled into browser-facing code without dragging a private
|
|
6
|
+
* engine or payload content across the boundary. Everything it surfaces upward is a content-free view
|
|
7
|
+
* model: identifiers, lifecycle statuses, counters, and opaque references.
|
|
8
|
+
*/
|
|
9
|
+
export { AGENT_APP_FEATURES, AgentAppClient, type AgentAppClientOptions, AgentAppError, type BoundaryDecisionResult, type BoundaryItemView, type CreateSessionInput, type PendingApprovalView, type ReplayEntryView, type ReplayResult, type ResolveHandoffInput, type ResumeInput, } from "./client.js";
|
|
10
|
+
export { type AgentTransport, AgentTransportError, type AgentTransportRequest, type AuthProvider, type CommandOutcome, HttpAgentTransport, type HttpAgentTransportOptions, parseEventStream, } from "./transport.js";
|
|
11
|
+
export { type AgentEventView, type ApprovalRequiredView, type ApprovalResolvedView, type AssistantChunkView, type BoundaryStateView, boundaryCommands, boundaryIsStale, type EvalComparisonView, type EvidenceTimelineView, type ExtensionReloadedView, type FaultInjectionView, type HandoffView, type MemoryCompactedView, OrderedEventBuffer, type RegistryCapabilityView, type RepairRequiredView, type RunStudioNodeState, type RunStudioNodeView, type RunStudioView, type RunView, type SessionFailedView, type SessionLifecycleView, type SessionStoppedView, type SessionView, type ToolCompletedView, type ToolDeltaView, type ToolStartedView, type TurnStartedView, toEvalComparisonView, toEventView, toEvidenceTimelineView, toFaultInjectionViews, toHandoffView, toRegistryCapabilityView, toRunStudioView, toRunView, toSessionView, type VerificationCompletedView, virtualizeEvidenceRows, } from "./view-models.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,KAAK,qBAAqB,EAC1B,aAAa,EACb,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,WAAW,GACjB,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,KAAK,cAAc,EACnB,mBAAmB,EACnB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,gBAAgB,GACjB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,eAAe,EACf,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,oBAAoB,EACpB,WAAW,EACX,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,SAAS,EACT,aAAa,EACb,KAAK,yBAAyB,EAC9B,sBAAsB,GACvB,MAAM,kBAAkB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@nifrajs/agent-app` - a presentation-safe browser SDK for Nifra agent hosts.
|
|
3
|
+
*
|
|
4
|
+
* This package depends only on `@nifrajs/agent-protocol`. It has no backend, provider, storage, model,
|
|
5
|
+
* or UI-framework dependency, so it can be bundled into browser-facing code without dragging a private
|
|
6
|
+
* engine or payload content across the boundary. Everything it surfaces upward is a content-free view
|
|
7
|
+
* model: identifiers, lifecycle statuses, counters, and opaque references.
|
|
8
|
+
*/
|
|
9
|
+
export { AGENT_APP_FEATURES, AgentAppClient, AgentAppError, } from "./client.js";
|
|
10
|
+
export { AgentTransportError, HttpAgentTransport, parseEventStream, } from "./transport.js";
|
|
11
|
+
export { boundaryCommands, boundaryIsStale, OrderedEventBuffer, toEvalComparisonView, toEventView, toEvidenceTimelineView, toFaultInjectionViews, toHandoffView, toRegistryCapabilityView, toRunStudioView, toRunView, toSessionView, virtualizeEvidenceRows, } from "./view-models.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,kBAAkB,EAClB,cAAc,EAEd,aAAa,GASd,MAAM,aAAa,CAAA;AACpB,OAAO,EAEL,mBAAmB,EAInB,kBAAkB,EAElB,gBAAgB,GACjB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAML,gBAAgB,EAChB,eAAe,EAOf,kBAAkB,EAelB,oBAAoB,EACpB,WAAW,EACX,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,wBAAwB,EACxB,eAAe,EACf,SAAS,EACT,aAAa,EAEb,sBAAsB,GACvB,MAAM,kBAAkB,CAAA"}
|