@inflexa-ai/harness 0.22.0 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/report-session-agent.d.ts +10 -7
- package/dist/agents/report-session-agent.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/dist/runtime/assemble.d.ts +10 -7
- package/dist/runtime/assemble.js +1 -1
- package/dist/tools/report-session/examine-page.d.ts +4 -0
- package/dist/tools/report-session/examine-page.js +4 -1
- package/dist/tools/report-session/index.d.ts +1 -1
- package/dist/tools/report-session/preview-report.d.ts +13 -10
- package/dist/tools/report-session/preview-report.js +16 -13
- package/dist/tools/report-session/session-page-publisher.d.ts +21 -8
- package/dist/tools/report-session/session-page-publisher.js +7 -4
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ import type { ThreadStore } from "../memory/thread-store.js";
|
|
|
38
38
|
import type { ReferenceResolver } from "../report-model/reference-resolver.js";
|
|
39
39
|
import type { ReportVersionStore } from "../state/report-versions.js";
|
|
40
40
|
import type { ReportSessionStateGateway } from "../tools/report-authoring/authoring-tools.js";
|
|
41
|
-
import { type
|
|
41
|
+
import { type MakeSessionPagePublisher, type ResolvePageAsset, type ResolvePageUrl } from "../tools/report-session/index.js";
|
|
42
42
|
/** Canonical agent id -- distinct from the id of the old templating agent. */
|
|
43
43
|
export declare const REPORT_SESSION_AGENT_ID: "report-session";
|
|
44
44
|
/**
|
|
@@ -99,15 +99,18 @@ export interface ReportSessionAgentDeps {
|
|
|
99
99
|
*/
|
|
100
100
|
readonly resolvePageAsset?: ResolvePageAsset;
|
|
101
101
|
/**
|
|
102
|
-
* Session-page publisher -- the hosted view of the rendered page.
|
|
103
|
-
*
|
|
104
|
-
*
|
|
102
|
+
* Session-page publisher factory -- the hosted view of the rendered page. The factory
|
|
103
|
+
* binds one analysis and the auth of the call, like `makeResolver`, thus the mint runs
|
|
104
|
+
* under the credential of the caller. Bound, the preview tool builds the publisher over
|
|
105
|
+
* the scope of the call, mints one grant after the page lands, and attaches the URL
|
|
106
|
+
* beside the path. Omitted, the result carries the page path alone.
|
|
105
107
|
*/
|
|
106
|
-
readonly
|
|
108
|
+
readonly makeSessionPages?: MakeSessionPagePublisher;
|
|
107
109
|
/**
|
|
108
110
|
* Page-URL formation of the eyes -- the URL that one look opens. A composition whose
|
|
109
|
-
* browser cannot reach the workspace tree binds a resolver that names a served URL
|
|
110
|
-
*
|
|
111
|
+
* browser cannot reach the workspace tree binds a resolver that names a served URL, and
|
|
112
|
+
* the args carry the auth of the tool call beside the page identity. Omitted, the eyes
|
|
113
|
+
* tool navigates through a `file://` URL of the page path.
|
|
111
114
|
*/
|
|
112
115
|
readonly resolvePageUrl?: ResolvePageUrl;
|
|
113
116
|
/** Operational logging seam; omitted falls back to no-op. */
|
|
@@ -39,7 +39,7 @@ const REPORT_SESSION_MAX_ITERATIONS = 75;
|
|
|
39
39
|
/** Build the report `AgentDefinition` with every tool bound to its deps. */
|
|
40
40
|
export function createReportSessionAgent(deps) {
|
|
41
41
|
const { model, pool, embedding, workspaceFs, gateway, resolveWorkspaceRoot, store, threads, chrome, eyes, makeResolver, resolvePageAsset, logger } = deps;
|
|
42
|
-
const { derivations, sandboxClient, runAuthorizer,
|
|
42
|
+
const { derivations, sandboxClient, runAuthorizer, makeSessionPages, resolvePageUrl } = deps;
|
|
43
43
|
const authoring = createReportAuthoringTools(gateway);
|
|
44
44
|
const tools = [
|
|
45
45
|
// The read surface toward the analysis. It roams the tree read-only.
|
|
@@ -83,7 +83,7 @@ export function createReportSessionAgent(deps) {
|
|
|
83
83
|
resolveWorkspaceRoot,
|
|
84
84
|
...(makeResolver ? { makeResolver } : {}),
|
|
85
85
|
...(resolvePageAsset ? { resolvePageAsset } : {}),
|
|
86
|
-
...(
|
|
86
|
+
...(makeSessionPages ? { makeSessionPages } : {}),
|
|
87
87
|
...(logger ? { logger } : {}),
|
|
88
88
|
}),
|
|
89
89
|
// The eyes tool. It opens the rendered page in headless Chrome.
|
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type { ProvenanceCollector } from "./provenance/collector.js";
|
|
|
36
36
|
export { UnavailablePreviewPublisher } from "./tools/report/preview-publisher.js";
|
|
37
37
|
export type { PreviewPublisher, PreviewMintResult } from "./tools/report/preview-publisher.js";
|
|
38
38
|
export { UnavailableSessionPagePublisher } from "./tools/report-session/session-page-publisher.js";
|
|
39
|
-
export type { SessionPagePublisher, SessionPageMintResult } from "./tools/report-session/session-page-publisher.js";
|
|
39
|
+
export type { MakeSessionPagePublisher, SessionPagePublisher, SessionPageMintResult } from "./tools/report-session/session-page-publisher.js";
|
|
40
40
|
export type { ResolvePageUrl, SessionPageAccess } from "./tools/report-session/index.js";
|
|
41
41
|
export { createDbosRunLauncher } from "./execution/dbos-run-launcher.js";
|
|
42
42
|
export type { RunLauncher, LaunchOptions } from "./execution/run-launcher.js";
|
package/dist/index.js
CHANGED
|
@@ -44,8 +44,10 @@ export { createNoopArtifactRegistry } from "./execution/noop-artifact-registry.j
|
|
|
44
44
|
export { UnavailablePreviewPublisher } from "./tools/report/preview-publisher.js";
|
|
45
45
|
// Seam: the hosted view of a report-session page. A managed host serves the URL space
|
|
46
46
|
// `report-sessions/{analysisId}/{threadId}` and mints access through its own publisher,
|
|
47
|
-
// thus the seam belongs on the front door.
|
|
48
|
-
//
|
|
47
|
+
// thus the seam belongs on the front door. Both seams bind per call over the auth of the
|
|
48
|
+
// tool call, thus a host mints under the credential of the caller and holds no ambient
|
|
49
|
+
// state. The URL seam of the eyes rides beside the publisher factory: a host whose
|
|
50
|
+
// browser cannot reach the workspace tree binds a served URL for the look.
|
|
49
51
|
export { UnavailableSessionPagePublisher } from "./tools/report-session/session-page-publisher.js";
|
|
50
52
|
// Run launching.
|
|
51
53
|
export { createDbosRunLauncher } from "./execution/dbos-run-launcher.js";
|
|
@@ -32,7 +32,7 @@ import { type CitationResolverConfig } from "../citations/resolve.js";
|
|
|
32
32
|
import type { CitationResolver } from "../citations/types.js";
|
|
33
33
|
import type { AuthContext } from "../auth/types.js";
|
|
34
34
|
import type { ReferenceResolver } from "../report-model/reference-resolver.js";
|
|
35
|
-
import type { ResolvePageAsset, ResolvePageUrl
|
|
35
|
+
import type { MakeSessionPagePublisher, ResolvePageAsset, ResolvePageUrl } from "../tools/report-session/index.js";
|
|
36
36
|
/** Registered child sandbox-step callable the parent's child dispatch closes over. */
|
|
37
37
|
export type SandboxStepCallable = (input: SandboxStepInput) => Promise<SandboxStepResult>;
|
|
38
38
|
/**
|
|
@@ -134,15 +134,18 @@ export interface CoreRuntimeDeps {
|
|
|
134
134
|
readonly resolveReportPageAsset?: ResolvePageAsset;
|
|
135
135
|
/**
|
|
136
136
|
* The hosted view of a report-session page. A managed host that serves the session URL
|
|
137
|
-
* space binds its publisher here, and the preview tool of the report agent then
|
|
138
|
-
* the minted URL beside the page path.
|
|
139
|
-
*
|
|
137
|
+
* space binds its publisher factory here, and the preview tool of the report agent then
|
|
138
|
+
* attaches the minted URL beside the page path. The factory binds one analysis and the
|
|
139
|
+
* auth of the tool call, like `makeReportReferenceResolver`, thus a host that mints under
|
|
140
|
+
* the credential of the caller binds it with no ambient state. Absent, the tool attaches
|
|
141
|
+
* nothing and the page path stays the whole result, which is the whole local path.
|
|
140
142
|
*/
|
|
141
|
-
readonly
|
|
143
|
+
readonly makeSessionPagePublisher?: MakeSessionPagePublisher;
|
|
142
144
|
/**
|
|
143
145
|
* The page-URL formation of the report-session eyes. A managed host whose browser cannot
|
|
144
|
-
* reach the workspace tree binds a resolver that names a served URL for the look
|
|
145
|
-
* the
|
|
146
|
+
* reach the workspace tree binds a resolver that names a served URL for the look, and the
|
|
147
|
+
* args carry the auth of the tool call beside the page identity. Absent, the eyes tool
|
|
148
|
+
* navigates through a `file://` URL of the page path.
|
|
146
149
|
*/
|
|
147
150
|
readonly resolveReportPageUrl?: ResolvePageUrl;
|
|
148
151
|
/**
|
package/dist/runtime/assemble.js
CHANGED
|
@@ -164,7 +164,7 @@ export function assembleCoreRuntime(deps) {
|
|
|
164
164
|
makeResolver: makeReportResolver,
|
|
165
165
|
...(eyes ? { eyes } : {}),
|
|
166
166
|
...(deps.resolveReportPageAsset ? { resolvePageAsset: deps.resolveReportPageAsset } : {}),
|
|
167
|
-
...(deps.
|
|
167
|
+
...(deps.makeSessionPagePublisher ? { makeSessionPages: deps.makeSessionPagePublisher } : {}),
|
|
168
168
|
...(deps.resolveReportPageUrl ? { resolvePageUrl: deps.resolveReportPageUrl } : {}),
|
|
169
169
|
...(conversation.logger ? { logger: conversation.logger } : {}),
|
|
170
170
|
});
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
* and no outcome would ever arrive.
|
|
46
46
|
*/
|
|
47
47
|
import { z } from "zod";
|
|
48
|
+
import type { AuthContext } from "../../auth/types.js";
|
|
48
49
|
import { type ChromeConfig } from "../../lib/chrome.js";
|
|
49
50
|
import { type AcquireEyes } from "../../lib/eyes.js";
|
|
50
51
|
import { type Logger } from "../../lib/logger.js";
|
|
@@ -56,11 +57,14 @@ export type { CapturePage, FailedRequest, PageCapture };
|
|
|
56
57
|
/**
|
|
57
58
|
* The URL formation of one look. It maps the page of the thread onto the URL that the browser opens.
|
|
58
59
|
* A composition whose browser cannot reach the workspace tree binds a resolver that names a served URL.
|
|
60
|
+
* The args carry the auth of the tool call beside the page identity, thus a realization mints the URL
|
|
61
|
+
* under the credential of the caller and holds no ambient state.
|
|
59
62
|
*/
|
|
60
63
|
export type ResolvePageUrl = (args: {
|
|
61
64
|
pagePath: string;
|
|
62
65
|
analysisId: string;
|
|
63
66
|
threadId: string;
|
|
67
|
+
auth: AuthContext;
|
|
64
68
|
}) => Promise<string>;
|
|
65
69
|
/** The empty input. The tool examines the current page of the thread, thus it needs no field. */
|
|
66
70
|
declare const examinePageInput: z.ZodObject<{}, z.core.$strip>;
|
|
@@ -276,7 +276,10 @@ export function createExaminePageTool(deps) {
|
|
|
276
276
|
// becomes a typed outcome and the look never starts.
|
|
277
277
|
let url;
|
|
278
278
|
try {
|
|
279
|
-
url =
|
|
279
|
+
url =
|
|
280
|
+
deps.resolvePageUrl !== undefined
|
|
281
|
+
? await deps.resolvePageUrl({ pagePath, analysisId, threadId, auth: ctx.session.auth })
|
|
282
|
+
: pathToFileURL(pagePath).href;
|
|
280
283
|
}
|
|
281
284
|
catch (cause) {
|
|
282
285
|
logger.warn("the page URL did not resolve", { threadId, analysisId, ...defaultErrorFields(cause) });
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export { createPreviewReportTool, type PreviewReportInput, type PreviewReportResult, type PreviewReportToolDeps, type ResolvePageAsset, type SessionPageAccess, } from "./preview-report.js";
|
|
9
9
|
export { createExaminePageTool, type CapturePage, type ExaminePageInput, type ExaminePageResult, type ExaminePageToolDeps, type FailedRequest, type PageCapture, type ResolvePageUrl, } from "./examine-page.js";
|
|
10
|
-
export { describeSessionPageMintFailure, UnavailableSessionPagePublisher, type SessionPageMintFailure, type SessionPageMintResult, type SessionPagePublisher, } from "./session-page-publisher.js";
|
|
10
|
+
export { describeSessionPageMintFailure, UnavailableSessionPagePublisher, type MakeSessionPagePublisher, type SessionPageMintFailure, type SessionPageMintResult, type SessionPagePublisher, } from "./session-page-publisher.js";
|
|
11
11
|
export { createRecordVersionTool, type RecordVersionInput, type RecordVersionResult, type RecordVersionToolDeps } from "./record-version.js";
|
|
12
12
|
export { createDeriveTableTool, type DeriveTableInput, type DeriveTableResult, type DeriveTableToolDeps } from "./derive-table.js";
|
|
13
13
|
export { createListPinnedArtifactsTool, type ListPinnedArtifactsInput, type ListPinnedArtifactsResult, type ListPinnedArtifactsToolDeps, type PinnedArtifact, type PinnedCitation, } from "./list-artifacts.js";
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
* namespace belongs to this path alone, thus the tool never writes under the old `previews/` or `reports/`
|
|
17
17
|
* trees. The result carries the absolute page path, thus a local host shows the page with no seam.
|
|
18
18
|
*
|
|
19
|
-
* A hosted view rides the same result. When the composition binds the session-page
|
|
20
|
-
* mints one grant after the page lands, and the
|
|
21
|
-
* `report-sessions/{analysisId}/{threadId}`
|
|
22
|
-
* rides the arm as data, and the page path
|
|
23
|
-
*
|
|
19
|
+
* A hosted view rides the same result. When the composition binds the session-page factory, the tool
|
|
20
|
+
* builds the publisher over the scope of the call, mints one grant after the page lands, and the
|
|
21
|
+
* `rendered` arm carries the URL of the URL space `report-sessions/{analysisId}/{threadId}`
|
|
22
|
+
* (`contracts/content-url.ts`) beside the path. A refused mint rides the arm as data, and the page path
|
|
23
|
+
* stays good — a broken grant surface never costs the render. An unbound factory changes nothing: the
|
|
24
|
+
* arm carries no access field, and a local host opens the file.
|
|
24
25
|
*
|
|
25
26
|
* Each degraded condition is a typed outcome in the ok channel: a session refusal, a gap list, a resolver
|
|
26
27
|
* absence, an unresolvable root at resolver construction, an unresolved reference, a bridge mismatch, a
|
|
@@ -43,7 +44,7 @@ import { type BridgeMismatch } from "../../report-render/value-bridge.js";
|
|
|
43
44
|
import type { RenderProblem } from "../../report-render/types.js";
|
|
44
45
|
import { type Tool } from "../define-tool.js";
|
|
45
46
|
import { type ReportSessionStateGateway, type SessionRefusal } from "../report-authoring/authoring-tools.js";
|
|
46
|
-
import { type
|
|
47
|
+
import { type MakeSessionPagePublisher } from "./session-page-publisher.js";
|
|
47
48
|
/** The empty input. The tool renders the current draft of the thread, thus it needs no field. */
|
|
48
49
|
declare const previewReportInput: z.ZodObject<{}, z.core.$strip>;
|
|
49
50
|
export type PreviewReportInput = z.infer<typeof previewReportInput>;
|
|
@@ -118,9 +119,11 @@ export type ResolvePageAsset = (specifier: string) => string;
|
|
|
118
119
|
* harness. An embedder that ships the asset bytes packed, for example a compiled single-file binary with no
|
|
119
120
|
* `node_modules` tree, materializes them to disk and binds its own lookup here.
|
|
120
121
|
*
|
|
121
|
-
* `
|
|
122
|
-
*
|
|
123
|
-
*
|
|
122
|
+
* `makeSessionPages` is optional, because a local host opens the page path itself. It binds one analysis
|
|
123
|
+
* and the auth of the call, like `makeResolver`, thus a realization mints under the credential of the
|
|
124
|
+
* caller. Bound, the tool builds the publisher over the scope of the call, mints one grant after the page
|
|
125
|
+
* lands, and attaches the URL beside the path. A refused mint rides the `rendered` arm as data, and it
|
|
126
|
+
* never fails the render.
|
|
124
127
|
*/
|
|
125
128
|
export interface PreviewReportToolDeps {
|
|
126
129
|
readonly gateway: ReportSessionStateGateway;
|
|
@@ -130,7 +133,7 @@ export interface PreviewReportToolDeps {
|
|
|
130
133
|
}) => ReferenceResolver;
|
|
131
134
|
readonly resolveWorkspaceRoot: ResolveWorkspaceRoot;
|
|
132
135
|
readonly resolvePageAsset?: ResolvePageAsset;
|
|
133
|
-
readonly
|
|
136
|
+
readonly makeSessionPages?: MakeSessionPagePublisher;
|
|
134
137
|
readonly logger?: Logger;
|
|
135
138
|
}
|
|
136
139
|
/**
|
|
@@ -16,11 +16,12 @@
|
|
|
16
16
|
* namespace belongs to this path alone, thus the tool never writes under the old `previews/` or `reports/`
|
|
17
17
|
* trees. The result carries the absolute page path, thus a local host shows the page with no seam.
|
|
18
18
|
*
|
|
19
|
-
* A hosted view rides the same result. When the composition binds the session-page
|
|
20
|
-
* mints one grant after the page lands, and the
|
|
21
|
-
* `report-sessions/{analysisId}/{threadId}`
|
|
22
|
-
* rides the arm as data, and the page path
|
|
23
|
-
*
|
|
19
|
+
* A hosted view rides the same result. When the composition binds the session-page factory, the tool
|
|
20
|
+
* builds the publisher over the scope of the call, mints one grant after the page lands, and the
|
|
21
|
+
* `rendered` arm carries the URL of the URL space `report-sessions/{analysisId}/{threadId}`
|
|
22
|
+
* (`contracts/content-url.ts`) beside the path. A refused mint rides the arm as data, and the page path
|
|
23
|
+
* stays good — a broken grant surface never costs the render. An unbound factory changes nothing: the
|
|
24
|
+
* arm carries no access field, and a local host opens the file.
|
|
24
25
|
*
|
|
25
26
|
* Each degraded condition is a typed outcome in the ok channel: a session refusal, a gap list, a resolver
|
|
26
27
|
* absence, an unresolvable root at resolver construction, an unresolved reference, a bridge mismatch, a
|
|
@@ -342,18 +343,20 @@ async function sweepAssets(assetsDir, staged, logger) {
|
|
|
342
343
|
/**
|
|
343
344
|
* Mint the hosted view of the page that landed.
|
|
344
345
|
*
|
|
345
|
-
* An absent
|
|
346
|
-
* local contract.
|
|
347
|
-
*
|
|
348
|
-
*
|
|
346
|
+
* An absent factory gives no grant, and the arm carries no access field — the page path stays the whole
|
|
347
|
+
* local contract. The tool builds the publisher over the scope of the call, thus the mint runs under the
|
|
348
|
+
* auth of the caller. A refusal, a thrown construction, and a thrown realization each become the
|
|
349
|
+
* not-granted arm, thus a broken grant surface never costs the render. The URL spells through
|
|
350
|
+
* `buildReportSessionUrl`, thus the formula lives in the contract and the seam gives the content-server
|
|
351
|
+
* base alone.
|
|
349
352
|
*/
|
|
350
|
-
async function mintAccess(
|
|
351
|
-
if (
|
|
353
|
+
async function mintAccess(makeSessionPages, analysisId, threadId, auth, logger) {
|
|
354
|
+
if (makeSessionPages === undefined) {
|
|
352
355
|
return undefined;
|
|
353
356
|
}
|
|
354
357
|
let minted;
|
|
355
358
|
try {
|
|
356
|
-
minted = await
|
|
359
|
+
minted = await makeSessionPages({ analysisId, auth }).mintSessionPageAccess(threadId);
|
|
357
360
|
}
|
|
358
361
|
catch (cause) {
|
|
359
362
|
logger.warn("the session-page mint threw", { threadId, analysisId, ...defaultErrorFields(cause) });
|
|
@@ -472,7 +475,7 @@ export function createPreviewReportTool(deps) {
|
|
|
472
475
|
logger.warn("the rendered hash did not stamp", { threadId, analysisId, detail });
|
|
473
476
|
return ok({ outcome: "stamp-failed", pagePath: written.value, detail });
|
|
474
477
|
}
|
|
475
|
-
const access = await mintAccess(deps.
|
|
478
|
+
const access = await mintAccess(deps.makeSessionPages, analysisId, threadId, ctx.session.auth, logger);
|
|
476
479
|
return ok({ outcome: "rendered", pagePath: written.value, ...(access !== undefined ? { access } : {}) });
|
|
477
480
|
},
|
|
478
481
|
});
|
|
@@ -7,10 +7,14 @@
|
|
|
7
7
|
* `report-sessions/{analysisId}/{threadId}` (`contracts/content-url.ts`). That mint hides behind this
|
|
8
8
|
* one method.
|
|
9
9
|
*
|
|
10
|
-
* The managed realization owns the grant mint and its client.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* The managed realization owns the grant mint and its client. A mint runs under the credential of the
|
|
11
|
+
* tool call, thus the composition binds a factory and the preview tool builds the publisher over the
|
|
12
|
+
* scope of the call — exactly as it builds the reference resolver. A boot-time singleton could not
|
|
13
|
+
* carry that credential, and a host that bans ambient state could not bind one at all. The local
|
|
14
|
+
* default (`UnavailableSessionPagePublisher`) returns not-ok, thus the preview tool attaches no URL
|
|
15
|
+
* and the render still lands — the page path stays the whole local contract.
|
|
13
16
|
*/
|
|
17
|
+
import type { AuthContext } from "../../auth/types.js";
|
|
14
18
|
export type SessionPageMintResult = {
|
|
15
19
|
ok: true;
|
|
16
20
|
data: {
|
|
@@ -40,16 +44,25 @@ export type SessionPageMintFailure = Extract<SessionPageMintResult, {
|
|
|
40
44
|
export declare function describeSessionPageMintFailure(failure: SessionPageMintFailure): string;
|
|
41
45
|
export interface SessionPagePublisher {
|
|
42
46
|
/**
|
|
43
|
-
* Mint the access grant of one session page.
|
|
44
|
-
*
|
|
45
|
-
*
|
|
47
|
+
* Mint the access grant of one session page. The publisher binds the analysis, thus the mint takes
|
|
48
|
+
* the thread id alone. `baseUrl` is the base URL of the content server, with no res path — the
|
|
49
|
+
* caller spells the whole URL through `buildReportSessionUrl`, thus the formula lives in the
|
|
50
|
+
* contract and never in a realization.
|
|
46
51
|
*/
|
|
47
|
-
mintSessionPageAccess(
|
|
52
|
+
mintSessionPageAccess(threadId: string): Promise<SessionPageMintResult>;
|
|
48
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* The per-call construction of the publisher. The factory binds one analysis and the auth of the tool
|
|
56
|
+
* call, thus a realization mints under the credential of the caller and holds no ambient state.
|
|
57
|
+
*/
|
|
58
|
+
export type MakeSessionPagePublisher = (scope: {
|
|
59
|
+
analysisId: string;
|
|
60
|
+
auth: AuthContext;
|
|
61
|
+
}) => SessionPagePublisher;
|
|
49
62
|
/**
|
|
50
63
|
* Local default — no hosted view of a session page. Returns not-ok, thus the preview tool carries the
|
|
51
64
|
* refusal as data and the page path stays the whole result.
|
|
52
65
|
*/
|
|
53
66
|
export declare class UnavailableSessionPagePublisher implements SessionPagePublisher {
|
|
54
|
-
mintSessionPageAccess(
|
|
67
|
+
mintSessionPageAccess(_threadId: string): Promise<SessionPageMintResult>;
|
|
55
68
|
}
|
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
* `report-sessions/{analysisId}/{threadId}` (`contracts/content-url.ts`). That mint hides behind this
|
|
8
8
|
* one method.
|
|
9
9
|
*
|
|
10
|
-
* The managed realization owns the grant mint and its client.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* The managed realization owns the grant mint and its client. A mint runs under the credential of the
|
|
11
|
+
* tool call, thus the composition binds a factory and the preview tool builds the publisher over the
|
|
12
|
+
* scope of the call — exactly as it builds the reference resolver. A boot-time singleton could not
|
|
13
|
+
* carry that credential, and a host that bans ambient state could not bind one at all. The local
|
|
14
|
+
* default (`UnavailableSessionPagePublisher`) returns not-ok, thus the preview tool attaches no URL
|
|
15
|
+
* and the render still lands — the page path stays the whole local contract.
|
|
13
16
|
*/
|
|
14
17
|
/**
|
|
15
18
|
* Renders a failed mint as the line an agent reads back from the preview tool.
|
|
@@ -33,7 +36,7 @@ export function describeSessionPageMintFailure(failure) {
|
|
|
33
36
|
* refusal as data and the page path stays the whole result.
|
|
34
37
|
*/
|
|
35
38
|
export class UnavailableSessionPagePublisher {
|
|
36
|
-
async mintSessionPageAccess(
|
|
39
|
+
async mintSessionPageAccess(_threadId) {
|
|
37
40
|
return {
|
|
38
41
|
ok: false,
|
|
39
42
|
error: { message: "the hosted view of a session page is unavailable in this environment" },
|
package/package.json
CHANGED