@cotal-ai/auth 0.61.0 → 0.63.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/authority-client.d.ts +13 -1
- package/dist/authority-client.d.ts.map +1 -1
- package/dist/authority-client.js +26 -2
- package/dist/authority-client.js.map +1 -1
- package/dist/delegated-user-intent.d.ts +125 -0
- package/dist/delegated-user-intent.d.ts.map +1 -0
- package/dist/delegated-user-intent.js +195 -0
- package/dist/delegated-user-intent.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/ledger.d.ts +15 -0
- package/dist/ledger.d.ts.map +1 -1
- package/dist/ledger.js +15 -2
- package/dist/ledger.js.map +1 -1
- package/dist/manager-authority.d.ts +34 -1
- package/dist/manager-authority.d.ts.map +1 -1
- package/dist/manager-authority.js +122 -13
- package/dist/manager-authority.js.map +1 -1
- package/dist/manager-contract.d.ts +4 -1
- package/dist/manager-contract.d.ts.map +1 -1
- package/dist/manager-contract.js +11 -4
- package/dist/manager-contract.js.map +1 -1
- package/dist/permissions.d.ts +15 -0
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +5 -2
- package/dist/permissions.js.map +1 -1
- package/dist/platform-control.d.ts +8 -1
- package/dist/platform-control.d.ts.map +1 -1
- package/dist/platform-control.js +33 -15
- package/dist/platform-control.js.map +1 -1
- package/dist/service.d.ts +27 -2
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +174 -25
- package/dist/service.js.map +1 -1
- package/package.json +3 -3
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* service restart; there is no file-only fallback.
|
|
26
26
|
*/
|
|
27
27
|
import { type NatsConnection } from "@nats-io/transport-node";
|
|
28
|
-
import { remoteManagerRegistrationProof, type PlaneConnTuple } from "@cotal-ai/core";
|
|
28
|
+
import { remoteManagerRegistrationProof, type EpCaller, type PlaneConnTuple } from "@cotal-ai/core";
|
|
29
29
|
import { type ConnectReader } from "./connect-reader.js";
|
|
30
30
|
/** Self-minted infra-credential TTL (fact-3 pin: SHORT expiry + in-process renewal, a bounded
|
|
31
31
|
* in-memory credential that closes with the service — never an unbounded persisted one). */
|
|
@@ -61,6 +61,18 @@ export declare function remoteManagerIssuerGrants(space: string, connId: string)
|
|
|
61
61
|
publish: string[];
|
|
62
62
|
subscribe: string[];
|
|
63
63
|
};
|
|
64
|
+
/** The PLATFORM READINESS reader (SPEC 13.9): `describe` and `status` of one manager instance on
|
|
65
|
+
* its `inst` rail only, the contract-store read `resolveService` verifies the describe answer with,
|
|
66
|
+
* and its own reply rail and inbox. No other command, instance, class route or store. */
|
|
67
|
+
export declare function platformReadinessGrants(space: string, connId: string, caller: EpCaller, instanceId: string): {
|
|
68
|
+
publish: string[];
|
|
69
|
+
subscribe: string[];
|
|
70
|
+
};
|
|
71
|
+
/** The manager request subjects whose served form a participant manager forwards for a resume or
|
|
72
|
+
* an answer (SPEC 14.8), on both routes a caller addresses a manager by. The issuing host reads
|
|
73
|
+
* them and never replies: the broker let only the caller's ceiling publish each one, so observing
|
|
74
|
+
* it is the host's own evidence that the caller asked. */
|
|
75
|
+
export declare function servedRunRequestSubjects(space: string): string[];
|
|
64
76
|
export { remoteManagerRegistrationProof };
|
|
65
77
|
/**
|
|
66
78
|
* The AUTH PLANE's OWN registration executor grant (#399 M2): the ONE `(auth, instanceId)`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authority-client.d.ts","sourceRoot":"","sources":["../src/authority-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAA6B,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGzF,OAAO,EAAyQ,8BAA8B,
|
|
1
|
+
{"version":3,"file":"authority-client.d.ts","sourceRoot":"","sources":["../src/authority-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;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CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,cAAc,CAAC;IACnB,wFAAwF;IACxF,MAAM,EAAE,MAAM,CAAC;IACf;oFACgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;4EACwE;IACxE,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB;;sDAEkD;IAClD,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,eAAe,CAAC,CAuE7F;AAED,MAAM,WAAW,uBAAuB;IACtC;;8CAE0C;IAC1C,OAAO,IAAI,aAAa,CAAC;IACzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,OAAO,CAAC,GAClD,OAAO,CAAC,uBAAuB,CAAC,CAqDlC"}
|
package/dist/authority-client.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
import { connect, jwtAuthenticator } from "@nats-io/transport-node";
|
|
28
28
|
import { encodeUser } from "@nats-io/jwt";
|
|
29
29
|
import { fromPublic, fromSeed } from "@nats-io/nkeys";
|
|
30
|
-
import { EpEnvelopeError, admissionBucket, sessionsBucket, assertInboxConnId, endpointToken, epAuthBucket, epcStreamName, epfStreamName, newIdentity, recordsBucket, retirementFrontierStreams, spacePrefix, assertPoolToken, principalTags, principalKey, remoteManagerActors, remoteManagerRegistrationProof, AUTH_ENDPOINT, assertLifecycleToken, epcredFamilyPrefix, epgateKey, eprepairKey, GOVERN_HEAD, RECORD_KINDS, recordAtomicKey, recordSpecKey, recordStatusKey } from "@cotal-ai/core";
|
|
30
|
+
import { EpEnvelopeError, admissionBucket, sessionsBucket, assertInboxConnId, endpointToken, epAuthBucket, epcStreamName, epfStreamName, newIdentity, recordsBucket, retirementFrontierStreams, spacePrefix, assertPoolToken, principalTags, principalKey, remoteManagerActors, remoteManagerRegistrationProof, AUTH_ENDPOINT, assertLifecycleToken, epcredFamilyPrefix, epgateKey, eprepairKey, GOVERN_HEAD, RECORD_KINDS, recordAtomicKey, recordSpecKey, recordStatusKey, BASELINE_LIFECYCLE_ENDPOINT, epCallerGrantRows, instanceOnlyManagerCapabilities } from "@cotal-ai/core";
|
|
31
31
|
import { authConnectReaderGrants, openConnectReader } from "./connect-reader.js";
|
|
32
32
|
/** Self-minted infra-credential TTL (fact-3 pin: SHORT expiry + in-process renewal, a bounded
|
|
33
33
|
* in-memory credential that closes with the service — never an unbounded persisted one). */
|
|
@@ -110,9 +110,33 @@ export function remoteManagerIssuerGrants(space, connId) {
|
|
|
110
110
|
`$JS.API.STREAM.INFO.KV_${sessionsBucket(space)}`,
|
|
111
111
|
`$JS.API.STREAM.MSG.GET.KV_${sessionsBucket(space)}`,
|
|
112
112
|
],
|
|
113
|
-
subscribe: base.subscribe,
|
|
113
|
+
subscribe: [...base.subscribe, ...servedRunRequestSubjects(space)],
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
+
/** The PLATFORM READINESS reader (SPEC 13.9): `describe` and `status` of one manager instance on
|
|
117
|
+
* its `inst` rail only, the contract-store read `resolveService` verifies the describe answer with,
|
|
118
|
+
* and its own reply rail and inbox. No other command, instance, class route or store. */
|
|
119
|
+
export function platformReadinessGrants(space, connId, caller, instanceId) {
|
|
120
|
+
const rows = epCallerGrantRows(space, instanceOnlyManagerCapabilities(["describe", "status"].map((command) => ({ endpoint: BASELINE_LIFECYCLE_ENDPOINT, command })), instanceId), caller);
|
|
121
|
+
return {
|
|
122
|
+
publish: [`$JS.API.DIRECT.GET.${epcStreamName(space)}.${spacePrefix(space)}.epc.>`, ...rows.pub],
|
|
123
|
+
subscribe: [`_INBOX_${assertInboxConnId(connId)}.>`, ...rows.sub],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/** The manager request subjects whose served form a participant manager forwards for a resume or
|
|
127
|
+
* an answer (SPEC 14.8), on both routes a caller addresses a manager by. The issuing host reads
|
|
128
|
+
* them and never replies: the broker let only the caller's ceiling publish each one, so observing
|
|
129
|
+
* it is the host's own evidence that the caller asked. */
|
|
130
|
+
export function servedRunRequestSubjects(space) {
|
|
131
|
+
const p = spacePrefix(space);
|
|
132
|
+
const m = endpointToken("manager");
|
|
133
|
+
return [
|
|
134
|
+
...["run-resume", "run-answer"].flatMap((c) => [`${p}.ep.v1.inst.${m}.*.${c}.>`, `${p}.ep.v1.one.${m}.${c}.>`]),
|
|
135
|
+
// A managed seat answers on the legacy rail, the relay path; nothing else served there is forwarded.
|
|
136
|
+
`${p}.ep.inst.${m}.*.run-answer.>`,
|
|
137
|
+
`${p}.ep.one.${m}.run-answer.>`,
|
|
138
|
+
];
|
|
139
|
+
}
|
|
116
140
|
export { remoteManagerRegistrationProof };
|
|
117
141
|
/**
|
|
118
142
|
* The AUTH PLANE's OWN registration executor grant (#399 M2): the ONE `(auth, instanceId)`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authority-client.js","sourceRoot":"","sources":["../src/authority-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAuB,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,yBAAyB,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,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,uDAAuD,CAAC,CAAC;YACxG,CAAC;iBAAM,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;gBAClC,IAAI,CAAC;oBACH,MAAM,GAAG,MAAM,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;oBACnD,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,kDAAkD,CAAC,CAAC;gBACvE,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,MAAM,GAAG,SAAS,CAAC;oBACnB,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,gCAAiC,CAAW,EAAE,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC;gBACjH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IACL,OAAO;QACL,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,MAAM,KAAK,SAAS;gBACtB,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,+KAA+K,CAAC,CAAC;YAC5N,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,KAAK,EAAE,KAAK,IAAI,EAAE;YAChB,MAAM,GAAG,IAAI,CAAC;YACd,MAAM,GAAG,SAAS,CAAC,CAAC,oEAAoE;YACxF,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host policy for a delegated user intent (SPEC 13.16): a signed-in user admits one launch or one
|
|
3
|
+
* retirement, and the platform control holder executes it while the intent and the agent stay the
|
|
4
|
+
* user's.
|
|
5
|
+
*
|
|
6
|
+
* Both decisions write nothing and mint nothing. The host that owns the intent store persists the
|
|
7
|
+
* admission record, consumes it with one revision-pinned CAS, and runs the enrollment and retirement
|
|
8
|
+
* writers it already runs for a user's own remote manager, with the decision's owner and parent.
|
|
9
|
+
* The holder's registration proves only which instance and epoch present the intent: no decision
|
|
10
|
+
* reads, requires or returns `supervise`.
|
|
11
|
+
*/
|
|
12
|
+
import { type DelegatedUserIntentAdmission, type DelegatedUserIntentRequest, type DelegatedUserLaunchTarget, type RemoteDelegatedUserIntentExecutionRequest, type RemoteDelegatedUserIntentExecutionResult, type RemoteManagedAgentPrepareRetirementRequest } from "@cotal-ai/core";
|
|
13
|
+
import type { ObserveManagerGate } from "./managed-agent-enrollment.js";
|
|
14
|
+
import type { PlatformControlDeps } from "./platform-control.js";
|
|
15
|
+
/** The host's record of one admitted intent. The host is its only writer: create-only at admission,
|
|
16
|
+
* then one revision-pinned CAS from `admitted` to `consumed` that writes `execution` before any
|
|
17
|
+
* effect, then revision-pinned CASes only: a sweeper's claim, the one write that sets `outcome`,
|
|
18
|
+
* and the executor's `released`. */
|
|
19
|
+
export interface DelegatedUserIntentRecord extends Omit<DelegatedUserIntentAdmission, "v" | "kind" | "requestId"> {
|
|
20
|
+
v: 1;
|
|
21
|
+
/** `<owner>.<actor>`: the launched agent's ledger parent, and the principal the envelope walk starts from. */
|
|
22
|
+
parent: string;
|
|
23
|
+
state: "admitted" | "consumed";
|
|
24
|
+
/** Written by the consuming CAS and never changed after. Absent while `admitted`. */
|
|
25
|
+
execution?: DelegatedUserIntentExecutionPin;
|
|
26
|
+
/** The host incarnation that claimed the execution for its executor because it believes that
|
|
27
|
+
* executor gone. Absent until a sweeper claims; a later sweeper may replace it. */
|
|
28
|
+
sweptBy?: DelegatedUserIntentIncarnation;
|
|
29
|
+
/** Set once, when the pinned execution ends. Absent while it runs or while the host recovers it. */
|
|
30
|
+
outcome?: "enrolled" | "retired" | "aborted";
|
|
31
|
+
/** Set once, only by the executor's own flight, after a sweeper's claim: the flight has stopped
|
|
32
|
+
* and revoked any grant at the pinned UID. Absent on every other record. */
|
|
33
|
+
released?: true;
|
|
34
|
+
}
|
|
35
|
+
/** One run of one host process, as SPEC §13.7 names an executor. An instance id without its process
|
|
36
|
+
* epoch names a process, never the run of it that holds a flight. */
|
|
37
|
+
export interface DelegatedUserIntentIncarnation {
|
|
38
|
+
instanceId: string;
|
|
39
|
+
/** The process epoch (§13.1) of the host's own serving instance, advanced by every restart. */
|
|
40
|
+
processEpoch: number;
|
|
41
|
+
}
|
|
42
|
+
/** What the consuming CAS fixes before any effect, so that a retry, a lost answer or a host restart
|
|
43
|
+
* resumes the same execution at the same lifecycle. */
|
|
44
|
+
export interface DelegatedUserIntentExecutionPin {
|
|
45
|
+
/** The holder request that consumed the record. Null when the host consumed a holder-gone retirement itself. */
|
|
46
|
+
requestId: string | null;
|
|
47
|
+
serveEpoch: number | null;
|
|
48
|
+
/** Launch: selected by the host before the CAS, and the only UID its writer enrolls. Retire: the target's. */
|
|
49
|
+
lifecycleUid: string;
|
|
50
|
+
/** Launch only: the holder's token digest. */
|
|
51
|
+
tokenHash?: string;
|
|
52
|
+
/** Retire only: managedRetirementOpId(lifecycleUid). */
|
|
53
|
+
opId?: string;
|
|
54
|
+
/** The host incarnation whose flight consumed the record: the execution's only executor. */
|
|
55
|
+
executor: DelegatedUserIntentIncarnation;
|
|
56
|
+
}
|
|
57
|
+
/** True while `record` holds the alias `(record.owner, record.intent.target.actor)`: consumed with
|
|
58
|
+
* no `outcome`, or claimed by a sweeper (`sweptBy`) and not yet `released`. */
|
|
59
|
+
export declare function delegatedUserIntentHoldsAlias(record: DelegatedUserIntentRecord): boolean;
|
|
60
|
+
/** In-process executions keyed by intentId, each bound to its pin, as RetirementFlights binds a
|
|
61
|
+
* retirement to its coordinates. A host process holds at most one flight per intent. */
|
|
62
|
+
export type DelegatedUserIntentFlights = Map<string, {
|
|
63
|
+
pin: DelegatedUserIntentExecutionPin;
|
|
64
|
+
promise: Promise<RemoteDelegatedUserIntentExecutionResult>;
|
|
65
|
+
}>;
|
|
66
|
+
/** Join the flight for `intentId`, or start `run` and register it. Returns undefined when that
|
|
67
|
+
* intent is in flight under a different pin: the caller refuses with `conflict` and starts nothing. */
|
|
68
|
+
export declare function joinOrStartDelegatedUserIntent(flights: DelegatedUserIntentFlights, intentId: string, pin: DelegatedUserIntentExecutionPin, run: () => Promise<RemoteDelegatedUserIntentExecutionResult>): Promise<RemoteDelegatedUserIntentExecutionResult> | undefined;
|
|
69
|
+
/** The platform control door's assignment observer as it shipped, unchanged. It is keyed by account,
|
|
70
|
+
* which has at most one current row, and both decisions require that row to name the intent's instance. */
|
|
71
|
+
export type ObservePlatformControlAssignment = PlatformControlDeps["observeAssignment"];
|
|
72
|
+
export interface AuthorizeDelegatedUserIntentAdmissionArgs {
|
|
73
|
+
request: DelegatedUserIntentRequest;
|
|
74
|
+
space: string;
|
|
75
|
+
accountPublicKey: string;
|
|
76
|
+
/** Derived from the verified IdP subject with deriveOwnerForIdpSubject. Never read from the request. */
|
|
77
|
+
owner: string;
|
|
78
|
+
/** This host's ledger directory. The decision reads the actor's row itself. */
|
|
79
|
+
dir: string;
|
|
80
|
+
observeAssignment: ObservePlatformControlAssignment;
|
|
81
|
+
observeManagerGate: ObserveManagerGate;
|
|
82
|
+
/** The host's launch record of this owner whose `execution.lifecycleUid` is `lifecycleUid`, read fresh. Retire only. */
|
|
83
|
+
observeLaunchRecord(owner: string, lifecycleUid: string): Promise<DelegatedUserIntentRecord | null>;
|
|
84
|
+
/** The host's records of this owner whose `intent.target.actor` is `actor`, read fresh. Launch only. */
|
|
85
|
+
observeAliasRecords(owner: string, actor: string): Promise<DelegatedUserIntentRecord[]>;
|
|
86
|
+
/** platformControlOwner(...) for this space and account. */
|
|
87
|
+
platformOwner: string;
|
|
88
|
+
now: number;
|
|
89
|
+
}
|
|
90
|
+
/** Decides one admission. Writes nothing and mints nothing. Returns the record the host persists. */
|
|
91
|
+
export declare function authorizeDelegatedUserIntentAdmission(args: AuthorizeDelegatedUserIntentAdmissionArgs): Promise<DelegatedUserIntentRecord>;
|
|
92
|
+
export interface AuthorizeDelegatedUserIntentExecutionArgs {
|
|
93
|
+
request: RemoteDelegatedUserIntentExecutionRequest;
|
|
94
|
+
space: string;
|
|
95
|
+
accountPublicKey: string;
|
|
96
|
+
platformOwner: string;
|
|
97
|
+
/** The host's record for request.intentId, read fresh. Null is an absent intent. */
|
|
98
|
+
intent: DelegatedUserIntentRecord | null;
|
|
99
|
+
observeAssignment: ObservePlatformControlAssignment;
|
|
100
|
+
observeManagerGate: ObserveManagerGate;
|
|
101
|
+
proofSecret: string | Uint8Array;
|
|
102
|
+
now: number;
|
|
103
|
+
}
|
|
104
|
+
/** The only facts an execution decision carries, all checked for the current request. */
|
|
105
|
+
export interface DelegatedUserIntentDecision {
|
|
106
|
+
intentId: string;
|
|
107
|
+
requestId: string;
|
|
108
|
+
serveEpoch: number;
|
|
109
|
+
owner: string;
|
|
110
|
+
parent: string;
|
|
111
|
+
instanceId: string;
|
|
112
|
+
/** True when the request equals the record's `execution` pin: the host joins that execution's
|
|
113
|
+
* flight, or answers from its outcome, and writes no second CAS. */
|
|
114
|
+
resume: boolean;
|
|
115
|
+
operation: "launch" | "retire";
|
|
116
|
+
target: DelegatedUserLaunchTarget | RemoteManagedAgentPrepareRetirementRequest["target"];
|
|
117
|
+
/** Launch only. */
|
|
118
|
+
tokenHash?: string;
|
|
119
|
+
/** Retire only: managedRetirementOpId(target.lifecycleUid). */
|
|
120
|
+
opId?: string;
|
|
121
|
+
}
|
|
122
|
+
/** Decides one execution. Writes nothing; the host consumes the record, pinning the execution, before
|
|
123
|
+
* acting on the decision. */
|
|
124
|
+
export declare function authorizeDelegatedUserIntentExecution(args: AuthorizeDelegatedUserIntentExecutionArgs): Promise<DelegatedUserIntentDecision>;
|
|
125
|
+
//# sourceMappingURL=delegated-user-intent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegated-user-intent.d.ts","sourceRoot":"","sources":["../src/delegated-user-intent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAUL,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,EAE9B,KA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C;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,oFAAoF;IACpF,MAAM,EAAE,yBAAyB,GAAG,IAAI,CAAC;IACzC,iBAAiB,EAAE,gCAAgC,CAAC;IACpD,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,WAAW,EAAE,MAAM,GAAG,UAAU,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,yFAAyF;AACzF,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB;wEACoE;IACpE,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC/B,MAAM,EAAE,yBAAyB,GAAG,0CAA0C,CAAC,QAAQ,CAAC,CAAC;IACzF,mBAAmB;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;6BAC6B;AAC7B,wBAAsB,qCAAqC,CACzD,IAAI,EAAE,yCAAyC,GAC9C,OAAO,CAAC,2BAA2B,CAAC,CAkDtC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host policy for a delegated user intent (SPEC 13.16): a signed-in user admits one launch or one
|
|
3
|
+
* retirement, and the platform control holder executes it while the intent and the agent stay the
|
|
4
|
+
* user's.
|
|
5
|
+
*
|
|
6
|
+
* Both decisions write nothing and mint nothing. The host that owns the intent store persists the
|
|
7
|
+
* admission record, consumes it with one revision-pinned CAS, and runs the enrollment and retirement
|
|
8
|
+
* writers it already runs for a user's own remote manager, with the decision's owner and parent.
|
|
9
|
+
* The holder's registration proves only which instance and epoch present the intent: no decision
|
|
10
|
+
* reads, requires or returns `supervise`.
|
|
11
|
+
*/
|
|
12
|
+
import { DELEGATED_USER_INTENT_MAX_TTL_SECONDS, EpEnvelopeError, assertDerivedOwnerToken, managedRetirementOpId, mintLifecycleUid, parseDelegatedUserIntentRequest, parseRemoteDelegatedUserIntentExecutionRequest, remoteManagerActors, resolveReadAcl, } from "@cotal-ai/core";
|
|
13
|
+
import { timingSafeEqual } from "node:crypto";
|
|
14
|
+
import { assertWithinSpawnerGrant, ledgerAuthorizeGrant } from "./ledger.js";
|
|
15
|
+
import { remoteManagerCurrentRegistrationProof } from "./retained-manager-validation.js";
|
|
16
|
+
/** True while `record` holds the alias `(record.owner, record.intent.target.actor)`: consumed with
|
|
17
|
+
* no `outcome`, or claimed by a sweeper (`sweptBy`) and not yet `released`. */
|
|
18
|
+
export function delegatedUserIntentHoldsAlias(record) {
|
|
19
|
+
return (record.state === "consumed" && record.outcome === undefined) || (record.sweptBy !== undefined && record.released !== true);
|
|
20
|
+
}
|
|
21
|
+
function samePin(a, b) {
|
|
22
|
+
return a.requestId === b.requestId && a.serveEpoch === b.serveEpoch && a.lifecycleUid === b.lifecycleUid &&
|
|
23
|
+
a.tokenHash === b.tokenHash && a.opId === b.opId &&
|
|
24
|
+
a.executor.instanceId === b.executor.instanceId && a.executor.processEpoch === b.executor.processEpoch;
|
|
25
|
+
}
|
|
26
|
+
/** Join the flight for `intentId`, or start `run` and register it. Returns undefined when that
|
|
27
|
+
* intent is in flight under a different pin: the caller refuses with `conflict` and starts nothing. */
|
|
28
|
+
export function joinOrStartDelegatedUserIntent(flights, intentId, pin, run) {
|
|
29
|
+
const existing = flights.get(intentId);
|
|
30
|
+
if (existing !== undefined)
|
|
31
|
+
return samePin(existing.pin, pin) ? existing.promise : undefined;
|
|
32
|
+
// Registered before `run` starts, so a call `run` makes back into this map joins this flight, and
|
|
33
|
+
// a synchronous throw rejects it.
|
|
34
|
+
const flight = Promise.resolve().then(run);
|
|
35
|
+
flights.set(intentId, { pin, promise: flight });
|
|
36
|
+
void flight.catch(() => { }).finally(() => { if (flights.get(intentId)?.promise === flight)
|
|
37
|
+
flights.delete(intentId); });
|
|
38
|
+
return flight;
|
|
39
|
+
}
|
|
40
|
+
/** A read is never a fence and never cached: an observer that fails refuses this call only. */
|
|
41
|
+
async function observe(what, read) {
|
|
42
|
+
try {
|
|
43
|
+
return await read();
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
throw new EpEnvelopeError("unavailable", `delegated user intent ${what} is unreadable: ${e instanceof Error ? e.message : String(e)}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function isCurrentAssignment(a, space, accountPublicKey, instanceId) {
|
|
50
|
+
return a !== null && a.v === 1 && a.state === "assigned" && a.space === space && a.accountPublicKey === accountPublicKey && a.instanceId === instanceId;
|
|
51
|
+
}
|
|
52
|
+
/** Decides one admission. Writes nothing and mints nothing. Returns the record the host persists. */
|
|
53
|
+
export async function authorizeDelegatedUserIntentAdmission(args) {
|
|
54
|
+
const r = parseDelegatedUserIntentRequest(args.request);
|
|
55
|
+
if (r.space !== args.space || r.accountPublicKey !== args.accountPublicKey)
|
|
56
|
+
throw new EpEnvelopeError("permission-denied", "delegated user intent names another space or account than this authority context");
|
|
57
|
+
// Only a human's derived owner admits an intent: a platform or service owner never acts as a user.
|
|
58
|
+
try {
|
|
59
|
+
assertDerivedOwnerToken(args.owner);
|
|
60
|
+
}
|
|
61
|
+
catch (e) {
|
|
62
|
+
throw new EpEnvelopeError("permission-denied", e instanceof Error ? e.message : String(e));
|
|
63
|
+
}
|
|
64
|
+
let scope;
|
|
65
|
+
try {
|
|
66
|
+
scope = ledgerAuthorizeGrant(args.dir)(args.owner, r.actor).scope ?? [];
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
throw new EpEnvelopeError("permission-denied", `delegated user intent found no ledger grant for actor "${r.actor}": ${e instanceof Error ? e.message : String(e)}`);
|
|
70
|
+
}
|
|
71
|
+
if (!scope.includes("spawn"))
|
|
72
|
+
throw new EpEnvelopeError("permission-denied", `delegated user intent needs scope "spawn" on actor "${r.actor}"`);
|
|
73
|
+
const parent = `${args.owner}.${r.actor}`;
|
|
74
|
+
const assignment = await observe("assignment", () => args.observeAssignment(args.space, args.accountPublicKey));
|
|
75
|
+
const gate = await observe("manager gate", () => args.observeManagerGate(r.instanceId));
|
|
76
|
+
const servePrincipal = `${args.platformOwner}.${remoteManagerActors(r.instanceId).serve}`;
|
|
77
|
+
let bound;
|
|
78
|
+
if (r.intent.operation === "launch") {
|
|
79
|
+
if (!isCurrentAssignment(assignment, args.space, args.accountPublicKey, r.instanceId))
|
|
80
|
+
throw new EpEnvelopeError("permission-denied", `platform control instance ${r.instanceId} is not the current assignment's instance for this account`);
|
|
81
|
+
if (gate && gate.principal !== servePrincipal)
|
|
82
|
+
throw new EpEnvelopeError("permission-denied", `manager gate belongs to ${gate.principal}, not serve principal ${servePrincipal}`);
|
|
83
|
+
if (!gate || gate.state !== "open")
|
|
84
|
+
throw new EpEnvelopeError("failed-precondition", `delegated user intent found no current open manager gate for instance ${r.instanceId}`);
|
|
85
|
+
const t = r.intent.target;
|
|
86
|
+
// A dry run of the walk the host's writer repeats at the write, over the read ACL that writer
|
|
87
|
+
// provisions: refuse before any record exists.
|
|
88
|
+
try {
|
|
89
|
+
assertWithinSpawnerGrant(args.dir, {
|
|
90
|
+
owner: args.owner,
|
|
91
|
+
actor: t.actor,
|
|
92
|
+
scope: t.capabilities ?? [],
|
|
93
|
+
allowSubscribe: resolveReadAcl(t.subscribe ?? [], t.allowSubscribe),
|
|
94
|
+
allowPublish: t.allowPublish ?? [],
|
|
95
|
+
parent,
|
|
96
|
+
...(t.role !== undefined ? { role: t.role } : {}),
|
|
97
|
+
}, "spawn");
|
|
98
|
+
}
|
|
99
|
+
catch (e) {
|
|
100
|
+
throw new EpEnvelopeError("permission-denied", e instanceof Error ? e.message : String(e));
|
|
101
|
+
}
|
|
102
|
+
const aliasRecords = await observe("alias records", () => args.observeAliasRecords(args.owner, t.actor));
|
|
103
|
+
if (aliasRecords.some(delegatedUserIntentHoldsAlias))
|
|
104
|
+
throw new EpEnvelopeError("failed-precondition", `actor "${t.actor}" is held by an unfinished delegated execution`);
|
|
105
|
+
bound = { managerLifecycleUid: assignment.lifecycleUid, assignmentRevision: assignment.assignmentRevision, serveEpoch: gate.processEpoch };
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
const t = r.intent.target;
|
|
109
|
+
if (t.owner !== args.owner)
|
|
110
|
+
throw new EpEnvelopeError("permission-denied", `retirement target owner "${t.owner}" does not match authenticated owner "${args.owner}"`);
|
|
111
|
+
const launch = await observe("launch record", () => args.observeLaunchRecord(args.owner, t.lifecycleUid));
|
|
112
|
+
// The launch record's own `actor` admitted the launch; only its target names the agent.
|
|
113
|
+
if (!launch || launch.owner !== args.owner || launch.intent.operation !== "launch" || launch.outcome !== "enrolled" ||
|
|
114
|
+
launch.execution?.lifecycleUid !== t.lifecycleUid || launch.intent.target.actor !== t.actor || launch.instanceId !== r.instanceId)
|
|
115
|
+
throw new EpEnvelopeError("failed-precondition", `lifecycle ${t.lifecycleUid} of "${t.actor}" is no enrolled delegated launch on instance ${r.instanceId}`);
|
|
116
|
+
const present = isCurrentAssignment(assignment, args.space, args.accountPublicKey, r.instanceId) &&
|
|
117
|
+
assignment.lifecycleUid === launch.managerLifecycleUid && assignment.assignmentRevision === launch.assignmentRevision &&
|
|
118
|
+
gatePresents(gate, servePrincipal, launch.serveEpoch);
|
|
119
|
+
// A gone holder cannot present the intent (execution requires the record's epoch), so the host
|
|
120
|
+
// consumes it itself.
|
|
121
|
+
bound = { managerLifecycleUid: launch.managerLifecycleUid, assignmentRevision: launch.assignmentRevision, serveEpoch: present ? launch.serveEpoch : null };
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
v: 1,
|
|
125
|
+
space: args.space,
|
|
126
|
+
owner: args.owner,
|
|
127
|
+
actor: r.actor,
|
|
128
|
+
parent,
|
|
129
|
+
intentId: mintLifecycleUid(),
|
|
130
|
+
accountPublicKey: args.accountPublicKey,
|
|
131
|
+
instanceId: r.instanceId,
|
|
132
|
+
...bound,
|
|
133
|
+
intent: r.intent,
|
|
134
|
+
expiresAt: new Date(args.now + DELEGATED_USER_INTENT_MAX_TTL_SECONDS * 1000).toISOString(),
|
|
135
|
+
state: "admitted",
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function gatePresents(gate, servePrincipal, serveEpoch) {
|
|
139
|
+
return gate !== null && gate.state === "open" && gate.principal === servePrincipal && gate.processEpoch === serveEpoch;
|
|
140
|
+
}
|
|
141
|
+
/** Decides one execution. Writes nothing; the host consumes the record, pinning the execution, before
|
|
142
|
+
* acting on the decision. */
|
|
143
|
+
export async function authorizeDelegatedUserIntentExecution(args) {
|
|
144
|
+
const r = parseRemoteDelegatedUserIntentExecutionRequest(args.request);
|
|
145
|
+
if (r.space !== args.space || r.accountPublicKey !== args.accountPublicKey)
|
|
146
|
+
throw new EpEnvelopeError("permission-denied", "delegated user intent execution names another space or account than this authority context");
|
|
147
|
+
const rec = args.intent;
|
|
148
|
+
if (!rec || rec.intentId !== r.intentId || rec.space !== args.space || rec.accountPublicKey !== args.accountPublicKey)
|
|
149
|
+
throw new EpEnvelopeError("failed-precondition", `delegated user intent ${r.intentId} was never admitted`);
|
|
150
|
+
let resume = false;
|
|
151
|
+
if (rec.state === "admitted") {
|
|
152
|
+
if (Date.parse(rec.expiresAt) <= args.now)
|
|
153
|
+
throw new EpEnvelopeError("failed-precondition", `delegated user intent ${r.intentId} expired at ${rec.expiresAt}`);
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
// Only the execution the consuming CAS pinned may present a consumed record again.
|
|
157
|
+
const pin = rec.execution;
|
|
158
|
+
if (!pin || pin.requestId !== r.requestId || pin.serveEpoch !== r.serveEpoch ||
|
|
159
|
+
(r.execute.operation === "launch" && pin.tokenHash !== r.execute.target.tokenHash))
|
|
160
|
+
throw new EpEnvelopeError("failed-precondition", `delegated user intent ${r.intentId} was consumed by another execution`);
|
|
161
|
+
resume = true;
|
|
162
|
+
}
|
|
163
|
+
if (r.instanceId !== rec.instanceId || r.managerLifecycleUid !== rec.managerLifecycleUid ||
|
|
164
|
+
r.assignmentRevision !== rec.assignmentRevision || r.execute.operation !== rec.intent.operation)
|
|
165
|
+
throw new EpEnvelopeError("permission-denied", `delegated user intent ${r.intentId} is bound to another instance, lifecycle, revision or operation`);
|
|
166
|
+
const assignment = await observe("assignment", () => args.observeAssignment(args.space, args.accountPublicKey));
|
|
167
|
+
if (!isCurrentAssignment(assignment, args.space, args.accountPublicKey, rec.instanceId) ||
|
|
168
|
+
assignment.assignmentRevision !== rec.assignmentRevision || assignment.lifecycleUid !== rec.managerLifecycleUid)
|
|
169
|
+
throw new EpEnvelopeError("permission-denied", "platform control assignment no longer names the intent's instance, lifecycle or revision");
|
|
170
|
+
const gate = await observe("manager gate", () => args.observeManagerGate(r.instanceId));
|
|
171
|
+
const servePrincipal = `${args.platformOwner}.${remoteManagerActors(r.instanceId).serve}`;
|
|
172
|
+
if (gate && gate.principal !== servePrincipal)
|
|
173
|
+
throw new EpEnvelopeError("permission-denied", `manager gate belongs to ${gate.principal}, not serve principal ${servePrincipal}`);
|
|
174
|
+
if (!gate || gate.state !== "open")
|
|
175
|
+
throw new EpEnvelopeError("failed-precondition", `delegated user intent execution found no current open manager gate for instance ${r.instanceId}`);
|
|
176
|
+
if (gate.processEpoch !== r.serveEpoch)
|
|
177
|
+
throw new EpEnvelopeError("conflict", `manager serve epoch ${r.serveEpoch} is stale; current is ${gate.processEpoch}`);
|
|
178
|
+
if (r.serveEpoch !== rec.serveEpoch)
|
|
179
|
+
throw new EpEnvelopeError("permission-denied", `delegated user intent ${r.intentId} is bound to serve epoch ${rec.serveEpoch}, not ${r.serveEpoch}`);
|
|
180
|
+
const expectedProof = remoteManagerCurrentRegistrationProof(args.proofSecret, args.platformOwner, r, gate);
|
|
181
|
+
if (!timingSafeEqual(Buffer.from(r.registrationProof), Buffer.from(expectedProof)))
|
|
182
|
+
throw new EpEnvelopeError("permission-denied", "delegated user intent execution proof does not match current host registration");
|
|
183
|
+
const base = { intentId: rec.intentId, requestId: r.requestId, serveEpoch: r.serveEpoch, owner: rec.owner, parent: rec.parent, instanceId: rec.instanceId, resume };
|
|
184
|
+
if (rec.intent.operation === "launch") {
|
|
185
|
+
if (r.execute.operation !== "launch" || r.execute.target.actor !== rec.intent.target.actor)
|
|
186
|
+
throw new EpEnvelopeError("permission-denied", `delegated user intent ${r.intentId} names a launch of "${rec.intent.target.actor}" only`);
|
|
187
|
+
return { ...base, operation: "launch", target: rec.intent.target, tokenHash: r.execute.target.tokenHash };
|
|
188
|
+
}
|
|
189
|
+
const want = rec.intent.target;
|
|
190
|
+
if (r.execute.operation !== "retire" || r.execute.target.owner !== want.owner || r.execute.target.actor !== want.actor ||
|
|
191
|
+
r.execute.target.lifecycleUid !== want.lifecycleUid)
|
|
192
|
+
throw new EpEnvelopeError("permission-denied", `delegated user intent ${r.intentId} names another retirement target`);
|
|
193
|
+
return { ...base, operation: "retire", target: want, opId: managedRetirementOpId(want.lifecycleUid) };
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=delegated-user-intent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegated-user-intent.js","sourceRoot":"","sources":["../src/delegated-user-intent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,qCAAqC,EACrC,eAAe,EACf,uBAAuB,EACvB,qBAAqB,EACrB,gBAAgB,EAChB,+BAA+B,EAC/B,8CAA8C,EAC9C,mBAAmB,EACnB,cAAc,GAQf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAG7E,OAAO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AAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK;QAClH,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,KAAK,IAAI,CAAC,YAAY;QACrD,MAAM,IAAI,eAAe,CAAC,mBAAmB,EAAE,yBAAyB,CAAC,CAAC,QAAQ,kCAAkC,CAAC,CAAC;IACxH,OAAO,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;AACxG,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ export { validateUserToken, assertCredentialIdClaim, USER_TOKEN_VER, MAX_TOKEN_T
|
|
|
6
6
|
export { USER_TOKEN_ALG, createUserTokenIssuer, generateSigningKey, exportSigningKey, importSigningKey, pinnedJwksResolver, type SigningKey, type SerializedSigningKey, type IssueClaims, type UserTokenIssuer, type CreateIssuerOpts, } from "./issuer.js";
|
|
7
7
|
export { createIdpBridge, verifyIdpToken, type IdpConfig, type ActorGrant, type CreateIdpBridgeOpts, type ExchangeResult, type IdpBridge, } from "./idp.js";
|
|
8
8
|
export { CATALOG_FRESH_MS, deviceLogin, establishIdpSession, fetchIdpJwt, revokeIdpSession, loadIdpSession, hasIdpSessions, saveIdpSession, deleteIdpSession, deleteIdpSpaceCatalog, hasIdpSpaceCatalog, prepareIdpSpaceCatalogs, requireIdpSession, normalizeIdpUrl, probeIdpJwks, type IdpSession, type DeviceLoginOpts, type DeviceLoginPrompt, } from "./login.js";
|
|
9
|
-
export { calloutPermissions, type AclResolver } from "./permissions.js";
|
|
9
|
+
export { calloutPermissions, type AclResolver, type UserCallerIssuer } from "./permissions.js";
|
|
10
10
|
export { USER_AUTH_TRUST_SCHEME, userAuthTrustFingerprint, validateRetainedManagedAgent, } from "./continuity.js";
|
|
11
11
|
export { AUTH_PROVIDER_NAME, authCalloutKey, authIssuerKey, authOwnerSecretKey, authServiceKeysKey, clearAuthServiceInfo, ensureCalloutAuth, ensureIssuer, ensureOwnerSecret, ensurePinnedIdp, loadAuthServiceInfo, loadCalloutAuth, loadIssuer, loadOwnerSecret, loadPinnedIdp, loadServiceKeys, saveAuthServiceInfo, saveServiceKeys, spaceIssuer, type AuthServiceInfo, type PinnedIdp, type ServiceKeys, } from "./store.js";
|
|
12
|
-
export { actorLedgerDir, managedActorLedgerDir, findInteractiveActor, findManagedActor, findActorUnified, grantActor, grantManagedActor, ledgerAclResolver, ledgerAuthorizeConnect, ledgerAuthorizeGrant, ledgerAuthorizeAgentExchange, ledgerRowFilename, loadActorLedger, revokeActor, revokeManagedActor, newActorToken, hashActorToken, AGENT_BEARER_TTL_SEC, type ActorKind, type ActorRow, } from "./ledger.js";
|
|
12
|
+
export { actorLedgerDir, managedActorLedgerDir, findInteractiveActor, findManagedActor, findActorUnified, grantActor, grantManagedActor, ledgerAclResolver, ledgerActorSourceIsLive, ledgerAuthorizeConnect, ledgerAuthorizeGrant, ledgerAuthorizeAgentExchange, ledgerRowFilename, loadActorLedger, revokeActor, revokeManagedActor, newActorToken, hashActorToken, AGENT_BEARER_TTL_SEC, type ActorKind, type ActorRow, } from "./ledger.js";
|
|
13
13
|
export { runAuthService, startAuthService, type AuthServiceHandle, type PublicFaceInput, type PlatformControlInput, openAuthAuthorityPlane, dispatchManagerAuthorityRequest, handleManagerServiceAuthority, JWKS_MAX_AGE_SEC, INTERACTIVE_RETIRE_PATH, MANAGED_RETIRE_PATH, VERIFY_ENROLLMENT_PATH, composeUserBundle, finalizeUserBundleEndpoint, checkAdvertisedServer, checkAgentProvisioningUrl, type AuthAuthorityPlane } from "./service.js";
|
|
14
14
|
export { remoteManagerIssuerGrants } from "./authority-client.js";
|
|
15
15
|
export { authConnectReaderGrants, openConnectReader, authorizeConnectCredential, type ConnectReader, } from "./connect-reader.js";
|
|
@@ -18,6 +18,7 @@ export { parseRemoteManagerMaintenanceRequest, authorizeRemoteManagerMaintenance
|
|
|
18
18
|
export { parseRemoteRetainedAgentValidationRequest, authorizeRemoteRetainedAgentValidation, completeRemoteRetainedAgentValidation, remoteManagerCurrentRegistrationProof, type AuthorizeRemoteRetainedAgentValidationArgs, } from "./retained-manager-validation.js";
|
|
19
19
|
export { parseRemoteManagerAdminAuthorizationRequest, authorizeRemoteManagerAdmin } from "./manager-admin-authorization.js";
|
|
20
20
|
export { authorizeRemoteManagedAgentEnrollment, authorizeRemoteManagedAgentPrepareRetirement, authorizeRemoteManagedAgentRuntimeCreate, authorizeRemoteManagedAgentRuntimeStatus, type AuthorizeRemoteManagedAgentEnrollmentArgs, type AuthorizeRemoteManagedAgentPrepareRetirementArgs, type AuthorizeRemoteManagedAgentRuntimeArgs, type RemoteManagedAgentRuntimeDecision, type ObserveManagerGate, } from "./managed-agent-enrollment.js";
|
|
21
|
+
export { authorizeDelegatedUserIntentAdmission, authorizeDelegatedUserIntentExecution, delegatedUserIntentHoldsAlias, joinOrStartDelegatedUserIntent, type AuthorizeDelegatedUserIntentAdmissionArgs, type AuthorizeDelegatedUserIntentExecutionArgs, type DelegatedUserIntentDecision, type DelegatedUserIntentExecutionPin, type DelegatedUserIntentFlights, type DelegatedUserIntentIncarnation, type DelegatedUserIntentRecord, type ObservePlatformControlAssignment, } from "./delegated-user-intent.js";
|
|
21
22
|
export { cotalAuthProvider } from "./provider.js";
|
|
22
23
|
import "./commands.js";
|
|
23
24
|
export { openSessionAuthStore, kvSessionLedger, sessionRedemptionHooks, closeSession, sweepSessions, kvServeIssuanceGate, type SessionAuthStore, type EndpointGateRow, type SessionSigner, type SessionHookDeps, type SessionCloser } from "./session-ledger.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CA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|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,EAAE,oCAAoC,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC1G,YAAY,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,UAAU,EACf,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,eAAe,EACf,cAAc,EACd,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,SAAS,GACf,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ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,eAAe,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAQjQ,OAAO,EACL,qBAAqB,EAAE,0BAA0B,EACjD,0BAA0B,EAAE,2BAA2B,EACvD,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,KAAK,gBAAgB,EAAE,KAAK,SAAS,GAC3F,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export { CATALOG_FRESH_MS, deviceLogin, establishIdpSession, fetchIdpJwt, revoke
|
|
|
8
8
|
export { calloutPermissions } from "./permissions.js";
|
|
9
9
|
export { USER_AUTH_TRUST_SCHEME, userAuthTrustFingerprint, validateRetainedManagedAgent, } from "./continuity.js";
|
|
10
10
|
export { AUTH_PROVIDER_NAME, authCalloutKey, authIssuerKey, authOwnerSecretKey, authServiceKeysKey, clearAuthServiceInfo, ensureCalloutAuth, ensureIssuer, ensureOwnerSecret, ensurePinnedIdp, loadAuthServiceInfo, loadCalloutAuth, loadIssuer, loadOwnerSecret, loadPinnedIdp, loadServiceKeys, saveAuthServiceInfo, saveServiceKeys, spaceIssuer, } from "./store.js";
|
|
11
|
-
export { actorLedgerDir, managedActorLedgerDir, findInteractiveActor, findManagedActor, findActorUnified, grantActor, grantManagedActor, ledgerAclResolver, ledgerAuthorizeConnect, ledgerAuthorizeGrant, ledgerAuthorizeAgentExchange, ledgerRowFilename, loadActorLedger, revokeActor, revokeManagedActor, newActorToken, hashActorToken, AGENT_BEARER_TTL_SEC, } from "./ledger.js";
|
|
11
|
+
export { actorLedgerDir, managedActorLedgerDir, findInteractiveActor, findManagedActor, findActorUnified, grantActor, grantManagedActor, ledgerAclResolver, ledgerActorSourceIsLive, ledgerAuthorizeConnect, ledgerAuthorizeGrant, ledgerAuthorizeAgentExchange, ledgerRowFilename, loadActorLedger, revokeActor, revokeManagedActor, newActorToken, hashActorToken, AGENT_BEARER_TTL_SEC, } from "./ledger.js";
|
|
12
12
|
export { runAuthService, startAuthService, openAuthAuthorityPlane, dispatchManagerAuthorityRequest, handleManagerServiceAuthority, JWKS_MAX_AGE_SEC, INTERACTIVE_RETIRE_PATH, MANAGED_RETIRE_PATH, VERIFY_ENROLLMENT_PATH, composeUserBundle, finalizeUserBundleEndpoint, checkAdvertisedServer, checkAgentProvisioningUrl } from "./service.js";
|
|
13
13
|
export { remoteManagerIssuerGrants } from "./authority-client.js";
|
|
14
14
|
// The R1 connect-arm deny-new READ seam (SPEC 13.1): the reader grant builder, the sealed
|
|
@@ -21,6 +21,7 @@ export { parseRemoteManagerMaintenanceRequest, authorizeRemoteManagerMaintenance
|
|
|
21
21
|
export { parseRemoteRetainedAgentValidationRequest, authorizeRemoteRetainedAgentValidation, completeRemoteRetainedAgentValidation, remoteManagerCurrentRegistrationProof, } from "./retained-manager-validation.js";
|
|
22
22
|
export { parseRemoteManagerAdminAuthorizationRequest, authorizeRemoteManagerAdmin } from "./manager-admin-authorization.js";
|
|
23
23
|
export { authorizeRemoteManagedAgentEnrollment, authorizeRemoteManagedAgentPrepareRetirement, authorizeRemoteManagedAgentRuntimeCreate, authorizeRemoteManagedAgentRuntimeStatus, } from "./managed-agent-enrollment.js";
|
|
24
|
+
export { authorizeDelegatedUserIntentAdmission, authorizeDelegatedUserIntentExecution, delegatedUserIntentHoldsAlias, joinOrStartDelegatedUserIntent, } from "./delegated-user-intent.js";
|
|
24
25
|
export { cotalAuthProvider } from "./provider.js"; // self-registers the "auth-provider" extension
|
|
25
26
|
import "./commands.js"; // self-registers `login` / `logout` / `actor` / `auth-service` into the core Registry
|
|
26
27
|
// NB: writeEndpointGate (the D14 endpoint-registration stand-in) is deliberately NOT
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,EAAE,oCAAoC,EAA+B,MAAM,uBAAuB,CAAC;AAE1G,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GAMjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,GAKpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GAMnB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,eAAe,EACf,cAAc,GAMf,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,YAAY,GAIb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,EAAE,oCAAoC,EAA+B,MAAM,uBAAuB,CAAC;AAE1G,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,GAMjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,GAKpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GAMnB,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