@cotal-ai/auth 0.86.0 → 0.88.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/service.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type ToolResultConsentRecorder, type ToolResultConsentSignerOptions } from "./tool-result-consent.js";
1
2
  import { type IncomingMessage, type ServerResponse } from "node:http";
2
3
  import { type EpAttributedReply, type EpGateState, type ParsedArgs, type PlatformControlAssignment, type PlatformControlAuthorityRequest, type PlatformControlAuthorityResult, type PlatformControlInnerRequest, type RemoteManagedAgentEnrollmentRequest, type RemoteManagedAgentEnrollmentResult, type RemoteManagedAgentPrepareRetirementRequest, type RemoteManagedAgentPrepareRetirementResult, type RemoteManagerAdminAuthorizationRequest, type RemoteManagerAuthorityRequest, type RemoteManagerMaintenanceRequest, type RemoteRetainedAgentValidationRequest, type SecretStore } from "@cotal-ai/core";
3
4
  import { type HostedContextInputs, type HostedServiceHandle, type ManagerInstanceIdentity } from "@cotal-ai/workspace";
@@ -25,8 +26,29 @@ export declare const MANAGED_RETIRE_PATH = "/managed-lifecycle/retire";
25
26
  * remote manager (#1972 §2.2). The platform owns the writers; this door owns the decision. It
26
27
  * derives the caller's scope from the local ledger and never accepts one from the caller. */
27
28
  export declare const VERIFY_ENROLLMENT_PATH = "/manager-service-authority/verify-enrollment";
29
+ /** Host-only, capability-gated proof decision. It neither signs consent nor serves results. */
30
+ export declare const TOOL_RESULT_HUMAN_PROOF_PATH = "/tool-result-human-proof/verify";
31
+ /** Host-only signed consent issuance, never private result content. */
32
+ export declare const TOOL_RESULT_CONSENT_PATH = "/tool-result-consent/issue";
28
33
  /** Which exchange arm asks for a manager-caller view. */
29
34
  export type ManagerCaller = "human" | "agent";
35
+ /** One Manager instance of an owner, as `/manager-instances` lists it. `state` is the verdict
36
+ * selection reads: `candidate` is an open gate of this owner whose current service registration and
37
+ * status match the gate's registration revision and process epoch. That is registration evidence,
38
+ * not proof the instance answers now; a describe pinned to the instance proves that. */
39
+ export interface ManagerInstanceRecord {
40
+ instanceId: string;
41
+ /** `remote` is an owner-registered Manager (`cotal supervise`); `local` is this host's own. */
42
+ placement: "remote" | "local";
43
+ state: "candidate" | "unknown" | "not open" | "not this owner's" | "not registered";
44
+ }
45
+ /** Every Manager gate of one owner at one scan. A failed scan is an error, never a partial list. */
46
+ export interface ManagerInstanceCatalog {
47
+ v: 1;
48
+ owner: string;
49
+ complete: true;
50
+ instances: ManagerInstanceRecord[];
51
+ }
30
52
  /** The service's AUTHORITY PLANE (R1, SPEC 13.1): the two self-minted data-account connections
31
53
  * behind (a) the composed connect authorizer — the file-ledger arm PLUS the credential deny-new
32
54
  * arm through the supervised, shape-proved reader — and (b) the exchange-time root-credential
@@ -36,6 +58,7 @@ export interface AuthAuthorityPlane {
36
58
  /** The callout's required native-key issuance recorder (SPEC 13.1 `natkey.`): create-only, then
37
59
  * the same connect authority re-read before the minted JWT may leave. */
38
60
  recordIssuance: NativeIssuanceRecorder;
61
+ recordToolResultConsent: ToolResultConsentRecorder;
39
62
  mintConnectCredential: (args: {
40
63
  owner: string;
41
64
  actor: string;
@@ -44,6 +67,8 @@ export interface AuthAuthorityPlane {
44
67
  /** `caller` picks the remedy an ambiguity refusal names: `--on` for the human (CLI) arm,
45
68
  * `cotal agent-bearer`'s `--manager-instance` for the agent arm, the wire field otherwise. */
46
69
  selectManagerInstance: (owner: string, requested?: string, caller?: ManagerCaller) => Promise<string>;
70
+ /** The owner's Manager instances with the verdict selection reads; selection is built on it. */
71
+ listManagerInstances: (owner: string) => Promise<ManagerInstanceCatalog>;
47
72
  authorizeManagerCaller: (owner: string, instanceId: string) => Promise<void>;
48
73
  /** The callout's issuance of an interactive user's `manager-caller` view (SPEC 13.15): one
49
74
  * issuer window that stages and releases evidence bound to the actor-ledger row and writes the
@@ -363,12 +388,15 @@ export declare function startAuthService(inputs: HostedContextInputs & {
363
388
  /** Trusted-host only. Forwarded unchanged to {@link openAuthAuthorityPlane}, which bounds it to
364
389
  * 5..86400 seconds. Absent: the 24h default. No CLI flag and no request field sets it. */
365
390
  standingRenewableTtlSeconds?: number;
391
+ /** Opt-in trusted-host consent signer, with seed material already in the private store. */
392
+ toolResultConsents?: ToolResultConsentSignerOptions;
366
393
  }): Promise<AuthServiceHandle>;
367
394
  /** The HTTP routes authenticate a human, so they only ever supply the human arm. */
368
395
  type HumanHolder = Extract<ManagerAuthorityHolder, {
369
396
  scope: string[];
370
397
  }>;
371
398
  interface HandlerCtx {
399
+ issueToolResultConsent?: (raw: unknown) => Promise<import("@cotal-ai/core").ToolResultConsent>;
372
400
  issuer: UserTokenIssuer;
373
401
  bridge: IdpBridge;
374
402
  bridgeIdp: {
@@ -425,6 +453,7 @@ interface HandlerCtx {
425
453
  lifecycleUid: string;
426
454
  }) => Promise<string>;
427
455
  selectManagerInstance: AuthAuthorityPlane["selectManagerInstance"];
456
+ listManagerInstances: AuthAuthorityPlane["listManagerInstances"];
428
457
  verifySession: AuthAuthorityPlane["verifySession"];
429
458
  }
430
459
  type ManagerAuthorityDispatchCtx = Pick<HandlerCtx, "space" | "dir" | "secrets" | "managerServiceAuthority" | "maintainRemoteManager" | "validateRetainedAgent" | "enrollManagedAgent" | "prepareManagedAgentRetirement" | "scanManagerGoalIndex" | "authorizeManagerAdmin" | "admitManagerRun" | "issueManagerRunAttempt" | "revokeManagerRun">;
@@ -461,6 +490,13 @@ export type ManagerServiceAuthorityCtx = ManagerAuthorityDispatchCtx & Pick<Hand
461
490
  * loopback capability is demanded; on the public face the verified IdP JWT is the proof, and the
462
491
  * dispatcher reads the caller's scope from the ledger either way. */
463
492
  export declare function handleManagerServiceAuthority(req: IncomingMessage, res: ServerResponse, ctx: ManagerServiceAuthorityCtx, policy: ExchangePolicy): Promise<void>;
493
+ /** Minimal host-held inputs for the proof decision; no signing or storage authority is used. */
494
+ export type ToolResultHumanProofCtx = Pick<HandlerCtx, "cap" | "bridgeIdp" | "ownerSecret" | "badCaps">;
495
+ /** Decide one signed password proof against the host's authenticated session subject.
496
+ * The subject is an equality constraint, never the source of the derived owner. */
497
+ export declare function handleToolResultHumanProof(req: IncomingMessage, res: ServerResponse, ctx: ToolResultHumanProofCtx): Promise<void>;
498
+ /** Consent issuance is confined to the authenticated host face and uses sanitized refusals. */
499
+ export declare function handleToolResultConsent(req: IncomingMessage, res: ServerResponse, ctx: Pick<HandlerCtx, "cap" | "badCaps" | "issueToolResultConsent">): Promise<void>;
464
500
  /** The advertised broker address the public bundle carries — the URL participants will dial, so
465
501
  * the same scheme family `cotal meshes add` accepts. Exported for the producer/consumer contract
466
502
  * smoke; returns the refusal sentence, or undefined when the address is usable. */
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAyDA,OAAO,EAAgB,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAKpF,OAAO,EAAw/C,KAAK,iBAAiB,EAAiB,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,yBAAyB,EAAE,KAAK,+BAA+B,EAAE,KAAK,8BAA8B,EAAE,KAAK,2BAA2B,EAAE,KAAK,mCAAmC,EAAE,KAAK,kCAAkC,EAAE,KAAK,0CAA0C,EAAE,KAAK,yCAAyC,EAAE,KAAK,sCAAsC,EAAE,KAAK,6BAA6B,EAAE,KAAK,+BAA+B,EAAE,KAAK,oCAAoC,EAAE,KAAK,WAAW,EAAsF,MAAM,gBAAgB,CAAC;AACzqE,OAAO,EAA4I,KAAK,mBAAmB,EAAyB,KAAK,mBAAmB,EAA2B,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAIjT,OAAO,EAA6F,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/J,OAAO,EAAoB,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC5G,OAAO,EAAuH,KAAK,uBAAuB,EAAE,KAAK,kCAAkC,EAA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QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB;;gGAE4F;IAC5F,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmB1B;AAED;;;mDAGmD;AACnD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAInG;AAED;;;cAGc;AACd,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUzE"}
package/dist/service.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { registryStores } from "./lifecycle-registry.js";
2
+ import { createToolResultConsentSigner, makeToolResultConsentRecorder } from "./tool-result-consent.js";
1
3
  /**
2
4
  * The AUTH SERVICE daemon — the one server-side process a user-auth space runs alongside its broker
3
5
  * (the delivery-daemon pattern: spawned detached by `cotal up`, pid-filed per space, torn down by
@@ -68,7 +70,7 @@ import { makePlatformControlAuthority, makePlatformControlReadiness, requireMana
68
70
  import { OwnedConnections } from "./owned-connections.js";
69
71
  import { makePlatformSupervisorAuthority, makePlatformSupervisorEnd, platformSupervisorEnded, requirePlatformSupervisorAdmin } from "./platform-supervisor.js";
70
72
  import { startAuthCallout } from "./callout.js";
71
- import { createIdpBridge, verifyIdpToken } from "./idp.js";
73
+ import { createIdpBridge, verifyIdpToken, verifyToolResultHumanProof } from "./idp.js";
72
74
  import { PUBLIC_EXCHANGE_VIEWS, assertTransferWriterClaim } from "./token.js";
73
75
  import { grantCoordinates, verifySessionRedemption } from "./session-redemption.js";
74
76
  import { pinnedJwksResolver } from "./issuer.js";
@@ -112,6 +114,10 @@ export const MANAGED_RETIRE_PATH = "/managed-lifecycle/retire";
112
114
  * remote manager (#1972 §2.2). The platform owns the writers; this door owns the decision. It
113
115
  * derives the caller's scope from the local ledger and never accepts one from the caller. */
114
116
  export const VERIFY_ENROLLMENT_PATH = "/manager-service-authority/verify-enrollment";
117
+ /** Host-only, capability-gated proof decision. It neither signs consent nor serves results. */
118
+ export const TOOL_RESULT_HUMAN_PROOF_PATH = "/tool-result-human-proof/verify";
119
+ /** Host-only signed consent issuance, never private result content. */
120
+ export const TOOL_RESULT_CONSENT_PATH = "/tool-result-consent/issue";
115
121
  /** Failed-exchange rate limit: at most this many REFUSED exchanges per rolling minute; further
116
122
  * attempts get 429 until the window drains. Successes are unthrottled (the CLI's normal path). */
117
123
  const FAILED_EXCHANGE_PER_MIN = 30;
@@ -422,6 +428,7 @@ async function buildAuthAuthorityPlane(opts, unwind, onConnection) {
422
428
  // the FRESH space-manager-lease holder check) and dispatches.
423
429
  const authAdmin = await openAuthAdminListener({ onConnection, server, space, dataAccount, reg: barrierReg, retirement, barrierFlight: retirementFlights, instanceId: authServeInstanceId, epoch: authServeGrant.epoch, grant: authServeGrant, log });
424
430
  unwind.push(() => authAdmin.close());
431
+ const recordToolResultConsent = makeToolResultConsentRecorder(registryStores(registry).authKv, () => refuseIfFenced(), space);
425
432
  const fileArm = ledgerAuthorizeConnect(opts.dir);
426
433
  // The callout's issuance evidence: create-only natkey row, then the connect authority re-read
427
434
  // in the same stream before the minted JWT may leave.
@@ -519,18 +526,9 @@ async function buildAuthAuthorityPlane(opts, unwind, onConnection) {
519
526
  return "not registered";
520
527
  return "candidate";
521
528
  };
522
- const selectManagerInstance = async (owner, requested, caller) => {
529
+ const listManagerInstances = async (owner) => {
523
530
  refuseIfFenced();
524
- if (requested !== undefined) {
525
- const instanceId = assertLifecycleToken(requested, "managerInstanceId");
526
- const verdict = await managerGate(owner, instanceId);
527
- if (verdict !== "candidate")
528
- throw new Error(`manager instance ${instanceId} is ${verdict}`);
529
- return instanceId;
530
- }
531
- const remoteInstances = [];
532
- const remoteLive = [];
533
- let localCandidate;
531
+ const instances = [];
534
532
  const localManager = loadLocalManager();
535
533
  for (const raw of await scanner.scanManagerGates()) {
536
534
  if (raw.op !== undefined)
@@ -542,16 +540,26 @@ async function buildAuthAuthorityPlane(opts, unwind, onConnection) {
542
540
  const row = parseEndpointGate(raw.data, raw.key);
543
541
  if (row.authorityFamily === "environment-manager")
544
542
  continue;
545
- if (row.principal === `${owner}.${remoteManagerActors(instanceId).serve}`) {
546
- remoteInstances.push(instanceId);
547
- if (await managerGate(owner, instanceId) === "candidate")
548
- remoteLive.push(instanceId);
549
- }
550
- else if (localManager?.instanceId === instanceId && row.principal === `local.${localManager.serveIdentity.id}`) {
551
- if (await managerGate(owner, instanceId) === "candidate")
552
- localCandidate = instanceId;
553
- }
543
+ if (row.principal === `${owner}.${remoteManagerActors(instanceId).serve}`)
544
+ instances.push({ instanceId, placement: "remote", state: await managerGate(owner, instanceId) });
545
+ else if (localManager?.instanceId === instanceId && row.principal === `local.${localManager.serveIdentity.id}`)
546
+ instances.push({ instanceId, placement: "local", state: await managerGate(owner, instanceId) });
547
+ }
548
+ return { v: 1, owner, complete: true, instances };
549
+ };
550
+ const selectManagerInstance = async (owner, requested, caller) => {
551
+ refuseIfFenced();
552
+ if (requested !== undefined) {
553
+ const instanceId = assertLifecycleToken(requested, "managerInstanceId");
554
+ const verdict = await managerGate(owner, instanceId);
555
+ if (verdict !== "candidate")
556
+ throw new Error(`manager instance ${instanceId} is ${verdict}`);
557
+ return instanceId;
554
558
  }
559
+ const { instances } = await listManagerInstances(owner);
560
+ const remoteInstances = instances.filter((i) => i.placement === "remote").map((i) => i.instanceId);
561
+ const remoteLive = instances.filter((i) => i.placement === "remote" && i.state === "candidate").map((i) => i.instanceId);
562
+ const localCandidate = instances.findLast((i) => i.placement === "local" && i.state === "candidate")?.instanceId;
555
563
  remoteLive.sort();
556
564
  if (remoteLive.length === 1)
557
565
  return remoteLive[0];
@@ -623,11 +631,13 @@ async function buildAuthAuthorityPlane(opts, unwind, onConnection) {
623
631
  refuseIfFenced();
624
632
  return recordIssuance(i);
625
633
  },
634
+ recordToolResultConsent,
626
635
  mintConnectCredential: (args) => {
627
636
  refuseIfFenced();
628
637
  return ensureRootCredential(registry, { ...args, managerInstance: `auth-service:${space}` });
629
638
  },
630
639
  selectManagerInstance,
640
+ listManagerInstances,
631
641
  authorizeManagerCaller: async (owner, instanceId) => {
632
642
  refuseIfFenced();
633
643
  const verdict = await managerGate(owner, assertLifecycleToken(instanceId, "managerInstanceId"));
@@ -1727,6 +1737,10 @@ export async function startAuthService(inputs) {
1727
1737
  const port = inputs.port ?? 0;
1728
1738
  if (!Number.isInteger(port) || port < 0 || port > 65535)
1729
1739
  throw new Error(`auth-service: port must be a port number, got ${port}`);
1740
+ if (inputs.toolResultConsents !== undefined &&
1741
+ (!inputs.toolResultConsents || typeof inputs.toolResultConsents.keyId !== "string" ||
1742
+ !/^[A-Za-z0-9_-]{1,200}$/.test(inputs.toolResultConsents.keyId) || typeof inputs.toolResultConsents.resolveAnchor !== "function"))
1743
+ throw new Error("auth-service: tool-result consent signer requires a key id and fresh anchor resolver");
1730
1744
  if (inputs.platformControl !== undefined && typeof inputs.platformControl?.observeAssignment !== "function")
1731
1745
  throw new Error("auth-service: platformControl requires an observeAssignment function");
1732
1746
  const host = inputs.platformControl?.host;
@@ -1752,6 +1766,7 @@ export async function startAuthService(inputs) {
1752
1766
  ...(inputs.platformControl !== undefined ? { platformControl: inputs.platformControl } : {}),
1753
1767
  ...(inputs.platformSupervisor !== undefined ? { platformSupervisor: inputs.platformSupervisor } : {}),
1754
1768
  ...(inputs.standingRenewableTtlSeconds !== undefined ? { standingRenewableTtlSeconds: inputs.standingRenewableTtlSeconds } : {}),
1769
+ ...(inputs.toolResultConsents !== undefined ? { toolResultConsents: inputs.toolResultConsents } : {}),
1755
1770
  });
1756
1771
  return { ...started.handle, readiness: () => ({ ...started.status(), context: inputs.context }) };
1757
1772
  }
@@ -1846,7 +1861,12 @@ async function startAuthContext(o) {
1846
1861
  let publicUrl;
1847
1862
  const failures = []; // rolling-window timestamps of REFUSED exchanges
1848
1863
  const badCaps = []; // rolling-window timestamps of invalid-capability attempts
1864
+ const issueToolResultConsent = o.toolResultConsents === undefined ? undefined : createToolResultConsentSigner({
1865
+ space, accountPublicKey: keys.dataAccount.pub, dir, store: secrets, idp: bridgeIdp, ownerSecret,
1866
+ signer: o.toolResultConsents, record: plane.recordToolResultConsent,
1867
+ });
1849
1868
  const ctx = {
1869
+ ...(issueToolResultConsent ? { issueToolResultConsent } : {}),
1850
1870
  issuer,
1851
1871
  bridge,
1852
1872
  bridgeIdp,
@@ -1878,6 +1898,7 @@ async function startAuthContext(o) {
1878
1898
  dir,
1879
1899
  mintConnectCredential: plane.mintConnectCredential,
1880
1900
  selectManagerInstance: plane.selectManagerInstance,
1901
+ listManagerInstances: plane.listManagerInstances,
1881
1902
  verifySession: plane.verifySession,
1882
1903
  };
1883
1904
  const loopback = createServer((req, res) => void handle(req, res, ctx));
@@ -2279,16 +2300,19 @@ const ROUTES = new Map([
2279
2300
  ],
2280
2301
  ["/exchange", (req, res, ctx) => handleExchange(req, res, ctx, LOOPBACK_POLICY)],
2281
2302
  ["/manager-service-authority", (req, res, ctx) => handleManagerServiceAuthority(req, res, ctx, LOOPBACK_POLICY)],
2303
+ ["/manager-instances", (req, res, ctx) => handleManagerInstances(req, res, ctx, LOOPBACK_POLICY)],
2282
2304
  [INTERACTIVE_RETIRE_PATH, handleInteractiveLifecycleRetirement],
2283
2305
  [MANAGED_RETIRE_PATH, handleManagedLifecycleRetirement],
2284
2306
  [VERIFY_ENROLLMENT_PATH, handleVerifyManagedAgentEnrollment],
2307
+ [TOOL_RESULT_HUMAN_PROOF_PATH, handleToolResultHumanProof],
2308
+ [TOOL_RESULT_CONSENT_PATH, handleToolResultConsent],
2285
2309
  ]);
2286
2310
  /** Route one HTTP request against the loopback route table. Errors are JSON `{ error }`. */
2287
2311
  async function handle(req, res, ctx) {
2288
2312
  try {
2289
2313
  const route = ROUTES.get(req.url ?? "");
2290
2314
  if (!route)
2291
- return send(res, 404, { error: "unknown path - /health, /jwks, /exchange, /manager-service-authority, /manager-service-authority/verify-enrollment, /interactive-lifecycle/retire, /managed-lifecycle/retire" });
2315
+ return send(res, 404, { error: "unknown path - /health, /jwks, /exchange, /manager-service-authority, /manager-instances, /manager-service-authority/verify-enrollment, /interactive-lifecycle/retire, /managed-lifecycle/retire" });
2292
2316
  await route(req, res, ctx);
2293
2317
  }
2294
2318
  catch (e) {
@@ -2613,6 +2637,45 @@ async function handleExchange(req, res, ctx, policy) {
2613
2637
  return send(res, 401, { error: reason });
2614
2638
  }
2615
2639
  }
2640
+ /** The signed-in person's own Manager instances, read-only, on both faces. The proof is the IdP JWT
2641
+ * the human exchange verifies, and the owner is derived from it the same way, so a caller lists only
2642
+ * its own owner's gates. A browser-origin request is refused as on every exchange route; an
2643
+ * embedding's server-side bridge forwards the person's proof. Issuance still re-checks the chosen
2644
+ * instance. */
2645
+ async function handleManagerInstances(req, res, ctx, policy) {
2646
+ if (req.method !== "POST")
2647
+ return send(res, 405, { error: "POST only" });
2648
+ if (req.headers.origin !== undefined)
2649
+ return send(res, 403, { error: "browser-origin requests are not served here" });
2650
+ if (!/^application\/json\b/.test(req.headers["content-type"] ?? ""))
2651
+ return send(res, 415, { error: "content-type must be application/json" });
2652
+ if (policy.requireCapability && req.headers.authorization !== `Bearer ${ctx.cap}`)
2653
+ return refuseCapability(res, ctx, "missing/invalid exchange capability - read it from the space's auth-service.json");
2654
+ const peer = policy.peerKey(req);
2655
+ const peerThrottled = policy.throttled(ctx, peer);
2656
+ const body = await readJsonBody(req);
2657
+ if (typeof body?.idpToken !== "string" || !body.idpToken)
2658
+ return send(res, 400, { error: "the manager instance list needs { idpToken: string }" });
2659
+ let owner;
2660
+ try {
2661
+ owner = deriveOwnerForIdpSubject(ctx.ownerSecret, ctx.bridgeIdp.issuer, (await verifyIdpToken(body.idpToken, ctx.bridgeIdp)).sub);
2662
+ }
2663
+ catch (e) {
2664
+ policy.recordFailure(ctx, peer);
2665
+ const reason = e instanceof Error ? e.message : String(e);
2666
+ console.error(`auth-service: refused a manager instance list: ${reason}`);
2667
+ if (peerThrottled)
2668
+ return send(res, 429, { error: "too many refused exchanges - wait a minute and retry" });
2669
+ return send(res, 401, { error: reason });
2670
+ }
2671
+ try {
2672
+ return send(res, 200, await ctx.listManagerInstances(owner));
2673
+ }
2674
+ catch (e) {
2675
+ // The proof was good and the gate read was not: unavailable, never an empty list.
2676
+ return send(res, 503, { error: `the manager instance list is unavailable: ${e instanceof Error ? e.message : String(e)}` });
2677
+ }
2678
+ }
2616
2679
  /** The typed manager authority exchange, served on both faces. The face's policy decides whether the
2617
2680
  * loopback capability is demanded; on the public face the verified IdP JWT is the proof, and the
2618
2681
  * dispatcher reads the caller's scope from the ledger either way. */
@@ -2654,6 +2717,68 @@ export async function handleManagerServiceAuthority(req, res, ctx, policy) {
2654
2717
  return send(res, 403, { error: reason });
2655
2718
  }
2656
2719
  }
2720
+ /** Decide one signed password proof against the host's authenticated session subject.
2721
+ * The subject is an equality constraint, never the source of the derived owner. */
2722
+ export async function handleToolResultHumanProof(req, res, ctx) {
2723
+ if (req.method !== "POST")
2724
+ return send(res, 405, { error: "POST only" });
2725
+ if (req.headers.origin !== undefined)
2726
+ return send(res, 403, { error: "browser-origin requests are not served here" });
2727
+ if (!/^application\/json\b/.test(req.headers["content-type"] ?? ""))
2728
+ return send(res, 415, { error: "content-type must be application/json" });
2729
+ if (req.headers.authorization !== `Bearer ${ctx.cap}`)
2730
+ return refuseCapability(res, ctx, "missing/invalid exchange capability - human proof verification is a loopback host action");
2731
+ let body;
2732
+ try {
2733
+ body = await readJsonBody(req);
2734
+ }
2735
+ catch (error) {
2736
+ return send(res, error instanceof RequestBodyError ? error.status : 400, { error: "invalid human proof request" });
2737
+ }
2738
+ if (!body || typeof body !== "object" || Array.isArray(body) ||
2739
+ Object.keys(body).some(key => key !== "idpToken" && key !== "subject") ||
2740
+ !("idpToken" in body) || typeof body.idpToken !== "string" || !body.idpToken ||
2741
+ !("subject" in body) || typeof body.subject !== "string" || !body.subject)
2742
+ return send(res, 400, { error: "human proof verification needs only { idpToken, subject }" });
2743
+ try {
2744
+ const proof = await verifyToolResultHumanProof(body.idpToken, ctx.bridgeIdp);
2745
+ if (proof.sub !== body.subject)
2746
+ return send(res, 403, { error: "human proof subject does not match the session" });
2747
+ const owner = deriveOwnerForIdpSubject(ctx.ownerSecret, ctx.bridgeIdp.issuer, proof.sub);
2748
+ return send(res, 200, { authorized: true, owner, ...proof });
2749
+ }
2750
+ catch {
2751
+ return send(res, 403, { error: "fresh signed password proof required" });
2752
+ }
2753
+ }
2754
+ /** Consent issuance is confined to the authenticated host face and uses sanitized refusals. */
2755
+ export async function handleToolResultConsent(req, res, ctx) {
2756
+ if (req.method !== "POST")
2757
+ return send(res, 405, { error: "POST only" });
2758
+ if (req.headers.origin !== undefined)
2759
+ return send(res, 403, { error: "browser-origin requests are not served here" });
2760
+ if (!/^application\/json\b/.test(req.headers["content-type"] ?? ""))
2761
+ return send(res, 415, { error: "content-type must be application/json" });
2762
+ if (req.headers.authorization !== `Bearer ${ctx.cap}`)
2763
+ return refuseCapability(res, ctx, "missing/invalid exchange capability - consent issuance is a loopback host action");
2764
+ if (!ctx.issueToolResultConsent)
2765
+ return send(res, 503, { error: "tool-result-consent-unavailable", outcome: "not-executed" });
2766
+ let body;
2767
+ try {
2768
+ body = await readJsonBody(req);
2769
+ }
2770
+ catch {
2771
+ return send(res, 400, { error: "invalid consent request", outcome: "not-executed" });
2772
+ }
2773
+ try {
2774
+ return send(res, 200, { consent: await ctx.issueToolResultConsent(body) }, { "cache-control": "no-store" });
2775
+ }
2776
+ catch (error) {
2777
+ const code = error instanceof EpEnvelopeError ? error.code : "unavailable";
2778
+ const status = code === "bad-request" ? 400 : code === "permission-denied" ? 403 : code === "conflict" ? 409 : 503;
2779
+ return send(res, status, { error: `tool-result-consent-${code}`, outcome: error instanceof EpEnvelopeError ? error.outcome ?? "unknown" : "unknown" });
2780
+ }
2781
+ }
2657
2782
  /** The advertised broker address the public bundle carries — the URL participants will dial, so
2658
2783
  * the same scheme family `cotal meshes add` accepts. Exported for the producer/consumer contract
2659
2784
  * smoke; returns the refusal sentence, or undefined when the address is usable. */
@@ -2756,6 +2881,7 @@ function makePublicHandler(ctx, policy, bundle) {
2756
2881
  ],
2757
2882
  ["/exchange", (req, res, c) => handleExchange(req, res, c, policy)],
2758
2883
  ["/manager-service-authority", (req, res, c) => handleManagerServiceAuthority(req, res, c, policy)],
2884
+ ["/manager-instances", (req, res, c) => handleManagerInstances(req, res, c, policy)],
2759
2885
  [
2760
2886
  "/.well-known/cotal-mesh",
2761
2887
  (req, res) => {
@@ -2788,7 +2914,7 @@ function makePublicHandler(ctx, policy, bundle) {
2788
2914
  try {
2789
2915
  const route = routes.get(req.url ?? "");
2790
2916
  if (!route)
2791
- return send(res, 404, { error: "unknown path - /health, /jwks, /exchange, /manager-service-authority, /.well-known/cotal-mesh" });
2917
+ return send(res, 404, { error: "unknown path - /health, /jwks, /exchange, /manager-service-authority, /manager-instances, /.well-known/cotal-mesh" });
2792
2918
  await route(req, res, ctx);
2793
2919
  }
2794
2920
  catch (e) {