@ory/argus 0.13.9 → 1.0.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/README.md +31 -45
- package/assets/commands/temporal-up.md +1 -1
- package/assets/skills/auth-setup/SKILL.md +1 -1
- package/assets/skills/local-dev/SKILL.md +17 -7
- package/assets/skills/ory-build-agent/SKILL.md +43 -97
- package/assets/skills/ory-e2b-sandbox/SKILL.md +18 -18
- package/assets/skills/ory-temporal-worker/SKILL.md +38 -42
- package/assets/skills/permissions-onboarding/SKILL.md +131 -104
- package/dist/adapters.d.ts +93 -30
- package/dist/adapters.js +464 -136
- package/dist/agent-auth.d.ts +258 -68
- package/dist/agent-auth.js +998 -202
- package/dist/auth-store.d.ts +37 -2
- package/dist/auth-store.js +37 -3
- package/dist/auth.d.ts +40 -4
- package/dist/auth.js +247 -19
- package/dist/bash-parser.d.ts +98 -0
- package/dist/bash-parser.js +396 -0
- package/dist/branding.d.ts +128 -0
- package/dist/branding.js +151 -0
- package/dist/build-info.json +4 -4
- package/dist/cli-invocation.d.ts +1 -1
- package/dist/cli-invocation.js +2 -1
- package/dist/cli.d.ts +20 -29
- package/dist/cli.js +271 -278
- package/dist/client.d.ts +175 -138
- package/dist/client.js +672 -391
- package/dist/config.d.ts +249 -57
- package/dist/config.js +486 -62
- package/dist/context.d.ts +10 -0
- package/dist/context.js +21 -0
- package/dist/contract-suite.d.ts +8 -8
- package/dist/contract-suite.js +88 -69
- package/dist/denial.d.ts +36 -3
- package/dist/denial.js +79 -10
- package/dist/event-reporter.d.ts +77 -0
- package/dist/event-reporter.js +776 -0
- package/dist/external-registrations-main.d.ts +10 -0
- package/dist/external-registrations-main.js +38 -0
- package/dist/external-registrations.d.ts +79 -0
- package/dist/external-registrations.js +188 -0
- package/dist/help-cli.d.ts +39 -0
- package/dist/help-cli.js +55 -0
- package/dist/hook-timeout.d.ts +64 -0
- package/dist/hook-timeout.js +88 -0
- package/dist/index.d.ts +31 -19
- package/dist/index.js +182 -31
- package/dist/lifecycle.d.ts +3 -3
- package/dist/lifecycle.js +38 -6
- package/dist/local/cli.js +11 -6
- package/dist/local/configs.d.ts +74 -18
- package/dist/local/configs.js +291 -84
- package/dist/local/health.d.ts +14 -0
- package/dist/local/health.js +50 -4
- package/dist/local/index.d.ts +2 -2
- package/dist/local/index.js +24 -10
- package/dist/local/manager.d.ts +20 -1
- package/dist/local/manager.js +160 -39
- package/dist/local/ports.d.ts +158 -0
- package/dist/local/ports.js +443 -0
- package/dist/local/seed.d.ts +22 -25
- package/dist/local/seed.js +88 -56
- package/dist/logger.d.ts +54 -25
- package/dist/logger.js +329 -63
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +10 -5
- package/dist/mirror-bootstrap.d.ts +48 -0
- package/dist/mirror-bootstrap.js +254 -0
- package/dist/opl.d.ts +289 -0
- package/dist/opl.js +446 -0
- package/dist/permission-mode.d.ts +87 -0
- package/dist/permission-mode.js +307 -0
- package/dist/permissions-cli.d.ts +13 -49
- package/dist/permissions-cli.js +154 -348
- package/dist/permissions.d.ts +148 -38
- package/dist/permissions.js +591 -45
- package/dist/post-install.d.ts +33 -0
- package/dist/post-install.js +127 -0
- package/dist/read-credential.d.ts +65 -0
- package/dist/read-credential.js +86 -0
- package/dist/registry/cli.js +5 -2
- package/dist/registry/config.d.ts +0 -17
- package/dist/registry/config.js +0 -23
- package/dist/registry/index.d.ts +1 -1
- package/dist/registry/index.js +2 -2
- package/dist/registry/manager.d.ts +4 -21
- package/dist/registry/manager.js +83 -55
- package/dist/runtime-credential.d.ts +140 -0
- package/dist/runtime-credential.js +572 -0
- package/dist/runtime.d.ts +408 -0
- package/dist/runtime.js +748 -0
- package/dist/setup.d.ts +23 -28
- package/dist/setup.js +57 -84
- package/dist/status-cli.d.ts +29 -13
- package/dist/status-cli.js +124 -144
- package/dist/status-data.d.ts +195 -0
- package/dist/status-data.js +333 -0
- package/dist/status-system.d.ts +24 -0
- package/dist/status-system.js +56 -0
- package/dist/subject.d.ts +126 -20
- package/dist/subject.js +215 -30
- package/dist/testing.d.ts +74 -38
- package/dist/testing.js +185 -68
- package/dist/tool-catalog.d.ts +53 -11
- package/dist/tool-catalog.js +164 -13
- package/dist/tool-metadata.d.ts +7 -6
- package/dist/tool-metadata.js +6 -5
- package/dist/types.d.ts +11 -1
- package/dist/uninstall.d.ts +74 -19
- package/dist/uninstall.js +224 -49
- package/dist/user-login.d.ts +22 -16
- package/dist/user-login.js +67 -96
- package/dist/watch-cli.d.ts +6 -0
- package/dist/watch-cli.js +217 -0
- package/package.json +3 -11
- package/dist/dev.d.ts +0 -103
- package/dist/dev.js +0 -584
- package/dist/interactive-setup.d.ts +0 -165
- package/dist/interactive-setup.js +0 -1546
- package/dist/local/jaeger-main.d.ts +0 -13
- package/dist/local/jaeger-main.js +0 -85
- package/dist/local/jaeger.d.ts +0 -50
- package/dist/local/jaeger.js +0 -162
- package/dist/otel/exporter.d.ts +0 -17
- package/dist/otel/exporter.js +0 -12
- package/dist/otel/index.d.ts +0 -2
- package/dist/otel/index.js +0 -8
- package/dist/otel/otlp.d.ts +0 -103
- package/dist/otel/otlp.js +0 -385
- package/dist/tracer.d.ts +0 -190
- package/dist/tracer.js +0 -481
- package/dist/watch-sandbox.d.ts +0 -9
- package/dist/watch-sandbox.js +0 -81
package/dist/config.d.ts
CHANGED
|
@@ -12,11 +12,13 @@ export interface OryOAuth2Tokens {
|
|
|
12
12
|
expiresAt: number;
|
|
13
13
|
/** Subject (sub claim) the token was issued for. */
|
|
14
14
|
subject?: string;
|
|
15
|
-
/** Client ID the token was issued under. */
|
|
15
|
+
/** Client ID the token was issued under. In-memory only. */
|
|
16
16
|
clientId?: string;
|
|
17
|
-
/**
|
|
17
|
+
/** @deprecated Accepted in memory for older callers; never persisted. */
|
|
18
18
|
idToken?: string;
|
|
19
|
-
/**
|
|
19
|
+
/** Bounded display claim extracted before the ID token is discarded. In-memory only. */
|
|
20
|
+
displayName?: string;
|
|
21
|
+
/** Scope string returned by the token endpoint. In-memory only. */
|
|
20
22
|
scope?: string;
|
|
21
23
|
}
|
|
22
24
|
/** Credentials for the human user principal (interactive login). */
|
|
@@ -26,10 +28,29 @@ export interface OryUserCredentials {
|
|
|
26
28
|
}
|
|
27
29
|
/**
|
|
28
30
|
* Credentials returned by an OAuth2 Dynamic Client Registration flow
|
|
29
|
-
* (RFC 7591). Persisted
|
|
30
|
-
*
|
|
31
|
-
* every session.
|
|
31
|
+
* (RFC 7591). Persisted by harness and session so separate hook processes in
|
|
32
|
+
* one session reuse its identity without sharing it with another session.
|
|
32
33
|
*/
|
|
34
|
+
/**
|
|
35
|
+
* The delegation edge recorded on a dynamically-registered OAuth2 client's
|
|
36
|
+
* `metadata` at registration time (see {@link OryAgentDynamicCredentials.delegation}).
|
|
37
|
+
*
|
|
38
|
+
* This compact local binding lets later processes validate which principal
|
|
39
|
+
* registered the credential and recover the delegator when no live principal
|
|
40
|
+
* is available. Ory's public DCR endpoint does not accept arbitrary metadata.
|
|
41
|
+
*/
|
|
42
|
+
export interface OryDelegationRecord {
|
|
43
|
+
/** The delegator, as a namespaced subject: `user:<sub>` or `agent:<sub>`. */
|
|
44
|
+
delegatedBy: string;
|
|
45
|
+
/** Which edge of the chain this client sits on. */
|
|
46
|
+
delegationType: "user-to-agent" | "agent-to-subagent";
|
|
47
|
+
/** Harness the delegation was established under (audit aid). */
|
|
48
|
+
harness?: string;
|
|
49
|
+
/** Sub-agent type, present only for `agent-to-subagent`. */
|
|
50
|
+
subAgentType?: string;
|
|
51
|
+
/** ISO-8601 timestamp the delegation was stamped. */
|
|
52
|
+
delegatedAt: string;
|
|
53
|
+
}
|
|
33
54
|
export interface OryAgentDynamicCredentials {
|
|
34
55
|
/** Issued client_id. */
|
|
35
56
|
clientId: string;
|
|
@@ -45,33 +66,114 @@ export interface OryAgentDynamicCredentials {
|
|
|
45
66
|
projectUrl: string;
|
|
46
67
|
/** Harness name baked into the client_name (audit aid). */
|
|
47
68
|
harness?: string;
|
|
69
|
+
/**
|
|
70
|
+
* The human-readable OAuth2 `client_name` this registration was issued
|
|
71
|
+
* under (e.g. `"Ory Agent Security · agent · claude-code @ host"`). Kept only
|
|
72
|
+
* on a fresh registration response for immediate display; never persisted.
|
|
73
|
+
* Later callers reconstruct a best-effort name from the outer harness key.
|
|
74
|
+
*/
|
|
75
|
+
clientName?: string;
|
|
76
|
+
/**
|
|
77
|
+
* The delegation edge recorded for this client at registration. Persisted
|
|
78
|
+
* here in local config only — Ory's public DCR endpoint rejects a `metadata`
|
|
79
|
+
* field, so it is never stored server-side. Absent when the delegator wasn't
|
|
80
|
+
* known at registration time (e.g. DCR bootstrapped from an out-of-band
|
|
81
|
+
* initial access token with no user/agent principal).
|
|
82
|
+
*/
|
|
83
|
+
delegation?: OryDelegationRecord;
|
|
84
|
+
/**
|
|
85
|
+
* The delegation node ids the agent-security broker returned for this agent's
|
|
86
|
+
* `user → agent` edge, **keyed by session**.
|
|
87
|
+
*
|
|
88
|
+
* Persisted at session start so a later sub-agent registration — which may run
|
|
89
|
+
* in a separate subprocess with no live agent principal — can pass the node id
|
|
90
|
+
* verbatim as `delegated_by` when recording the `agent → subagent` edge,
|
|
91
|
+
* without the plugin re-deriving the server's join-key encoding.
|
|
92
|
+
*
|
|
93
|
+
* Kept as a map for compatibility with credentials written by the earlier
|
|
94
|
+
* install-scoped model. A session-scoped credential normally contains only
|
|
95
|
+
* its own entry.
|
|
96
|
+
*
|
|
97
|
+
* Server-assigned and opaque to the plugin — never parsed, only echoed.
|
|
98
|
+
*/
|
|
99
|
+
delegationNodeIds?: Record<string, string>;
|
|
48
100
|
}
|
|
49
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* How many sessions' delegation node ids to keep per credential. Only the
|
|
103
|
+
* current session's is ever read; the rest are kept as a small audit tail and
|
|
104
|
+
* bounded so a long-lived install's config doesn't grow without limit.
|
|
105
|
+
*/
|
|
106
|
+
export declare const DELEGATION_NODE_HISTORY = 10;
|
|
107
|
+
/**
|
|
108
|
+
* Credentials for the AI agent principal (machine identity). Every harness
|
|
109
|
+
* session owns a distinct DCR client, and every typed sub-agent in that session
|
|
110
|
+
* owns a distinct child client.
|
|
111
|
+
*/
|
|
50
112
|
export interface OryAgentCredentialsBlock {
|
|
51
|
-
/** Per-install credentials issued via dynamic client registration. */
|
|
52
|
-
dynamic?: OryAgentDynamicCredentials;
|
|
53
113
|
/**
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
*
|
|
114
|
+
* Agent credentials keyed by harness then session.
|
|
115
|
+
*/
|
|
116
|
+
dynamic?: Record<string, Record<string, OryAgentDynamicCredentials>>;
|
|
117
|
+
/**
|
|
118
|
+
* Sub-agent registrations keyed by harness, session, then type.
|
|
59
119
|
*/
|
|
60
|
-
subAgents?: Record<string, OryAgentDynamicCredentials
|
|
120
|
+
subAgents?: Record<string, Record<string, Record<string, OryAgentDynamicCredentials>>>;
|
|
121
|
+
/**
|
|
122
|
+
* Aged-out or superseded registrations queued for best-effort RFC 7592
|
|
123
|
+
* revocation. Failed revocations remain here for a later session to retry.
|
|
124
|
+
*/
|
|
125
|
+
retired?: OryAgentDynamicCredentials[];
|
|
61
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Key used when a credential record carries no harness of its own — only
|
|
129
|
+
* reachable by migrating a config written before credentials were keyed by
|
|
130
|
+
* harness, where the `harness` field had never been persisted. Such a record
|
|
131
|
+
* is never re-used (no harness matches it), but it stays addressable so
|
|
132
|
+
* uninstall can still revoke the server-side client rather than orphaning it.
|
|
133
|
+
*/
|
|
134
|
+
export declare const UNKNOWN_HARNESS_KEY = "unknown";
|
|
135
|
+
/**
|
|
136
|
+
* Session key for a caller with no session concept — an Agent SDK integration
|
|
137
|
+
* embedded in a long-running service, or a one-off script. Such a caller gets
|
|
138
|
+
* one stable identity under this key rather than a new client per call, which
|
|
139
|
+
* is the only sensible reading of "per session" when there are no sessions.
|
|
140
|
+
* Credentials migrated from a config written before session keying also land
|
|
141
|
+
* here: the session they belonged to is not recoverable, but the record stays
|
|
142
|
+
* addressable so uninstall can revoke it.
|
|
143
|
+
*/
|
|
144
|
+
export declare const SESSIONLESS_KEY = "sessionless";
|
|
62
145
|
/**
|
|
63
146
|
* What the plugin does when a permission check returns deny.
|
|
64
147
|
*
|
|
65
|
-
* - `observe` — log the denial, emit a `permission.observe_deny`
|
|
148
|
+
* - `observe` — log the denial, emit a `permission.observe_deny` activity event,
|
|
66
149
|
* allow the tool through. The onboarding default: first-time users
|
|
67
150
|
* see what Ory would block, without being blocked.
|
|
68
151
|
* - `enforce` — block the tool. The production posture.
|
|
69
152
|
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
153
|
+
* Only meaningful while Agent Security is connected (see
|
|
154
|
+
* {@link resolveConfig}); with no project URL no checks run at all, so there is
|
|
155
|
+
* no deny to have a posture about.
|
|
73
156
|
*/
|
|
74
157
|
export type PermissionMode = "observe" | "enforce";
|
|
158
|
+
/**
|
|
159
|
+
* The last permission mode read from the server, cached locally so the
|
|
160
|
+
* synchronous config read reflects it across process restarts and survives a
|
|
161
|
+
* temporary loss of connectivity. Written only by the server-read path (see
|
|
162
|
+
* `permission-mode.ts`); never set by hand — the mode is admin-controlled on the
|
|
163
|
+
* Ory project, not locally.
|
|
164
|
+
*/
|
|
165
|
+
export interface PermissionModeCache {
|
|
166
|
+
mode: PermissionMode;
|
|
167
|
+
/** Unix epoch ms when this value was last read from the server. */
|
|
168
|
+
fetchedAt: number;
|
|
169
|
+
/** Project this posture was read from. Absent only on legacy scalar caches. */
|
|
170
|
+
projectUrl?: string;
|
|
171
|
+
/** Per-project/principal values used to avoid applying one scope's fallback to another. */
|
|
172
|
+
scopes?: Record<string, {
|
|
173
|
+
mode: PermissionMode;
|
|
174
|
+
fetchedAt: number;
|
|
175
|
+
}>;
|
|
176
|
+
}
|
|
75
177
|
export interface OryPluginConfig {
|
|
76
178
|
/**
|
|
77
179
|
* Ory project API URL — the SDK base path all API calls target. The Ory
|
|
@@ -79,6 +181,12 @@ export interface OryPluginConfig {
|
|
|
79
181
|
* name is accepted as an alias for `ORY_PROJECT_URL` (see {@link resolveConfig}).
|
|
80
182
|
*/
|
|
81
183
|
projectUrl?: string;
|
|
184
|
+
/**
|
|
185
|
+
* Canonical Ory Agent Security broker URL. Broker calls resolve this value
|
|
186
|
+
* independently from {@link projectUrl}, which remains the OAuth2/DCR origin.
|
|
187
|
+
* Older configs fall back to `projectUrl` until this key is persisted.
|
|
188
|
+
*/
|
|
189
|
+
agentSecurityUrl?: string;
|
|
82
190
|
/**
|
|
83
191
|
* Ory project UUID — the other half of the Console "Get Started" pair
|
|
84
192
|
* (`ORY_PROJECT_ID`). Persisted by the interactive installer because the
|
|
@@ -88,42 +196,53 @@ export interface OryPluginConfig {
|
|
|
88
196
|
* never be substituted for a slug when building it.
|
|
89
197
|
*/
|
|
90
198
|
projectId?: string;
|
|
91
|
-
|
|
199
|
+
/**
|
|
200
|
+
* Human-readable project and workspace names, captured at install time for
|
|
201
|
+
* display only (e.g. the dashboard's connected-stack card). Not used to
|
|
202
|
+
* address any API — {@link projectUrl} / {@link projectId} do that.
|
|
203
|
+
*/
|
|
204
|
+
projectName?: string;
|
|
205
|
+
workspaceName?: string;
|
|
206
|
+
/** Opaque broker node ids keyed by harness and session. Contains no credentials. */
|
|
207
|
+
delegationAnchors?: Record<string, Record<string, string>>;
|
|
92
208
|
/**
|
|
93
209
|
* Public OAuth2 client id used by the user PKCE browser flow when
|
|
94
|
-
*
|
|
210
|
+
* the interactive user login runs (every session). The client must be registered ahead of time
|
|
95
211
|
* in the Ory project with all four loopback redirect URIs
|
|
96
212
|
* (`http://127.0.0.1:47823..47826/callback`) and
|
|
97
213
|
* `token_endpoint_auth_method=none`. The local stack provisions one
|
|
98
|
-
* automatically;
|
|
99
|
-
*
|
|
214
|
+
* automatically; hosted Agent Security uses the reserved
|
|
215
|
+
* `ory-agent-security-login` client by default. Custom deployments can
|
|
216
|
+
* override the id here or through `ORY_OAUTH2_CLIENT_ID`.
|
|
100
217
|
*/
|
|
101
218
|
oauth2ClientId?: string;
|
|
102
|
-
/** When true, only audit logging is enabled — no auth or permission checks. */
|
|
103
|
-
auditOnly?: boolean;
|
|
104
219
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
220
|
+
* The last permission mode read from the Ory project, cached locally. The
|
|
221
|
+
* mode itself is admin-controlled server-side (a Keto permission — see
|
|
222
|
+
* `permission-mode.ts`); this is only a cache so the value survives restarts
|
|
223
|
+
* and brief loss of connectivity. Not user-settable.
|
|
108
224
|
*/
|
|
109
|
-
|
|
225
|
+
permissionModeCache?: PermissionModeCache;
|
|
110
226
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
227
|
+
* Overrides the namespace the human user is addressed under in permission
|
|
228
|
+
* checks. Users are always addressed as a SubjectSet `<namespace>:<subject>`;
|
|
229
|
+
* this only changes the namespace (default `User`) and must match how the
|
|
230
|
+
* tuples were written in Keto. The local stack seeds tuples as `User:<id>`,
|
|
231
|
+
* so the local-stack install path persists `"User"` here explicitly. The
|
|
232
|
+
* `ORY_USER_SUBJECT_NAMESPACE` env var overrides this. Unset ⇒ the `User`
|
|
233
|
+
* default.
|
|
116
234
|
*/
|
|
117
|
-
|
|
235
|
+
userSubjectNamespace?: string;
|
|
118
236
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
237
|
+
* Harness plugins currently installed against this shared config, e.g.
|
|
238
|
+
* `["claude-code", "codex"]`. Written by the install path (see
|
|
239
|
+
* `wireRuntime`) and pruned by `uninstall`, so uninstalling one plugin can
|
|
240
|
+
* tell whether it is the *last* consumer of the shared configuration — and
|
|
241
|
+
* therefore whether wiping it is safe. Absent on configs written before the
|
|
242
|
+
* registry existed; the uninstall path falls back to the harnesses evidenced
|
|
243
|
+
* by the runtime manifest and the persisted credentials.
|
|
125
244
|
*/
|
|
126
|
-
|
|
245
|
+
installedHarnesses?: string[];
|
|
127
246
|
/** Credentials for the human user (interactive PKCE login). */
|
|
128
247
|
user?: OryUserCredentials;
|
|
129
248
|
/** Credentials for the AI agent process (machine identity). */
|
|
@@ -160,13 +279,25 @@ export declare function getConfigPath(): string;
|
|
|
160
279
|
*/
|
|
161
280
|
export declare function loadConfig(): OryPluginConfig;
|
|
162
281
|
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
282
|
+
* The harness plugins recorded as installed against this shared config.
|
|
283
|
+
* Returns an empty array when nothing has been registered yet (which, on a
|
|
284
|
+
* config written before the registry existed, is not the same as "nothing is
|
|
285
|
+
* installed" — callers that must not over-read that should reconcile against
|
|
286
|
+
* the runtime manifest and persisted credentials; see
|
|
287
|
+
* `resolveInstalledHarnesses` in `uninstall.ts`).
|
|
288
|
+
*/
|
|
289
|
+
export declare function listInstalledHarnesses(): string[];
|
|
290
|
+
/**
|
|
291
|
+
* Record a harness plugin as installed. Idempotent — installing twice leaves
|
|
292
|
+
* one entry. Returns the full list after the addition.
|
|
293
|
+
*/
|
|
294
|
+
export declare function registerInstalledHarness(harness: string): string[];
|
|
295
|
+
/**
|
|
296
|
+
* Forget a harness plugin. Returns the harnesses still installed afterwards —
|
|
297
|
+
* what the uninstall path uses to decide whether the shared config is now
|
|
298
|
+
* unreferenced and safe to wipe.
|
|
168
299
|
*/
|
|
169
|
-
export declare function
|
|
300
|
+
export declare function unregisterInstalledHarness(harness: string): string[];
|
|
170
301
|
/**
|
|
171
302
|
* Save config to the config file. Merges with existing values — only
|
|
172
303
|
* provided fields are overwritten. Concurrent processes serialize via a
|
|
@@ -185,7 +316,7 @@ export declare function saveConfig(update: Partial<{
|
|
|
185
316
|
* Concurrent processes serialize on the lock; the write itself is
|
|
186
317
|
* atomic via write-temp + rename.
|
|
187
318
|
*/
|
|
188
|
-
export declare function mutateConfig(mutator: (current: OryPluginConfig) => OryPluginConfig): void;
|
|
319
|
+
export declare function mutateConfig(mutator: (current: OryPluginConfig) => OryPluginConfig | undefined): void;
|
|
189
320
|
/**
|
|
190
321
|
* True when `value` looks like an Ory project **id** (a UUID) rather than a
|
|
191
322
|
* project **slug**. Project slugs are human-readable tokens (e.g.
|
|
@@ -197,6 +328,49 @@ export declare function mutateConfig(mutator: (current: OryPluginConfig) => OryP
|
|
|
197
328
|
* base URL.
|
|
198
329
|
*/
|
|
199
330
|
export declare function looksLikeProjectId(value: string): boolean;
|
|
331
|
+
/**
|
|
332
|
+
* The values Agent Security needs, and whether all are present.
|
|
333
|
+
*
|
|
334
|
+
* This is the *only* thing that decides whether the security half of a plugin
|
|
335
|
+
* runs. There is no stored on/off flag and no env override: a plugin is
|
|
336
|
+
* connected exactly when it can address a project (`projectUrl`), reach the
|
|
337
|
+
* canonical broker (`agentSecurityUrl`, with a legacy project URL fallback),
|
|
338
|
+
* and complete the user's browser sign-in (`oauth2ClientId`). Anything less and the
|
|
339
|
+
* authentication gates, permission checks, and delegation recording all no-op.
|
|
340
|
+
*
|
|
341
|
+
* The developer-experience half — skills, commands, the local Ory stack, the
|
|
342
|
+
* MCP server, and local activity logging — is installed unconditionally and never
|
|
343
|
+
* consults this.
|
|
344
|
+
*/
|
|
345
|
+
export interface SecurityConnection {
|
|
346
|
+
/** True when all required values resolve (including the legacy broker fallback). */
|
|
347
|
+
connected: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* Which required values are missing, in the order a user should supply them.
|
|
350
|
+
* Empty when {@link connected} is true. Drives every "not connected because…"
|
|
351
|
+
* message so the reason is never guessed at the call site.
|
|
352
|
+
*/
|
|
353
|
+
missing: Array<"projectUrl" | "agentSecurityUrl" | "oauth2ClientId">;
|
|
354
|
+
}
|
|
355
|
+
/** Reserved public PKCE client provisioned by Ory Agent Security setup. */
|
|
356
|
+
export declare const DEFAULT_OAUTH2_CLIENT_ID = "ory-agent-security-login";
|
|
357
|
+
export declare const DEFAULT_AGENT_SECURITY_URL = "https://agents.console.ory.com";
|
|
358
|
+
export declare const LOCAL_AGENT_SECURITY_URL = "https://agents.console.ory:8080";
|
|
359
|
+
/**
|
|
360
|
+
* The one predicate the gates ask: is Agent Security connected?
|
|
361
|
+
*
|
|
362
|
+
* Shorthand for `resolveConfig().security.connected`, provided so the many
|
|
363
|
+
* call sites that only need the boolean read as a single question rather than
|
|
364
|
+
* a property walk. When this is false the plugin still runs — it just logs activity
|
|
365
|
+
* locally and gates nothing.
|
|
366
|
+
*/
|
|
367
|
+
export declare function isSecurityConnected(): boolean;
|
|
368
|
+
/**
|
|
369
|
+
* Render why Agent Security isn't running, e.g.
|
|
370
|
+
* `"missing --oauth2-client-id (ORY_OAUTH2_CLIENT_ID)"`. Returns undefined when
|
|
371
|
+
* it *is* connected, so callers can `?? "connected"` at the display site.
|
|
372
|
+
*/
|
|
373
|
+
export declare function describeSecurityGap(security?: SecurityConnection): string | undefined;
|
|
200
374
|
/**
|
|
201
375
|
* Resolve config by checking environment variables first, then the config file.
|
|
202
376
|
* Returns the merged result with the source of each value.
|
|
@@ -208,22 +382,40 @@ export declare function looksLikeProjectId(value: string): boolean;
|
|
|
208
382
|
*/
|
|
209
383
|
export declare function resolveConfig(): {
|
|
210
384
|
projectUrl?: string;
|
|
385
|
+
agentSecurityUrl?: string;
|
|
211
386
|
projectId?: string;
|
|
212
|
-
|
|
387
|
+
projectName?: string;
|
|
388
|
+
workspaceName?: string;
|
|
213
389
|
oauth2ClientId?: string;
|
|
214
|
-
|
|
390
|
+
/**
|
|
391
|
+
* Whether Agent Security runs, derived from the project and broker URLs. The
|
|
392
|
+
* OAuth2 client always resolves through an override or the reserved default.
|
|
393
|
+
* See {@link SecurityConnection}.
|
|
394
|
+
*/
|
|
395
|
+
security: SecurityConnection;
|
|
396
|
+
/**
|
|
397
|
+
* The permission mode as last read from the server and cached locally
|
|
398
|
+
* (`observe` when nothing is cached). The authoritative, live value is
|
|
399
|
+
* resolved per-check by `resolvePermissionMode`; this synchronous value is the
|
|
400
|
+
* cached fallback used by display surfaces and the MCP `applyPermissionMode`
|
|
401
|
+
* path.
|
|
402
|
+
*/
|
|
215
403
|
permissionMode: PermissionMode;
|
|
216
|
-
permissionModeSource: "
|
|
217
|
-
|
|
218
|
-
|
|
404
|
+
permissionModeSource: "server" | "cache" | "default";
|
|
405
|
+
/** The raw cache entry, exposing `fetchedAt` for freshness display. */
|
|
406
|
+
permissionModeCache?: PermissionModeCache;
|
|
219
407
|
userSubjectNamespace?: string;
|
|
220
408
|
userSubjectNamespaceSource: "env" | "config" | "none";
|
|
221
409
|
projectUrlSource: "env" | "config" | "none";
|
|
410
|
+
agentSecurityUrlSource: "env" | "config" | "projectUrl" | "default";
|
|
222
411
|
projectIdSource: "env" | "config" | "none";
|
|
223
|
-
|
|
224
|
-
oauth2ClientIdSource: "env" | "config" | "none";
|
|
412
|
+
oauth2ClientIdSource: "env" | "config" | "default";
|
|
225
413
|
};
|
|
226
414
|
/**
|
|
227
|
-
* Build the "not
|
|
415
|
+
* Build the "Agent Security is not connected" message for a harness CLI.
|
|
416
|
+
*
|
|
417
|
+
* Deliberately does not frame this as a degraded mode: the plugin is fully
|
|
418
|
+
* installed and its developer-experience half is working. The message states
|
|
419
|
+
* the one thing that is off and the values that turn it on.
|
|
228
420
|
*/
|
|
229
421
|
export declare function configPromptMessage(binName: string): string;
|