@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
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ /**
3
+ * The umbrella brand and the names for every resource the installer creates in
4
+ * (or for) an Ory project. Centralized here so every install path — the web
5
+ * wizard, the TTY wizard, and the agent-identity gates — produces the same,
6
+ * self-describing names, and so the naming policy lives in one place.
7
+ *
8
+ * The policy has two tiers, because many users install these plugins against
9
+ * the **same** Ory project:
10
+ *
11
+ * - **Shared** resources (one per project, reused by every user/harness) are
12
+ * addressed by a **stable, reserved identifier** so all installs find and
13
+ * reuse the one resource instead of duplicating it: the login client's
14
+ * {@link USER_LOGIN_CLIENT_ID} and the permission namespace
15
+ * ({@link PERMISSION_NAMESPACE}). An identifier, not a display name — see
16
+ * {@link USER_LOGIN_CLIENT_ID} for why the distinction is a security
17
+ * property and not a preference.
18
+ * - **Per-installer** resources (many per project by design — confidential
19
+ * per-machine DCR credentials, write-once API keys) get an **attributable**
20
+ * name carrying *who* and *where*, so a shared project's resource list stays
21
+ * legible and prunable: {@link agentClientName}, {@link projectApiKeyName}.
22
+ *
23
+ * Everything shares the {@link PRODUCT_NAME} prefix so the plugin's resources
24
+ * group together and are instantly recognizable in a shared Ory Console.
25
+ */
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.PERMISSION_NAMESPACE = exports.DEFAULT_PROJECT_NAME = exports.USER_LOGIN_SCOPE_CLI = exports.USER_LOGIN_SCOPE_OAUTH = exports.USER_LOGIN_SCOPES = exports.USER_LOGIN_BASE_SCOPES = exports.USER_LOGIN_CLIENT_NAME = exports.USER_LOGIN_CLIENT_ID = exports.PRODUCT_NAME = void 0;
28
+ exports.isUserLoginClient = isUserLoginClient;
29
+ exports.agentClientName = agentClientName;
30
+ exports.shortSessionLabel = shortSessionLabel;
31
+ exports.projectApiKeyName = projectApiKeyName;
32
+ /** Human-readable umbrella name for everything this product creates. */
33
+ exports.PRODUCT_NAME = "Ory Agent Security";
34
+ /**
35
+ * The **reserved client id** of the shared user-login OAuth2 client — the one
36
+ * thing that identifies it. Every provisioning path (Ory Console setup, the
37
+ * local-dev Hydra seed) creates the client *at this id*, and every lookup
38
+ * addresses it by this id, so all of them converge on one client.
39
+ *
40
+ * It is an id rather than a name for a security reason. A project set up for
41
+ * Agent Security has public dynamic client registration enabled, and Hydra's DCR
42
+ * endpoint places no restriction on `client_name` — so anyone can register a
43
+ * client carrying {@link USER_LOGIN_CLIENT_NAME} verbatim with their own
44
+ * `redirect_uris`, and a name-based lookup can resolve to it (Hydra lists
45
+ * clients ordered by id, so re-registering until the assigned UUID sorts first
46
+ * is roughly a coin flip). Whoever then installs a plugin would complete a PKCE
47
+ * login — `offline_access` included — against the attacker's client. A
48
+ * `client_id` is not forgeable the same way: Hydra assigns a fresh UUID to a
49
+ * dynamically registered client and refuses a caller-chosen one, so only a
50
+ * caller holding the project's admin credentials can claim this id.
51
+ *
52
+ * There is deliberately **no name-based fallback** anywhere: a fallback reopens
53
+ * exactly that hole.
54
+ */
55
+ exports.USER_LOGIN_CLIENT_ID = "ory-agent-security-login";
56
+ /**
57
+ * The **display name** of the shared user-login client — a human-readable label
58
+ * for the Ory Console's client list, and nothing more. It is a *public* client
59
+ * (no secret) that every user on a project shares across every harness plugin,
60
+ * and the name says so plainly; no "PKCE" in it, since how it authenticates is
61
+ * an implementation detail, not what it is.
62
+ *
63
+ * Never resolve the client by this string. It is attacker-supplyable (see
64
+ * {@link USER_LOGIN_CLIENT_ID}); {@link USER_LOGIN_CLIENT_ID} is what dedupes
65
+ * installs onto one client, and {@link isUserLoginClient} is the only accepted
66
+ * test for "is this the login client".
67
+ */
68
+ exports.USER_LOGIN_CLIENT_NAME = `${exports.PRODUCT_NAME} · shared user login (all plugins)`;
69
+ /**
70
+ * Whether a client is *the* shared user-login client, decided **only** by its
71
+ * id. A client carrying {@link USER_LOGIN_CLIENT_NAME} under any other id is
72
+ * some other client — possibly one an attacker registered — and is rejected.
73
+ */
74
+ function isUserLoginClient(client) {
75
+ return client.clientId === exports.USER_LOGIN_CLIENT_ID;
76
+ }
77
+ /**
78
+ * The single source of truth for the interactive user-login OAuth2 scopes.
79
+ * Every place that registers the client (`ory create/update oauth2-client`,
80
+ * the local-dev Hydra seed, the manual-setup help) and the PKCE flow that
81
+ * requests them must agree, or the flow fails with `invalid_scope` (or the
82
+ * requested scope is silently dropped). `openid`/`offline_access` are the
83
+ * baseline; `profile`/`email` populate the id_token's name claims so the
84
+ * signed-in user can be shown by name.
85
+ */
86
+ exports.USER_LOGIN_BASE_SCOPES = ["openid", "offline_access"];
87
+ exports.USER_LOGIN_SCOPES = [
88
+ ...exports.USER_LOGIN_BASE_SCOPES,
89
+ "profile",
90
+ "email",
91
+ ];
92
+ /** Space-delimited form for an OAuth2 `authorize` request / Hydra client `scope`. */
93
+ exports.USER_LOGIN_SCOPE_OAUTH = exports.USER_LOGIN_SCOPES.join(" ");
94
+ /** Comma-delimited form for the `ory … oauth2-client --scope` CLI flag. */
95
+ exports.USER_LOGIN_SCOPE_CLI = exports.USER_LOGIN_SCOPES.join(",");
96
+ /** Default name for a project the installer creates. Harness-agnostic, since a
97
+ * team typically points several harnesses at one shared project. */
98
+ exports.DEFAULT_PROJECT_NAME = exports.PRODUCT_NAME;
99
+ /** The shared permission-model namespace (an OPL class name, so it must stay a
100
+ * bare identifier — no spaces/branding — and stable across installs). */
101
+ exports.PERMISSION_NAMESPACE = "AgentTool";
102
+ /**
103
+ * The client_name for an agent's (or sub-agent's) OAuth2 identity registered
104
+ * via DCR. These are confidential, per-machine credentials — many per shared
105
+ * project by design — so the name is attributable: the harness it belongs to
106
+ * and the host it was registered from, plus a short session label and the
107
+ * sub-agent type when applicable.
108
+ */
109
+ function agentClientName(opts) {
110
+ const { harness, host, subAgentType, sessionId } = opts;
111
+ const session = sessionId?.trim() ? ` · ${shortSessionLabel(sessionId)}` : "";
112
+ if (subAgentType) {
113
+ const scope = harness ? `${harness}/${subAgentType}` : subAgentType;
114
+ return `${exports.PRODUCT_NAME} · sub-agent · ${scope}${session} @ ${host}`;
115
+ }
116
+ return harness
117
+ ? `${exports.PRODUCT_NAME} · agent · ${harness}${session} @ ${host}`
118
+ : `${exports.PRODUCT_NAME} · agent${session} @ ${host}`;
119
+ }
120
+ /** How much of a session id goes into a display label. */
121
+ const SESSION_LABEL_LENGTH = 8;
122
+ /**
123
+ * A short, stable label for a session id, for **display only** — `status`
124
+ * output and log lines. Ids are usually UUIDs; the leading characters separate
125
+ * them well enough for a human scanning a list, and the full id is always
126
+ * recoverable from the delegation record and activity events.
127
+ *
128
+ * Never use this to build a permission subject. A derived session subject must
129
+ * carry the full session id (`Agent:<clientId>|<session>`) so it matches what an
130
+ * admin writes in the Console after reading the same id off the delegation graph.
131
+ */
132
+ function shortSessionLabel(sessionId) {
133
+ const trimmed = sessionId.trim();
134
+ return trimmed.length > SESSION_LABEL_LENGTH
135
+ ? trimmed.slice(0, SESSION_LABEL_LENGTH)
136
+ : trimmed;
137
+ }
138
+ /**
139
+ * The name for a project API key minted for runtime permission checks. Ory only
140
+ * returns a key's secret at creation, so a key can't be reused across machines
141
+ * — each installer that mints one gets its own. The name therefore carries the
142
+ * signed-in *user* (the axis that matters on a shared project) plus the host, so
143
+ * a team admin can tell whose key is whose and prune stale ones. No timestamp:
144
+ * the Ory Console's key listing already shows a "Date Added" column. `user`
145
+ * falls back to the host alone when it isn't resolvable (e.g. login skipped).
146
+ */
147
+ function projectApiKeyName(opts) {
148
+ const who = opts.user && opts.user !== "agent:unknown" ? opts.user : null;
149
+ const where = who ? `${who} @ ${opts.host}` : opts.host;
150
+ return `${exports.PRODUCT_NAME}: Permission Checks - ${where}`;
151
+ }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "repo": "ory-agent-plugins",
3
- "commit": "f7663bf2a792378be5a94c7d6bb0d6671e1da6a9",
4
- "commitShort": "f7663bf",
3
+ "commit": "6f11a1695f60ec11e7905c6a73f8683235c5e4df",
4
+ "commitShort": "6f11a16",
5
5
  "branch": "main",
