@sema-agent/server 1.313.0 → 1.314.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/dist/auth-bridge.d.ts +3 -2
- package/dist/bench/s1/live-deps.js +2 -2
- package/dist/budget.d.ts +4 -76
- package/dist/budget.js +4 -83
- package/dist/capabilities/sandbox-file-send.d.ts +2 -1
- package/dist/config-types.d.ts +1 -1
- package/dist/elicitation.d.ts +5 -3
- package/dist/elicitation.js +3 -2
- package/dist/fleet-lease.d.ts +1 -1
- package/dist/fleet-lease.js +1 -1
- package/dist/hooks/hook-llm.d.ts +5 -4
- package/dist/hooks/hook-runner.d.ts +1 -1
- package/dist/hooks/hook-runner.js +1 -1
- package/dist/http/server.js +67 -85
- package/dist/key-resolver.d.ts +1 -1
- package/dist/key-resolver.js +1 -1
- package/dist/leader/grader-env-factory.d.ts +1 -1
- package/dist/leader/grader-env-factory.js +2 -2
- package/dist/leader/wire.d.ts +1 -1
- package/dist/leader/wire.js +1 -1
- package/dist/main.js +26 -26
- package/dist/memory-scope.d.ts +18 -0
- package/dist/memory-scope.js +38 -0
- package/dist/observability/cost-taxonomy.d.ts +34 -0
- package/dist/observability/cost-taxonomy.js +26 -0
- package/dist/observability/prompt-manifest.d.ts +75 -0
- package/dist/observability/prompt-manifest.js +82 -0
- package/dist/plugins/web-search.d.ts +4 -3
- package/dist/question.d.ts +2 -1
- package/dist/question.js +3 -2
- package/dist/run-local.js +2 -2
- package/dist/runtime-caps-resolver.d.ts +7 -7
- package/dist/runtime-caps-resolver.js +3 -3
- package/dist/security.d.ts +2 -16
- package/dist/security.js +3 -37
- package/dist/tool-approval.d.ts +2 -1
- package/dist/tool-approval.js +3 -2
- package/package.json +1 -1
package/dist/auth-bridge.d.ts
CHANGED
|
@@ -23,7 +23,8 @@ export type VerifyOutcome = {
|
|
|
23
23
|
ok: false;
|
|
24
24
|
error: AuthBridgeErrorCode;
|
|
25
25
|
};
|
|
26
|
-
export
|
|
26
|
+
export interface RegistryJwtVerifier {
|
|
27
27
|
verify: (bearer: string) => Promise<VerifyOutcome>;
|
|
28
|
-
}
|
|
28
|
+
}
|
|
29
|
+
export declare function createRegistryJwtVerifier(opts: RegistryJwtVerifierOptions): RegistryJwtVerifier;
|
|
29
30
|
//# sourceMappingURL=auth-bridge.d.ts.map
|
|
@@ -4,7 +4,7 @@ import { createBrain } from "../../brain.js";
|
|
|
4
4
|
import { buildPricing } from "../../budget.js";
|
|
5
5
|
import { RemoteContainerExecutionEnv } from "../../plugins/remote-env-e2b.js";
|
|
6
6
|
import { createDurableAskPolicy } from "../../approval.js";
|
|
7
|
-
import {
|
|
7
|
+
import { createLeaderRunner } from "../../leader/wire.js";
|
|
8
8
|
import { runOracle as runStandaloneOracle } from "./oracle.js";
|
|
9
9
|
import { makeRepairOracle } from "./repair-oracle-adapter.js";
|
|
10
10
|
import { assertDistinctEnvs } from "./runner-ctx.js";
|
|
@@ -358,7 +358,7 @@ async function runLeaderForTrap(rt, brain, models, roles, pricing, trap, cellId,
|
|
|
358
358
|
process.env.LEADER_ENABLED = "true";
|
|
359
359
|
process.env.LEADER_WORKER_BUDGET_USD = String((rt.maxCostUsd ?? 1.0) / 2);
|
|
360
360
|
process.env.LEADER_CONFLICT_ROUNDS = process.env.LEADER_CONFLICT_ROUNDS ?? "2";
|
|
361
|
-
const run =
|
|
361
|
+
const run = createLeaderRunner({
|
|
362
362
|
brain, models, roles, pricing, e2bApiKey: rt.e2bApiKey, workspace: W,
|
|
363
363
|
...(process.env.S1_DEBUG_GIT ? { logger: { warn: (m, x) => console.error(`[S1_DEBUG_LEADER warn] ${m}`, x ? JSON.stringify(x).slice(0, 300) : ""), info: (m, x) => console.error(`[S1_DEBUG_LEADER info] ${m}`, x ? JSON.stringify(x).slice(0, 200) : "") } } : {}),
|
|
364
364
|
});
|
package/dist/budget.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Metrics } from "./observability/metrics.js";
|
|
|
3
3
|
import type { QuotaTracker } from "./observability/cost-quota.js";
|
|
4
4
|
import type { FleetUsageAccumulator } from "./fleet-client.js";
|
|
5
5
|
import type { FleetLeaseManager } from "./fleet-lease.js";
|
|
6
|
+
import { type PromptManifestTracker } from "./observability/prompt-manifest.js";
|
|
6
7
|
export declare function buildPricing(models: Record<string, Model>): Record<string, ModelPricing>;
|
|
7
8
|
export declare function cardinalityGuard(cap: number, onOverflow: () => void): (value: string) => string;
|
|
8
9
|
export interface ModelUsageDelta {
|
|
@@ -20,88 +21,15 @@ export declare class ModelUsageTracker {
|
|
|
20
21
|
drain(taskId: string): Record<string, ModelUsageDelta> | undefined;
|
|
21
22
|
clear(taskId: string): void;
|
|
22
23
|
}
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
blocks: Array<{
|
|
26
|
-
id: string;
|
|
27
|
-
chars: number;
|
|
28
|
-
hash: string;
|
|
29
|
-
}>;
|
|
30
|
-
sections?: Array<{
|
|
31
|
-
id: string;
|
|
32
|
-
slot: string;
|
|
33
|
-
carrier: string;
|
|
34
|
-
cadence: string;
|
|
35
|
-
cacheClass: string;
|
|
36
|
-
chars: number;
|
|
37
|
-
hash: string;
|
|
38
|
-
contentHash?: string;
|
|
39
|
-
}>;
|
|
40
|
-
tools?: Array<{
|
|
41
|
-
wireName: string;
|
|
42
|
-
aliases: string[];
|
|
43
|
-
contractId: string;
|
|
44
|
-
implementationRevision: string;
|
|
45
|
-
cardId: string;
|
|
46
|
-
shapeDigest: string;
|
|
47
|
-
wireSchemaDigest: string;
|
|
48
|
-
}>;
|
|
49
|
-
totalChars: number;
|
|
50
|
-
}
|
|
51
|
-
export declare function promptManifestRecordOf(e: {
|
|
52
|
-
constitution: string;
|
|
53
|
-
blocks: Array<{
|
|
54
|
-
id: string;
|
|
55
|
-
chars: number;
|
|
56
|
-
hash: string;
|
|
57
|
-
}>;
|
|
58
|
-
sections?: Array<{
|
|
59
|
-
id: string;
|
|
60
|
-
slot: string;
|
|
61
|
-
carrier: string;
|
|
62
|
-
cadence: string;
|
|
63
|
-
cacheClass: string;
|
|
64
|
-
chars: number;
|
|
65
|
-
hash: string;
|
|
66
|
-
contentHash?: string;
|
|
67
|
-
}>;
|
|
68
|
-
tools?: Array<{
|
|
69
|
-
wireName: string;
|
|
70
|
-
aliases: string[];
|
|
71
|
-
contractId: string;
|
|
72
|
-
implementationRevision: string;
|
|
73
|
-
cardId: string;
|
|
74
|
-
shapeDigest: string;
|
|
75
|
-
wireSchemaDigest: string;
|
|
76
|
-
}>;
|
|
77
|
-
totalChars: number;
|
|
78
|
-
}): PromptManifestRecord;
|
|
79
|
-
export declare function configAssembledRecordOf(e: {
|
|
80
|
-
catalogVersion?: unknown;
|
|
81
|
-
fields?: unknown;
|
|
82
|
-
overrideReasons?: unknown;
|
|
83
|
-
ts?: unknown;
|
|
84
|
-
}): Record<string, unknown> | undefined;
|
|
85
|
-
export declare class PromptManifestTracker {
|
|
86
|
-
private readonly byTask;
|
|
87
|
-
private readonly configByTask;
|
|
88
|
-
private readonly active;
|
|
89
|
-
private leaseCounter;
|
|
90
|
-
register(taskId: string): number;
|
|
91
|
-
record(taskId: string, m: PromptManifestRecord): void;
|
|
92
|
-
recordConfig(taskId: string, rec: Record<string, unknown>): void;
|
|
93
|
-
drainConfig(taskId: string): Array<Record<string, unknown>> | undefined;
|
|
94
|
-
drain(taskId: string): PromptManifestRecord[] | undefined;
|
|
95
|
-
clear(taskId: string, lease: number): void;
|
|
96
|
-
}
|
|
97
|
-
export declare function buildTracer(metrics: Pick<Metrics, "inc" | "observe">, costQuota?: QuotaTracker, modelUsage?: ModelUsageTracker, fleetUsage?: FleetUsageAccumulator, fleetLease?: FleetLeaseManager, quotaWeightFor?: (model: string) => number, promptManifests?: PromptManifestTracker): TracerHook;
|
|
24
|
+
export { type PromptManifestRecord, promptManifestRecordOf, configAssembledRecordOf, PromptManifestTracker, } from "./observability/prompt-manifest.js";
|
|
25
|
+
export declare function createTracer(metrics: Pick<Metrics, "inc" | "observe">, costQuota?: QuotaTracker, modelUsage?: ModelUsageTracker, fleetUsage?: FleetUsageAccumulator, fleetLease?: FleetLeaseManager, quotaWeightFor?: (model: string) => number, promptManifests?: PromptManifestTracker): TracerHook;
|
|
98
26
|
export declare function cacheFamilyOfMirror(model: {
|
|
99
27
|
api?: string;
|
|
100
28
|
params?: {
|
|
101
29
|
promptCacheFamily?: string;
|
|
102
30
|
};
|
|
103
31
|
} | undefined): "input-includes-cached" | "input-excludes-cached" | undefined;
|
|
104
|
-
export declare function
|
|
32
|
+
export declare function createSideQueryAccountant(metrics: Pick<Metrics, "inc">, costQuota?: QuotaTracker, fleetUsage?: FleetUsageAccumulator, fleetLease?: FleetLeaseManager, quotaWeightFor?: (model: string) => number): (principal: string | undefined, r: {
|
|
105
33
|
model: string;
|
|
106
34
|
family?: "input-includes-cached" | "input-excludes-cached";
|
|
107
35
|
usage?: {
|
package/dist/budget.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { modelCostToPricing } from "@sema-agent/core";
|
|
2
2
|
import { currentPrincipal } from "./observability/principal-context.js";
|
|
3
|
+
import { promptManifestRecordOf, configAssembledRecordOf } from "./observability/prompt-manifest.js";
|
|
3
4
|
export function buildPricing(models) {
|
|
4
5
|
const pricing = {};
|
|
5
6
|
for (const m of Object.values(models))
|
|
@@ -61,88 +62,8 @@ export class ModelUsageTracker {
|
|
|
61
62
|
}
|
|
62
63
|
clear(taskId) { this.byTask.delete(taskId); this.active.delete(taskId); }
|
|
63
64
|
}
|
|
64
|
-
export
|
|
65
|
-
|
|
66
|
-
constitution: String(e.constitution),
|
|
67
|
-
blocks: (Array.isArray(e.blocks) ? e.blocks : []).map((b) => ({ id: String(b.id), chars: b.chars, hash: String(b.hash) })),
|
|
68
|
-
...(Array.isArray(e.sections)
|
|
69
|
-
? { sections: e.sections.map((s) => ({ id: String(s.id), slot: String(s.slot), carrier: String(s.carrier), cadence: String(s.cadence), cacheClass: String(s.cacheClass), chars: s.chars, hash: String(s.hash), ...(typeof s.contentHash === "string" ? { contentHash: s.contentHash } : {}) })) }
|
|
70
|
-
: {}),
|
|
71
|
-
...(Array.isArray(e.tools)
|
|
72
|
-
? { tools: e.tools.map((t) => ({ wireName: String(t.wireName), aliases: (Array.isArray(t.aliases) ? t.aliases : []).map(String), contractId: String(t.contractId), implementationRevision: String(t.implementationRevision), cardId: String(t.cardId), shapeDigest: String(t.shapeDigest), wireSchemaDigest: String(t.wireSchemaDigest) })) }
|
|
73
|
-
: {}),
|
|
74
|
-
totalChars: e.totalChars,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
export function configAssembledRecordOf(e) {
|
|
78
|
-
const rec = {
|
|
79
|
-
catalogVersion: e.catalogVersion,
|
|
80
|
-
fields: e.fields,
|
|
81
|
-
...(e.overrideReasons !== undefined ? { overrideReasons: e.overrideReasons } : {}),
|
|
82
|
-
ts: e.ts,
|
|
83
|
-
};
|
|
84
|
-
try {
|
|
85
|
-
if (JSON.stringify(rec).length > 32_768)
|
|
86
|
-
return undefined;
|
|
87
|
-
}
|
|
88
|
-
catch {
|
|
89
|
-
return undefined;
|
|
90
|
-
}
|
|
91
|
-
return rec;
|
|
92
|
-
}
|
|
93
|
-
export class PromptManifestTracker {
|
|
94
|
-
byTask = new Map();
|
|
95
|
-
configByTask = new Map();
|
|
96
|
-
active = new Map();
|
|
97
|
-
leaseCounter = 0;
|
|
98
|
-
register(taskId) {
|
|
99
|
-
if (!taskId)
|
|
100
|
-
return 0;
|
|
101
|
-
const lease = ++this.leaseCounter;
|
|
102
|
-
this.active.set(taskId, lease);
|
|
103
|
-
return lease;
|
|
104
|
-
}
|
|
105
|
-
record(taskId, m) {
|
|
106
|
-
if (!taskId || !this.active.has(taskId))
|
|
107
|
-
return;
|
|
108
|
-
const q = this.byTask.get(taskId);
|
|
109
|
-
if (q)
|
|
110
|
-
q.push(m);
|
|
111
|
-
else
|
|
112
|
-
this.byTask.set(taskId, [m]);
|
|
113
|
-
}
|
|
114
|
-
recordConfig(taskId, rec) {
|
|
115
|
-
if (!taskId || !this.active.has(taskId))
|
|
116
|
-
return;
|
|
117
|
-
const q = this.configByTask.get(taskId);
|
|
118
|
-
if (q)
|
|
119
|
-
q.push(rec);
|
|
120
|
-
else
|
|
121
|
-
this.configByTask.set(taskId, [rec]);
|
|
122
|
-
}
|
|
123
|
-
drainConfig(taskId) {
|
|
124
|
-
const q = this.configByTask.get(taskId);
|
|
125
|
-
if (!q || q.length === 0)
|
|
126
|
-
return undefined;
|
|
127
|
-
this.configByTask.delete(taskId);
|
|
128
|
-
return q;
|
|
129
|
-
}
|
|
130
|
-
drain(taskId) {
|
|
131
|
-
const q = this.byTask.get(taskId);
|
|
132
|
-
if (!q || q.length === 0)
|
|
133
|
-
return undefined;
|
|
134
|
-
this.byTask.delete(taskId);
|
|
135
|
-
return q;
|
|
136
|
-
}
|
|
137
|
-
clear(taskId, lease) {
|
|
138
|
-
if (this.active.get(taskId) !== lease)
|
|
139
|
-
return;
|
|
140
|
-
this.byTask.delete(taskId);
|
|
141
|
-
this.active.delete(taskId);
|
|
142
|
-
this.configByTask.delete(taskId);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
export function buildTracer(metrics, costQuota, modelUsage, fleetUsage, fleetLease, quotaWeightFor, promptManifests) {
|
|
65
|
+
export { promptManifestRecordOf, configAssembledRecordOf, PromptManifestTracker, } from "./observability/prompt-manifest.js";
|
|
66
|
+
export function createTracer(metrics, costQuota, modelUsage, fleetUsage, fleetLease, quotaWeightFor, promptManifests) {
|
|
146
67
|
const toolName = cardinalityGuard(256, () => metrics.inc("metric_label_overflow_total", { label: "tool_name" }));
|
|
147
68
|
const modelId = cardinalityGuard(256, () => metrics.inc("metric_label_overflow_total", { label: "model" }));
|
|
148
69
|
const providerName = cardinalityGuard(64, () => metrics.inc("metric_label_overflow_total", { label: "provider" }));
|
|
@@ -200,7 +121,7 @@ export function cacheFamilyOfMirror(model) {
|
|
|
200
121
|
return "input-includes-cached";
|
|
201
122
|
return model.api === "anthropic-messages" || model.api === "bedrock-converse-stream" ? "input-excludes-cached" : "input-includes-cached";
|
|
202
123
|
}
|
|
203
|
-
export function
|
|
124
|
+
export function createSideQueryAccountant(metrics, costQuota, fleetUsage, fleetLease, quotaWeightFor) {
|
|
204
125
|
return (principal, r) => {
|
|
205
126
|
const input = typeof r.usage?.input === "number" ? r.usage.input : 0;
|
|
206
127
|
const output = typeof r.usage?.output === "number" ? r.usage.output : 0;
|
|
@@ -16,8 +16,9 @@ export interface SandboxFileSendDeps {
|
|
|
16
16
|
prepare: (filename: string | undefined, scope?: string) => PreparedDirectUpload;
|
|
17
17
|
maxBytes: number;
|
|
18
18
|
}
|
|
19
|
-
export
|
|
19
|
+
export type SandboxFileSend = (path: string, ctx: {
|
|
20
20
|
taskId?: string;
|
|
21
21
|
principal?: string;
|
|
22
22
|
}) => Promise<IssuedFileLink>;
|
|
23
|
+
export declare function createSandboxFileSend(deps: SandboxFileSendDeps): SandboxFileSend;
|
|
23
24
|
//# sourceMappingURL=sandbox-file-send.d.ts.map
|
package/dist/config-types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { SealedKeyPoison } from "./sealed-key.js";
|
|
|
2
2
|
import type { McpServerSpec, Model, ModelRoles } from "@sema-agent/core";
|
|
3
3
|
import type { ApprovalHmacKey, PrincipalJwtKey } from "./auth-keys.js";
|
|
4
4
|
import type { ElicitationThrottle } from "./elicitation.js";
|
|
5
|
-
import type { InfraCostRates } from "./
|
|
5
|
+
import type { InfraCostRates } from "./observability/cost-taxonomy.js";
|
|
6
6
|
import type { Autonomy, CommandRule } from "./runtime-governance.js";
|
|
7
7
|
export interface ScopedMcpServer {
|
|
8
8
|
scenarios: string[];
|
package/dist/elicitation.d.ts
CHANGED
|
@@ -8,12 +8,13 @@ export interface ElicitationFrame {
|
|
|
8
8
|
mode?: "form";
|
|
9
9
|
action?: McpElicitResponse["action"];
|
|
10
10
|
}
|
|
11
|
-
export interface
|
|
11
|
+
export interface ElicitationRunContext {
|
|
12
12
|
taskId: string;
|
|
13
13
|
owner: string | null;
|
|
14
14
|
emit: (frame: ElicitationFrame) => void | Promise<void>;
|
|
15
15
|
abortSignal?: AbortSignal;
|
|
16
16
|
}
|
|
17
|
+
export type ElicitRunContext = ElicitationRunContext;
|
|
17
18
|
export interface ElicitationThrottle {
|
|
18
19
|
maxConcurrentPerRun: number;
|
|
19
20
|
maxTotalPerRun: number;
|
|
@@ -21,13 +22,14 @@ export interface ElicitationThrottle {
|
|
|
21
22
|
ttlMs: number;
|
|
22
23
|
}
|
|
23
24
|
export declare const DEFAULT_ELICITATION_THROTTLE: ElicitationThrottle;
|
|
24
|
-
export declare function
|
|
25
|
+
export declare function parseElicitationResponse(body: unknown): {
|
|
25
26
|
ok: true;
|
|
26
27
|
value: McpElicitResponse;
|
|
27
28
|
} | {
|
|
28
29
|
ok: false;
|
|
29
30
|
error: string;
|
|
30
31
|
};
|
|
32
|
+
export declare const parseElicitResponse: typeof parseElicitationResponse;
|
|
31
33
|
export declare class ElicitationCoordinator {
|
|
32
34
|
private readonly als;
|
|
33
35
|
private readonly pending;
|
|
@@ -35,7 +37,7 @@ export declare class ElicitationCoordinator {
|
|
|
35
37
|
private readonly throttle;
|
|
36
38
|
private readonly now;
|
|
37
39
|
constructor(throttle?: ElicitationThrottle, now?: () => number);
|
|
38
|
-
runWithContext<T>(ctx:
|
|
40
|
+
runWithContext<T>(ctx: ElicitationRunContext, fn: () => Promise<T>): Promise<T>;
|
|
39
41
|
elicit: (req: McpElicitRequest, signal?: AbortSignal) => Promise<McpElicitResponse>;
|
|
40
42
|
respond(id: string, principal: string | undefined, body: unknown): {
|
|
41
43
|
status: number;
|
package/dist/elicitation.js
CHANGED
|
@@ -9,7 +9,7 @@ export const DEFAULT_ELICITATION_THROTTLE = {
|
|
|
9
9
|
minIntervalMsPerServer: 1_000,
|
|
10
10
|
ttlMs: 5 * 60_000,
|
|
11
11
|
};
|
|
12
|
-
export function
|
|
12
|
+
export function parseElicitationResponse(body) {
|
|
13
13
|
if (body === null || typeof body !== "object" || Array.isArray(body))
|
|
14
14
|
return { ok: false, error: "body must be an object" };
|
|
15
15
|
const b = body;
|
|
@@ -32,6 +32,7 @@ export function parseElicitResponse(body) {
|
|
|
32
32
|
}
|
|
33
33
|
return { ok: true, value: { action: b.action } };
|
|
34
34
|
}
|
|
35
|
+
export const parseElicitResponse = parseElicitationResponse;
|
|
35
36
|
function boundSchema(schema) {
|
|
36
37
|
if (schema === undefined)
|
|
37
38
|
return undefined;
|
|
@@ -126,7 +127,7 @@ export class ElicitationCoordinator {
|
|
|
126
127
|
return answer;
|
|
127
128
|
};
|
|
128
129
|
respond(id, principal, body) {
|
|
129
|
-
const parsed =
|
|
130
|
+
const parsed = parseElicitationResponse(body);
|
|
130
131
|
if (!parsed.ok)
|
|
131
132
|
return { status: 400, body: { error: parsed.error } };
|
|
132
133
|
const entry = this.pending.get(id);
|
package/dist/fleet-lease.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ export declare class FleetLeaseManager {
|
|
|
65
65
|
private issueOrRenew;
|
|
66
66
|
private issueOrRenewInner;
|
|
67
67
|
}
|
|
68
|
-
export declare function
|
|
68
|
+
export declare function createFleetLeaseFromEnv(cfg: {
|
|
69
69
|
configCenter?: {
|
|
70
70
|
baseUrl: string;
|
|
71
71
|
token: string;
|
package/dist/fleet-lease.js
CHANGED
|
@@ -115,7 +115,7 @@ export class FleetLeaseManager {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
export function
|
|
118
|
+
export function createFleetLeaseFromEnv(cfg, opts) {
|
|
119
119
|
const cc = cfg.configCenter;
|
|
120
120
|
if (!cc?.baseUrl || !cc.token || !cc.worker)
|
|
121
121
|
return undefined;
|
package/dist/hooks/hook-llm.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ export type HookModelPick = {
|
|
|
11
11
|
ok: false;
|
|
12
12
|
error: string;
|
|
13
13
|
};
|
|
14
|
+
export interface HookLlm {
|
|
15
|
+
hookModelFor: (requested?: string) => HookModelPick;
|
|
16
|
+
hookLlm: HookLlmCall;
|
|
17
|
+
}
|
|
14
18
|
export declare function createHookLlm(deps: {
|
|
15
19
|
config: ServiceConfig;
|
|
16
20
|
getKeyResolver: () => ((model: Model) => Promise<{
|
|
@@ -20,8 +24,5 @@ export declare function createHookLlm(deps: {
|
|
|
20
24
|
inc: (name: string, labels?: Record<string, string>) => void;
|
|
21
25
|
};
|
|
22
26
|
fetchImpl?: typeof fetch;
|
|
23
|
-
}):
|
|
24
|
-
hookModelFor: (requested?: string) => HookModelPick;
|
|
25
|
-
hookLlm: HookLlmCall;
|
|
26
|
-
};
|
|
27
|
+
}): HookLlm;
|
|
27
28
|
//# sourceMappingURL=hook-llm.d.ts.map
|
|
@@ -49,6 +49,6 @@ export interface LlmHookExtra {
|
|
|
49
49
|
system: string;
|
|
50
50
|
transcript: string;
|
|
51
51
|
}
|
|
52
|
-
export declare function
|
|
52
|
+
export declare function createTaskHooks(config: HooksConfig, ctx: HookRunnerContext): Hooks | undefined;
|
|
53
53
|
export declare function composeHooks(deployment: Hooks | undefined, task: Hooks): Hooks;
|
|
54
54
|
//# sourceMappingURL=hook-runner.d.ts.map
|
|
@@ -494,7 +494,7 @@ async function runObserveOnlyEvent(event, groups, matchValue, payload, ctx, once
|
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
export function
|
|
497
|
+
export function createTaskHooks(config, ctx) {
|
|
498
498
|
const configured = Object.keys(config).filter((e) => (config[e]?.length ?? 0) > 0);
|
|
499
499
|
const dark = configured.filter((e) => HOOK_EVENT_OWNER[e] === "engine" && !LIT_EVENTS.includes(e));
|
|
500
500
|
if (dark.length > 0) {
|