@ory/argus 0.14.0 → 1.0.1
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 +413 -0
- package/dist/runtime.js +825 -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
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `deregister-external` — replay every recorded foreign-tool removal.
|
|
4
|
+
*
|
|
5
|
+
* Run by `pnpm clean:all` before it deletes the data dir, so wiping our own
|
|
6
|
+
* state never leaves another tool pointing at a directory that is gone (#206).
|
|
7
|
+
* Always exits 0: this is cleanup in front of a destructive step that is going
|
|
8
|
+
* to happen regardless.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* `deregister-external` — replay every recorded foreign-tool removal.
|
|
5
|
+
*
|
|
6
|
+
* Run by `pnpm clean:all` before it deletes the data dir, so wiping our own
|
|
7
|
+
* state never leaves another tool pointing at a directory that is gone (#206).
|
|
8
|
+
* Always exits 0: this is cleanup in front of a destructive step that is going
|
|
9
|
+
* to happen regardless.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const external_registrations_js_1 = require("./external-registrations.js");
|
|
13
|
+
function main() {
|
|
14
|
+
const pending = (0, external_registrations_js_1.loadExternalRegistrations)();
|
|
15
|
+
if (pending.length === 0) {
|
|
16
|
+
console.log("[ory] No external registrations to remove.");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
for (const result of (0, external_registrations_js_1.deregisterExternalRegistrations)()) {
|
|
20
|
+
if (result.ok) {
|
|
21
|
+
console.log(`[ory] Deregistered ${result.registration.description}.`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
console.warn(`[ory] Could not deregister ${result.registration.description}: ${result.detail}. ` +
|
|
25
|
+
`Remove it by hand with: ${[
|
|
26
|
+
result.registration.remove.command,
|
|
27
|
+
...result.registration.remove.args,
|
|
28
|
+
].join(" ")}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
main();
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
console.warn(`[ory] External deregistration failed: ${err.message}`);
|
|
37
|
+
}
|
|
38
|
+
process.exit(0);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registrations we have made in *another tool's* config that point back into
|
|
3
|
+
* our data dir.
|
|
4
|
+
*
|
|
5
|
+
* Two harnesses do this today: Codex and Claude Code both assemble a plugin
|
|
6
|
+
* marketplace under `<dataDir>/<harness>/` and hand that **path** to the
|
|
7
|
+
* harness CLI, which stores it and re-reads it on every run.
|
|
8
|
+
*
|
|
9
|
+
* That makes the data dir load-bearing for a foreign tool, and removing it
|
|
10
|
+
* without deregistering first leaves that tool pointing at a directory which no
|
|
11
|
+
* longer exists. For Codex the blast radius is the whole `codex plugin`
|
|
12
|
+
* surface, including plugins that have nothing to do with Ory:
|
|
13
|
+
*
|
|
14
|
+
* ```
|
|
15
|
+
* $ codex plugin list
|
|
16
|
+
* Error: failed to load configured marketplace snapshot(s):
|
|
17
|
+
* - `ory` at ~/.config/ory-agent-plugins/codex/marketplace: marketplace root
|
|
18
|
+
* does not contain a supported manifest
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* The ordinary `uninstall` path deregisters correctly. The problem is every
|
|
22
|
+
* path that removes the data dir *without* going through it — `pnpm clean:all`
|
|
23
|
+
* or a user clearing the directory by hand. Removing our own state should never
|
|
24
|
+
* leave someone else's tool broken (#206).
|
|
25
|
+
*
|
|
26
|
+
* So each plugin records how to undo its registration, and the destructive
|
|
27
|
+
* paths replay those removals **before** deleting anything. The record is
|
|
28
|
+
* deliberately a plain command rather than a callback: the code that could run
|
|
29
|
+
* it may itself be inside the directory about to be deleted.
|
|
30
|
+
*/
|
|
31
|
+
export interface ExternalRegistration {
|
|
32
|
+
/** The harness that made the registration. One record per harness. */
|
|
33
|
+
harness: string;
|
|
34
|
+
/** The foreign tool holding the reference (`codex`, `claude`). */
|
|
35
|
+
tool: string;
|
|
36
|
+
/** Human-readable summary, shown when the removal runs. */
|
|
37
|
+
description: string;
|
|
38
|
+
/** Path inside our data dir that the foreign tool points at. */
|
|
39
|
+
root: string;
|
|
40
|
+
/** Argv that removes the registration from the foreign tool. */
|
|
41
|
+
remove: {
|
|
42
|
+
command: string;
|
|
43
|
+
args: string[];
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** Every registration currently recorded. */
|
|
47
|
+
export declare function loadExternalRegistrations(): ExternalRegistration[];
|
|
48
|
+
/**
|
|
49
|
+
* Record (or refresh) the registration for a harness. Idempotent: re-running an
|
|
50
|
+
* install replaces the harness's entry rather than appending a duplicate.
|
|
51
|
+
*/
|
|
52
|
+
export declare function recordExternalRegistration(entry: ExternalRegistration): void;
|
|
53
|
+
/** Forget a harness's registration, after it has been deregistered. */
|
|
54
|
+
export declare function clearExternalRegistration(harness: string): void;
|
|
55
|
+
export interface DeregisterResult {
|
|
56
|
+
registration: ExternalRegistration;
|
|
57
|
+
ok: boolean;
|
|
58
|
+
detail?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Replay every recorded removal. Call this **before** deleting the data dir.
|
|
62
|
+
*
|
|
63
|
+
* Entirely best-effort: a foreign tool that is no longer installed, or that
|
|
64
|
+
* fails the removal, must not stop the reset that is in progress. Results are
|
|
65
|
+
* returned so the caller can report what happened.
|
|
66
|
+
*/
|
|
67
|
+
export declare function deregisterExternalRegistrations(): DeregisterResult[];
|
|
68
|
+
/** Drop the whole registry (the data dir is about to go anyway). */
|
|
69
|
+
export declare function clearAllExternalRegistrations(): void;
|
|
70
|
+
/**
|
|
71
|
+
* A registration whose target directory has gone missing — the foreign tool is
|
|
72
|
+
* pointing at nothing, which is the state that breaks it.
|
|
73
|
+
*
|
|
74
|
+
* `status` uses this to say what happened and how to fix it, instead of leaving
|
|
75
|
+
* the user to decode an error from a tool that never mentions Ory.
|
|
76
|
+
*/
|
|
77
|
+
export declare function findDanglingRegistration(harness: string): ExternalRegistration | undefined;
|
|
78
|
+
/** One-line remediation for a dangling registration, for `status` output. */
|
|
79
|
+
export declare function describeDanglingRegistration(registration: ExternalRegistration): string;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Registrations we have made in *another tool's* config that point back into
|
|
4
|
+
* our data dir.
|
|
5
|
+
*
|
|
6
|
+
* Two harnesses do this today: Codex and Claude Code both assemble a plugin
|
|
7
|
+
* marketplace under `<dataDir>/<harness>/` and hand that **path** to the
|
|
8
|
+
* harness CLI, which stores it and re-reads it on every run.
|
|
9
|
+
*
|
|
10
|
+
* That makes the data dir load-bearing for a foreign tool, and removing it
|
|
11
|
+
* without deregistering first leaves that tool pointing at a directory which no
|
|
12
|
+
* longer exists. For Codex the blast radius is the whole `codex plugin`
|
|
13
|
+
* surface, including plugins that have nothing to do with Ory:
|
|
14
|
+
*
|
|
15
|
+
* ```
|
|
16
|
+
* $ codex plugin list
|
|
17
|
+
* Error: failed to load configured marketplace snapshot(s):
|
|
18
|
+
* - `ory` at ~/.config/ory-agent-plugins/codex/marketplace: marketplace root
|
|
19
|
+
* does not contain a supported manifest
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* The ordinary `uninstall` path deregisters correctly. The problem is every
|
|
23
|
+
* path that removes the data dir *without* going through it — `pnpm clean:all`
|
|
24
|
+
* or a user clearing the directory by hand. Removing our own state should never
|
|
25
|
+
* leave someone else's tool broken (#206).
|
|
26
|
+
*
|
|
27
|
+
* So each plugin records how to undo its registration, and the destructive
|
|
28
|
+
* paths replay those removals **before** deleting anything. The record is
|
|
29
|
+
* deliberately a plain command rather than a callback: the code that could run
|
|
30
|
+
* it may itself be inside the directory about to be deleted.
|
|
31
|
+
*/
|
|
32
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
33
|
+
if (k2 === undefined) k2 = k;
|
|
34
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
35
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
36
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
37
|
+
}
|
|
38
|
+
Object.defineProperty(o, k2, desc);
|
|
39
|
+
}) : (function(o, m, k, k2) {
|
|
40
|
+
if (k2 === undefined) k2 = k;
|
|
41
|
+
o[k2] = m[k];
|
|
42
|
+
}));
|
|
43
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
44
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
45
|
+
}) : function(o, v) {
|
|
46
|
+
o["default"] = v;
|
|
47
|
+
});
|
|
48
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
49
|
+
var ownKeys = function(o) {
|
|
50
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
51
|
+
var ar = [];
|
|
52
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
53
|
+
return ar;
|
|
54
|
+
};
|
|
55
|
+
return ownKeys(o);
|
|
56
|
+
};
|
|
57
|
+
return function (mod) {
|
|
58
|
+
if (mod && mod.__esModule) return mod;
|
|
59
|
+
var result = {};
|
|
60
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
61
|
+
__setModuleDefault(result, mod);
|
|
62
|
+
return result;
|
|
63
|
+
};
|
|
64
|
+
})();
|
|
65
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
+
exports.loadExternalRegistrations = loadExternalRegistrations;
|
|
67
|
+
exports.recordExternalRegistration = recordExternalRegistration;
|
|
68
|
+
exports.clearExternalRegistration = clearExternalRegistration;
|
|
69
|
+
exports.deregisterExternalRegistrations = deregisterExternalRegistrations;
|
|
70
|
+
exports.clearAllExternalRegistrations = clearAllExternalRegistrations;
|
|
71
|
+
exports.findDanglingRegistration = findDanglingRegistration;
|
|
72
|
+
exports.describeDanglingRegistration = describeDanglingRegistration;
|
|
73
|
+
const fs = __importStar(require("node:fs"));
|
|
74
|
+
const path = __importStar(require("node:path"));
|
|
75
|
+
const node_child_process_1 = require("node:child_process");
|
|
76
|
+
const config_js_1 = require("./config.js");
|
|
77
|
+
/** Where the registry lives. Sibling of `config.json`, under the data dir. */
|
|
78
|
+
function registryPath() {
|
|
79
|
+
return path.join((0, config_js_1.getDataDir)(), "external-registrations.json");
|
|
80
|
+
}
|
|
81
|
+
function readAll() {
|
|
82
|
+
try {
|
|
83
|
+
const raw = fs.readFileSync(registryPath(), "utf-8");
|
|
84
|
+
const parsed = JSON.parse(raw);
|
|
85
|
+
if (!Array.isArray(parsed))
|
|
86
|
+
return [];
|
|
87
|
+
return parsed.filter((r) => !!r &&
|
|
88
|
+
typeof r.harness === "string" &&
|
|
89
|
+
typeof r.root === "string" &&
|
|
90
|
+
!!r.remove);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
// Absent or unreadable: nothing recorded is the safe reading. This registry
|
|
94
|
+
// only ever drives best-effort cleanup, so a parse failure must not throw
|
|
95
|
+
// into an install or a reset.
|
|
96
|
+
return [];
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function writeAll(entries) {
|
|
100
|
+
const dir = (0, config_js_1.getDataDir)();
|
|
101
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
102
|
+
fs.writeFileSync(registryPath(), JSON.stringify(entries, null, 2) + "\n");
|
|
103
|
+
}
|
|
104
|
+
/** Every registration currently recorded. */
|
|
105
|
+
function loadExternalRegistrations() {
|
|
106
|
+
return readAll();
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Record (or refresh) the registration for a harness. Idempotent: re-running an
|
|
110
|
+
* install replaces the harness's entry rather than appending a duplicate.
|
|
111
|
+
*/
|
|
112
|
+
function recordExternalRegistration(entry) {
|
|
113
|
+
const others = readAll().filter((r) => r.harness !== entry.harness);
|
|
114
|
+
writeAll([...others, entry]);
|
|
115
|
+
}
|
|
116
|
+
/** Forget a harness's registration, after it has been deregistered. */
|
|
117
|
+
function clearExternalRegistration(harness) {
|
|
118
|
+
const remaining = readAll().filter((r) => r.harness !== harness);
|
|
119
|
+
if (remaining.length === 0) {
|
|
120
|
+
fs.rmSync(registryPath(), { force: true });
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
writeAll(remaining);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Replay every recorded removal. Call this **before** deleting the data dir.
|
|
127
|
+
*
|
|
128
|
+
* Entirely best-effort: a foreign tool that is no longer installed, or that
|
|
129
|
+
* fails the removal, must not stop the reset that is in progress. Results are
|
|
130
|
+
* returned so the caller can report what happened.
|
|
131
|
+
*/
|
|
132
|
+
function deregisterExternalRegistrations() {
|
|
133
|
+
const entries = readAll();
|
|
134
|
+
const results = [];
|
|
135
|
+
for (const registration of entries) {
|
|
136
|
+
const { command, args } = registration.remove;
|
|
137
|
+
try {
|
|
138
|
+
const result = (0, node_child_process_1.spawnSync)(command, args, {
|
|
139
|
+
encoding: "utf-8",
|
|
140
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
141
|
+
shell: process.platform === "win32",
|
|
142
|
+
timeout: 30_000,
|
|
143
|
+
});
|
|
144
|
+
if (result.status === 0) {
|
|
145
|
+
results.push({ registration, ok: true });
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
const output = ((result.stdout ?? "") + (result.stderr ?? "")).trim();
|
|
149
|
+
results.push({
|
|
150
|
+
registration,
|
|
151
|
+
ok: false,
|
|
152
|
+
detail: output || result.error?.message || `exit ${result.status}`,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch (err) {
|
|
157
|
+
results.push({
|
|
158
|
+
registration,
|
|
159
|
+
ok: false,
|
|
160
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (entries.length > 0)
|
|
165
|
+
clearAllExternalRegistrations();
|
|
166
|
+
return results;
|
|
167
|
+
}
|
|
168
|
+
/** Drop the whole registry (the data dir is about to go anyway). */
|
|
169
|
+
function clearAllExternalRegistrations() {
|
|
170
|
+
fs.rmSync(registryPath(), { force: true });
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* A registration whose target directory has gone missing — the foreign tool is
|
|
174
|
+
* pointing at nothing, which is the state that breaks it.
|
|
175
|
+
*
|
|
176
|
+
* `status` uses this to say what happened and how to fix it, instead of leaving
|
|
177
|
+
* the user to decode an error from a tool that never mentions Ory.
|
|
178
|
+
*/
|
|
179
|
+
function findDanglingRegistration(harness) {
|
|
180
|
+
return readAll().find((r) => r.harness === harness && !fs.existsSync(r.root));
|
|
181
|
+
}
|
|
182
|
+
/** One-line remediation for a dangling registration, for `status` output. */
|
|
183
|
+
function describeDanglingRegistration(registration) {
|
|
184
|
+
const cmd = [registration.remove.command, ...registration.remove.args].join(" ");
|
|
185
|
+
return (`${registration.description} points at ${registration.root}, which no longer exists — ` +
|
|
186
|
+
`every '${registration.tool} plugin' command will fail until this is repaired. ` +
|
|
187
|
+
`Re-run the install to restore it, or remove the stale entry with: ${cmd}`);
|
|
188
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared `--help` handling for every plugin CLI.
|
|
3
|
+
*
|
|
4
|
+
* Each CLI dispatches on `argv[0]` with a `switch`, so `--help` was only ever
|
|
5
|
+
* recognized in the *subcommand position*. Once a subcommand matched, trailing
|
|
6
|
+
* flags it did not know were ignored — and `install --help` ran a real install,
|
|
7
|
+
* writing harness config, registering a marketplace, materializing a runtime,
|
|
8
|
+
* and connecting against whatever `ORY_PROJECT_URL` / `ORY_OAUTH2_CLIENT_ID`
|
|
9
|
+
* happened to be in the environment (#222/#221).
|
|
10
|
+
*
|
|
11
|
+
* `<cmd> --help` is universal muscle memory for "tell me about this, change
|
|
12
|
+
* nothing", so it must never carry a side effect.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* True when the user asked for usage anywhere in `args` rather than in the
|
|
16
|
+
* subcommand slot — e.g. `install --help`, `local up -h`.
|
|
17
|
+
*
|
|
18
|
+
* Deliberately scans the whole tail: the point is that a help request must be
|
|
19
|
+
* honored wherever it appears, not just where the dispatcher happens to look.
|
|
20
|
+
* `--` ends the scan so a flag being *passed through* to something else is not
|
|
21
|
+
* mistaken for a request to this CLI (`install -- --help`).
|
|
22
|
+
*/
|
|
23
|
+
export declare function wantsHelp(args: readonly string[]): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Guard for the top of a CLI's `main()`, after `argv` is split.
|
|
26
|
+
*
|
|
27
|
+
* Returns true when the CLI should print usage and do nothing else. Call it
|
|
28
|
+
* *before* the dispatch switch:
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* const [command, ...args] = process.argv.slice(2);
|
|
32
|
+
* if (shouldPrintHelp(command, args)) return help();
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* A bare `--help` / `help` / no command at all is left to the existing `switch`
|
|
36
|
+
* arms, which already handle it; this only covers the case the dispatcher
|
|
37
|
+
* cannot see — a help flag *after* a matched subcommand.
|
|
38
|
+
*/
|
|
39
|
+
export declare function shouldPrintHelp(command: string | undefined, args: readonly string[]): boolean;
|
package/dist/help-cli.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared `--help` handling for every plugin CLI.
|
|
4
|
+
*
|
|
5
|
+
* Each CLI dispatches on `argv[0]` with a `switch`, so `--help` was only ever
|
|
6
|
+
* recognized in the *subcommand position*. Once a subcommand matched, trailing
|
|
7
|
+
* flags it did not know were ignored — and `install --help` ran a real install,
|
|
8
|
+
* writing harness config, registering a marketplace, materializing a runtime,
|
|
9
|
+
* and connecting against whatever `ORY_PROJECT_URL` / `ORY_OAUTH2_CLIENT_ID`
|
|
10
|
+
* happened to be in the environment (#222/#221).
|
|
11
|
+
*
|
|
12
|
+
* `<cmd> --help` is universal muscle memory for "tell me about this, change
|
|
13
|
+
* nothing", so it must never carry a side effect.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.wantsHelp = wantsHelp;
|
|
17
|
+
exports.shouldPrintHelp = shouldPrintHelp;
|
|
18
|
+
/** The flags every CLI accepts as a request for usage. */
|
|
19
|
+
const HELP_FLAGS = new Set(["--help", "-h", "help"]);
|
|
20
|
+
/**
|
|
21
|
+
* True when the user asked for usage anywhere in `args` rather than in the
|
|
22
|
+
* subcommand slot — e.g. `install --help`, `local up -h`.
|
|
23
|
+
*
|
|
24
|
+
* Deliberately scans the whole tail: the point is that a help request must be
|
|
25
|
+
* honored wherever it appears, not just where the dispatcher happens to look.
|
|
26
|
+
* `--` ends the scan so a flag being *passed through* to something else is not
|
|
27
|
+
* mistaken for a request to this CLI (`install -- --help`).
|
|
28
|
+
*/
|
|
29
|
+
function wantsHelp(args) {
|
|
30
|
+
for (const arg of args) {
|
|
31
|
+
if (arg === "--")
|
|
32
|
+
return false;
|
|
33
|
+
if (HELP_FLAGS.has(arg))
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Guard for the top of a CLI's `main()`, after `argv` is split.
|
|
40
|
+
*
|
|
41
|
+
* Returns true when the CLI should print usage and do nothing else. Call it
|
|
42
|
+
* *before* the dispatch switch:
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* const [command, ...args] = process.argv.slice(2);
|
|
46
|
+
* if (shouldPrintHelp(command, args)) return help();
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* A bare `--help` / `help` / no command at all is left to the existing `switch`
|
|
50
|
+
* arms, which already handle it; this only covers the case the dispatcher
|
|
51
|
+
* cannot see — a help flag *after* a matched subcommand.
|
|
52
|
+
*/
|
|
53
|
+
function shouldPrintHelp(command, args) {
|
|
54
|
+
return command !== undefined && wantsHelp(args);
|
|
55
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook-timeout windows a harness declares on the entries it installs.
|
|
3
|
+
*
|
|
4
|
+
* Every subprocess harness kills a hook that runs past its window. Session
|
|
5
|
+
* start is the one hook that can legitimately take minutes: it may run the
|
|
6
|
+
* interactive PKCE browser login, which waits on a human. The tool-lifecycle
|
|
7
|
+
* hooks only make permission checks.
|
|
8
|
+
*
|
|
9
|
+
* **The invariant these constants exist to hold** (asserted in
|
|
10
|
+
* `hook-timeout.test.ts`): every declared session-start window is strictly
|
|
11
|
+
* greater than {@link DEFAULT_LOGIN_TIMEOUT_MS}. The login must always
|
|
12
|
+
* terminate on its own terms and record a clean `timeout` outcome the user can
|
|
13
|
+
* act on — never be SIGKILLed mid-flow by the harness, which surfaces nothing
|
|
14
|
+
* and leaves the session with no user identity (and, under `enforce`, every
|
|
15
|
+
* subsequent tool denied for a reason nothing explains).
|
|
16
|
+
*
|
|
17
|
+
* **Units differ per harness and are not guessable** — each was verified
|
|
18
|
+
* against the harness's own binary, because getting one wrong is silent:
|
|
19
|
+
*
|
|
20
|
+
* | Harness | Unit | Evidence |
|
|
21
|
+
* |--------------|--------------|-------------------------------------------------------------------|
|
|
22
|
+
* | claude-code | seconds | `timeout: number().describe("Timeout in seconds")`, `timeout * 1000` |
|
|
23
|
+
* | codex | seconds | documented per-handler timeout |
|
|
24
|
+
* | cursor | seconds | documented per-hook timeout |
|
|
25
|
+
* | gemini-cli | milliseconds | `DEFAULT_HOOK_TIMEOUT = 6e4`; `Hook timed out after ${timeout}ms` |
|
|
26
|
+
* | antigravity | seconds | `timeout_seconds`; validated `"must be between 5 and 120 seconds"` |
|
|
27
|
+
*
|
|
28
|
+
* Antigravity additionally **validates** its range, so it caps what any harness
|
|
29
|
+
* can be given — which is why the login window has to fit inside 120s.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Wall-clock budget for a session-start hook: the interactive login, plus the
|
|
33
|
+
* agent DCR registration and delegation record that follow it.
|
|
34
|
+
*
|
|
35
|
+
* Generous on purpose. It is an upper bound on a hook that is *waiting*, not a
|
|
36
|
+
* latency target — nothing is spinning, and the login gives up on its own well
|
|
37
|
+
* before this.
|
|
38
|
+
*/
|
|
39
|
+
export declare const SESSION_START_HOOK_WINDOW_MS = 300000;
|
|
40
|
+
/**
|
|
41
|
+
* Budget for the tool-lifecycle hooks. A permission check, plus the batched
|
|
42
|
+
* per-word round trips shell decomposition can add.
|
|
43
|
+
*/
|
|
44
|
+
export declare const TOOL_HOOK_WINDOW_MS = 60000;
|
|
45
|
+
/**
|
|
46
|
+
* Hard ceiling on a session-start window, per harness, where the harness
|
|
47
|
+
* validates or silently rejects the value. Antigravity refuses anything over
|
|
48
|
+
* 120 seconds; the others impose no documented maximum.
|
|
49
|
+
*/
|
|
50
|
+
export declare const HOOK_TIMEOUT_MAX_MS: Readonly<Record<string, number>>;
|
|
51
|
+
/** The unit a harness's hook config expresses timeouts in. */
|
|
52
|
+
export type HookTimeoutUnit = "seconds" | "milliseconds";
|
|
53
|
+
/**
|
|
54
|
+
* The session-start hook timeout to declare for `harness`, in that harness's
|
|
55
|
+
* own unit, clamped to any ceiling the harness enforces.
|
|
56
|
+
*
|
|
57
|
+
* Throws if the clamped result would not outlast the login. That is a build-time
|
|
58
|
+
* failure on purpose: a harness whose maximum window is shorter than the login
|
|
59
|
+
* cannot host the login as it is configured, and shipping it would reintroduce
|
|
60
|
+
* exactly the silent mid-flow kill this module exists to prevent.
|
|
61
|
+
*/
|
|
62
|
+
export declare function sessionStartHookTimeout(harness: string, unit: HookTimeoutUnit): number;
|
|
63
|
+
/** The tool-lifecycle hook timeout to declare for `harness`, in its own unit. */
|
|
64
|
+
export declare function toolHookTimeout(harness: string, unit: HookTimeoutUnit): number;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Hook-timeout windows a harness declares on the entries it installs.
|
|
4
|
+
*
|
|
5
|
+
* Every subprocess harness kills a hook that runs past its window. Session
|
|
6
|
+
* start is the one hook that can legitimately take minutes: it may run the
|
|
7
|
+
* interactive PKCE browser login, which waits on a human. The tool-lifecycle
|
|
8
|
+
* hooks only make permission checks.
|
|
9
|
+
*
|
|
10
|
+
* **The invariant these constants exist to hold** (asserted in
|
|
11
|
+
* `hook-timeout.test.ts`): every declared session-start window is strictly
|
|
12
|
+
* greater than {@link DEFAULT_LOGIN_TIMEOUT_MS}. The login must always
|
|
13
|
+
* terminate on its own terms and record a clean `timeout` outcome the user can
|
|
14
|
+
* act on — never be SIGKILLed mid-flow by the harness, which surfaces nothing
|
|
15
|
+
* and leaves the session with no user identity (and, under `enforce`, every
|
|
16
|
+
* subsequent tool denied for a reason nothing explains).
|
|
17
|
+
*
|
|
18
|
+
* **Units differ per harness and are not guessable** — each was verified
|
|
19
|
+
* against the harness's own binary, because getting one wrong is silent:
|
|
20
|
+
*
|
|
21
|
+
* | Harness | Unit | Evidence |
|
|
22
|
+
* |--------------|--------------|-------------------------------------------------------------------|
|
|
23
|
+
* | claude-code | seconds | `timeout: number().describe("Timeout in seconds")`, `timeout * 1000` |
|
|
24
|
+
* | codex | seconds | documented per-handler timeout |
|
|
25
|
+
* | cursor | seconds | documented per-hook timeout |
|
|
26
|
+
* | gemini-cli | milliseconds | `DEFAULT_HOOK_TIMEOUT = 6e4`; `Hook timed out after ${timeout}ms` |
|
|
27
|
+
* | antigravity | seconds | `timeout_seconds`; validated `"must be between 5 and 120 seconds"` |
|
|
28
|
+
*
|
|
29
|
+
* Antigravity additionally **validates** its range, so it caps what any harness
|
|
30
|
+
* can be given — which is why the login window has to fit inside 120s.
|
|
31
|
+
*/
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.HOOK_TIMEOUT_MAX_MS = exports.TOOL_HOOK_WINDOW_MS = exports.SESSION_START_HOOK_WINDOW_MS = void 0;
|
|
34
|
+
exports.sessionStartHookTimeout = sessionStartHookTimeout;
|
|
35
|
+
exports.toolHookTimeout = toolHookTimeout;
|
|
36
|
+
const auth_js_1 = require("./auth.js");
|
|
37
|
+
/**
|
|
38
|
+
* Wall-clock budget for a session-start hook: the interactive login, plus the
|
|
39
|
+
* agent DCR registration and delegation record that follow it.
|
|
40
|
+
*
|
|
41
|
+
* Generous on purpose. It is an upper bound on a hook that is *waiting*, not a
|
|
42
|
+
* latency target — nothing is spinning, and the login gives up on its own well
|
|
43
|
+
* before this.
|
|
44
|
+
*/
|
|
45
|
+
exports.SESSION_START_HOOK_WINDOW_MS = 300_000;
|
|
46
|
+
/**
|
|
47
|
+
* Budget for the tool-lifecycle hooks. A permission check, plus the batched
|
|
48
|
+
* per-word round trips shell decomposition can add.
|
|
49
|
+
*/
|
|
50
|
+
exports.TOOL_HOOK_WINDOW_MS = 60_000;
|
|
51
|
+
/**
|
|
52
|
+
* Hard ceiling on a session-start window, per harness, where the harness
|
|
53
|
+
* validates or silently rejects the value. Antigravity refuses anything over
|
|
54
|
+
* 120 seconds; the others impose no documented maximum.
|
|
55
|
+
*/
|
|
56
|
+
exports.HOOK_TIMEOUT_MAX_MS = {
|
|
57
|
+
antigravity: 120_000,
|
|
58
|
+
};
|
|
59
|
+
function convert(ms, unit) {
|
|
60
|
+
return unit === "seconds" ? Math.round(ms / 1000) : ms;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The session-start hook timeout to declare for `harness`, in that harness's
|
|
64
|
+
* own unit, clamped to any ceiling the harness enforces.
|
|
65
|
+
*
|
|
66
|
+
* Throws if the clamped result would not outlast the login. That is a build-time
|
|
67
|
+
* failure on purpose: a harness whose maximum window is shorter than the login
|
|
68
|
+
* cannot host the login as it is configured, and shipping it would reintroduce
|
|
69
|
+
* exactly the silent mid-flow kill this module exists to prevent.
|
|
70
|
+
*/
|
|
71
|
+
function sessionStartHookTimeout(harness, unit) {
|
|
72
|
+
const ceiling = exports.HOOK_TIMEOUT_MAX_MS[harness];
|
|
73
|
+
const ms = ceiling
|
|
74
|
+
? Math.min(exports.SESSION_START_HOOK_WINDOW_MS, ceiling)
|
|
75
|
+
: exports.SESSION_START_HOOK_WINDOW_MS;
|
|
76
|
+
if (ms <= auth_js_1.DEFAULT_LOGIN_TIMEOUT_MS) {
|
|
77
|
+
throw new Error(`Session-start hook window for "${harness}" (${ms}ms) does not outlast the ` +
|
|
78
|
+
`login timeout (${auth_js_1.DEFAULT_LOGIN_TIMEOUT_MS}ms). The login would be killed ` +
|
|
79
|
+
`mid-flow. Lower DEFAULT_LOGIN_TIMEOUT_MS or raise the harness ceiling.`);
|
|
80
|
+
}
|
|
81
|
+
return convert(ms, unit);
|
|
82
|
+
}
|
|
83
|
+
/** The tool-lifecycle hook timeout to declare for `harness`, in its own unit. */
|
|
84
|
+
function toolHookTimeout(harness, unit) {
|
|
85
|
+
const ceiling = exports.HOOK_TIMEOUT_MAX_MS[harness];
|
|
86
|
+
const ms = ceiling ? Math.min(exports.TOOL_HOOK_WINDOW_MS, ceiling) : exports.TOOL_HOOK_WINDOW_MS;
|
|
87
|
+
return convert(ms, unit);
|
|
88
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
export { OryAgentClient, type OryAgentConfig, type PrincipalIdentity, } from "./client.js";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
1
|
+
export { OryAgentClient, type OryAgentConfig, type PrincipalIdentity, type RecordDelegationInput, type RecordDelegationResult, } from "./client.js";
|
|
2
|
+
export { authenticatedRuntimeRequest, canonicalCredentialIdentity, canonicalProjectUrl, credentialAccount, configureSystemCaTrustForDefaultFetch, createOsTalosCredentialStore, enrollTalosChildRuntimeCredential, enrollTalosRuntimeCredential, resolveRuntimeCredential, runCredentialStoreCommand, talosRuntimeCredential, type CredentialStoreCommandOptions, type CredentialStoreCommandRunner, type ResolveRuntimeCredentialOptions, type EnrollTalosChildRuntimeCredentialOptions, type EnrollTalosRuntimeCredentialOptions, type EnrolledRuntimeCredential, type OsTalosCredentialStoreOptions, type NodeTlsCaProvider, type StoredTalosCredential, type TalosCredentialStore, type TalosCredentialIdentity, type RuntimeAuthenticatedRequest, type RuntimeAuthorizationHeader, type RuntimeCredential, type RuntimeCredentialKind, type RuntimeRequestAuthenticator, } from "./runtime-credential.js";
|
|
3
|
+
export { DebugLogger, ActiveActivity, redactLogData, formatLogEntry, withQuietStderr, type LogEntry, type LogLevel, type ActivityEntry, type ActivityStatus, type UnifiedLogEntry, type ActivityEnricher, type ActivitySink, } from "./logger.js";
|
|
4
|
+
export { AgentSecurityEventReporter, SERVER_ACTIVITY_EVENTS, projectActivityEntry, type EventReporterOptions, type ServerActivityEvent, } from "./event-reporter.js";
|
|
5
|
+
export { currentSessionContext, withSessionContext, setSessionContext, clearSessionContext, type SessionContext, } from "./context.js";
|
|
6
|
+
export { loadConfig, saveConfig, resolveConfig, isSecurityConnected, describeSecurityGap, type SecurityConnection, mutateConfig, getConfigPath, getDataDir, getHarnessDataDir, listInstalledHarnesses, registerInstalledHarness, unregisterInstalledHarness, UNKNOWN_HARNESS_KEY, SESSIONLESS_KEY, type OryPluginConfig, type OryOAuth2Tokens, type OryUserCredentials, type OryAgentCredentialsBlock, type OryAgentDynamicCredentials, type OryDelegationRecord, type PermissionMode, type PermissionModeCache, } from "./config.js";
|
|
7
|
+
export { resolvePermissionMode, warmPermissionModeCache, resetPermissionModeCache, type PermissionModeSource, type ResolvedPermissionMode, type ModeSubject, } from "./permission-mode.js";
|
|
5
8
|
export { pkceLogin, refreshAccessToken, detectHeadless, generateCodeVerifier, sha256Base64Url, buildAuthorizeUrl, LOOPBACK_PORTS, DEFAULT_LOGIN_TIMEOUT_MS, type PkceLoginOptions, type PkceLoginOutcome, type PkceDeclineReason, } from "./auth.js";
|
|
9
|
+
export { wantsHelp, shouldPrintHelp } from "./help-cli.js";
|
|
10
|
+
export { loadExternalRegistrations, recordExternalRegistration, clearExternalRegistration, clearAllExternalRegistrations, deregisterExternalRegistrations, findDanglingRegistration, describeDanglingRegistration, type ExternalRegistration, type DeregisterResult, } from "./external-registrations.js";
|
|
11
|
+
export { SESSION_START_HOOK_WINDOW_MS, TOOL_HOOK_WINDOW_MS, HOOK_TIMEOUT_MAX_MS, sessionStartHookTimeout, toolHookTimeout, type HookTimeoutUnit, } from "./hook-timeout.js";
|
|
6
12
|
export { loadTokens, saveTokens, clearTokens, isExpired, refreshAndSave, tryAcquirePkceFlightLock, clearPkceFlightLock, waitForPeerTokens, waitForPeerTokensSync, TOKEN_EXPIRY_SKEW_SEC, type PkceFlightLock, } from "./auth-store.js";
|
|
7
13
|
export { ensureUserAuthenticated, ensureAuthenticated, type UserLoginDecision, type UserLoginMode, type UserLoginOptions, } from "./user-login.js";
|
|
8
|
-
export { resolveAgentCredentials, ensureAgentIdentity, ensureSubAgentIdentity, fetchClientCredentialsToken, registerAgentClient, loadAgentDynamicCredentials, saveAgentDynamicCredentials, clearAgentDynamicCredentials, loadSubAgentDynamicCredentials, saveSubAgentDynamicCredentials, clearSubAgentDynamicCredentials, revokeAgentDynamicClient, AGENT_TOKEN_EXPIRY_SKEW_SEC, type AgentCredentials, type AgentCredentialKind, type ResolveAgentCredentialsOptions, type EnsureAgentIdentityOptions, type RegisterAgentClientArgs, type DelegationInput, type RevokeAgentClientResult, type SubAgentIdentity, type EnsureSubAgentIdentityOptions, } from "./agent-auth.js";
|
|
9
|
-
export {
|
|
14
|
+
export { resolveAgentCredentials, resolveRuntimeAgentCredentials, ensureAgentIdentity, ensureSubAgentIdentity, fetchClientCredentialsToken, registerAgentClient, loadAgentDynamicCredentials, loadAgentDynamicCredentialsByHarness, saveAgentDynamicCredentials, clearAgentDynamicCredentials, latestAgentRegistration, latestSubAgentSession, countAgentSessions, claimAgentDynamicCredentials, loadSubAgentDynamicCredentials, loadAllSubAgentDynamicCredentials, loadSubAgentDynamicCredentialsByHarness, saveSubAgentDynamicCredentials, clearSubAgentDynamicCredentials, clearSubAgentDynamicCredentialsForHarness, claimSubAgentDynamicCredentials, loadDelegationNodeId, saveDelegationNodeId, loadRetiredCredentials, clearRetiredCredentials, retireAgentSessions, sessionRetention, revokeAgentDynamicClient, AGENT_TOKEN_EXPIRY_SKEW_SEC, DEFAULT_SESSION_RETENTION, type AgentRegistrationClaim, type AgentCredentials, type AgentCredentialKind, type ResolveAgentCredentialsOptions, type ResolveRuntimeAgentCredentialsOptions, type EnsureAgentIdentityOptions, type RegisterAgentClientArgs, type DelegationInput, type RevokeAgentClientResult, type SubAgentIdentity, type EnsureSubAgentIdentityOptions, } from "./agent-auth.js";
|
|
15
|
+
export { ensureReadCredential, resetReadCredentialBackoff, READ_CREDENTIAL_RETRY_MS, type EnsureReadCredentialOptions, type ReadCredentialOutcome, } from "./read-credential.js";
|
|
16
|
+
export { clearCredentialsForUninstall, resolveInstalledHarnesses, type ClearCredentialsOptions, type ClearCredentialsResult, } from "./uninstall.js";
|
|
10
17
|
export { type SessionInfo, type OAuth2TokenInfo, type PermissionCheck, type PermissionResult, type BatchPermissionResult, type OryError, type OryErrorCode, } from "./types.js";
|
|
11
|
-
export { runConfigureCommand, runAgentCommand, printOryConfig, printEnvironment, printLogTail, printEnvHelp,
|
|
18
|
+
export { runConfigureCommand, runAgentCommand, printOryConfig, printEnvironment, printLogTail, printEnvHelp, isTtyAvailable, promptOnTty, promptForProjectUrl, interactiveConfigPrompt, } from "./cli.js";
|
|
12
19
|
export { oryNpx } from "./cli-invocation.js";
|
|
13
|
-
export { runPermissionsCommand
|
|
14
|
-
export {
|
|
20
|
+
export { runPermissionsCommand } from "./permissions-cli.js";
|
|
21
|
+
export { runWatchCommand, type WatchCommandOptions } from "./watch-cli.js";
|
|
22
|
+
export { runPostInstall } from "./post-install.js";
|
|
15
23
|
export { runStatusCommand, printUserIdentitySection, printAgentIdentitySection, printPermissionsSection, type StatusCommandOptions, } from "./status-cli.js";
|
|
16
24
|
export { collectStatusReport, probePermissionsCoverage, type StatusReport, type StatusConfigSection, type StatusUserSection, type StatusAgentSection, type StatusPermissionsSection, type StatusActivitySection, type PermissionsCoverage, } from "./status-data.js";
|
|
17
|
-
export { ensureOryCli, isSignedIn, listWorkspaces, createWorkspace, createProject, resolveProjectUrl, getDcrState, enableDcrAction, provisionOAuth2Client, saveNetworkConfig, runFullSetup, inspectPermissions, provisionPermissions, grantToolPermissions, provisionProjectApiKey, configureAuditOnly, configureLocalStack, type SetupActionDeps, type LocalStackResult, type FullSetupResult, } from "./setup-actions.js";
|
|
18
|
-
export { canLaunchBrowser, launchWebInstaller, launchWebDashboard, } from "./web/launch.js";
|
|
19
|
-
export { startServer, type RunningServer } from "./web/server.js";
|
|
20
|
-
export type { WebAppMode, BootstrapPayload } from "./web/types.js";
|
|
21
25
|
export { runVersionCommand, collectVersionInfo, resolveBuildInfo, type BuildInfo, type VersionInfo, type VersionCommandOptions, } from "./version-cli.js";
|
|
22
|
-
export { parseSetupArgs, readJsonFile, writeJsonFile, isOryHookCommand,
|
|
23
|
-
export {
|
|
26
|
+
export { parseSetupArgs, readJsonFile, writeJsonFile, isOryHookCommand, matcherHookEntry, mergeMatcherHooks, removeMatcherHooks, flatHookEntry, mergeFlatHooks, removeFlatHooks, printSetupHelp, printNextSteps, nextStepsSink, beginDeferNextSteps, emitDeferredNextSteps, mcpServerEntry, mergeMcpServer, removeMcpServer, registerPlugin, unregisterPlugin, type SetupArgs, type HookCommand, type MatcherEntry, } from "./setup.js";
|
|
27
|
+
export { wireRuntime, resolveRuntimeForInstall, materializeRuntime, linkedRuntime, resolveRuntimeEntry, resolveMcpRuntimeEntry, writeHookShim, writeMcpShim, hookCommand, mcpCommand, isOryRuntimeCommand, requireHookCommand, moduleSpecifier, getRuntimeRoot, getRuntimeStoreDir, getShimDir, getHookShimPath, getMcpShimPath, readRuntimeManifest, recordRuntimeWiring, getRuntimeWiring, removeRuntimeWiring, pruneRuntimeStores, checkRuntimeHealth, describeRuntimeHealth, defaultNpmInstaller, MCP_SERVER_PACKAGE, type RuntimeTarget, type RuntimeWiring, type RuntimeManifest, type RuntimeHealth, type NpmInstaller, type PreparedRuntime, } from "./runtime.js";
|
|
28
|
+
export { renderMirrorBootstrap, type MirrorBootstrapKind, type MirrorBootstrapOptions, } from "./mirror-bootstrap.js";
|
|
24
29
|
export { renderOrySkills, renderOryCommands, commandToSkill, commandToToml, commandToFrontmatterMarkdown, commandToPlainMarkdown, toSkillMarkdown, writeSkillTree, removeSkillDirs, ORY_SKILL_NAMES, ORY_COMMAND_SKILL_NAMES, ORY_COMMAND_SLUGS, type RenderedSkill, type RenderedCommand, type RenderProfileOptions, } from "./skills.js";
|
|
25
|
-
export { runLocalCommand,
|
|
30
|
+
export { runLocalCommand, } from "./local/index.js";
|
|
26
31
|
export { runRegistryCommand, REGISTRY_URL } from "./registry/index.js";
|
|
27
|
-
export { checkAndDecide, applyPermissionMode, gateToolCall, type PermissionDecision, type ModeDecision, type
|
|
28
|
-
export {
|
|
32
|
+
export { checkAndDecide, applyPermissionMode, gateToolCall, decomposeAndCheck, resolveCheckRelation, type PermissionDecision, type ModeDecision, type DecisionActivityAttributes, type CheckAndDecideOptions, type ApplyPermissionModeContext, type GateToolCallArgs, type PrincipalBlockSubjects, type ToolGateOutcome, type BlockReason, } from "./permissions.js";
|
|
33
|
+
export { extractShellCommands, extractBashCommandWords, type ParsedShell, type ShellCommand, type ShellRedirect, type ShellAssignment, type BashParseResult, } from "./bash-parser.js";
|
|
34
|
+
export { buildAgentSecurityOpl, renderToolNamespaceClass, renderDelegationNamespaceClass, renderPermissionModeNamespaceClass, renderAgentRoleNamespaceClass, renderEnrollmentNamespaceClass, renderPrincipalClass, renderOplImport, OPL_IMPORT_MODULE, OPL_IMPORT_SYMBOLS, PRINCIPAL_NAMESPACES, NODE_REFERENCE_NAMESPACES, AGENT_NODE_NAMESPACE, SUBAGENT_NODE_NAMESPACE, RELATION_USERS, RELATION_BLOCKED_SUBJECTS, RELATION_DELEGATES, RELATION_CREDENTIALS, RELATION_ENFORCED_SUBJECTS, RELATION_MEMBERS, RELATION_OPTED_OUT_SUBJECTS, PERMISSION_MODE_OBJECT, AUTO_ENROLL_OBJECT, PROJECT_POSTURE_OBJECT, PERMISSION_MODE_NAMESPACE, DELEGATION_NAMESPACE, AGENT_ROLE_NAMESPACE, ENROLLMENT_NAMESPACE, PERMIT_USE, DEFAULT_NAMESPACE, DEFAULT_SHELL_NAMESPACE, } from "./opl.js";
|
|
35
|
+
export { HARNESS_TOOL_CATALOG, KNOWN_HARNESSES, ALL_TOOLS, getToolCatalog, INTERACTIVE_TOOL_CATALOG, getInteractiveToolCatalog, isInteractiveTool, SHELL_TOOL_CATALOG, getShellToolCatalog, isShellTool, SHELL_COMMAND_CATALOG, getShellCommandCatalog, resolveShellCommandNamespace, extractShellCommand, type KnownHarness, } from "./tool-catalog.js";
|
|
29
36
|
export { classifyLifecycle, isUserFacingPhase, isToolExecutionPhase, HARNESS_LIFECYCLE_MAP, USER_FACING_PHASES, TOOL_EXECUTION_PHASES, type LifecyclePhase, } from "./lifecycle.js";
|
|
30
37
|
export { parseClaudeCodeMcpTool, parseGeminiMcpTool, parseMcpToolGeneric, checkMcpPermission, type McpToolIdentifier, type McpPermissionCheckOptions, type McpPermissionResult, } from "./mcp.js";
|
|
31
|
-
export { resolveUserSubject, runWithUserSubject, subjectLabel, type UserSubjectRef, } from "./subject.js";
|
|
32
|
-
export { formatDenialMessage, formatDenialSummary, formatAlertMessage, formatAlertSummary, alertAttributes, OryDenialError, type DenialContext, type AlertAttributes, } from "./denial.js";
|
|
38
|
+
export { resolveUserSubject, runWithUserSubject, subjectLabel, resolveAgentSubject, resolveAgentSessionSubject, resolveSubAgentSubject, resolveSubAgentSpawnSubject, AGENT_NAMESPACE, SUBAGENT_NAMESPACE, SESSION_NAMESPACE, DEFAULT_USER_SUBJECT_NAMESPACE, type UserSubjectRef, } from "./subject.js";
|
|
39
|
+
export { formatDenialMessage, formatDenialSummary, formatAlertMessage, formatAlertSummary, alertAttributes, shellDenialFields, OryDenialError, type DenialContext, type AlertAttributes, } from "./denial.js";
|
|
33
40
|
export { summarizeToolInput, summarizeToolOutput, type ToolInputSummary, type ToolOutputSummary, } from "./tool-metadata.js";
|
|
34
|
-
export {
|
|
35
|
-
export { resolveNamespace, sessionStart, gate, complete, registerSubagent, writeUserDelegatesAgent, writeAgentDelegatesSubagent, wrapTool, type SessionStartResult, type SessionStartOptions, type RegisterSubagentOptions, type GateResult, type GateOptions, type WrapToolOptions, } from "./adapters.js";
|
|
41
|
+
export { resolveNamespace, sessionStart, createSessionStarter, withHookContext, decideTool, gate, complete, fail, registerSubagent, writeUserDelegatesAgent, writeAgentDelegatesSubagent, wrapTool, type SessionStartResult, type SessionStartOptions, type HookContextOptions, type RegisterSubagentOptions, type GateResult, type GateOptions, type WrapToolOptions, } from "./adapters.js";
|
|
36
42
|
export { collectSystemServices, type StatusSystemSection, type StatusSystemService, } from "./status-system.js";
|
|
37
|
-
export { runDashboardCommand } from "./dashboard-cli.js";
|