@ory/argus 0.13.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +31 -45
  2. package/assets/commands/temporal-up.md +1 -1
  3. package/assets/skills/auth-setup/SKILL.md +1 -1
  4. package/assets/skills/local-dev/SKILL.md +17 -7
  5. package/assets/skills/ory-build-agent/SKILL.md +43 -97
  6. package/assets/skills/ory-e2b-sandbox/SKILL.md +18 -18
  7. package/assets/skills/ory-temporal-worker/SKILL.md +38 -42
  8. package/assets/skills/permissions-onboarding/SKILL.md +131 -104
  9. package/dist/adapters.d.ts +93 -30
  10. package/dist/adapters.js +464 -136
  11. package/dist/agent-auth.d.ts +258 -68
  12. package/dist/agent-auth.js +998 -202
  13. package/dist/auth-store.d.ts +37 -2
  14. package/dist/auth-store.js +37 -3
  15. package/dist/auth.d.ts +40 -4
  16. package/dist/auth.js +247 -19
  17. package/dist/bash-parser.d.ts +98 -0
  18. package/dist/bash-parser.js +396 -0
  19. package/dist/branding.d.ts +128 -0
  20. package/dist/branding.js +151 -0
  21. package/dist/build-info.json +4 -4
  22. package/dist/cli-invocation.d.ts +1 -1
  23. package/dist/cli-invocation.js +2 -1
  24. package/dist/cli.d.ts +20 -29
  25. package/dist/cli.js +271 -278
  26. package/dist/client.d.ts +175 -138
  27. package/dist/client.js +672 -391
  28. package/dist/config.d.ts +249 -57
  29. package/dist/config.js +486 -62
  30. package/dist/context.d.ts +10 -0
  31. package/dist/context.js +21 -0
  32. package/dist/contract-suite.d.ts +8 -8
  33. package/dist/contract-suite.js +88 -69
  34. package/dist/denial.d.ts +36 -3
  35. package/dist/denial.js +79 -10
  36. package/dist/event-reporter.d.ts +77 -0
  37. package/dist/event-reporter.js +776 -0
  38. package/dist/external-registrations-main.d.ts +10 -0
  39. package/dist/external-registrations-main.js +38 -0
  40. package/dist/external-registrations.d.ts +79 -0
  41. package/dist/external-registrations.js +188 -0
  42. package/dist/help-cli.d.ts +39 -0
  43. package/dist/help-cli.js +55 -0
  44. package/dist/hook-timeout.d.ts +64 -0
  45. package/dist/hook-timeout.js +88 -0
  46. package/dist/index.d.ts +31 -19
  47. package/dist/index.js +182 -31
  48. package/dist/lifecycle.d.ts +3 -3
  49. package/dist/lifecycle.js +38 -6
  50. package/dist/local/cli.js +11 -6
  51. package/dist/local/configs.d.ts +74 -18
  52. package/dist/local/configs.js +291 -84
  53. package/dist/local/health.d.ts +14 -0
  54. package/dist/local/health.js +50 -4
  55. package/dist/local/index.d.ts +2 -2
  56. package/dist/local/index.js +24 -10
  57. package/dist/local/manager.d.ts +20 -1
  58. package/dist/local/manager.js +160 -39
  59. package/dist/local/ports.d.ts +158 -0
  60. package/dist/local/ports.js +443 -0
  61. package/dist/local/seed.d.ts +22 -25
  62. package/dist/local/seed.js +88 -56
  63. package/dist/logger.d.ts +54 -25
  64. package/dist/logger.js +329 -63
  65. package/dist/mcp.d.ts +2 -2
  66. package/dist/mcp.js +10 -5
  67. package/dist/mirror-bootstrap.d.ts +48 -0
  68. package/dist/mirror-bootstrap.js +254 -0
  69. package/dist/opl.d.ts +289 -0
  70. package/dist/opl.js +446 -0
  71. package/dist/permission-mode.d.ts +87 -0
  72. package/dist/permission-mode.js +307 -0
  73. package/dist/permissions-cli.d.ts +13 -49
  74. package/dist/permissions-cli.js +154 -348
  75. package/dist/permissions.d.ts +148 -38
  76. package/dist/permissions.js +591 -45
  77. package/dist/post-install.d.ts +33 -0
  78. package/dist/post-install.js +127 -0
  79. package/dist/read-credential.d.ts +65 -0
  80. package/dist/read-credential.js +86 -0
  81. package/dist/registry/cli.js +5 -2
  82. package/dist/registry/config.d.ts +0 -17
  83. package/dist/registry/config.js +0 -23
  84. package/dist/registry/index.d.ts +1 -1
  85. package/dist/registry/index.js +2 -2
  86. package/dist/registry/manager.d.ts +4 -21
  87. package/dist/registry/manager.js +83 -55
  88. package/dist/runtime-credential.d.ts +140 -0
  89. package/dist/runtime-credential.js +572 -0
  90. package/dist/runtime.d.ts +408 -0
  91. package/dist/runtime.js +748 -0
  92. package/dist/setup.d.ts +23 -28
  93. package/dist/setup.js +57 -84
  94. package/dist/status-cli.d.ts +29 -13
  95. package/dist/status-cli.js +124 -144
  96. package/dist/status-data.d.ts +195 -0
  97. package/dist/status-data.js +333 -0
  98. package/dist/status-system.d.ts +24 -0
  99. package/dist/status-system.js +56 -0
  100. package/dist/subject.d.ts +126 -20
  101. package/dist/subject.js +215 -30
  102. package/dist/testing.d.ts +74 -38
  103. package/dist/testing.js +185 -68
  104. package/dist/tool-catalog.d.ts +53 -11
  105. package/dist/tool-catalog.js +164 -13
  106. package/dist/tool-metadata.d.ts +7 -6
  107. package/dist/tool-metadata.js +6 -5
  108. package/dist/types.d.ts +11 -1
  109. package/dist/uninstall.d.ts +74 -19
  110. package/dist/uninstall.js +224 -49
  111. package/dist/user-login.d.ts +22 -16
  112. package/dist/user-login.js +67 -96
  113. package/dist/watch-cli.d.ts +6 -0
  114. package/dist/watch-cli.js +217 -0
  115. package/package.json +3 -11
  116. package/dist/dev.d.ts +0 -103
  117. package/dist/dev.js +0 -584
  118. package/dist/interactive-setup.d.ts +0 -165
  119. package/dist/interactive-setup.js +0 -1546
  120. package/dist/local/jaeger-main.d.ts +0 -13
  121. package/dist/local/jaeger-main.js +0 -85
  122. package/dist/local/jaeger.d.ts +0 -50
  123. package/dist/local/jaeger.js +0 -162
  124. package/dist/otel/exporter.d.ts +0 -17
  125. package/dist/otel/exporter.js +0 -12
  126. package/dist/otel/index.d.ts +0 -2
  127. package/dist/otel/index.js +0 -8
  128. package/dist/otel/otlp.d.ts +0 -103
  129. package/dist/otel/otlp.js +0 -385
  130. package/dist/tracer.d.ts +0 -190
  131. package/dist/tracer.js +0 -481
  132. package/dist/watch-sandbox.d.ts +0 -9
  133. package/dist/watch-sandbox.js +0 -81
