@ory/argus 0.13.9 → 0.14.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.
Files changed (65) hide show
  1. package/README.md +2 -1
  2. package/assets/commands/dashboard.md +34 -0
  3. package/assets/skills/ory-build-agent/SKILL.md +11 -13
  4. package/assets/skills/ory-e2b-sandbox/SKILL.md +0 -1
  5. package/assets/skills/ory-temporal-worker/SKILL.md +8 -10
  6. package/assets/skills/permissions-onboarding/SKILL.md +3 -3
  7. package/dist/adapters.d.ts +12 -5
  8. package/dist/adapters.js +59 -10
  9. package/dist/agent-auth.d.ts +34 -3
  10. package/dist/agent-auth.js +58 -8
  11. package/dist/auth.d.ts +7 -0
  12. package/dist/auth.js +90 -5
  13. package/dist/branding.d.ts +67 -0
  14. package/dist/branding.js +81 -0
  15. package/dist/build-info.json +4 -4
  16. package/dist/cli.d.ts +3 -3
  17. package/dist/cli.js +13 -52
  18. package/dist/config.d.ts +48 -19
  19. package/dist/config.js +31 -26
  20. package/dist/contract-suite.d.ts +5 -3
  21. package/dist/contract-suite.js +13 -22
  22. package/dist/dashboard-cli.d.ts +8 -0
  23. package/dist/dashboard-cli.js +70 -0
  24. package/dist/dev.js +3 -4
  25. package/dist/index.d.ts +11 -4
  26. package/dist/index.js +39 -3
  27. package/dist/interactive-setup.d.ts +144 -23
  28. package/dist/interactive-setup.js +412 -224
  29. package/dist/local/health.d.ts +14 -0
  30. package/dist/local/health.js +46 -0
  31. package/dist/local/manager.js +1 -3
  32. package/dist/local/seed.d.ts +9 -20
  33. package/dist/local/seed.js +26 -18
  34. package/dist/permissions-cli.js +1 -1
  35. package/dist/project-api-key.d.ts +69 -0
  36. package/dist/project-api-key.js +147 -0
  37. package/dist/registry/manager.js +62 -18
  38. package/dist/setup-actions.d.ts +232 -0
  39. package/dist/setup-actions.js +507 -0
  40. package/dist/setup.d.ts +19 -0
  41. package/dist/setup.js +44 -14
  42. package/dist/skills.js +7 -0
  43. package/dist/status-cli.d.ts +2 -2
  44. package/dist/status-cli.js +4 -30
  45. package/dist/status-data.d.ts +96 -0
  46. package/dist/status-data.js +250 -0
  47. package/dist/status-system.d.ts +24 -0
  48. package/dist/status-system.js +56 -0
  49. package/dist/uninstall.d.ts +33 -15
  50. package/dist/uninstall.js +65 -22
  51. package/dist/user-login.d.ts +16 -9
  52. package/dist/user-login.js +18 -28
  53. package/dist/web/api.d.ts +33 -0
  54. package/dist/web/api.js +294 -0
  55. package/dist/web/launch.d.ts +11 -0
  56. package/dist/web/launch.js +96 -0
  57. package/dist/web/server.d.ts +20 -0
  58. package/dist/web/server.js +233 -0
  59. package/dist/web/types.d.ts +65 -0
  60. package/dist/web/types.js +2 -0
  61. package/dist/webapp/assets/index-Wucl4SZs.css +1 -0
  62. package/dist/webapp/assets/index-m-GtEdq0.js +49 -0
  63. package/dist/webapp/favicon.ico +0 -0
  64. package/dist/webapp/index.html +15 -0
  65. package/package.json +17 -2
package/dist/config.js CHANGED
@@ -37,7 +37,6 @@ exports.getDataDir = getDataDir;
37
37
  exports.getHarnessDataDir = getHarnessDataDir;
38
38
  exports.getConfigPath = getConfigPath;
39
39
  exports.loadConfig = loadConfig;
40
- exports.parseUserLoginEnv = parseUserLoginEnv;
41
40
  exports.saveConfig = saveConfig;
42
41
  exports.mutateConfig = mutateConfig;
43
42
  exports.looksLikeProjectId = looksLikeProjectId;