6
- "commitDate": "2026-07-15T15:56:35-07:00",
6
+ "commitDate": "2026-08-29T19:17:15-07:00",
7
7
  "dirty": false,
8
- "builtAt": "2026-07-15T23:00:39.070Z"
8
+ "builtAt": "2026-08-30T02:20:53.108Z"
9
9
  }
@@ -7,7 +7,7 @@
7
7
  * package is already installed. In the common install flow the user runs
8
8
  * `npx @ory/<harness> install` — a one-shot npx invocation that leaves
9
9
  * nothing on `PATH` — so a follow-up banner that says `npx ory-claude
10
- * permissions bootstrap` fails: npm can't find a package literally named
10
+ * permissions status` fails: npm can't find a package literally named
11
11
  * `ory-claude` and errors out.
12
12
  *
13
13
  * The always-resolvable form is `npx -y -p @ory/<harness> ory-<short>
@@ -8,7 +8,7 @@
8
8
  * package is already installed. In the common install flow the user runs
9
9
  * `npx @ory/<harness> install` — a one-shot npx invocation that leaves
10
10
  * nothing on `PATH` — so a follow-up banner that says `npx ory-claude
11
- * permissions bootstrap` fails: npm can't find a package literally named
11
+ * permissions status` fails: npm can't find a package literally named
12
12
  * `ory-claude` and errors out.
13
13
  *
14
14
  * The always-resolvable form is `npx -y -p @ory/<harness> ory-<short>
