@ory/argus 0.14.0 → 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 -46
- 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 +39 -91
- package/assets/skills/ory-e2b-sandbox/SKILL.md +18 -17
- package/assets/skills/ory-temporal-worker/SKILL.md +31 -33
- package/assets/skills/permissions-onboarding/SKILL.md +131 -104
- package/dist/adapters.d.ts +88 -32
- package/dist/adapters.js +443 -164
- package/dist/agent-auth.d.ts +226 -67
- package/dist/agent-auth.js +951 -205
- package/dist/auth-store.d.ts +37 -2
- package/dist/auth-store.js +37 -3
- package/dist/auth.d.ts +33 -4
- package/dist/auth.js +163 -20
- package/dist/bash-parser.d.ts +98 -0
- package/dist/bash-parser.js +396 -0
- package/dist/branding.d.ts +77 -16
- package/dist/branding.js +93 -23
- 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 -239
- package/dist/client.d.ts +175 -138
- package/dist/client.js +672 -391
- package/dist/config.d.ts +217 -54
- package/dist/config.js +461 -42
- package/dist/context.d.ts +10 -0
- package/dist/context.js +21 -0
- package/dist/contract-suite.d.ts +3 -5
- package/dist/contract-suite.js +75 -47
- 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 +28 -23
- package/dist/index.js +173 -58
- 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.js +7 -7
- 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 +159 -36
- package/dist/local/ports.d.ts +158 -0
- package/dist/local/ports.js +443 -0
- package/dist/local/seed.d.ts +13 -5
- package/dist/local/seed.js +62 -38
- 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 +21 -37
- 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 -47
- package/dist/setup.js +59 -116
- package/dist/skills.js +0 -7
- package/dist/status-cli.d.ts +27 -11
- package/dist/status-cli.js +121 -115
- package/dist/status-data.d.ts +116 -17
- package/dist/status-data.js +121 -38
- 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 +71 -34
- package/dist/uninstall.js +217 -85
- package/dist/user-login.d.ts +9 -10
- package/dist/user-login.js +56 -75
- package/dist/watch-cli.d.ts +6 -0
- package/dist/watch-cli.js +217 -0
- package/package.json +4 -27
- package/assets/commands/dashboard.md +0 -34
- package/dist/dashboard-cli.d.ts +0 -8
- package/dist/dashboard-cli.js +0 -70
- package/dist/dev.d.ts +0 -103
- package/dist/dev.js +0 -583
- package/dist/interactive-setup.d.ts +0 -286
- package/dist/interactive-setup.js +0 -1734
- 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/project-api-key.d.ts +0 -69
- package/dist/project-api-key.js +0 -147
- package/dist/setup-actions.d.ts +0 -232
- package/dist/setup-actions.js +0 -507
- 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/web/api.d.ts +0 -33
- package/dist/web/api.js +0 -294
- package/dist/web/launch.d.ts +0 -11
- package/dist/web/launch.js +0 -96
- package/dist/web/server.d.ts +0 -20
- package/dist/web/server.js +0 -233
- package/dist/web/types.d.ts +0 -65
- package/dist/web/types.js +0 -2
- package/dist/webapp/assets/index-Wucl4SZs.css +0 -1
- package/dist/webapp/assets/index-m-GtEdq0.js +0 -49
- package/dist/webapp/favicon.ico +0 -0
- package/dist/webapp/index.html +0 -15
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,18 +28,16 @@ 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
|
*/
|
|
33
34
|
/**
|
|
34
35
|
* The delegation edge recorded on a dynamically-registered OAuth2 client's
|
|
35
36
|
* `metadata` at registration time (see {@link OryAgentDynamicCredentials.delegation}).
|
|
36
37
|
*
|
|
37
|
-
* This
|
|
38
|
-
* the
|
|
39
|
-
*
|
|
40
|
-
* tuple rebuilt — even if the tuple is lost, corrupted, or never written.
|
|
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
41
|
*/
|
|
42
42
|
export interface OryDelegationRecord {
|
|
43
43
|
/** The delegator, as a namespaced subject: `user:<sub>` or `agent:<sub>`. */
|
|
@@ -66,6 +66,13 @@ export interface OryAgentDynamicCredentials {
|
|
|
66
66
|
projectUrl: string;
|
|
67
67
|
/** Harness name baked into the client_name (audit aid). */
|
|
68
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;
|
|
69
76
|
/**
|
|
70
77
|
* The delegation edge recorded for this client at registration. Persisted
|
|
71
78
|
* here in local config only — Ory's public DCR endpoint rejects a `metadata`
|
|
@@ -74,33 +81,99 @@ export interface OryAgentDynamicCredentials {
|
|
|
74
81
|
* initial access token with no user/agent principal).
|
|
75
82
|
*/
|
|
76
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>;
|
|
77
100
|
}
|
|
78
|
-
/**
|
|
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
|
+
*/
|
|
79
112
|
export interface OryAgentCredentialsBlock {
|
|
80
|
-
/** Per-install credentials issued via dynamic client registration. */
|
|
81
|
-
dynamic?: OryAgentDynamicCredentials;
|
|
82
113
|
/**
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
*
|
|
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.
|
|
88
119
|
*/
|
|
89
|
-
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[];
|
|
90
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";
|
|
91
145
|
/**
|
|
92
146
|
* What the plugin does when a permission check returns deny.
|
|
93
147
|
*
|
|
94
|
-
* - `observe` — log the denial, emit a `permission.observe_deny`
|
|
148
|
+
* - `observe` — log the denial, emit a `permission.observe_deny` activity event,
|
|
95
149
|
* allow the tool through. The onboarding default: first-time users
|
|
96
150
|
* see what Ory would block, without being blocked.
|
|
97
151
|
* - `enforce` — block the tool. The production posture.
|
|
98
152
|
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
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.
|
|
102
156
|
*/
|
|
103
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
|
+
}
|
|
104
177
|
export interface OryPluginConfig {
|
|
105
178
|
/**
|
|
106
179
|
* Ory project API URL — the SDK base path all API calls target. The Ory
|
|
@@ -108,6 +181,12 @@ export interface OryPluginConfig {
|
|
|
108
181
|
* name is accepted as an alias for `ORY_PROJECT_URL` (see {@link resolveConfig}).
|
|
109
182
|
*/
|
|
110
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;
|
|
111
190
|
/**
|
|
112
191
|
* Ory project UUID — the other half of the Console "Get Started" pair
|
|
113
192
|
* (`ORY_PROJECT_ID`). Persisted by the interactive installer because the
|
|
@@ -124,43 +203,46 @@ export interface OryPluginConfig {
|
|
|
124
203
|
*/
|
|
125
204
|
projectName?: string;
|
|
126
205
|
workspaceName?: string;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
* Token id of the project API key stored in {@link apiKey}, captured when the
|
|
130
|
-
* installer mints the key via the Ory Console API. Ory only returns a key's
|
|
131
|
-
* secret at creation and deletion addresses the token by id (not by its
|
|
132
|
-
* secret value), so the id is persisted here purely so `uninstall` can delete
|
|
133
|
-
* the key server-side. Absent for keys minted before id-tracking, or supplied
|
|
134
|
-
* by hand via `configure --api-key`.
|
|
135
|
-
*/
|
|
136
|
-
apiKeyId?: string;
|
|
206
|
+
/** Opaque broker node ids keyed by harness and session. Contains no credentials. */
|
|
207
|
+
delegationAnchors?: Record<string, Record<string, string>>;
|
|
137
208
|
/**
|
|
138
209
|
* Public OAuth2 client id used by the user PKCE browser flow when
|
|
139
210
|
* the interactive user login runs (every session). The client must be registered ahead of time
|
|
140
211
|
* in the Ory project with all four loopback redirect URIs
|
|
141
212
|
* (`http://127.0.0.1:47823..47826/callback`) and
|
|
142
213
|
* `token_endpoint_auth_method=none`. The local stack provisions one
|
|
143
|
-
* automatically;
|
|
144
|
-
*
|
|
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`.
|
|
145
217
|
*/
|
|
146
218
|
oauth2ClientId?: string;
|
|
147
|
-
/** When true, only audit logging is enabled — no auth or permission checks. */
|
|
148
|
-
auditOnly?: boolean;
|
|
149
219
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
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.
|
|
153
224
|
*/
|
|
154
|
-
|
|
225
|
+
permissionModeCache?: PermissionModeCache;
|
|
155
226
|
/**
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* were written in Keto. The local stack seeds tuples as `User:<id>`,
|
|
160
|
-
* local-stack install path persists `"User"` here
|
|
161
|
-
*
|
|
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.
|
|
162
234
|
*/
|
|
163
235
|
userSubjectNamespace?: string;
|
|
236
|
+
/**
|
|
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.
|
|
244
|
+
*/
|
|
245
|
+
installedHarnesses?: string[];
|
|
164
246
|
/** Credentials for the human user (interactive PKCE login). */
|
|
165
247
|
user?: OryUserCredentials;
|
|
166
248
|
/** Credentials for the AI agent process (machine identity). */
|
|
@@ -196,6 +278,26 @@ export declare function getConfigPath(): string;
|
|
|
196
278
|
* does not exist or is invalid.
|
|
197
279
|
*/
|
|
198
280
|
export declare function loadConfig(): OryPluginConfig;
|
|
281
|
+
/**
|
|
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.
|
|
299
|
+
*/
|
|
300
|
+
export declare function unregisterInstalledHarness(harness: string): string[];
|
|
199
301
|
/**
|
|
200
302
|
* Save config to the config file. Merges with existing values — only
|
|
201
303
|
* provided fields are overwritten. Concurrent processes serialize via a
|
|
@@ -214,7 +316,7 @@ export declare function saveConfig(update: Partial<{
|
|
|
214
316
|
* Concurrent processes serialize on the lock; the write itself is
|
|
215
317
|
* atomic via write-temp + rename.
|
|
216
318
|
*/
|
|
217
|
-
export declare function mutateConfig(mutator: (current: OryPluginConfig) => OryPluginConfig): void;
|
|
319
|
+
export declare function mutateConfig(mutator: (current: OryPluginConfig) => OryPluginConfig | undefined): void;
|
|
218
320
|
/**
|
|
219
321
|
* True when `value` looks like an Ory project **id** (a UUID) rather than a
|
|
220
322
|
* project **slug**. Project slugs are human-readable tokens (e.g.
|
|
@@ -226,6 +328,49 @@ export declare function mutateConfig(mutator: (current: OryPluginConfig) => OryP
|
|
|
226
328
|
* base URL.
|
|
227
329
|
*/
|
|
228
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;
|
|
229
374
|
/**
|
|
230
375
|
* Resolve config by checking environment variables first, then the config file.
|
|
231
376
|
* Returns the merged result with the source of each value.
|
|
@@ -237,22 +382,40 @@ export declare function looksLikeProjectId(value: string): boolean;
|
|
|
237
382
|
*/
|
|
238
383
|
export declare function resolveConfig(): {
|
|
239
384
|
projectUrl?: string;
|
|
385
|
+
agentSecurityUrl?: string;
|
|
240
386
|
projectId?: string;
|
|
241
387
|
projectName?: string;
|
|
242
388
|
workspaceName?: string;
|
|
243
|
-
apiKey?: string;
|
|
244
389
|
oauth2ClientId?: string;
|
|
245
|
-
|
|
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
|
+
*/
|
|
246
403
|
permissionMode: PermissionMode;
|
|
247
|
-
permissionModeSource: "
|
|
404
|
+
permissionModeSource: "server" | "cache" | "default";
|
|
405
|
+
/** The raw cache entry, exposing `fetchedAt` for freshness display. */
|
|
406
|
+
permissionModeCache?: PermissionModeCache;
|
|
248
407
|
userSubjectNamespace?: string;
|
|
249
408
|
userSubjectNamespaceSource: "env" | "config" | "none";
|
|
250
409
|
projectUrlSource: "env" | "config" | "none";
|
|
410
|
+
agentSecurityUrlSource: "env" | "config" | "projectUrl" | "default";
|
|
251
411
|
projectIdSource: "env" | "config" | "none";
|
|
252
|
-
|
|
253
|
-
oauth2ClientIdSource: "env" | "config" | "none";
|
|
412
|
+
oauth2ClientIdSource: "env" | "config" | "default";
|
|
254
413
|
};
|
|
255
414
|
/**
|
|
256
|
-
* 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.
|
|
257
420
|
*/
|
|
258
421
|
export declare function configPromptMessage(binName: string): string;
|