@agenticprimitives/orchestration 0.0.0-alpha.4 → 0.0.0-alpha.6
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 +2 -0
- package/dist/admission.d.ts +50 -10
- package/dist/admission.d.ts.map +1 -1
- package/dist/admission.js +170 -8
- package/dist/admission.js.map +1 -1
- package/dist/answer-quality.d.ts +80 -0
- package/dist/answer-quality.d.ts.map +1 -0
- package/dist/answer-quality.js +97 -0
- package/dist/answer-quality.js.map +1 -0
- package/dist/authority.d.ts +34 -0
- package/dist/authority.d.ts.map +1 -1
- package/dist/conformance.d.ts +66 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +140 -0
- package/dist/conformance.js.map +1 -0
- package/dist/derivation.d.ts +21 -0
- package/dist/derivation.d.ts.map +1 -0
- package/dist/derivation.js +31 -0
- package/dist/derivation.js.map +1 -0
- package/dist/export-port.d.ts +13 -0
- package/dist/export-port.d.ts.map +1 -0
- package/dist/export-port.js +2 -0
- package/dist/export-port.js.map +1 -0
- package/dist/index.d.ts +20 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -4
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +37 -0
- package/dist/intent.d.ts.map +1 -0
- package/dist/intent.js +46 -0
- package/dist/intent.js.map +1 -0
- package/dist/judgment.d.ts +131 -0
- package/dist/judgment.d.ts.map +1 -0
- package/dist/judgment.js +249 -0
- package/dist/judgment.js.map +1 -0
- package/dist/loop.d.ts +44 -7
- package/dist/loop.d.ts.map +1 -1
- package/dist/loop.js +310 -63
- package/dist/loop.js.map +1 -1
- package/dist/metrics.js +8 -8
- package/dist/metrics.js.map +1 -1
- package/dist/outcome.d.ts +223 -0
- package/dist/outcome.d.ts.map +1 -0
- package/dist/outcome.js +325 -0
- package/dist/outcome.js.map +1 -0
- package/dist/plan-digest.d.ts +6 -0
- package/dist/plan-digest.d.ts.map +1 -0
- package/dist/plan-digest.js +35 -0
- package/dist/plan-digest.js.map +1 -0
- package/dist/planner.d.ts +18 -0
- package/dist/planner.d.ts.map +1 -1
- package/dist/planner.js +74 -0
- package/dist/planner.js.map +1 -1
- package/dist/reconcile.d.ts +41 -0
- package/dist/reconcile.d.ts.map +1 -0
- package/dist/reconcile.js +20 -0
- package/dist/reconcile.js.map +1 -0
- package/dist/record.d.ts +98 -21
- package/dist/record.d.ts.map +1 -1
- package/dist/record.js +45 -1
- package/dist/record.js.map +1 -1
- package/dist/regression.d.ts +109 -0
- package/dist/regression.d.ts.map +1 -0
- package/dist/regression.js +97 -0
- package/dist/regression.js.map +1 -0
- package/dist/selection.d.ts +334 -0
- package/dist/selection.d.ts.map +1 -0
- package/dist/selection.js +481 -0
- package/dist/selection.js.map +1 -0
- package/dist/spans.d.ts +62 -0
- package/dist/spans.d.ts.map +1 -1
- package/dist/spans.js +78 -11
- package/dist/spans.js.map +1 -1
- package/dist/tool-invoker.d.ts +54 -3
- package/dist/tool-invoker.d.ts.map +1 -1
- package/dist/tool-invoker.js +26 -1
- package/dist/tool-invoker.js.map +1 -1
- package/dist/trace-facts.d.ts +84 -0
- package/dist/trace-facts.d.ts.map +1 -0
- package/dist/trace-facts.js +82 -0
- package/dist/trace-facts.js.map +1 -0
- package/dist/types.d.ts +74 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -1
- package/package.json +16 -7
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { RunRecordV1 } from './record.js';
|
|
2
|
+
/** How the request reached the harness. Ids only. */
|
|
3
|
+
export interface RunDoorV1 {
|
|
4
|
+
kind: 'a2a-message' | 'harness-ask' | 'routed' | 'trigger' | 'resume' | 'home-mcp' | 'channel-mention' | 'background';
|
|
5
|
+
/** A2A 1.0 `Message.messageId` / `contextId` / task id, when the door was an A2A message. */
|
|
6
|
+
messageId?: string;
|
|
7
|
+
contextId?: string;
|
|
8
|
+
taskId?: string;
|
|
9
|
+
/** Spec 397 — through a HOST (the Home MCP): which registered client of the person, and under which template
|
|
10
|
+
* (`ask-as-me`, `act-as-me`). Ids only; the wire itself is never here. */
|
|
11
|
+
client?: string;
|
|
12
|
+
template?: string;
|
|
13
|
+
}
|
|
14
|
+
/** One language-model call the run made. Times in ms. */
|
|
15
|
+
/** What a provider REPORTED a model call used (never an estimate): input and output tokens, and where the provider
|
|
16
|
+
* says so, the input served from its prompt cache and the output spent on reasoning. */
|
|
17
|
+
export interface ModelUsageV1 {
|
|
18
|
+
tokensIn: number;
|
|
19
|
+
tokensOut: number;
|
|
20
|
+
cachedIn?: number;
|
|
21
|
+
reasoningOut?: number;
|
|
22
|
+
}
|
|
23
|
+
/** Sum usages (an absent one contributes nothing). */
|
|
24
|
+
export declare function addUsage(a: ModelUsageV1 | undefined, b: ModelUsageV1 | undefined): ModelUsageV1 | undefined;
|
|
25
|
+
export interface ModelCallV1 {
|
|
26
|
+
/** `judge`: the call that chose a skill (spec 415 selection); `structured`: a step's own structured call. */
|
|
27
|
+
role: 'plan' | 'compose' | 'structured' | 'judge';
|
|
28
|
+
/** Spec 417 §5 — the step whose call this was (a skill's answer); absent for the plan, the compose and the judge. */
|
|
29
|
+
stepRef?: string;
|
|
30
|
+
/** The call failed (no answer came back); its time and tokens still count. */
|
|
31
|
+
failed?: boolean;
|
|
32
|
+
model?: string;
|
|
33
|
+
provider?: string;
|
|
34
|
+
/** A digest of the prompt (never the prompt) — two runs share a prompt exactly when these match. */
|
|
35
|
+
promptDigest?: string;
|
|
36
|
+
tokensIn?: number;
|
|
37
|
+
tokensOut?: number;
|
|
38
|
+
/** Spec 388 — why this provider carried the call (a reason code). */
|
|
39
|
+
routeReason?: string;
|
|
40
|
+
startMs?: number;
|
|
41
|
+
endMs?: number;
|
|
42
|
+
}
|
|
43
|
+
/** The configuration a run ran under — each part something a comparison may change on its own. */
|
|
44
|
+
export interface VariantV1 {
|
|
45
|
+
/** The playbook, by its definition commitment; absent = the bare harness. */
|
|
46
|
+
playbook?: string;
|
|
47
|
+
/** supplied | compiled | model | rule-based. */
|
|
48
|
+
plannerKind?: string;
|
|
49
|
+
/** Spec 388 route policy (`budget`, a pinned provider …). */
|
|
50
|
+
routePolicy?: string;
|
|
51
|
+
/** The runtime's build (deployment version id / commit). */
|
|
52
|
+
build?: string;
|
|
53
|
+
/** Harness-capability toggles by notation (`retrieval/kb` → `off`). Absent ⇒ defaults. */
|
|
54
|
+
toggles?: Record<string, string>;
|
|
55
|
+
}
|
|
56
|
+
/** The seeded records a run began from, by digest (a comparison's fixture). Absent for a live run. */
|
|
57
|
+
export interface StartingStateRefV1 {
|
|
58
|
+
digest: string;
|
|
59
|
+
}
|
|
60
|
+
export type EngagementEffectV1 = 'changed-plan' | 'changed-step' | 'changed-answer' | 'no-change' | 'refused';
|
|
61
|
+
/** One engagement of a harness capability — on the run (no `stepRef`) or on one step. */
|
|
62
|
+
export interface HarnessEngagementV1 {
|
|
63
|
+
capability: string;
|
|
64
|
+
effect: EngagementEffectV1;
|
|
65
|
+
version?: string;
|
|
66
|
+
stepRef?: string;
|
|
67
|
+
/** Spec 415 §3a — for a `skill-selection/*` engagement: candidates offered, chosen, and the rejected neighbour (IRIs). */
|
|
68
|
+
offered?: string[];
|
|
69
|
+
chose?: string[];
|
|
70
|
+
rejected?: string[];
|
|
71
|
+
/** Spec 415 A4 — the request typed in the domain ontology (class IRIs; `https://agenticprimitives.dev/ns/execution#OutsideDomain`). */
|
|
72
|
+
intent?: {
|
|
73
|
+
requests?: string;
|
|
74
|
+
about?: string[];
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/** A variant's identity: SHA-256 over its canonical JSON (keys sorted — RFC 8785 for these string-valued parts). */
|
|
78
|
+
export declare function variantDigestOf(v: VariantV1): Promise<`sha256:${string}`>;
|
|
79
|
+
/** The planner kind as a harness-capability notation. */
|
|
80
|
+
export declare function plannerCapabilityOf(kind: string | undefined): string | undefined;
|
|
81
|
+
/** Every engagement the record shows, derived, merged with the explicit stamps (first mention wins per capability
|
|
82
|
+
* and step). Deterministic: the same record yields the same list. */
|
|
83
|
+
export declare function engagementsOf(record: RunRecordV1): HarnessEngagementV1[];
|
|
84
|
+
//# sourceMappingURL=trace-facts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-facts.d.ts","sourceRoot":"","sources":["../src/trace-facts.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,qDAAqD;AACrD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,aAAa,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,iBAAiB,GAIlG,YAAY,CAAC;IACjB,6FAA6F;IAC7F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;+EAC2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,yDAAyD;AACzD;yFACyF;AACzF,MAAM,WAAW,YAAY;IAAG,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE;AAC/G,sDAAsD;AACtD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,YAAY,GAAG,SAAS,EAAE,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAK3G;AAED,MAAM,WAAW,WAAW;IAC1B,6GAA6G;IAC7G,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,YAAY,GAAG,OAAO,CAAC;IAClD,qHAAqH;IACrH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,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E,MAAM,EAAE,CAAA;KAAE,CAAC;CAClD;AAED,oHAAoH;AACpH,wBAAsB,eAAe,CAAC,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,MAAM,EAAE,CAAC,CAG/E;AAED,yDAAyD;AACzD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKhF;AAED;sEACsE;AACtE,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,mBAAmB,EAAE,CAyCxE"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { canonicalJson, isArtifactRef, resultFactsOf } from './artifacts.js';
|
|
2
|
+
/** Sum usages (an absent one contributes nothing). */
|
|
3
|
+
export function addUsage(a, b) {
|
|
4
|
+
if (!a)
|
|
5
|
+
return b;
|
|
6
|
+
if (!b)
|
|
7
|
+
return a;
|
|
8
|
+
const opt = (x, y) => (x === undefined && y === undefined ? undefined : (x ?? 0) + (y ?? 0));
|
|
9
|
+
const cachedIn = opt(a.cachedIn, b.cachedIn), reasoningOut = opt(a.reasoningOut, b.reasoningOut);
|
|
10
|
+
return { tokensIn: a.tokensIn + b.tokensIn, tokensOut: a.tokensOut + b.tokensOut, ...(cachedIn !== undefined ? { cachedIn } : {}), ...(reasoningOut !== undefined ? { reasoningOut } : {}) };
|
|
11
|
+
}
|
|
12
|
+
/** A variant's identity: SHA-256 over its canonical JSON (keys sorted — RFC 8785 for these string-valued parts). */
|
|
13
|
+
export async function variantDigestOf(v) {
|
|
14
|
+
const bytes = new Uint8Array(await crypto.subtle.digest('SHA-256', new TextEncoder().encode(canonicalJson(v))));
|
|
15
|
+
return `sha256:${Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('')}`;
|
|
16
|
+
}
|
|
17
|
+
/** The planner kind as a harness-capability notation. */
|
|
18
|
+
export function plannerCapabilityOf(kind) {
|
|
19
|
+
if (!kind)
|
|
20
|
+
return undefined;
|
|
21
|
+
if (kind === 'supplied')
|
|
22
|
+
return 'planner/supplied';
|
|
23
|
+
if (kind === 'compiled')
|
|
24
|
+
return 'planner/compiled-shape';
|
|
25
|
+
return 'planner/model';
|
|
26
|
+
}
|
|
27
|
+
/** Every engagement the record shows, derived, merged with the explicit stamps (first mention wins per capability
|
|
28
|
+
* and step). Deterministic: the same record yields the same list. */
|
|
29
|
+
export function engagementsOf(record) {
|
|
30
|
+
const out = [];
|
|
31
|
+
const seen = new Set();
|
|
32
|
+
const add = (e) => {
|
|
33
|
+
const k = `${e.capability}|${e.stepRef ?? ''}`;
|
|
34
|
+
if (seen.has(k))
|
|
35
|
+
return;
|
|
36
|
+
seen.add(k);
|
|
37
|
+
out.push(e);
|
|
38
|
+
};
|
|
39
|
+
for (const e of record.engaged ?? [])
|
|
40
|
+
add(e);
|
|
41
|
+
// The planner proposed the plan (a supplied plan is still "the plan came from here").
|
|
42
|
+
const planner = plannerCapabilityOf(record.variant?.plannerKind);
|
|
43
|
+
if (planner)
|
|
44
|
+
add({ capability: planner, effect: record.plan.steps.length ? 'changed-plan' : 'no-change' });
|
|
45
|
+
// Plan admission: a refusal that forced a replan changed the plan; one that ended the run refused.
|
|
46
|
+
const refusals = record.events.filter((e) => e.type === 'PlanRefused');
|
|
47
|
+
if (refusals.length)
|
|
48
|
+
add({ capability: 'plan-admission', effect: refusals.some((r) => r.replanning) ? 'changed-plan' : 'refused' });
|
|
49
|
+
// A playbook governed the run.
|
|
50
|
+
if (record.receipts.some((r) => r.skillRef))
|
|
51
|
+
add({ capability: 'playbook', effect: 'changed-plan' });
|
|
52
|
+
// Fan-out (spec 380): the loop expands one step into `<base>#<k>` steps — its own id convention — so an expanded
|
|
53
|
+
// step on the record IS the evidence the plan was widened.
|
|
54
|
+
if (record.steps.some((s) => /#\d+$/.test(s.stepRef)))
|
|
55
|
+
add({ capability: 'fan-out', effect: 'changed-plan' });
|
|
56
|
+
const receipts = new Map(record.receipts.map((r) => [r.stepRef, r]));
|
|
57
|
+
const replayed = new Set(record.events.filter((e) => e.type === 'StepReplayed').map((e) => e.stepRef));
|
|
58
|
+
const approvalRefused = new Set(record.events.filter((e) => e.type === 'ApprovalRefused').map((e) => e.stepRef));
|
|
59
|
+
for (const s of record.steps) {
|
|
60
|
+
const r = receipts.get(s.stepRef);
|
|
61
|
+
const facts = resultFactsOf(s.result);
|
|
62
|
+
// Spec 413 — the declared retrieval step grounds what is SAID: passages that came back changed the answer.
|
|
63
|
+
if (s.stepRef === 'retrieve')
|
|
64
|
+
add({ capability: 'retrieval/kb', stepRef: s.stepRef, effect: s.ok && typeof facts?.count === 'number' && facts.count > 0 ? 'changed-answer' : 'no-change' });
|
|
65
|
+
if (replayed.has(s.stepRef) || s.replayed)
|
|
66
|
+
add({ capability: 'durable-resume', stepRef: s.stepRef, effect: 'changed-step' });
|
|
67
|
+
if (r?.authority?.afterApproval)
|
|
68
|
+
add({ capability: 'approval', stepRef: s.stepRef, effect: 'changed-step' });
|
|
69
|
+
if (approvalRefused.has(s.stepRef))
|
|
70
|
+
add({ capability: 'approval', stepRef: s.stepRef, effect: 'refused' });
|
|
71
|
+
if (r?.decisions?.length)
|
|
72
|
+
add({ capability: 'decision-rules', stepRef: s.stepRef, effect: 'changed-step' });
|
|
73
|
+
if (r?.binding?.correlation?.delegatedTo)
|
|
74
|
+
add({ capability: 'handoff', stepRef: s.stepRef, effect: 'changed-step' });
|
|
75
|
+
else if (typeof facts?.via?.runRef === 'string')
|
|
76
|
+
add({ capability: 'routing', stepRef: s.stepRef, effect: 'changed-step' });
|
|
77
|
+
if (isArtifactRef(s.result))
|
|
78
|
+
add({ capability: 'context-offload', stepRef: s.stepRef, effect: 'changed-step' });
|
|
79
|
+
}
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=trace-facts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-facts.js","sourceRoot":"","sources":["../src/trace-facts.ts"],"names":[],"mappings":"AAWA,OAAO,EAA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,CAAC,CAAC;QAC7G,IAAI,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;YAAE,GAAG,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;QAC3G,IAAI,CAAC,EAAE,SAAS,EAAE,MAAM;YAAE,GAAG,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;QAC5G,IAAI,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW;YAAE,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;aAChH,IAAI,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,QAAQ;YAAE,GAAG,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;QAC5H,IAAI,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;YAAE,GAAG,CAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAClH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -9,9 +9,52 @@ export interface Intent {
|
|
|
9
9
|
constraints?: Record<string, unknown>;
|
|
10
10
|
/** Optional context the planner may use (principal handle, locale…). Opaque to the loop. */
|
|
11
11
|
context?: Record<string, unknown>;
|
|
12
|
+
/** Spec 410 §5 — the versions this intent is acted under: the ontology manifest digest and the compiled
|
|
13
|
+
* definition's digest. Set by the runtime before the intent is offered for a mandate; the intent digest
|
|
14
|
+
* (RFC 8785 over the whole object) then binds them, and the verifier recomputes under the versions it
|
|
15
|
+
* runs with. Opaque to the loop; the shape is `delegation.VersionBindingV1`. */
|
|
16
|
+
versions?: {
|
|
17
|
+
ontologyManifestDigest: string;
|
|
18
|
+
semanticsDigest: string;
|
|
19
|
+
};
|
|
12
20
|
}
|
|
13
21
|
/** A capability the agent MAY compose. The planner picks from these; the loop refuses any other tool id. */
|
|
14
22
|
export type OutcomeClass = 'lookup' | 'submission' | 'authoritative';
|
|
23
|
+
/**
|
|
24
|
+
* Spec 410 §2 — the adapter's declaration, on the tool contract. `verificationWindow` is the time between the
|
|
25
|
+
* harness's check and the provider's commit, as an ISO 8601 duration (`PT30S`) or the word `unbounded` — a
|
|
26
|
+
* legal and visible answer. `retry` says what a second identical call does; `cancellation` what a cancel can
|
|
27
|
+
* do — `none` means the word is absent from every projection of this tool.
|
|
28
|
+
*/
|
|
29
|
+
export interface AdapterDeclarationV1 {
|
|
30
|
+
verificationWindow: string;
|
|
31
|
+
retry: 'idempotent-by-key' | 'never' | 'compensating';
|
|
32
|
+
cancellation: 'none' | 'before-commit' | 'compensating';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Spec 426 — AN EXECUTOR INVOKE DECLARATION: "call executor E's skill S as me, and hand me back its receipt."
|
|
36
|
+
* A capability carrying this is dispatched by ONE generic invoker (no runtime tool per domain): it resolves
|
|
37
|
+
* `executor` to a URL + client through OPERATOR CONFIG (never a hardcoded host — `executor` is a NAME, not a
|
|
38
|
+
* URL), obtains a session for the RUN'S PRINCIPAL, sends one A2A `message/send` carrying `metadata.skill =
|
|
39
|
+
* intent`, and records the receipt in `run.provenance`. An `invoke` block IMPLIES self-acting (v1): the write
|
|
40
|
+
* is to the principal's own domain, so the session is the authority and no mandate is minted — the generic
|
|
41
|
+
* invoker takes the session from the principal structurally, never from an arg (§6; `check:invoke-is-self-acting`).
|
|
42
|
+
*/
|
|
43
|
+
export interface ExecutorInvokeV1 {
|
|
44
|
+
/** v1's only transport. */
|
|
45
|
+
transport: 'a2a.message-send';
|
|
46
|
+
/** A NAME the operator maps to { url, client } — never a URL (ADR-0021: no host in a tool or a package). */
|
|
47
|
+
executor: string;
|
|
48
|
+
/** The executor's skill id → `metadata.skill`: which of its skills it runs. */
|
|
49
|
+
intent: string;
|
|
50
|
+
/** How the capability's args map onto the message. */
|
|
51
|
+
args: {
|
|
52
|
+
/** The arg holding the free-text part ("what happened, in my words") → the message text. */
|
|
53
|
+
goal: string;
|
|
54
|
+
/** Args passed through as message metadata. */
|
|
55
|
+
metadata?: string[];
|
|
56
|
+
};
|
|
57
|
+
}
|
|
15
58
|
export interface ToolSpec {
|
|
16
59
|
/** Stable tool id (matches the invoker's dispatch key, e.g. an MCP tool name). */
|
|
17
60
|
id: string;
|
|
@@ -36,6 +79,10 @@ export interface ToolSpec {
|
|
|
36
79
|
action: string;
|
|
37
80
|
resourceArg?: string;
|
|
38
81
|
authorityArg?: string;
|
|
82
|
+
/** Spec 408 §2.2 — this tool REDEEMS the mandate on chain (a payment, a chartered treasury's transfer):
|
|
83
|
+
* every enforcer fires at redemption, so a caveat with no off-chain judge may be recorded as enforced
|
|
84
|
+
* there. Absent ⇒ the step is judged strictly off chain. Declared on the tool, never by a plan. */
|
|
85
|
+
redeemsOnChain?: boolean;
|
|
39
86
|
};
|
|
40
87
|
/**
|
|
41
88
|
* Spec 366 — the argument naming the agent this act is ABOUT and is ANSWERED BY. When it resolves to an
|
|
@@ -92,6 +139,17 @@ export interface ToolSpec {
|
|
|
92
139
|
* can tell an act authorized by a session from one authorized by a signature.
|
|
93
140
|
*/
|
|
94
141
|
selfAuthorized?: true;
|
|
142
|
+
/**
|
|
143
|
+
* Spec 426 — this tool is an EXECUTOR INVOKE: it has no built-in invoker; the one generic invoker reads this
|
|
144
|
+
* block, calls the resolved executor as the run's principal, and returns its receipt. Compiled from the
|
|
145
|
+
* contract's `invoke` declaration (the only place a tool gains a behaviour by declaration, not runtime code).
|
|
146
|
+
* Its presence IMPLIES `selfAuthorized` (v1 is self-acting); a value-moving or cross-principal invoke is out of
|
|
147
|
+
* scope and keeps its own mandate-gated tool. The generic invoker, not this field, is the gate.
|
|
148
|
+
*/
|
|
149
|
+
invoke?: ExecutorInvokeV1;
|
|
150
|
+
/** Spec 420 — this tool's invoker honours `ctx.dryRun` (checks its preconditions, writes nothing), so a comparison may
|
|
151
|
+
* INVOKE it instead of holding it before invocation — its refusal ("nothing I remember contains …") is then testable. */
|
|
152
|
+
dryRun?: 'invoke';
|
|
95
153
|
/**
|
|
96
154
|
* Spec 363 W5 — the DECISION POINTS this capability consults, by id.
|
|
97
155
|
*
|
|
@@ -110,6 +168,14 @@ export interface ToolSpec {
|
|
|
110
168
|
toolId: string;
|
|
111
169
|
args: Record<string, unknown>;
|
|
112
170
|
};
|
|
171
|
+
/** Spec 410 §2 — what this tool's ADAPTER declares about the effect it makes. Required of every tool that
|
|
172
|
+
* submits or commits (`establishes` ≠ lookup); a generated surface may say "cancel" only when
|
|
173
|
+
* `cancellation` is not `none`. Declared, never inferred from a response. */
|
|
174
|
+
adapter?: AdapterDeclarationV1;
|
|
175
|
+
/** Spec 410 §7 — WHAT THIS TOOL'S WRITE CARRIES, per argument, as ontology classes (`{ body: ['apvault:ContactEmail'] }`).
|
|
176
|
+
* The information-flow caveat on a mandate names what a write may carry; the verifier compares the classes of
|
|
177
|
+
* the arguments a step presents against it. Declared by the adapter's author, never inferred from a value. */
|
|
178
|
+
carries?: Readonly<Record<string, readonly string[]>>;
|
|
113
179
|
/** An irreversible action: imposes `fresh-authorization` whatever the tier. */
|
|
114
180
|
irreversible?: boolean;
|
|
115
181
|
/** Spec 358 W4 — this tool's result ENUMERATES the objects of a domain relation (an ontology IRI,
|
|
@@ -167,6 +233,9 @@ export interface PlanStep {
|
|
|
167
233
|
};
|
|
168
234
|
}
|
|
169
235
|
/** The ordered tool composition the planner produced for an intent. */
|
|
236
|
+
/** Spec 421 W1 — the reserved continuation step ("show me what these reads return, then I will plan the rest"). A plan
|
|
237
|
+
* node, never a tool the loop invokes or a verifier judges. */
|
|
238
|
+
export declare const CONTINUE_STEP_ID = "plan.continue";
|
|
170
239
|
export interface Plan {
|
|
171
240
|
steps: PlanStep[];
|
|
172
241
|
/** Optional one-line reasoning (audit/telemetry only — never trusted as authority). */
|
|
@@ -227,10 +296,14 @@ export interface RunResult {
|
|
|
227
296
|
};
|
|
228
297
|
risk: import('./authority.js').ResolvedStep['risk'];
|
|
229
298
|
args: Record<string, unknown>;
|
|
299
|
+
/** Spec 410 §7 — what the tool declares its inputs carry, so the requirement can name what the write may carry. */
|
|
300
|
+
carries?: ToolSpec['carries'];
|
|
301
|
+
/** Spec 421 W2 — whose words each argument came from (the planner's raw values, before resolution). */
|
|
302
|
+
derivation?: Record<string, import('./derivation.js').ArgDerivationV1>;
|
|
230
303
|
};
|
|
231
304
|
}
|
|
232
305
|
/** Stable error codes the loop / planners raise (fail-closed; never a silent empty success). */
|
|
233
|
-
export type OrchestrationErrorCode = 'no_plan' | 'unknown_tool' | 'empty_plan' | 'max_steps' | 'planner_failed' | 'no_authority_port' | 'no_approval_port' | 'no_mandate_presented' | 'keyring_needs_selector' | 'fan_out_unbound' | 'fan_out_not_array' | 'fan_out_refused' | 'fan_out_over_limit';
|
|
306
|
+
export type OrchestrationErrorCode = 'no_plan' | 'reconcile_indeterminate' | 'unknown_tool' | 'empty_plan' | 'max_steps' | 'planner_failed' | 'no_authority_port' | 'no_approval_port' | 'no_mandate_presented' | 'keyring_needs_selector' | 'fan_out_unbound' | 'fan_out_not_array' | 'fan_out_refused' | 'resume_integrity' | 'fan_out_over_limit';
|
|
234
307
|
export declare class OrchestrationError extends Error {
|
|
235
308
|
readonly code: OrchestrationErrorCode;
|
|
236
309
|
constructor(code: OrchestrationErrorCode, message: string);
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAQA,eAA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EAAE,MAAM,CAAC;IACrB;mGAC+F;IAC/F,MAAM,CAAC,EAAE,OAAO,YAAY,EAAE,cAAc,CAAC;IAC7C;;iDAE6C;IAC7C,QAAQ,CAAC,EAAE;QACT,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAClF,IAAI,EAAE,OAAO,gBAAgB,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC9B,mHAAmH;QACnH,OAAO,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;QAC9B,uGAAuG;QACvG,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,iBAAiB,EAAE,eAAe,CAAC,CAAC;KACxE,CAAC;CACH;AAED,gGAAgG;AAChG,MAAM,MAAM,sBAAsB,GAC9B,SAAS,GACT,yBAAyB,GACzB,cAAc,GACd,YAAY,GACZ,WAAW,GACX,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,sBAAsB,GACtB,wBAAwB,GACxB,iBAAiB,GACjB,mBAAmB,GACnB,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,CAAC;AAEzB,qBAAa,kBAAmB,SAAQ,KAAK;aAEzB,IAAI,EAAE,sBAAsB;gBAA5B,IAAI,EAAE,sBAAsB,EAC5C,OAAO,EAAE,MAAM;CAKlB"}
|
package/dist/types.js
CHANGED
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
export const PACKAGE_NAME = '@agenticprimitives/orchestration';
|
|
9
9
|
export const PACKAGE_STATUS = 'w1-core';
|
|
10
10
|
export const SPEC_REF = 'packages/orchestration/spec.md';
|
|
11
|
+
/** The ordered tool composition the planner produced for an intent. */
|
|
12
|
+
/** Spec 421 W1 — the reserved continuation step ("show me what these reads return, then I will plan the rest"). A plan
|
|
13
|
+
* node, never a tool the loop invokes or a verifier judges. */
|
|
14
|
+
export const CONTINUE_STEP_ID = 'plan.continue';
|
|
11
15
|
export class OrchestrationError extends Error {
|
|
12
16
|
code;
|
|
13
17
|
constructor(code, message) {
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,EAAE;AACF,+FAA+F;AAC/F,2GAA2G;AAC3G,6GAA6G;AAC7G,6GAA6G;AAC7G,+GAA+G;AAE/G,MAAM,CAAC,MAAM,YAAY,GAAG,kCAA2C,CAAC;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,SAAkB,CAAC;AACjD,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,EAAE;AACF,+FAA+F;AAC/F,2GAA2G;AAC3G,6GAA6G;AAC7G,6GAA6G;AAC7G,+GAA+G;AAE/G,MAAM,CAAC,MAAM,YAAY,GAAG,kCAA2C,CAAC;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,SAAkB,CAAC;AACjD,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAyC,CAAC;AAyNlE,uEAAuE;AACvE;gEACgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAqFhD,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAEzB;IADlB,YACkB,IAA4B,EAC5C,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,SAAI,GAAJ,IAAI,CAAwB;QAI5C,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/orchestration",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.6",
|
|
4
4
|
"description": "The Ring-0 agentic orchestration core (ADR-0044): the intent→plan→execute→observe loop, the Planner + ToolInvoker ports, and a deterministic rule-based planner. A first-party app expresses a goal; the loop plans which tools compose to satisfy it and runs them through an injected invoker. Pure leaf — no transport, no LLM SDK, no chain; the concrete LLM binding lives behind the Planner port in orchestration-anthropic.",
|
|
5
|
+
"homepage": "https://agenticprimitives.dev",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
|
|
8
|
+
},
|
|
9
|
+
"author": {
|
|
10
|
+
"name": "Agentic Trust Labs",
|
|
11
|
+
"url": "https://agenticprimitives.dev"
|
|
12
|
+
},
|
|
5
13
|
"license": "MIT",
|
|
6
14
|
"repository": {
|
|
7
15
|
"type": "git",
|
|
8
16
|
"url": "git+https://github.com/agentictrustlabs/agenticprimitives.git",
|
|
9
17
|
"directory": "packages/orchestration"
|
|
10
18
|
},
|
|
11
|
-
"homepage": "https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/orchestration",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
|
|
14
|
-
},
|
|
15
19
|
"type": "module",
|
|
16
20
|
"main": "./dist/index.js",
|
|
17
21
|
"types": "./dist/index.d.ts",
|
|
@@ -39,10 +43,15 @@
|
|
|
39
43
|
"orchestration",
|
|
40
44
|
"planner",
|
|
41
45
|
"intent",
|
|
42
|
-
"agentic-loop"
|
|
46
|
+
"agentic-loop",
|
|
47
|
+
"agentic-primitives",
|
|
48
|
+
"agenticprimitives",
|
|
49
|
+
"ai-agents",
|
|
50
|
+
"agent-authority",
|
|
51
|
+
"agentic-trust"
|
|
43
52
|
],
|
|
44
53
|
"dependencies": {
|
|
45
|
-
"@agenticprimitives/tool-policy": "1.0.0-alpha.
|
|
54
|
+
"@agenticprimitives/tool-policy": "1.0.0-alpha.27"
|
|
46
55
|
},
|
|
47
56
|
"scripts": {
|
|
48
57
|
"build": "tsc -p tsconfig.build.json",
|