@@ -36,6 +36,7 @@ const BIN_TO_PACKAGE = {
36
36
  "ory-amp": "@ory/amp",
37
37
  "ory-pi": "@ory/pi",
38
38
  "ory-agy": "@ory/antigravity",
39
+ "ory-cursor": "@ory/cursor",
39
40
  };
40
41
  /**
41
42
  * Render a copy-pasteable `npx` invocation prefix for a harness bin.
package/dist/cli.d.ts CHANGED
@@ -1,20 +1,22 @@
1
1
  /**
2
2
  * Shared `configure` command implementation for all plugin CLIs.
3
3
  *
4
- * Parses --project-url, --api-key, and --oauth2-client-id from args.
5
- * If none is provided, shows the current configuration. Otherwise saves
6
- * the provided values.
4
+ * `configure` only ever touches the **security** half of a plugin. The
5
+ * developer-experience half skills, commands, the local Ory stack, the MCP
6
+ * server, local activity logging — is installed unconditionally and has nothing to
7
+ * configure, so it is never mentioned here as an alternative or a fallback.
7
8
  *
8
- * When `--project-url` is provided, requires the OAuth2 client id to be
9
- * resolvable from one of: the `--oauth2-client-id` flag, the
10
- * `ORY_OAUTH2_CLIENT_ID` env var, or an already-persisted value in the
11
- * shared config. The PKCE browser flow that runs when
12
- * `ORY_USER_LOGIN=true` can't self-register that client surfacing the
13
- * requirement here keeps users from a silently-broken setup later.
9
+ * Connecting takes the project URL and canonical broker origin from the Ory
10
+ * Console (Agent Security). The public OAuth2 client id defaults to the reserved
11
+ * Agent Security login client and can be overridden for custom deployments.
12
+ * Existing configurations use the project URL as a legacy broker fallback.
13
+ * `--disconnect` clears all three stored connection values.
14
+ *
15
+ * With no arguments, prints what is currently resolved.
14
16
  */