package/dist/setup.d.ts CHANGED
@@ -28,13 +28,14 @@ export declare function readJsonFile(filePath: string): Record<string, unknown>;
28
28
  export declare function writeJsonFile(filePath: string, data: unknown): void;
29
29
  /**
30
30
  * Check if a hook command belongs to an Ory plugin.
31
+ *
32
+ * The command written today is `node "<dataDir>/bin/ory-hook-<harness>.js"`, so
33
+ * the harness's own bin name no longer appears in it — matching goes through
34
+ * the shared runtime predicate, which also still recognizes the version-pinned
35
+ * `npx` commands earlier releases wrote so an install merge replaces them
36
+ * instead of running both.
31
37
  */
32
38
  export declare function isOryHookCommand(h: HookCommand, binName: string): boolean;
33
- /**
34
- * Resolve the hook command string for a plugin.
35
- * Tries require.resolve first, falls back to the global bin name.
36
- */
37
- export declare function resolveHookCommand(packageName: string, binName: string): string;
38
39
  /**
39
40
  * Build a matcher-based hook entry: `[{ matcher: "", hooks: [{ type: "command", command }] }]`
40
41
  */
@@ -59,27 +60,20 @@ export declare function mergeFlatHooks(existing: Record<string, unknown>, newHoo
59
60
  * Remove all Ory flat hooks from existing config.
60
61
  */
61
62
  export declare function removeFlatHooks(existing: Record<string, unknown>, binName: string): Record<string, unknown>;
62
- /**
63
- * Resolve the command + args needed to run the Ory MCP server.
64
- * Tries require.resolve first, falls back to the global bin name.
65
- */
66
- export declare function resolveMcpServerCommand(): {
67
- command: string;
68
- args: string[];
69
- };
70
63
  /**
71
64
  * Generate the mcpServers config object for the Ory MCP server.
65
+ *
66
+ * The command is always supplied by the caller: it is the MCP shim written when
67
+ * the runtime was resolved at install time. There is deliberately no fallback
68
+ * that re-resolves the package — a registration that resolves at *run* time is
69
+ * the thing this design removes.
72
70
  */
73
- export declare function mcpServerEntry(cmd?: {
71
+ export declare function mcpServerEntry(cmd: {
74
72
  command: string;
75
73
  args: string[];
76
74
  }): Record<string, unknown>;
77
- /**
78
- * Merge the Ory MCP server into an existing settings object's `mcpServers` key.
79
- * Pass an optional `cmd` to override the default resolution (useful when the
80
- * caller can resolve the mcp-server entry point more reliably than core can).
81
- */
82
- export declare function mergeMcpServer(existing: Record<string, unknown>, cmd?: {
75
+ /** Merge the Ory MCP server into an existing settings object's `mcpServers` key. */
76
+ export declare function mergeMcpServer(existing: Record<string, unknown>, cmd: {
83
77
  command: string;
84
78
  args: string[];
85
79
  }): Record<string, unknown>;
@@ -125,7 +119,7 @@ export type NextStepsRenderer = (opts: {
125
119
  export declare function beginDeferNextSteps(): void;
126
120
  /**
127
121
  * Print any captured next-steps output and stop deferring. `configured` tells
128
- * the renderer whether the wizard finished configuring Ory (so it can drop the
122
+ * the renderer whether the install finished configuring Ory (so it can drop the
129
123
  * manual setup steps, which would only contradict what's already saved).
130
124
  */
131
125
  export declare function emitDeferredNextSteps(configured?: boolean): void;
@@ -133,22 +127,23 @@ export declare function emitDeferredNextSteps(configured?: boolean): void;
133
127
  * Either run the next-steps printer now, or capture it for later when
134
128
  * deferral is active. Harness-specific next-steps printers (e.g. Codex's)
135
129
  * route through this so they participate in the same deferral. When run inline
136
- * (e.g. the standalone setup binary) no wizard configured anything, so the
130
+ * (e.g. the standalone setup binary) nothing configured a connection, so the
137
131
  * renderer is invoked with `configured: false`.
138
132
  */
139
133
  export declare function nextStepsSink(fn: NextStepsRenderer): void;
140
134
  /**
141
135
  * Print the "Next steps" text after successful setup. Deferred to the end of
142
- * an interactive install via {@link nextStepsSink} (see above). When the wizard
143
- * already connected Ory, prints a short launch summary instead of the manual
144
- * env-var setup steps.
136
+ * an install via {@link nextStepsSink} (see above). When the install already
137
+ * connected Ory, prints a short launch summary instead of the manual env-var
138
+ * setup steps.
145
139
  */
146
140
  export declare function printNextSteps(harnessName: string, uninstallCmd: string, opts?: NextStepsOpts): void;
147
141
  /**
148
142
  * Identity a harness passes to {@link printNextSteps} so the "you're all set"
149
- * message can emit copy-pasteable `status` / `watch` / `permissions` commands
150
- * and tailor itself to the mode the wizard actually configured (audit-only has
151
- * no enforcement step). Optional so older callers still get the short summary.
143
+ * message can emit copy-pasteable `status` / `permissions` commands
144
+ * and tailor itself to what the install configured (with Agent Security not
145
+ * connected there is no enforcement step to describe). Optional so older
146
+ * callers still get the short summary.
152
147
  */
153
148
  export interface NextStepsOpts {
154
149
  /** CLI bin name, e.g. `ory-claude` — used to render follow-up commands. */
package/dist/setup.js CHANGED
@@ -37,14 +37,12 @@ exports.parseSetupArgs = parseSetupArgs;
37
37
  exports.readJsonFile = readJsonFile;
38
38
  exports.writeJsonFile = writeJsonFile;
39
39
  exports.isOryHookCommand = isOryHookCommand;
40
- exports.resolveHookCommand = resolveHookCommand;
41
40
  exports.matcherHookEntry = matcherHookEntry;
42
41
  exports.mergeMatcherHooks = mergeMatcherHooks;
43
42
  exports.removeMatcherHooks = removeMatcherHooks;
44
43
  exports.flatHookEntry = flatHookEntry;
45
44
  exports.mergeFlatHooks = mergeFlatHooks;
46
45
  exports.removeFlatHooks = removeFlatHooks;
47
- exports.resolveMcpServerCommand = resolveMcpServerCommand;
48
46
  exports.mcpServerEntry = mcpServerEntry;
49
47
  exports.mergeMcpServer = mergeMcpServer;
50
48
  exports.removeMcpServer = removeMcpServer;
@@ -60,6 +58,7 @@ const os = __importStar(require("node:os"));
60
58
  const path = __importStar(require("node:path"));
61
59
  const cli_invocation_js_1 = require("./cli-invocation.js");
62
60
  const config_js_1 = require("./config.js");
61
+ const runtime_js_1 = require("./runtime.js");
63
62
  const ui = __importStar(require("./ui.js"));
64
63
  // ─── Arg Parsing ───────────────────────────────────────────────────
65
64
  /**
@@ -119,25 +118,17 @@ function writeJsonFile(filePath, data) {
119
118
  // ─── Hook Command Utilities ────────────────────────────────────────
120
119
  /**
121
120
  * Check if a hook command belongs to an Ory plugin.
121
+ *
122
+ * The command written today is `node "<dataDir>/bin/ory-hook-<harness>.js"`, so
123
+ * the harness's own bin name no longer appears in it — matching goes through
124
+ * the shared runtime predicate, which also still recognizes the version-pinned
125
+ * `npx` commands earlier releases wrote so an install merge replaces them
126
+ * instead of running both.
122
127
  */
123
128
  function isOryHookCommand(h, binName) {
124
- return h.command?.includes(binName) || h.command?.includes("ory-agent-plugins");
125
- }
126
- /**
127
- * Resolve the hook command string for a plugin.
128
- * Tries require.resolve first, falls back to the global bin name.
129
- */
130
- function resolveHookCommand(packageName, binName) {
131
- try {
132
- const binPath = require.resolve(packageName);
133
- // The package root resolves to the main entry (dist/index.js).
134
- // The hook script lives alongside it as dist/hook.js.
135
- const hookPath = path.resolve(path.dirname(binPath), "hook.js");
136
- return `node "${hookPath}"`;
137
- }
138
- catch {
139
- return binName;
140
- }
129
+ return ((0, runtime_js_1.isOryRuntimeCommand)(h.command) ||
130
+ h.command?.includes(binName) ||
131
+ h.command?.includes("ory-agent-plugins"));
141
132
  }
142
133
  // ─── Matcher-Based Hooks (Claude Code, Gemini CLI) ─────────────────
143
134
  /**
@@ -225,35 +216,21 @@ function removeFlatHooks(existing, binName) {
225
216
  }
226
217
  // ─── MCP Server Config ────────────────────────────────────────────
227
218
  const MCP_SERVER_NAME = "ory";
228
- const MCP_SERVER_PACKAGE = "@ory/mcp-server";
229
- /**
230
- * Resolve the command + args needed to run the Ory MCP server.
231
- * Tries require.resolve first, falls back to the global bin name.
232
- */
233
- function resolveMcpServerCommand() {
234
- try {
235
- const entryPoint = require.resolve(MCP_SERVER_PACKAGE);
236
- return { command: "node", args: [entryPoint] };
237
- }
238
- catch {
239
- return { command: "ory-mcp-server", args: [] };
240
- }
241
- }
242
219
  /**
243
220
  * Generate the mcpServers config object for the Ory MCP server.
221
+ *
222
+ * The command is always supplied by the caller: it is the MCP shim written when
223
+ * the runtime was resolved at install time. There is deliberately no fallback
224
+ * that re-resolves the package — a registration that resolves at *run* time is
225
+ * the thing this design removes.
244
226
  */
245
227
  function mcpServerEntry(cmd) {
246
- const resolved = cmd ?? resolveMcpServerCommand();
247
228
  return {
248
- command: resolved.command,
249
- ...(resolved.args.length > 0 ? { args: resolved.args } : {}),
229
+ command: cmd.command,
230
+ ...(cmd.args.length > 0 ? { args: cmd.args } : {}),
250
231
  };
251
232
  }
252
- /**
253
- * Merge the Ory MCP server into an existing settings object's `mcpServers` key.
254
- * Pass an optional `cmd` to override the default resolution (useful when the
255
- * caller can resolve the mcp-server entry point more reliably than core can).
256
- */
233
+ /** Merge the Ory MCP server into an existing settings object's `mcpServers` key. */
257
234
  function mergeMcpServer(existing, cmd) {
258
235
  const merged = { ...existing };
259
236
  const servers = (merged.mcpServers ?? {});
@@ -378,13 +355,11 @@ Options:
378
355
 
379
356
  Environment variables:
380
357
  ORY_PROJECT_URL Your Ory project URL (required at runtime)
381
- ORY_AGENT_API_KEY Agent API key / OAuth2 bearer (preferred name;
382
- ORY_API_KEY is honored as a deprecated alias)
383
- ORY_OAUTH2_CLIENT_ID Public OAuth2 client id for the user PKCE flow
384
- (required when ORY_USER_LOGIN=true)
385
- ORY_USER_LOGIN Set to "true" to enable the interactive user login
386
- (or persist it with: configure --user-login)
387
- ORY_PERMISSION_MODE "observe" (default) or "enforce" — what to do on deny
358
+ ORY_AGENT_SECURITY_URL Canonical Agent Security origin (legacy fallback: project URL)
359
+ ORY_AGENT_CLIENT_ID Static agent OAuth2 client_credentials (with
360
+ ORY_AGENT_CLIENT_SECRET …SECRET) otherwise the agent self-registers
361
+ ORY_OAUTH2_CLIENT_ID Override the public OAuth2 client id for the user PKCE flow
362
+ (default: ory-agent-security-login)
388
363
  ORY_AGENT_DEBUG Set to "true" for debug logging
389
364
  ORY_AGENT_LOG_FILE Path to write debug logs
390
365
  ORY_AGENT_SUBJECT_ID Override the subject ID for permission checks
@@ -399,7 +374,7 @@ function beginDeferNextSteps() {
399
374
  }
400
375
  /**
401
376
  * Print any captured next-steps output and stop deferring. `configured` tells
402
- * the renderer whether the wizard finished configuring Ory (so it can drop the
377
+ * the renderer whether the install finished configuring Ory (so it can drop the
403
378
  * manual setup steps, which would only contradict what's already saved).
404
379
  */
405
380
  function emitDeferredNextSteps(configured = false) {
@@ -413,7 +388,7 @@ function emitDeferredNextSteps(configured = false) {
413
388
  * Either run the next-steps printer now, or capture it for later when
414
389
  * deferral is active. Harness-specific next-steps printers (e.g. Codex's)
415
390
  * route through this so they participate in the same deferral. When run inline
416
- * (e.g. the standalone setup binary) no wizard configured anything, so the
391
+ * (e.g. the standalone setup binary) nothing configured a connection, so the
417
392
  * renderer is invoked with `configured: false`.
418
393
  */
419
394
  function nextStepsSink(fn) {
@@ -425,9 +400,9 @@ function nextStepsSink(fn) {
425
400
  }
426
401
  /**
427
402
  * Print the "Next steps" text after successful setup. Deferred to the end of
428
- * an interactive install via {@link nextStepsSink} (see above). When the wizard
429
- * already connected Ory, prints a short launch summary instead of the manual
430
- * env-var setup steps.
403
+ * an install via {@link nextStepsSink} (see above). When the install already
404
+ * connected Ory, prints a short launch summary instead of the manual env-var
405
+ * setup steps.
431
406
  */
432
407
  function printNextSteps(harnessName, uninstallCmd, opts) {
433
408
  nextStepsSink(({ configured }) => configured
@@ -435,44 +410,45 @@ function printNextSteps(harnessName, uninstallCmd, opts) {
435
410
  : printNextStepsNow(harnessName, uninstallCmd));
436
411
  }
437
412
  /**
438
- * The closing message when the interactive wizard already configured Ory.
413
+ * The closing message when the install already configured a connection.
439
414
  * Everything the manual steps would ask for is done, so this points the user
440
- * at the next things they'll actually want: see what Ory is doing (status /
441
- * live trace watch), promote to enforcement, and turn on debug logging. When
415
+ * at the next things they'll actually want: see what Ory is doing, enable the
416
+ * live debug stream, and promote to enforcement. When
442
417
  * no {@link NextStepsOpts} is supplied it degrades to the short launch summary.
443
418
  */
444
419
  function printConfiguredNextStepsNow(harnessName, uninstallCmd, opts) {
445
420
  ui.heading("Next steps:");
446
- ui.success(`Ory is configured — start ${harnessName} in your project directory.`);
421
+ ui.success((0, config_js_1.resolveConfig)().security.connected
422
+ ? `Ory Agent Security is connected — start ${harnessName} in your project directory.`
423
+ : `Start ${harnessName} in your project directory.`);
447
424
  if (!opts) {
448
425
  ui.blank();
449
426
  ui.hint(`To uninstall: ${ui.inlineCommand(uninstallCmd)}`);
450
427
  return;
451
428
  }
452
429
  const npx = (0, cli_invocation_js_1.oryNpx)(opts.binName);
453
- const auditOnly = (0, config_js_1.resolveConfig)().auditOnly;
454
- if (auditOnly) {
455
- ui.hint("Audit-only mode: tool calls are traced locally no checks run, nothing is blocked.");
430
+ const security = (0, config_js_1.resolveConfig)().security;
431
+ if (!security.connected) {
432
+ ui.hint("Ory Agent Security is not connected: tool activity is logged locally, nothing is checked or blocked.");
433
+ ui.hint(`Connect it any time with ${ui.inlineCommand(`${npx} configure --project-url <URL> --agent-security-url <URL>`)}.`);
456
434
  ui.blank();
457
- ui.bullet("1. See what's been traced:");
435
+ ui.bullet("1. See what's happening — config and recent activity:");
458
436
  ui.command(`${npx} status`);
459
- ui.hint(` ...or watch it live: ${ui.inlineCommand(`${npx} watch`)}`);
460
437
  ui.blank();
461
- ui.bullet("2. Want more detail? Turn on debug logging:");
438
+ ui.bullet("2. Stream complete activity and debug output live:");
462
439
  ui.command("export ORY_AGENT_DEBUG=true");
463
440
  }
464
441
  else {
465
- ui.hint("It starts in watch mode: every tool call is checked, but nothing is blocked yet.");
442
+ ui.hint("It starts in observe mode: every tool call is checked, but nothing is blocked yet.");
466
443
  ui.blank();
467
- ui.bullet("1. See what Ory is doing — config, permission coverage, recent activity:");
444
+ ui.bullet("1. See what's happening — config and permission coverage:");
468
445
  ui.command(`${npx} status`);
469
- ui.hint(` ...or watch the trace stream live: ${ui.inlineCommand(`${npx} watch`)}`);
470
446
  ui.blank();
471
- ui.bullet("2. Turn on enforcement once the watch-mode traces look right:");
472
- ui.command(`${npx} permissions enforce`);
473
- ui.hint(` denied tools are then blocked; return to watch with ${ui.inlineCommand(`${npx} permissions observe`)}`);
447
+ ui.bullet("2. Turn on enforcement once the activity log looks right:");
448
+ ui.hint(" the deny posture is controlled on the Ory project (Agent Security).");
449
+ ui.hint(` Check the live mode with ${ui.inlineCommand(`${npx} permissions status`)}.`);
474
450
  ui.blank();
475
- ui.bullet("3. Want more detail? Turn on debug logging:");
451
+ ui.bullet("3. Stream complete activity and debug output live:");
476
452
  ui.command("export ORY_AGENT_DEBUG=true");
477
453
  }
478
454
  ui.blank();
@@ -480,24 +456,21 @@ function printConfiguredNextStepsNow(harnessName, uninstallCmd, opts) {
480
456
  }
481
457
  function printNextStepsNow(harnessName, uninstallCmd) {
482
458
  ui.heading("Next steps:");
483
- ui.bullet("1. Set required environment variables:");
459
+ ui.bullet("1. Optional connect Ory Agent Security with the project URL from the Ory Console:");
460
+ ui.command("configure --project-url <URL>");
461
+ ui.hint(" ...or set it per-session via an env var:");
484
462
  ui.command("export ORY_PROJECT_URL=https://your-project.projects.oryapis.com");
485
- ui.command("export ORY_AGENT_API_KEY=ory_pat_...");
486
- ui.blank();
487
- ui.bullet("2. Turn on the interactive user login (opt-in). Either persist it:");
488
- ui.command("configure --user-login --oauth2-client-id <public OAuth2 client id>");
489
- ui.hint(" ...or set it per-session via env vars:");
490
- ui.command("export ORY_USER_LOGIN=true");
491
- ui.command("export ORY_OAUTH2_CLIENT_ID=<public OAuth2 client id>");
492
- ui.hint(` Without these, ${harnessName} runs without a human Ory identity attached`);
493
- ui.hint(" to the session and permission checks fall back to a session:<id> subject.");
494
- ui.hint(" The OAuth2 client id is the public client (no secret) you registered in");
495
- ui.hint(" your Ory project with the four loopback redirect URIs.");
463
+ ui.hint(" ORY_AGENT_SECURITY_URL optionally overrides the production broker.");
464
+ ui.hint(" ORY_OAUTH2_CLIENT_ID optionally overrides ory-agent-security-login.");
465
+ ui.hint(` Without a project URL, checks stay off and ${harnessName} only logs tool activity locally.`);
466
+ ui.hint(" Everything else the plugin installs works without them.");
467
+ ui.hint(" The reserved public login client is provisioned in the Ory Console");
468
+ ui.hint(" along with the permission model, grants, and enforce posture.");
496
469
  ui.blank();
497
- ui.bullet("3. Optionally enable debug logging:");
470
+ ui.bullet("2. Optionally enable debug logging:");
498
471
  ui.command("export ORY_AGENT_DEBUG=true");
499
472
  ui.blank();
500
- ui.bullet(`4. Start ${harnessName} in your project directory.`);
473
+ ui.bullet(`3. Start ${harnessName} in your project directory.`);
501
474
  ui.blank();
502
475
  ui.hint(`To uninstall: ${ui.inlineCommand(uninstallCmd)}`);
503
476
  }
@@ -1,18 +1,33 @@
1
1
  /**
2
- * Render the "User identity" block. Shows the `ORY_USER_LOGIN` state and,
3
- * when a PKCE token is cached, the resolved subject and expiry.
2
+ * Render the "User identity" block. The interactive PKCE login runs every
3
+ * session; this shows the cached token's subject and expiry, if any.
4
4
  */
5
5
  export declare function printUserIdentitySection(): void;
6
6
  /**
7
7
  * Render the "Agent identity" block. Summarizes the resolved machine
8
- * credential — static env override, persisted DCR, or unconfigured.
8
+ * credential — static env override, persisted DCR, or unconfigured. Each
9
+ * installed harness has its own agent registration, so the report is for
10
+ * `harness`'s identity only.
9
11
  */
10
- export declare function printAgentIdentitySection(): void;
12
+ export declare function printAgentIdentitySection(harness: string): void;
11
13
  /**
12
- * Render the "Permissions" block. Always prints the configured mode and
13
- * namespace; runs a network probe of the harness's built-in tool catalog
14
- * only when a project URL is configured *and* a user identity is
15
- * available (cached PKCE tokens or `ORY_USER_SUBJECT_ID`).
14
+ * Render the "Sub-agent identities" block one entry per typed sub-agent
15
+ * (e.g. `Explore`, `general-purpose`) the agent has registered a distinct
16
+ * OAuth2 client for via DCR. All sub-agent identities are dynamic
17
+ * registrations. Scoped to `harness` sub-agents belong to that harness's
18
+ * agent. A no-op when none exist yet.
19
+ */
20
+ export declare function printSubAgentIdentitiesSection(harness: string): void;
21
+ /**
22
+ * Render the "Permissions" block: the deny posture, the namespace, and the
23
+ * coverage of the harness's built-in tool catalog.
24
+ *
25
+ * The network probe runs only when a project URL is configured *and* a user
26
+ * identity is available (cached PKCE tokens or `ORY_USER_SUBJECT_ID`). When it
27
+ * runs, the reported **Mode is read live from the project** in the same pass, so
28
+ * this line answers "what would a tool call do right now?" rather than echoing a
29
+ * cache that is only refreshed at session start. On every other path the last
30
+ * cached value is reported, annotated as such.
16
31
  */
17
32
  export declare function printPermissionsSection(binName: string, harness: string): Promise<void>;
18
33
  export interface StatusCommandOptions {
@@ -21,17 +36,18 @@ export interface StatusCommandOptions {
21
36
  /**
22
37
  * Optional renderer for the "Hooks & plugin" section. Each harness owns
23
38
  * the layout for its plugin-specific registration data (extension dir,
24
- * marketplace plugin ID, hook script path, etc.).
39
+ * marketplace plugin ID, hook script path, etc.). May be async — some
40
+ * harnesses have to reach the network to report what will actually load.
25
41
  */
26
- printPluginSection?: () => void;
42
+ printPluginSection?: () => void | Promise<void>;
27
43
  }
28
44
  /**
29
45
  * Compose the unified `status` output for a plugin CLI. Sections render
30
46
  * in this order: title → configuration → user identity → agent identity
31
- * → permissions → hooks & plugin → environment → recent activity
32
- * (traces + debug log).
47
+ * → sub-agent identities → permissions → hooks & plugin → environment →
48
+ * recent activity from the unified activity/debug log.
33
49
  *
34
- * Each section degrades gracefully — missing project URL, audit-only
50
+ * Each section degrades gracefully — Agent Security not connected
35
51
  * mode, and empty token caches all surface as inline "n/a" lines rather
36
52
  * than aborting the command.
37
53
  */