@ory/argus 1.2.3 → 1.3.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 (52) hide show
  1. package/README.md +25 -0
  2. package/assets/skills/ory-build-agent/SKILL.md +1 -1
  3. package/assets/skills/ory-deploy-agent/SKILL.md +315 -0
  4. package/assets/skills/ory-deploy-openai-e2b/SKILL.md +289 -0
  5. package/assets/skills/ory-e2b-sandbox/SKILL.md +10 -6
  6. package/assets/skills/ory-temporal-worker/SKILL.md +4 -4
  7. package/dist/adapters.d.ts +11 -3
  8. package/dist/adapters.js +55 -13
  9. package/dist/agent-auth.d.ts +18 -7
  10. package/dist/agent-auth.js +120 -10
  11. package/dist/auth-store.d.ts +3 -3
  12. package/dist/auth-store.js +56 -12
  13. package/dist/auth.d.ts +1 -1
  14. package/dist/auth.js +1 -1
  15. package/dist/bash-parser.js +212 -47
  16. package/dist/build-info.json +4 -4
  17. package/dist/cli.js +5 -0
  18. package/dist/client.d.ts +15 -0
  19. package/dist/client.js +24 -7
  20. package/dist/config.d.ts +23 -3
  21. package/dist/config.js +202 -18
  22. package/dist/contract-suite.d.ts +0 -8
  23. package/dist/contract-suite.js +0 -1
  24. package/dist/event-reporter.d.ts +1 -0
  25. package/dist/event-reporter.js +19 -2
  26. package/dist/hook-timeout.d.ts +2 -2
  27. package/dist/hook-timeout.js +2 -2
  28. package/dist/index.d.ts +4 -4
  29. package/dist/index.js +13 -6
  30. package/dist/lifecycle.js +2 -1
  31. package/dist/local/configs.d.ts +2 -4
  32. package/dist/local/configs.js +2 -4
  33. package/dist/local/manager.js +4 -4
  34. package/dist/local/seed.d.ts +4 -4
  35. package/dist/local/seed.js +8 -10
  36. package/dist/permissions.d.ts +3 -3
  37. package/dist/permissions.js +26 -1
  38. package/dist/runtime-credential.d.ts +35 -0
  39. package/dist/runtime-credential.js +252 -1
  40. package/dist/runtime.d.ts +19 -12
  41. package/dist/runtime.js +69 -21
  42. package/dist/setup.js +3 -3
  43. package/dist/skills.d.ts +3 -5
  44. package/dist/skills.js +14 -5
  45. package/dist/subject.d.ts +2 -3
  46. package/dist/subject.js +10 -11
  47. package/dist/testing.d.ts +17 -0
  48. package/dist/testing.js +53 -0
  49. package/dist/tool-catalog.d.ts +17 -15
  50. package/dist/tool-catalog.js +239 -52
  51. package/dist/user-login.js +1 -1
  52. package/package.json +1 -1