15
17
  export declare function runConfigureCommand(binName: string, args: string[]): void;
16
18
  /**
17
- * Print the "Configuration:" block showing Ory project URL and API key status.
19
+ * Print the "Configuration:" block showing the resolved Ory connection.
18
20
  */
19
21
  export declare function printOryConfig(): void;
20
22
  /**
@@ -22,32 +24,17 @@ export declare function printOryConfig(): void;
22
24
  */
23
25
  export declare function printEnvironment(): void;
24
26
  /**
25
- * Print the last 5 debug log entries. When `harness` is given the path is
27
+ * Print the last 10 unified activity/debug log entries. When `harness` is given the path is
26
28
  * resolved the same way the plugin does at runtime — the default per-harness
27
29
  * data-dir location when `ORY_AGENT_LOG_FILE` is unset — so `status` finds the
28
- * log without the reader hand-setting env vars. The debug log only exists when
29
- * a session ran with `ORY_AGENT_DEBUG=true`; when it doesn't, this prints a
30
- * one-line pointer on how to turn it on rather than staying silent.
30
+ * log without the reader hand-setting env vars. Activity is always filed;
31
+ * verbose diagnostic entries are included only when `ORY_AGENT_DEBUG=true`.
31
32
  */
32
33
  export declare function printLogTail(harness?: string): void;
33
34
  /**
34
35
  * Print the "Configure your Ory credentials" help text.
35
36
  */
36
37
  export declare function printEnvHelp(binName: string): void;
37
- /**
38
- * Print the last 5 trace spans. When `harness` is given the path is resolved
39
- * the same way the plugin does at runtime — the default per-harness data-dir
40
- * location when `ORY_AGENT_TRACE_FILE` is unset — so `status` shows recent
41
- * activity out of the box (traces are written on every recorded span). When no
42
- * spans have been recorded yet, prints a one-line pointer at the trace file so
43
- * the reader knows where to look (and how to watch it live).
44
- */
45
- export declare function printTraceTail(harness?: string): void;
46
- /**
47
- * Run the live trace watcher. Tails the NDJSON trace file and prints
48
- * formatted spans to stdout as they arrive. Blocks until interrupted.
49
- */
50
- export declare function runWatchCommand(harness: string, args: string[]): void;
51
38
  /**
52
39
  * Returns true if `/dev/tty` can be opened for reading. Use this before
53
40
  * attempting to prompt the user — the harness has already taken stdin so
@@ -86,6 +73,10 @@ export declare function interactiveConfigPrompt(binName: string): Promise<boolea
86
73
  * - `unregister` — best-effort RFC 7592 DELETE on the registered
87
74
  * client, then clear the persisted block.
88
75
  *
76
+ * Each installed harness owns its own agent identity, so both subcommands act
77
+ * on `harness`'s registration by default. `--all` widens them to every
78
+ * harness registered against the shared config.
79
+ *
89
80
  * Returns the process exit code (0 on success, non-zero on usage error).
90
81
  */
91
- export declare function runAgentCommand(binName: string, args: string[]): Promise<number>;
82
+ export declare function runAgentCommand(binName: string, harness: string, args: string[]): Promise<number>;