@@ -120,11 +119,19 @@ function loadConfig() {
120
119
  projectId: typeof parsed.projectId === "string" && parsed.projectId.trim()
121
120
  ? parsed.projectId.trim()
122
121
  : undefined,
122
+ projectName: typeof parsed.projectName === "string" && parsed.projectName.trim()
123
+ ? parsed.projectName.trim()
124
+ : undefined,
125
+ workspaceName: typeof parsed.workspaceName === "string" && parsed.workspaceName.trim()
126
+ ? parsed.workspaceName.trim()
127
+ : undefined,
123
128
  apiKey: typeof parsed.apiKey === "string" ? parsed.apiKey : undefined,
129
+ apiKeyId: typeof parsed.apiKeyId === "string" && parsed.apiKeyId.trim()
130
+ ? parsed.apiKeyId.trim()
131
+ : undefined,
124
132
  oauth2ClientId: typeof parsed.oauth2ClientId === "string" ? parsed.oauth2ClientId : undefined,
125
133
  auditOnly: parsed.auditOnly === true ? true : undefined,
126
134
  permissionMode: parsePermissionMode(parsed.permissionMode),
127
- userLogin: typeof parsed.userLogin === "boolean" ? parsed.userLogin : undefined,
128
135
  userSubjectNamespace: typeof parsed.userSubjectNamespace === "string" && parsed.userSubjectNamespace.trim()
129
136
  ? parsed.userSubjectNamespace.trim()
130
137
  : undefined,
@@ -139,21 +146,6 @@ function loadConfig() {
139
146
  function parsePermissionMode(value) {
140
147
  return value === "observe" || value === "enforce" ? value : undefined;
141
148
  }
142
- /** Env values that turn the interactive user login on. */
143
- const USER_LOGIN_ENABLED_VALUES = new Set(["1", "true", "yes", "on"]);
144
- /**
145
- * Read `ORY_USER_LOGIN` from the environment. Returns `true`/`false` when
146
- * the var is set (any recognized truthy value enables it; anything else
147
- * disables it), or `undefined` when the var is absent/empty so callers
148
- * fall back to the config file. Centralized here so the user gate, status
149
- * CLI, and configure command resolve it identically.
150
- */
151
- function parseUserLoginEnv() {
152
- const raw = process.env.ORY_USER_LOGIN;
153
- if (raw === undefined || raw.trim() === "")
154
- return undefined;
155
- return USER_LOGIN_ENABLED_VALUES.has(raw.trim().toLowerCase());
156
- }
157
149
  function parseAgentCredentials(parsed) {
158
150
  const raw = parsed.agent;
159
151
  if (!raw || typeof raw !== "object")
@@ -197,6 +189,26 @@ function parseAgentDynamicCredentials(value) {
197
189
  registeredAt,
198
190
  projectUrl: v.projectUrl,
199
191
  harness: typeof v.harness === "string" ? v.harness : undefined,
192
+ ...(parseDelegationRecord(v.delegation)
193
+ ? { delegation: parseDelegationRecord(v.delegation) }
194
+ : {}),
195
+ };
196
+ }
197
+ function parseDelegationRecord(value) {
198
+ if (!value || typeof value !== "object")
199
+ return undefined;
200
+ const v = value;
201
+ if (typeof v.delegatedBy !== "string" || v.delegatedBy.length === 0)
202
+ return undefined;
203
+ if (v.delegationType !== "user-to-agent" && v.delegationType !== "agent-to-subagent") {
204
+ return undefined;
205
+ }
206
+ return {
207
+ delegatedBy: v.delegatedBy,
208
+ delegationType: v.delegationType,
209
+ ...(typeof v.harness === "string" ? { harness: v.harness } : {}),
210
+ ...(typeof v.subAgentType === "string" ? { subAgentType: v.subAgentType } : {}),
211
+ delegatedAt: typeof v.delegatedAt === "string" ? v.delegatedAt : "",
200
212
  };
201
213
  }
202
214
  function parseUserCredentials(parsed) {
@@ -411,7 +423,6 @@ function resolveConfig() {
411
423
  const envApiKey = process.env.ORY_AGENT_API_KEY ?? process.env.ORY_API_KEY;
412
424
  const envClientId = process.env.ORY_OAUTH2_CLIENT_ID;
413
425
  const envMode = parsePermissionMode(process.env.ORY_PERMISSION_MODE);
414
- const envUserLogin = parseUserLoginEnv();
415
426
  const envUserSubjectNamespace = process.env.ORY_USER_SUBJECT_NAMESPACE?.trim() || undefined;
416
427
  const permissionMode = envMode ?? file.permissionMode ?? "observe";
417
428
  const permissionModeSource = envMode
@@ -419,12 +430,6 @@ function resolveConfig() {
419
430
  : file.permissionMode
420
431
  ? "config"
421
432
  : "default";
422
- const userLogin = envUserLogin ?? file.userLogin ?? false;
423
- const userLoginSource = envUserLogin !== undefined
424
- ? "env"
425
- : file.userLogin !== undefined
426
- ? "config"
427
- : "default";
428
433
  const projectId = envProjectId ?? file.projectId;
429
434
  // The SDK URL is only ever an explicit, slug-based URL (from ORY_PROJECT_URL,
430
435
  // ORY_SDK_URL, or the config file). The project id is NOT a URL source — it
@@ -438,13 +443,13 @@ function resolveConfig() {
438
443
  return {
439
444
  projectUrl,
440
445
  projectId,
446
+ projectName: file.projectName,
447
+ workspaceName: file.workspaceName,
441
448
  apiKey: envApiKey ?? file.apiKey,
442
449
  oauth2ClientId: envClientId ?? file.oauth2ClientId,
443
450
  auditOnly: file.auditOnly === true,
444
451
  permissionMode,
445
452
  permissionModeSource,
446
- userLogin,
447
- userLoginSource,
448
453
  userSubjectNamespace: envUserSubjectNamespace ?? file.userSubjectNamespace,
449
454
  userSubjectNamespaceSource: envUserSubjectNamespace
450
455
  ? "env"
@@ -61,10 +61,12 @@ export interface HarnessContractAdapter {
61
61
  /** A real, non-interactive tool from this harness's catalog. */
62
62
  tool: string;
63
63
  /**
64
- * Whether the harness's session-start primitive can carry a hard block
65
- * (subprocess exit-code harnesses: true; in-process advisory: false).
64
+ * @deprecated Ignored. Session start is now uniformly non-blocking on every
65
+ * harness (authentication never blocks; enforcement is governed by
66
+ * `permissionMode` at tool-call time). Kept optional so existing adapters
67
+ * that still pass it type-check.
66
68
  */
67
- sessionCanBlock: boolean;
69
+ sessionCanBlock?: boolean;
68
70
  /** Whether the tool gate can hard-block. Defaults to true. */
69
71
  toolCanBlock?: boolean;
70
72
  /** Set false when the plugin has no legacy OAuth2-token session path. */
@@ -36,12 +36,12 @@ exports.runHarnessContractSuite = runHarnessContractSuite;
36
36
  const vitest_1 = require("vitest");
37
37
  const config_js_1 = require("./config.js");
38
38
  const testing_js_1 = require("./testing.js");
39
- const DISABLED_DECISION = {
39
+ const DEFAULT_DECISION = {
40
40
  proceed: true,
41
- mode: "disabled",
42
- reason: "ORY_USER_LOGIN not enabled",
41
+ mode: "skipped",
42
+ reason: "no cached user identity in contract suite",
43
43
  };
44
- function makeGates(userDecision = DISABLED_DECISION) {
44
+ function makeGates(userDecision = DEFAULT_DECISION) {
45
45
  return {
46
46
  userLogin: vitest_1.vi.fn(async () => userDecision),
47
47
  agentGate: vitest_1.vi.fn(async () => ({
@@ -125,42 +125,33 @@ function runHarnessContractSuite(adapter) {
125
125
  (0, vitest_1.expect)(outcome.blocked).toBe(false);
126
126
  });
127
127
  });
128
- // ── User-login gate translation ────────────────────────────────
128
+ // ── User-login gate is advisory (never blocks the session) ─────
129
129
  (0, vitest_1.describe)("user-login gate", () => {
130
130
  const declined = {
131
131
  proceed: false,
132
132
  mode: "declined",
133
133
  reason: "User declined the OAuth2 consent screen",
134
134
  };
135
- (0, vitest_1.it)(adapter.sessionCanBlock
136
- ? "translates a declined login into the native session block"
137
- : "treats a declined login as advisory (no session block channel)", async () => {
135
+ (0, vitest_1.it)("never blocks the session even when the user login declines", async () => {
136
+ // Authentication is non-blocking on every harness; enforcement is
137
+ // governed by permissionMode at tool-call time, not here.
138
138
  const gates = makeGates(declined);
139
139
  const outcome = await adapter.sessionStart(ctx(gates));
140
- (0, vitest_1.expect)(outcome.blocked).toBe(adapter.sessionCanBlock);
141
- if (adapter.sessionCanBlock) {
142
- (0, vitest_1.expect)(outcome.reason).toBeTruthy();
143
- }
140
+ (0, vitest_1.expect)(outcome.blocked).toBe(false);
144
141
  });
145
142
  (0, vitest_1.it)("runs the agent gate even when the user gate declines", async () => {
146
143
  const gates = makeGates(declined);
147
144
  await adapter.sessionStart(ctx(gates));
148
145
  (0, vitest_1.expect)(gates.agentGate).toHaveBeenCalledOnce();
149
146
  });
150
- (0, vitest_1.it)("proceeds without legacy verification when the gate handled auth", async () => {
147
+ (0, vitest_1.it)("never runs a legacy session-token verification path", async () => {
148
+ // The user gate owns authentication; there is no separate legacy
149
+ // verify/introspect fall-through any longer.
151
150
  process.env.ORY_SESSION_TOKEN = "should-not-be-verified";
152
151
  const verify = (0, testing_js_1.stubSessionSuccess)(client);
153
- const gates = makeGates({ proceed: true, mode: "ok", reason: "logged in" });
154
- const outcome = await adapter.sessionStart(ctx(gates));
155
- (0, vitest_1.expect)(outcome.blocked).toBe(false);
156
- (0, vitest_1.expect)(verify).not.toHaveBeenCalled();
157
- });
158
- (0, vitest_1.it)("falls through to legacy verification when the gate is disabled", async () => {
159
- process.env.ORY_SESSION_TOKEN = "legacy-token";
160
- const verify = (0, testing_js_1.stubSessionSuccess)(client);
161
152
  const outcome = await adapter.sessionStart(ctx());
162
153
  (0, vitest_1.expect)(outcome.blocked).toBe(false);
163
- (0, vitest_1.expect)(verify).toHaveBeenCalled();
154
+ (0, vitest_1.expect)(verify).not.toHaveBeenCalled();
164
155
  });
165
156
  });
166
157
  // ── Tool gate translation ──────────────────────────────────────
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Entry point invoked by each harness CLI's `dashboard` case. Returns the
3
+ * intended process exit code; never throws. With `--json` (or when no browser
4
+ * can be opened) it prints the report and resolves immediately; otherwise it
5
+ * opens the web app in `status` mode and resolves when the SPA requests
6
+ * shutdown or the user interrupts (Ctrl+C).
7
+ */
8
+ export declare function runDashboardCommand(binName: string, harness: string, args: string[]): Promise<number>;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runDashboardCommand = runDashboardCommand;
4
+ /**
5
+ * Shared `dashboard` CLI implementation. Each harness's `cli/main.ts`
6
+ * delegates `<bin> dashboard` here.
7
+ *
8
+ * The dashboard is the live status view of the plugin, and one of the two
9
+ * surfaces of the Ory Agent web app (the other being the guided installer): it
10
+ * opens that app in `status` mode via {@link file://./web/launch.ts}'s
11
+ * `launchWebDashboard`, reusing the same loopback server + React SPA. The data
12
+ * it renders is the shared {@link file://./status-data.ts} `StatusReport`,
13
+ * which the dashboard extends with a "System information" section — the health
14
+ * of the core Ory services (Kratos, Hydra, Keto) from
15
+ * {@link file://./status-system.ts}.
16
+ *
17
+ * Besides reading status, the dashboard exposes a "Change stack" action that
18
+ * hands off to the same guided wizard the installer uses (embedded, starting on
19
+ * the stack chooser) so the user can reconfigure which Ory stack the plugin runs
20
+ * against — Ory Network, the local stack, or audit-only — without leaving the
21
+ * browser. It reuses the shared install API and reloads status on return.
22
+ *
23
+ * Flags:
24
+ * --json Print the status report as JSON and exit (no server). Also the
25
+ * automatic fallback when a browser can't be opened (headless / CI).
26
+ */
27
+ const launch_js_1 = require("./web/launch.js");
28
+ const status_data_js_1 = require("./status-data.js");
29
+ const cli_invocation_js_1 = require("./cli-invocation.js");
30
+ function printDashboardHelp(binName) {
31
+ console.log(`Usage: ${binName} dashboard [options]`);
32
+ console.log("");
33
+ console.log("Open the Ory Agent dashboard in your browser — a live view of the");
34
+ console.log("plugin's configuration and the health of the core Ory services (Kratos,");
35
+ console.log("Hydra, Keto), refreshing live. It is the status surface of the same web");
36
+ console.log("app that powers the guided installer, and its \"Change stack\" action lets");
37
+ console.log("you reconfigure which Ory stack the plugin runs against.");
38
+ console.log("");
39
+ console.log("Options:");
40
+ console.log(" --json Print the status report as JSON and exit (no server)");
41
+ console.log("");
42
+ console.log(` ${(0, cli_invocation_js_1.oryNpx)(binName)} dashboard`);
43
+ }
44
+ /**
45
+ * Entry point invoked by each harness CLI's `dashboard` case. Returns the
46
+ * intended process exit code; never throws. With `--json` (or when no browser
47
+ * can be opened) it prints the report and resolves immediately; otherwise it
48
+ * opens the web app in `status` mode and resolves when the SPA requests
49
+ * shutdown or the user interrupts (Ctrl+C).
50
+ */
51
+ async function runDashboardCommand(binName, harness, args) {
52
+ if (args.includes("--help") || args.includes("-h")) {
53
+ printDashboardHelp(binName);
54
+ return 0;
55
+ }
56
+ // `--json`, or any environment where we can't open a browser (CI, no TTY,
57
+ // no display), falls back to the machine-readable report on stdout.
58
+ if (args.includes("--json") || !(0, launch_js_1.canLaunchBrowser)()) {
59
+ const report = await (0, status_data_js_1.collectStatusReport)(harness);
60
+ console.log(JSON.stringify(report, null, 2));
61
+ return 0;
62
+ }
63
+ const launched = await (0, launch_js_1.launchWebDashboard)(binName, harness);
64
+ if (!launched) {
65
+ console.error("Could not start the dashboard server.");
66
+ console.error(`Use "${(0, cli_invocation_js_1.oryNpx)(binName)} dashboard --json" for the raw report instead.`);
67
+ return 1;
68
+ }
69
+ return 0;
70
+ }
package/dist/dev.js CHANGED
@@ -417,9 +417,8 @@ function buildLocalOryEnv(gatewayUrl, seed) {
417
417
  return {
418
418
  ORY_PROJECT_URL: gatewayUrl,
419
419
  ORY_PERMISSION_NAMESPACE: seed.permissions.namespace,
420
- // User login always on in local dev so the launcher demonstrates
421
- // the interactive PKCE login UX end-to-end every session.
422
- ORY_USER_LOGIN: "true",
420
+ // User login runs every session (always on); no flag needed. The launcher
421
+ // demonstrates the interactive PKCE login UX end-to-end.
423
422
  // Agent identity — the harness self-registers via DCR on first run
424
423
  // using the user's bearer as the initial access token. No static
425
424
  // client_credentials are seeded; explicitly clear them so a leaking
@@ -498,7 +497,7 @@ async function bootstrapLocalOry(localDir) {
498
497
  console.warn(`[ory-dev] Local Ory: seed failed (${msg}). Continuing without local Ory.`);
499
498
  return { active: false };
500
499
  }
501
- console.log(`[ory-dev] Local Ory: agent ${seed.agent.identity.email}, user ${seed.user.identity.email}, ` +
500
+ console.log(`[ory-dev] Local Ory: user ${seed.user.identity.email}, ` +
502
501
  `${seed.permissions.tuples} permissions in '${namespace}' for ${seed.permissions.subject}.`);
503
502
  return { active: true, gatewayUrl, seed };
504
503
  }
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  export { OryAgentClient, type OryAgentConfig, type PrincipalIdentity, } from "./client.js";
2
2
  export { DebugLogger, redactLogData, withQuietStderr, type LogEntry, type LogLevel, } from "./logger.js";
3
3
  export { Tracer, ActiveSpan, deriveTraceId, formatSpan, watchTraceFile, type TraceEvent, type SpanStatus, type TraceSpan, type SpanOptions, type TracerOptions, type TracerContext, type SpanAttributeEnricher, } from "./tracer.js";
4
- export { loadConfig, saveConfig, resolveConfig, mutateConfig, getConfigPath, getDataDir, getHarnessDataDir, type OryPluginConfig, type OryOAuth2Tokens, type OryUserCredentials, type OryAgentCredentialsBlock, type OryAgentDynamicCredentials, type PermissionMode, } from "./config.js";
4
+ export { loadConfig, saveConfig, resolveConfig, mutateConfig, getConfigPath, getDataDir, getHarnessDataDir, type OryPluginConfig, type OryOAuth2Tokens, type OryUserCredentials, type OryAgentCredentialsBlock, type OryAgentDynamicCredentials, type OryDelegationRecord, type PermissionMode, } from "./config.js";
5
5
  export { pkceLogin, refreshAccessToken, detectHeadless, generateCodeVerifier, sha256Base64Url, buildAuthorizeUrl, LOOPBACK_PORTS, DEFAULT_LOGIN_TIMEOUT_MS, type PkceLoginOptions, type PkceLoginOutcome, type PkceDeclineReason, } from "./auth.js";
6
6
  export { loadTokens, saveTokens, clearTokens, isExpired, refreshAndSave, tryAcquirePkceFlightLock, clearPkceFlightLock, waitForPeerTokens, waitForPeerTokensSync, TOKEN_EXPIRY_SKEW_SEC, type PkceFlightLock, } from "./auth-store.js";
7
7
  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 RevokeAgentClientResult, type SubAgentIdentity, type EnsureSubAgentIdentityOptions, } from "./agent-auth.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
9
  export { clearCredentialsForUninstall, type ClearCredentialsOptions, type ClearCredentialsResult, } from "./uninstall.js";
10
10
  export { type SessionInfo, type OAuth2TokenInfo, type PermissionCheck, type PermissionResult, type BatchPermissionResult, type OryError, type OryErrorCode, } from "./types.js";
11
11
  export { runConfigureCommand, runAgentCommand, printOryConfig, printEnvironment, printLogTail, printEnvHelp, printTraceTail, runWatchCommand, isTtyAvailable, promptOnTty, promptForProjectUrl, interactiveConfigPrompt, } from "./cli.js";
@@ -13,12 +13,17 @@ export { oryNpx } from "./cli-invocation.js";
13
13
  export { runPermissionsCommand, isUserIdentityCached, maybeAutoBootstrap, printPermissionsOnboardingHelp, } from "./permissions-cli.js";
14
14
  export { runInteractiveSetup, runPostInstall, projectUrlFromSlug, LOOPBACK_REDIRECT_URIS, type OryCliRunner, type OryExecResult, type InteractiveSetupDeps, type InteractiveSetupOutcome, type InteractiveSetupResult, } from "./interactive-setup.js";
15
15
  export { runStatusCommand, printUserIdentitySection, printAgentIdentitySection, printPermissionsSection, type StatusCommandOptions, } from "./status-cli.js";
16
+ 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";
16
21
  export { runVersionCommand, collectVersionInfo, resolveBuildInfo, type BuildInfo, type VersionInfo, type VersionCommandOptions, } from "./version-cli.js";
17
- export { parseSetupArgs, readJsonFile, writeJsonFile, isOryHookCommand, resolveHookCommand, matcherHookEntry, mergeMatcherHooks, removeMatcherHooks, flatHookEntry, mergeFlatHooks, removeFlatHooks, printSetupHelp, printNextSteps, nextStepsSink, beginDeferNextSteps, emitDeferredNextSteps, resolveMcpServerCommand, mcpServerEntry, mergeMcpServer, removeMcpServer, registerPlugin, unregisterPlugin, type SetupArgs, type HookCommand, type MatcherEntry, } from "./setup.js";
22
+ export { parseSetupArgs, readJsonFile, writeJsonFile, isOryHookCommand, resolveHookCommand, pinHookToLocalRegistry, matcherHookEntry, mergeMatcherHooks, removeMatcherHooks, flatHookEntry, mergeFlatHooks, removeFlatHooks, printSetupHelp, printNextSteps, nextStepsSink, beginDeferNextSteps, emitDeferredNextSteps, resolveMcpServerCommand, mcpServerEntry, mergeMcpServer, removeMcpServer, registerPlugin, unregisterPlugin, type SetupArgs, type HookCommand, type MatcherEntry, } from "./setup.js";
18
23
  export { runDevLauncher, type DevLauncherConfig, type InstallContext, } from "./dev.js";
19
24
  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";
20
25
  export { runLocalCommand, ensureDevJaeger, stopDevJaeger, DEV_JAEGER_CONTAINER, type EnsureDevJaegerResult, type StopDevJaegerResult, } from "./local/index.js";
21
- export { runRegistryCommand } from "./registry/index.js";
26
+ export { runRegistryCommand, REGISTRY_URL } from "./registry/index.js";
22
27
  export { checkAndDecide, applyPermissionMode, gateToolCall, type PermissionDecision, type ModeDecision, type DecisionSpanAttributes, type CheckAndDecideOptions, type ApplyPermissionModeContext, type GateToolCallArgs, type ToolGateOutcome, } from "./permissions.js";
23
28
  export { HARNESS_TOOL_CATALOG, KNOWN_HARNESSES, ALL_TOOLS, getToolCatalog, INTERACTIVE_TOOL_CATALOG, getInteractiveToolCatalog, isInteractiveTool, type KnownHarness, } from "./tool-catalog.js";
24
29
  export { classifyLifecycle, isUserFacingPhase, isToolExecutionPhase, HARNESS_LIFECYCLE_MAP, USER_FACING_PHASES, TOOL_EXECUTION_PHASES, type LifecyclePhase, } from "./lifecycle.js";
@@ -28,3 +33,5 @@ export { formatDenialMessage, formatDenialSummary, formatAlertMessage, formatAle
28
33
  export { summarizeToolInput, summarizeToolOutput, type ToolInputSummary, type ToolOutputSummary, } from "./tool-metadata.js";
29
34
  export { OtlpExporter, otlpExporterFromEnv, parseKeyValueList, type SpanExporter, type OtlpExporterOptions, type OtlpProtocol, } from "./otel/index.js";
30
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";
36
+ export { collectSystemServices, type StatusSystemSection, type StatusSystemService, } from "./status-system.js";
37
+ export { runDashboardCommand } from "./dashboard-cli.js";
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.clearCredentialsForUninstall = exports.AGENT_TOKEN_EXPIRY_SKEW_SEC = exports.revokeAgentDynamicClient = exports.clearSubAgentDynamicCredentials = exports.saveSubAgentDynamicCredentials = exports.loadSubAgentDynamicCredentials = exports.clearAgentDynamicCredentials = exports.saveAgentDynamicCredentials = exports.loadAgentDynamicCredentials = exports.registerAgentClient = exports.fetchClientCredentialsToken = exports.ensureSubAgentIdentity = exports.ensureAgentIdentity = exports.resolveAgentCredentials = exports.ensureAuthenticated = exports.ensureUserAuthenticated = exports.TOKEN_EXPIRY_SKEW_SEC = exports.waitForPeerTokensSync = exports.waitForPeerTokens = exports.clearPkceFlightLock = exports.tryAcquirePkceFlightLock = exports.refreshAndSave = exports.isExpired = exports.clearTokens = exports.saveTokens = exports.loadTokens = exports.DEFAULT_LOGIN_TIMEOUT_MS = exports.LOOPBACK_PORTS = exports.buildAuthorizeUrl = exports.sha256Base64Url = exports.generateCodeVerifier = exports.detectHeadless = exports.refreshAccessToken = exports.pkceLogin = exports.getHarnessDataDir = exports.getDataDir = exports.getConfigPath = exports.mutateConfig = exports.resolveConfig = exports.saveConfig = exports.loadConfig = exports.watchTraceFile = exports.formatSpan = exports.deriveTraceId = exports.ActiveSpan = exports.Tracer = exports.withQuietStderr = exports.redactLogData = exports.DebugLogger = exports.OryAgentClient = void 0;
4
- exports.unregisterPlugin = exports.registerPlugin = exports.removeMcpServer = exports.mergeMcpServer = exports.mcpServerEntry = exports.resolveMcpServerCommand = exports.emitDeferredNextSteps = exports.beginDeferNextSteps = exports.nextStepsSink = exports.printNextSteps = exports.printSetupHelp = exports.removeFlatHooks = exports.mergeFlatHooks = exports.flatHookEntry = exports.removeMatcherHooks = exports.mergeMatcherHooks = exports.matcherHookEntry = exports.resolveHookCommand = exports.isOryHookCommand = exports.writeJsonFile = exports.readJsonFile = exports.parseSetupArgs = exports.resolveBuildInfo = exports.collectVersionInfo = exports.runVersionCommand = exports.printPermissionsSection = exports.printAgentIdentitySection = exports.printUserIdentitySection = exports.runStatusCommand = exports.LOOPBACK_REDIRECT_URIS = exports.projectUrlFromSlug = exports.runPostInstall = exports.runInteractiveSetup = exports.printPermissionsOnboardingHelp = exports.maybeAutoBootstrap = exports.isUserIdentityCached = exports.runPermissionsCommand = exports.oryNpx = exports.interactiveConfigPrompt = exports.promptForProjectUrl = exports.promptOnTty = exports.isTtyAvailable = exports.runWatchCommand = exports.printTraceTail = exports.printEnvHelp = exports.printLogTail = exports.printEnvironment = exports.printOryConfig = exports.runAgentCommand = exports.runConfigureCommand = void 0;
5
- exports.OtlpExporter = exports.summarizeToolOutput = exports.summarizeToolInput = exports.OryDenialError = exports.alertAttributes = exports.formatAlertSummary = exports.formatAlertMessage = exports.formatDenialSummary = exports.formatDenialMessage = exports.subjectLabel = exports.runWithUserSubject = exports.resolveUserSubject = exports.checkMcpPermission = exports.parseMcpToolGeneric = exports.parseGeminiMcpTool = exports.parseClaudeCodeMcpTool = exports.TOOL_EXECUTION_PHASES = exports.USER_FACING_PHASES = exports.HARNESS_LIFECYCLE_MAP = exports.isToolExecutionPhase = exports.isUserFacingPhase = exports.classifyLifecycle = exports.isInteractiveTool = exports.getInteractiveToolCatalog = exports.INTERACTIVE_TOOL_CATALOG = exports.getToolCatalog = exports.ALL_TOOLS = exports.KNOWN_HARNESSES = exports.HARNESS_TOOL_CATALOG = exports.gateToolCall = exports.applyPermissionMode = exports.checkAndDecide = exports.runRegistryCommand = exports.DEV_JAEGER_CONTAINER = exports.stopDevJaeger = exports.ensureDevJaeger = exports.runLocalCommand = exports.ORY_COMMAND_SLUGS = exports.ORY_COMMAND_SKILL_NAMES = exports.ORY_SKILL_NAMES = exports.removeSkillDirs = exports.writeSkillTree = exports.toSkillMarkdown = exports.commandToPlainMarkdown = exports.commandToFrontmatterMarkdown = exports.commandToToml = exports.commandToSkill = exports.renderOryCommands = exports.renderOrySkills = exports.runDevLauncher = void 0;
6
- exports.wrapTool = exports.writeAgentDelegatesSubagent = exports.writeUserDelegatesAgent = exports.registerSubagent = exports.complete = exports.gate = exports.sessionStart = exports.resolveNamespace = exports.parseKeyValueList = exports.otlpExporterFromEnv = void 0;
4
+ exports.collectVersionInfo = exports.runVersionCommand = exports.startServer = exports.launchWebDashboard = exports.launchWebInstaller = exports.canLaunchBrowser = exports.configureLocalStack = exports.configureAuditOnly = exports.provisionProjectApiKey = exports.grantToolPermissions = exports.provisionPermissions = exports.inspectPermissions = exports.runFullSetup = exports.saveNetworkConfig = exports.provisionOAuth2Client = exports.enableDcrAction = exports.getDcrState = exports.resolveProjectUrl = exports.createProject = exports.createWorkspace = exports.listWorkspaces = exports.isSignedIn = exports.ensureOryCli = exports.probePermissionsCoverage = exports.collectStatusReport = exports.printPermissionsSection = exports.printAgentIdentitySection = exports.printUserIdentitySection = exports.runStatusCommand = exports.LOOPBACK_REDIRECT_URIS = exports.projectUrlFromSlug = exports.runPostInstall = exports.runInteractiveSetup = exports.printPermissionsOnboardingHelp = exports.maybeAutoBootstrap = exports.isUserIdentityCached = exports.runPermissionsCommand = exports.oryNpx = exports.interactiveConfigPrompt = exports.promptForProjectUrl = exports.promptOnTty = exports.isTtyAvailable = exports.runWatchCommand = exports.printTraceTail = exports.printEnvHelp = exports.printLogTail = exports.printEnvironment = exports.printOryConfig = exports.runAgentCommand = exports.runConfigureCommand = void 0;
5
+ exports.getToolCatalog = exports.ALL_TOOLS = exports.KNOWN_HARNESSES = exports.HARNESS_TOOL_CATALOG = exports.gateToolCall = exports.applyPermissionMode = exports.checkAndDecide = exports.REGISTRY_URL = exports.runRegistryCommand = exports.DEV_JAEGER_CONTAINER = exports.stopDevJaeger = exports.ensureDevJaeger = exports.runLocalCommand = exports.ORY_COMMAND_SLUGS = exports.ORY_COMMAND_SKILL_NAMES = exports.ORY_SKILL_NAMES = exports.removeSkillDirs = exports.writeSkillTree = exports.toSkillMarkdown = exports.commandToPlainMarkdown = exports.commandToFrontmatterMarkdown = exports.commandToToml = exports.commandToSkill = exports.renderOryCommands = exports.renderOrySkills = exports.runDevLauncher = exports.unregisterPlugin = exports.registerPlugin = exports.removeMcpServer = exports.mergeMcpServer = exports.mcpServerEntry = exports.resolveMcpServerCommand = exports.emitDeferredNextSteps = exports.beginDeferNextSteps = exports.nextStepsSink = exports.printNextSteps = exports.printSetupHelp = exports.removeFlatHooks = exports.mergeFlatHooks = exports.flatHookEntry = exports.removeMatcherHooks = exports.mergeMatcherHooks = exports.matcherHookEntry = exports.pinHookToLocalRegistry = exports.resolveHookCommand = exports.isOryHookCommand = exports.writeJsonFile = exports.readJsonFile = exports.parseSetupArgs = exports.resolveBuildInfo = void 0;
6
+ exports.runDashboardCommand = exports.collectSystemServices = exports.wrapTool = exports.writeAgentDelegatesSubagent = exports.writeUserDelegatesAgent = exports.registerSubagent = exports.complete = exports.gate = exports.sessionStart = exports.resolveNamespace = exports.parseKeyValueList = exports.otlpExporterFromEnv = exports.OtlpExporter = exports.summarizeToolOutput = exports.summarizeToolInput = exports.OryDenialError = exports.alertAttributes = exports.formatAlertSummary = exports.formatAlertMessage = exports.formatDenialSummary = exports.formatDenialMessage = exports.subjectLabel = exports.runWithUserSubject = exports.resolveUserSubject = exports.checkMcpPermission = exports.parseMcpToolGeneric = exports.parseGeminiMcpTool = exports.parseClaudeCodeMcpTool = exports.TOOL_EXECUTION_PHASES = exports.USER_FACING_PHASES = exports.HARNESS_LIFECYCLE_MAP = exports.isToolExecutionPhase = exports.isUserFacingPhase = exports.classifyLifecycle = exports.isInteractiveTool = exports.getInteractiveToolCatalog = exports.INTERACTIVE_TOOL_CATALOG = void 0;
7
7
  var client_js_1 = require("./client.js");
8
8
  Object.defineProperty(exports, "OryAgentClient", { enumerable: true, get: function () { return client_js_1.OryAgentClient; } });
9
9
  var logger_js_1 = require("./logger.js");
@@ -93,6 +93,33 @@ Object.defineProperty(exports, "runStatusCommand", { enumerable: true, get: func
93
93
  Object.defineProperty(exports, "printUserIdentitySection", { enumerable: true, get: function () { return status_cli_js_1.printUserIdentitySection; } });
94
94
  Object.defineProperty(exports, "printAgentIdentitySection", { enumerable: true, get: function () { return status_cli_js_1.printAgentIdentitySection; } });
95
95
  Object.defineProperty(exports, "printPermissionsSection", { enumerable: true, get: function () { return status_cli_js_1.printPermissionsSection; } });
96
+ var status_data_js_1 = require("./status-data.js");
97
+ Object.defineProperty(exports, "collectStatusReport", { enumerable: true, get: function () { return status_data_js_1.collectStatusReport; } });
98
+ Object.defineProperty(exports, "probePermissionsCoverage", { enumerable: true, get: function () { return status_data_js_1.probePermissionsCoverage; } });
99
+ var setup_actions_js_1 = require("./setup-actions.js");
100
+ Object.defineProperty(exports, "ensureOryCli", { enumerable: true, get: function () { return setup_actions_js_1.ensureOryCli; } });
101
+ Object.defineProperty(exports, "isSignedIn", { enumerable: true, get: function () { return setup_actions_js_1.isSignedIn; } });
102
+ Object.defineProperty(exports, "listWorkspaces", { enumerable: true, get: function () { return setup_actions_js_1.listWorkspaces; } });
103
+ Object.defineProperty(exports, "createWorkspace", { enumerable: true, get: function () { return setup_actions_js_1.createWorkspace; } });
104
+ Object.defineProperty(exports, "createProject", { enumerable: true, get: function () { return setup_actions_js_1.createProject; } });
105
+ Object.defineProperty(exports, "resolveProjectUrl", { enumerable: true, get: function () { return setup_actions_js_1.resolveProjectUrl; } });
106
+ Object.defineProperty(exports, "getDcrState", { enumerable: true, get: function () { return setup_actions_js_1.getDcrState; } });
107
+ Object.defineProperty(exports, "enableDcrAction", { enumerable: true, get: function () { return setup_actions_js_1.enableDcrAction; } });
108
+ Object.defineProperty(exports, "provisionOAuth2Client", { enumerable: true, get: function () { return setup_actions_js_1.provisionOAuth2Client; } });
109
+ Object.defineProperty(exports, "saveNetworkConfig", { enumerable: true, get: function () { return setup_actions_js_1.saveNetworkConfig; } });
110
+ Object.defineProperty(exports, "runFullSetup", { enumerable: true, get: function () { return setup_actions_js_1.runFullSetup; } });
111
+ Object.defineProperty(exports, "inspectPermissions", { enumerable: true, get: function () { return setup_actions_js_1.inspectPermissions; } });
112
+ Object.defineProperty(exports, "provisionPermissions", { enumerable: true, get: function () { return setup_actions_js_1.provisionPermissions; } });
113
+ Object.defineProperty(exports, "grantToolPermissions", { enumerable: true, get: function () { return setup_actions_js_1.grantToolPermissions; } });
114
+ Object.defineProperty(exports, "provisionProjectApiKey", { enumerable: true, get: function () { return setup_actions_js_1.provisionProjectApiKey; } });
115
+ Object.defineProperty(exports, "configureAuditOnly", { enumerable: true, get: function () { return setup_actions_js_1.configureAuditOnly; } });
116
+ Object.defineProperty(exports, "configureLocalStack", { enumerable: true, get: function () { return setup_actions_js_1.configureLocalStack; } });
117
+ var launch_js_1 = require("./web/launch.js");
118
+ Object.defineProperty(exports, "canLaunchBrowser", { enumerable: true, get: function () { return launch_js_1.canLaunchBrowser; } });
119
+ Object.defineProperty(exports, "launchWebInstaller", { enumerable: true, get: function () { return launch_js_1.launchWebInstaller; } });
120
+ Object.defineProperty(exports, "launchWebDashboard", { enumerable: true, get: function () { return launch_js_1.launchWebDashboard; } });
121
+ var server_js_1 = require("./web/server.js");
122
+ Object.defineProperty(exports, "startServer", { enumerable: true, get: function () { return server_js_1.startServer; } });
96
123
  var version_cli_js_1 = require("./version-cli.js");
97
124
  Object.defineProperty(exports, "runVersionCommand", { enumerable: true, get: function () { return version_cli_js_1.runVersionCommand; } });
98
125
  Object.defineProperty(exports, "collectVersionInfo", { enumerable: true, get: function () { return version_cli_js_1.collectVersionInfo; } });
@@ -103,6 +130,7 @@ Object.defineProperty(exports, "readJsonFile", { enumerable: true, get: function
103
130
  Object.defineProperty(exports, "writeJsonFile", { enumerable: true, get: function () { return setup_js_1.writeJsonFile; } });
104
131
  Object.defineProperty(exports, "isOryHookCommand", { enumerable: true, get: function () { return setup_js_1.isOryHookCommand; } });
105
132
  Object.defineProperty(exports, "resolveHookCommand", { enumerable: true, get: function () { return setup_js_1.resolveHookCommand; } });
133
+ Object.defineProperty(exports, "pinHookToLocalRegistry", { enumerable: true, get: function () { return setup_js_1.pinHookToLocalRegistry; } });
106
134
  Object.defineProperty(exports, "matcherHookEntry", { enumerable: true, get: function () { return setup_js_1.matcherHookEntry; } });
107
135
  Object.defineProperty(exports, "mergeMatcherHooks", { enumerable: true, get: function () { return setup_js_1.mergeMatcherHooks; } });
108
136
  Object.defineProperty(exports, "removeMatcherHooks", { enumerable: true, get: function () { return setup_js_1.removeMatcherHooks; } });
@@ -142,6 +170,7 @@ Object.defineProperty(exports, "stopDevJaeger", { enumerable: true, get: functio
142
170
  Object.defineProperty(exports, "DEV_JAEGER_CONTAINER", { enumerable: true, get: function () { return index_js_1.DEV_JAEGER_CONTAINER; } });
143
171
  var index_js_2 = require("./registry/index.js");
144
172
  Object.defineProperty(exports, "runRegistryCommand", { enumerable: true, get: function () { return index_js_2.runRegistryCommand; } });
173
+ Object.defineProperty(exports, "REGISTRY_URL", { enumerable: true, get: function () { return index_js_2.REGISTRY_URL; } });
145
174
  var permissions_js_1 = require("./permissions.js");
146
175
  Object.defineProperty(exports, "checkAndDecide", { enumerable: true, get: function () { return permissions_js_1.checkAndDecide; } });
147
176
  Object.defineProperty(exports, "applyPermissionMode", { enumerable: true, get: function () { return permissions_js_1.applyPermissionMode; } });
@@ -193,3 +222,10 @@ Object.defineProperty(exports, "registerSubagent", { enumerable: true, get: func
193
222
  Object.defineProperty(exports, "writeUserDelegatesAgent", { enumerable: true, get: function () { return adapters_js_1.writeUserDelegatesAgent; } });
194
223
  Object.defineProperty(exports, "writeAgentDelegatesSubagent", { enumerable: true, get: function () { return adapters_js_1.writeAgentDelegatesSubagent; } });
195
224
  Object.defineProperty(exports, "wrapTool", { enumerable: true, get: function () { return adapters_js_1.wrapTool; } });
225
+ // ─── Dashboard (status surface of the web app) ──────────────────────────────
226
+ // Appended at EOF (outside the web-installer branch's edit region) so the two
227
+ // branches merge without an index.ts conflict.
228
+ var status_system_js_1 = require("./status-system.js");
229
+ Object.defineProperty(exports, "collectSystemServices", { enumerable: true, get: function () { return status_system_js_1.collectSystemServices; } });
230
+ var dashboard_cli_js_1 = require("./dashboard-cli.js");
231
+ Object.defineProperty(exports, "runDashboardCommand", { enumerable: true, get: function () { return dashboard_cli_js_1.runDashboardCommand; } });