@@ -35,6 +35,9 @@ exports.HARNESS_TOOL_CATALOG = {
35
35
  "Write",
36
36
  "Edit",
37
37
  "Bash",
38
+ "Monitor",
39
+ "PowerShell",
40
+ "Workflow",
38
41
  "Glob",
39
42
  "Grep",
40
43
  "WebFetch",
@@ -45,6 +48,34 @@ exports.HARNESS_TOOL_CATALOG = {
45
48
  "TodoWrite",
46
49
  "Agent",
47
50
  "Task",
51
+ "Artifact",
52
+ "CronCreate",
53
+ "CronDelete",
54
+ "CronList",
55
+ "EndConversation",
56
+ "EnterPlanMode",
57
+ "EnterWorktree",
58
+ "ExitWorktree",
59
+ "ListAgents",
60
+ "ListMcpResourcesTool",
61
+ "LSP",
62
+ "PushNotification",
63
+ "ReadMcpResourceTool",
64
+ "RemoteTrigger",
65
+ "ReportFindings",
66
+ "ScheduleWakeup",
67
+ "SendFeedback",
68
+ "SendMessage",
69
+ "SendUserFile",
70
+ "ShareOnboardingGuide",
71
+ "SubagentHandback",
72
+ "TaskCreate",
73
+ "TaskGet",
74
+ "TaskList",
75
+ "TaskOutput",
76
+ "TaskStop",
77
+ "TaskUpdate",
78
+ "WaitForMcpServers",
48
79
  ],
49
80
  // The Claude Agent SDK exposes the same built-in tool surface as Claude
50
81
  // Code (it is the embeddable form of the same runtime), so the catalog
@@ -54,6 +85,9 @@ exports.HARNESS_TOOL_CATALOG = {
54
85
  "Write",
55
86
  "Edit",
56
87
  "Bash",
88
+ "Monitor",
89
+ "PowerShell",
90
+ "Workflow",
57
91
  "Glob",
58
92
  "Grep",
59
93
  "WebFetch",
@@ -64,20 +98,67 @@ exports.HARNESS_TOOL_CATALOG = {
64
98
  "TodoWrite",
65
99
  "Agent",
66
100
  "Task",
101
+ "Artifact",
102
+ "CronCreate",
103
+ "CronDelete",
104
+ "CronList",
105
+ "EndConversation",
106
+ "EnterPlanMode",
107
+ "EnterWorktree",
108
+ "ExitWorktree",
109
+ "ListAgents",
110
+ "ListMcpResourcesTool",
111
+ "LSP",
112
+ "PushNotification",
113
+ "ReadMcpResourceTool",
114
+ "RemoteTrigger",
115
+ "ReportFindings",
116
+ "ScheduleWakeup",
117
+ "SendFeedback",
118
+ "SendMessage",
119
+ "SendUserFile",
120
+ "ShareOnboardingGuide",
121
+ "SubagentHandback",
122
+ "TaskCreate",
123
+ "TaskGet",
124
+ "TaskList",
125
+ "TaskOutput",
126
+ "TaskStop",
127
+ "TaskUpdate",
128
+ "WaitForMcpServers",
67
129
  ],
68
- // Codex serializes its hook `tool_name` as `Bash` (shell) and `apply_patch`
69
- // (file edits — `Write`/`Edit` are matcher aliases only); MCP tools arrive as
70
- // `mcp__<server>__<tool>` and aren't enumerable here. Verified against
71
- // codex 0.143 (see packages/codex/src/types.ts).
72
- codex: ["Bash", "apply_patch"],
130
+ // Codex serializes its hook `tool_name` as `Bash` (shell), `apply_patch`
131
+ // (file edits — `Write`/`Edit` are matcher aliases only), and `webrun`
132
+ // (web access); MCP tools arrive as `mcp__<server>__<tool>` and aren't
133
+ // enumerable here. Verified against codex 0.155 (see packages/codex/src/types.ts).
134
+ codex: ["Bash", "apply_patch", "webrun", "spawn_agent"],
73
135
  "gemini-cli": [
136
+ "run_shell_command",
137
+ "shell",
138
+ "glob",
139
+ "grep_search",
140
+ "list_directory",
74
141
  "read_file",
142
+ "read_many_files",
143
+ "replace",
75
144
  "write_file",
76
- "edit_file",
77
- "list_files",
78
- "search_files",
79
- "shell",
80
- "web_search",
145
+ "write_todos",
146
+ "tracker_create_task",
147
+ "tracker_update_task",
148
+ "tracker_get_task",
149
+ "tracker_list_tasks",
150
+ "tracker_add_dependency",
151
+ "tracker_visualize",
152
+ "list_mcp_resources",
153
+ "read_mcp_resource",
154
+ "activate_skill",
155
+ "get_internal_docs",
156
+ "enter_plan_mode",
157
+ "update_topic",
158
+ "complete_task",
159
+ "invoke_agent",
160
+ "google_web_search",
161
+ "web_fetch",
81
162
  ],
82
163
  // OpenClaw's built-in tool ids (docs.openclaw.ai/tools): shell is `exec`,
83
164
  // file ops are `read`/`write`/`edit`/`apply_patch`, plus web + browser.
@@ -90,18 +171,107 @@ exports.HARNESS_TOOL_CATALOG = {
90
171
  "web_search",
91
172
  "web_fetch",
92
173
  "browser",
174
+ "process",
175
+ "code_execution",
176
+ "x_search",
177
+ "secrets",
178
+ "message",
179
+ "gateway",
180
+ "plugins",
181
+ "nodes",
182
+ "computer",
183
+ "screen",
184
+ "theme",
185
+ "dashboard",
186
+ "terminal",
187
+ "portal",
188
+ "canvas",
189
+ "show_widget",
190
+ "sessions",
191
+ "sessions_list",
192
+ "sessions_history",
193
+ "sessions_search",
194
+ "sessions_send",
195
+ "sessions_spawn",
196
+ "sessions_yield",
197
+ "subagents",
198
+ "session_status",
199
+ "memory_search",
200
+ "memory_get",
201
+ "agents_list",
202
+ "get_goal",
203
+ "create_goal",
204
+ "update_goal",
205
+ "progress_card",
206
+ "view_image",
207
+ "image_generate",
208
+ "music_generate",
209
+ "video_generate",
210
+ "tts",
211
+ "pdf",
212
+ ],
213
+ opencode: [
214
+ "read",
215
+ "write",
216
+ "edit",
217
+ "bash",
218
+ "glob",
219
+ "grep",
220
+ "webfetch",
221
+ "apply_patch",
222
+ "skill",
223
+ "todowrite",
224
+ "websearch",
225
+ "task",
226
+ "lsp",
227
+ "execute",
228
+ ],
229
+ continue: [
230
+ "Edit",
231
+ "Exit",
232
+ "Fetch",
233
+ "List",
234
+ "MultiEdit",
235
+ "Read",
236
+ "ReportFailure",
237
+ "Bash",
238
+ "Search",
239
+ "Status",
240
+ "Subagent",
241
+ "Skills",
242
+ "UploadArtifact",
243
+ "Diff",
244
+ "Checklist",
245
+ "Write",
93
246
  ],
94
- opencode: ["read", "write", "edit", "bash", "glob", "grep", "webfetch"],
95
- continue: ["Bash", "Read", "Edit", "Write", "Grep", "Glob", "WebSearch"],
96
247
  goose: [
248
+ "analyze",
249
+ "write",
250
+ "edit",
97
251
  "shell",
98
- "text_editor",
99
- "read_file",
100
- "write_file",
101
- "list_windows",
102
- "screen_capture",
252
+ "tree",
253
+ "read_image",
254
+ "todo__todo_write",
255
+ "apps__list_apps",
256
+ "apps__create_app",
257
+ "apps__iterate_app",
258
+ "apps__delete_app",
259
+ "extensionmanager__search_available_extensions",
260
+ "extensionmanager__manage_extensions",
261
+ "extensionmanager__list_resources",
262
+ "extensionmanager__read_resource",
263
+ "load",
264
+ "delegate",
265
+ "load_skill",
103
266
  ],
104
267
  cline: [
268
+ "read_files",
269
+ "search_codebase",
270
+ "run_commands",
271
+ "fetch_web_content",
272
+ "apply_patch",
273
+ "editor",
274
+ "skills",
105
275
  "execute_command",
106
276
  "read_file",
107
277
  "write_to_file",
@@ -109,6 +279,7 @@ exports.HARNESS_TOOL_CATALOG = {
109
279
  "search_files",
110
280
  "list_files",
111
281
  "use_mcp_tool",
282
+ "browser_action",
112
283
  ],
113
284
  amp: [
114
285
  "Bash",
@@ -125,8 +296,15 @@ exports.HARNESS_TOOL_CATALOG = {
125
296
  "todo_write",
126
297
  "oracle",
127
298
  "Task",
299
+ "create_thread",
300
+ "list_agent_modes",
301
+ "get_thread_status",
302
+ "send_thread_message",
303
+ "wait_for_threads",
128
304
  ],
129
305
  pi: ["read", "write", "edit", "bash", "grep", "find", "ls"],
306
+ // This adapter remains pinned to the agy 1.0.13 hook contract. Antigravity
307
+ // 2.0 changes both these names and the hook payload/response schema.
130
308
  antigravity: [
131
309
  "run_command",
132
310
  "view_file",
@@ -140,23 +318,9 @@ exports.HARNESS_TOOL_CATALOG = {
140
318
  "search_web",
141
319
  "call_mcp_tool",
142
320
  ],
143
- // Cursor's `preToolUse` hook serializes `tool_name` as a coarse tool
144
- // category (Shell, Read, Write, Edit, Delete, List, Search, MCP, Task);
145
- // fine-grained shell commands and MCP tools arrive on the dedicated
146
- // `beforeShellExecution` / `beforeMCPExecution` hooks (logged, not gated,
147
- // to avoid double-gating). Bootstrap seeds the categories the agent gate
148
- // actually checks. Best-effort — verify against your Cursor version.
149
- cursor: [
150
- "Read",
151
- "Write",
152
- "Edit",
153
- "Delete",
154
- "Shell",
155
- "List",
156
- "Search",
157
- "MCP",
158
- "Task",
159
- ],
321
+ // Cursor's documented `preToolUse` matcher categories. MCP calls arrive as
322
+ // dynamic `MCP:<tool_name>` values and are intentionally omitted here.
323
+ cursor: ["Read", "Write", "Grep", "Delete", "Shell", "Task"],
160
324
  };
161
325
  exports.KNOWN_HARNESSES = Object.keys(exports.HARNESS_TOOL_CATALOG);
162
326
  /**
@@ -190,20 +354,20 @@ exports.ALL_TOOLS = Array.from(new Set(Object.values(exports.HARNESS_TOOL_CATALO
190
354
  * applied to every harness).
191
355
  */
192
356
  exports.INTERACTIVE_TOOL_CATALOG = {
193
- "claude-code": ["AskUserQuestion", "ExitPlanMode", "TodoWrite"],
357
+ "claude-code": ["AskUserQuestion", "ExitPlanMode"],
194
358
  // Same runtime as Claude Code — the SDK delivers the same
195
359
  // user-interaction primitives through PreToolUse.
196
- "claude-agent-sdk": ["AskUserQuestion", "ExitPlanMode", "TodoWrite"],
360
+ "claude-agent-sdk": ["AskUserQuestion", "ExitPlanMode"],
197
361
  codex: [],
198
- "gemini-cli": [],
199
- openclaw: [],
200
- opencode: [],
201
- continue: [],
362
+ "gemini-cli": ["ask_user", "exit_plan_mode"],
363
+ openclaw: ["ask_user"],
364
+ opencode: ["question", "plan_exit"],
365
+ continue: ["AskQuestion"],
202
366
  goose: [],
203
- cline: [],
367
+ cline: ["ask_question", "submit_and_exit"],
204
368
  amp: [],
205
369
  pi: [],
206
- antigravity: [],
370
+ antigravity: ["ask_question"],
207
371
  cursor: [],
208
372
  };
209
373
  function parseEnvInteractiveTools() {
@@ -245,21 +409,21 @@ function isInteractiveTool(harness, toolName) {
245
409
  * precise map is used rather than the {@link isBashLikeTool} heuristic.
246
410
  */
247
411
  exports.SHELL_TOOL_CATALOG = {
248
- "claude-code": ["Bash"],
249
- "claude-agent-sdk": ["Bash"],
412
+ "claude-code": ["Bash", "Monitor", "PowerShell"],
413
+ "claude-agent-sdk": ["Bash", "Monitor", "PowerShell"],
250
414
  codex: ["Bash"],
251
- // Gemini CLI's hook payload has been observed with both the short `shell`
252
- // name and the fuller `run_shell_command` id across versions; accept both so
253
- // decomposition fires regardless. `ORY_SHELL_TOOLS` remains the escape hatch.
254
- "gemini-cli": ["shell", "run_shell_command"],
415
+ // Current Gemini CLI releases emit the canonical `run_shell_command` id.
416
+ // `ORY_SHELL_TOOLS` remains the escape hatch for vendor renames.
417
+ "gemini-cli": ["run_shell_command", "shell"],
255
418
  openclaw: ["exec"],
256
419
  opencode: ["bash"],
257
420
  continue: ["Bash"],
258
421
  goose: ["shell"],
259
- cline: ["execute_command"],
422
+ cline: ["run_commands", "execute_command"],
260
423
  amp: ["Bash"],
261
424
  pi: ["bash"],
262
425
  antigravity: ["run_command"],
426
+ cursor: ["Shell"],
263
427
  };
264
428
  function parseEnvList(raw) {
265
429
  if (!raw)
@@ -346,16 +510,39 @@ const SHELL_COMMAND_FIELDS = [
346
510
  "commandLine",
347
511
  "CommandLine",
348
512
  ];
513
+ const UNRESOLVED_SHELL_COMMAND = "$ORY_UNRESOLVED_SHELL_COMMAND";
514
+ function extractClineRunCommands(args) {
515
+ if (!args || typeof args !== "object")
516
+ return [UNRESOLVED_SHELL_COMMAND];
517
+ const value = args.commands;
518
+ if (typeof value !== "string")
519
+ return [UNRESOLVED_SHELL_COMMAND];
520
+ try {
521
+ const commands = JSON.parse(value);
522
+ if (!Array.isArray(commands) || !commands.every((command) => typeof command === "string")) {
523
+ return [UNRESOLVED_SHELL_COMMAND];
524
+ }
525
+ return commands.length > 0 ? commands : undefined;
526
+ }
527
+ catch {
528
+ return [UNRESOLVED_SHELL_COMMAND];
529
+ }
530
+ }
349
531
  /**
350
- * Extract the shell command string from a harness's tool-args object — the same
532
+ * Extract shell command strings from a harness's tool-args object — the same
351
533
  * object the handler already passes to `summarizeToolInput`. Returns `undefined`
352
534
  * when the tool isn't a shell tool for this harness or no command field is
353
- * present (the gate then skips decomposition and degrades to the top-level
354
- * `Bash` check — it never breaks).
535
+ * present. Cline's `run_commands` is the exception: malformed command data is
536
+ * represented as an unresolvable command so enforce mode fails closed. Cline's
537
+ * command array remains an array so independently executed entries cannot
538
+ * change how neighboring entries parse.
355
539
  */
356
540
  function extractShellCommand(harness, toolName, args) {
357
541
  if (!isShellTool(harness, toolName))
358
542
  return undefined;
543
+ if (harness === "cline" && toolName === "run_commands") {
544
+ return extractClineRunCommands(args);
545
+ }
359
546
  if (!args || typeof args !== "object")
360
547
  return undefined;
361
548
  const obj = args;
@@ -95,7 +95,7 @@ async function ensureUserAuthenticated(client, options) {
95
95
  function attachUserPrincipal(client, decision) {
96
96
  if (decision.mode === "ok" || decision.mode === "refreshed") {
97
97
  // Tokens were just persisted (or are still valid); pull them so
98
- // downstream code (e.g. the agent gate's DCR flow) can use the
98
+ // downstream code (for example Talos enrollment) can use the
99
99
  // user's bearer as an initial access token.
100
100
  const tokens = (0, auth_store_js_1.loadTokens)();
101
101
  const subject = decision.subject ?? tokens?.subject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ory/argus",
3
- "version": "1.2.3",
3
+ "version": "1.3.0",
4
4
  "description": "Ory Argus: the core API for building authentication, authorization, and audit into AI agent harness plugins, extensions, and custom integrations",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://ory.com",