@action-intelligence/cli 0.2.1 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +130 -6
  2. package/action.mjs +175 -55
  3. package/bin/darwin-arm64/action-api +0 -0
  4. package/bin/darwin-arm64/dependencies.json +9 -9
  5. package/bin/darwin-x64/action-api +0 -0
  6. package/bin/darwin-x64/dependencies.json +9 -9
  7. package/bin/linux-arm64/action-api +0 -0
  8. package/bin/linux-arm64/dependencies.json +306 -306
  9. package/bin/linux-x64/action-api +0 -0
  10. package/bin/linux-x64/dependencies.json +311 -311
  11. package/bin/windows-arm64/action-api.exe +0 -0
  12. package/bin/windows-arm64/dependencies.json +9 -9
  13. package/bin/windows-x64/action-api.exe +0 -0
  14. package/bin/windows-x64/dependencies.json +9 -9
  15. package/package.json +1 -1
  16. /package/bin/darwin-arm64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-APACHE +0 -0
  17. /package/bin/darwin-arm64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-ISC +0 -0
  18. /package/bin/darwin-arm64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-MIT +0 -0
  19. /package/bin/darwin-arm64/licenses/{rustls-webpki-0.103.13 → rustls-webpki-0.103.15}/LICENSE +0 -0
  20. /package/bin/darwin-arm64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-APACHE +0 -0
  21. /package/bin/darwin-arm64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-MIT +0 -0
  22. /package/bin/darwin-x64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-APACHE +0 -0
  23. /package/bin/darwin-x64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-ISC +0 -0
  24. /package/bin/darwin-x64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-MIT +0 -0
  25. /package/bin/darwin-x64/licenses/{rustls-webpki-0.103.13 → rustls-webpki-0.103.15}/LICENSE +0 -0
  26. /package/bin/darwin-x64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-APACHE +0 -0
  27. /package/bin/darwin-x64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-MIT +0 -0
  28. /package/bin/linux-arm64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-APACHE +0 -0
  29. /package/bin/linux-arm64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-ISC +0 -0
  30. /package/bin/linux-arm64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-MIT +0 -0
  31. /package/bin/linux-arm64/licenses/{rustls-webpki-0.103.13 → rustls-webpki-0.103.15}/LICENSE +0 -0
  32. /package/bin/linux-arm64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-APACHE +0 -0
  33. /package/bin/linux-arm64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-MIT +0 -0
  34. /package/bin/linux-x64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-APACHE +0 -0
  35. /package/bin/linux-x64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-ISC +0 -0
  36. /package/bin/linux-x64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-MIT +0 -0
  37. /package/bin/linux-x64/licenses/{rustls-webpki-0.103.13 → rustls-webpki-0.103.15}/LICENSE +0 -0
  38. /package/bin/linux-x64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-APACHE +0 -0
  39. /package/bin/linux-x64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-MIT +0 -0
  40. /package/bin/windows-arm64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-APACHE +0 -0
  41. /package/bin/windows-arm64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-ISC +0 -0
  42. /package/bin/windows-arm64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-MIT +0 -0
  43. /package/bin/windows-arm64/licenses/{rustls-webpki-0.103.13 → rustls-webpki-0.103.15}/LICENSE +0 -0
  44. /package/bin/windows-arm64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-APACHE +0 -0
  45. /package/bin/windows-arm64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-MIT +0 -0
  46. /package/bin/windows-x64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-APACHE +0 -0
  47. /package/bin/windows-x64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-ISC +0 -0
  48. /package/bin/windows-x64/licenses/{rustls-0.23.41 → rustls-0.23.45}/LICENSE-MIT +0 -0
  49. /package/bin/windows-x64/licenses/{rustls-webpki-0.103.13 → rustls-webpki-0.103.15}/LICENSE +0 -0
  50. /package/bin/windows-x64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-APACHE +0 -0
  51. /package/bin/windows-x64/licenses/{thread_local-1.1.9 → thread_local-1.1.10}/LICENSE-MIT +0 -0
package/README.md CHANGED
@@ -10,6 +10,7 @@ Node.js 20 or newer is required for the npm installation:
10
10
  ```sh
11
11
  npm install --global @action-intelligence/cli
12
12
  action auth login
13
+ action whoami
13
14
  action context list
14
15
  action context use <space-id-or-key>
15
16
  ```
@@ -24,12 +25,42 @@ action auth status
24
25
  action auth logout
25
26
  ```
26
27
 
28
+ `action whoami` verifies the active credential with the API and shows its display name, ID, type,
29
+ and organization alongside the profile, API URL, and selected space. It works before selecting
30
+ a space and supports human sessions and machine credentials. Use `action whoami --format json` for
31
+ structured output. Add `--verbose` to include credential and organization scopes in either text or
32
+ JSON output. The selected space is the configured ID or key, not a check of space access.
33
+
27
34
  Human credentials stay in macOS Keychain, Linux Secret Service, or Windows Credential Manager.
28
35
  Linux requires a working Secret Service and `secret-tool`. Profile files contain non-secret settings
29
36
  only. Credentials are bound to the API origin used during login.
30
37
 
31
38
  For enabled machine access, supply `ACTION_TOKEN` or `ACTION_API_KEY` through a secret manager.
32
- `ACTION_TOKEN` takes precedence. Do not put credentials in project files or command arguments.
39
+ `ACTION_TOKEN` takes precedence, followed by `ACTION_API_KEY`, then the compatible `ACTION_API_TOKEN` alias. Do not put credentials in project files or command arguments.
40
+
41
+ ## Conversations and cases
42
+
43
+ Copilot is available directly; the agent does not need to discover an automation or version:
44
+
45
+ ```sh
46
+ action copilot "Summarize my open cases"
47
+ action copilot --case TEAM-42 "Help me investigate this case"
48
+ action copilot --session <id> "What should we do next?"
49
+ action copilot --session <id>
50
+ action sessions transcript <id> --page-all
51
+ action cases reopen TEAM-42 --yes
52
+ action cases unarchive TEAM-42 --yes
53
+ ```
54
+
55
+ Standalone Copilot sessions are private. Copilot and `sessions reply` wait for the matching reply;
56
+ `reply_received` confirms a response, not completion of every action it describes. Use `--no-wait`
57
+ for a delivery receipt or `--timeout <seconds>` to change the wait limit (default 120).
58
+ Messages also accept `--input-file <path|->`; use `--` before literal option-like text.
59
+
60
+ Failed submissions and waits retain session/message IDs. Resume with `sessions wait <session-id>
61
+ <client-message-id>` without resending, or reuse `--client-message-id` when retrying a submission.
62
+ `--page-all` reads older history. `cases reopen` restores an open status; `cases unarchive` preserves
63
+ status. A partially completed reopen reports its acknowledged writes and recovery details.
33
64
 
34
65
  ## Discover and call resources
35
66
 
@@ -39,17 +70,29 @@ action --schema
39
70
  action cases list --help
40
71
  action cases list --schema
41
72
  action cases list --limit 10
42
- action cases get --case-id <id>
73
+ action cases get --case-id-or-identifier <id-or-identifier>
43
74
  action automations list
44
75
  action sessions list
45
76
  action knowledge list-folders
77
+ action knowledge search --json '{"question":"How do I request VPN access?"}'
78
+ action directory search-users --json '{"query":"Alex"}'
79
+ action directory search-groups --json '{"query":"Engineering"}'
80
+ action cases search --json '{"question":"VPN connection failures"}'
81
+ action cases read-context --params '{"caseIdOrIdentifier":"CASE-1","sessionLimit":20}'
82
+ action sessions read-transcript --params '{"sessionId":"<id>","afterSeq":0,"limit":50}'
83
+ action requests intake --json '{"initialMessage":{"clientMessageId":"request-1","content":"I need VPN access","mode":"prompt"}}' --yes
84
+ action requests escalate --params '{"sourceThreadId":"<request-session-id>"}' --json '{"reason":"Need a person"}' --yes
46
85
  ```
47
86
 
48
- Commands use named IDs, such as `--case-id`, instead of positional IDs. A selected space is supplied
87
+ Generated resource commands use named IDs, such as `--case-id-or-identifier`. Operator shortcuts also accept positional IDs. A selected space is supplied
49
88
  automatically; `--space-id <id>` selects it explicitly for one operation. `--profile`, `--api-url`,
50
89
  and `--space` provide connection/context overrides. Human credentials cannot be sent to a different
51
90
  API origin without signing in there; explicit machine credentials can target an alternate API.
52
91
 
92
+ Directory search and request intake use signed-in user credentials. Case transcript reads require
93
+ both `sessions:read` and `cases:read`; escalation requires `cases:write`. Intake follows the same
94
+ routing as the in-product help desk, and escalation uses the same assignment and muting settings.
95
+
53
96
  The legacy Case, Automation, Form, Skill, and Workflow Builder sessions are retired. Use Copilot
54
97
  for authoring; existing Builder conversations remain readable. Workflow Suggestion sessions remain
55
98
  available.
@@ -65,14 +108,25 @@ not an output-format switch.** Use `--params` for a JSON object of path/query/he
65
108
  ```sh
66
109
  action cases list --params '{"limit":10}' --format json
67
110
  action cases list --limit 10 --page-all --page-limit 5
68
- action cases archive --case-id <id> --yes
111
+ action cases archive --case-id-or-identifier <id-or-identifier> --yes
69
112
  ```
70
113
 
114
+ `--case-id` is a compatibility alias only for case commands that declare `caseIdOrIdentifier`
115
+ and no `caseId` parameter. Inbox commands such as `read-inbox-case` and `archive-inbox-case`
116
+ keep their required `--case-id` parameter. `--params` rejects unknown names; numeric parameter
117
+ bounds are validated before authentication or confirmation. Explicit space IDs and saved context
118
+ IDs are sent directly to the resource endpoint, which enforces access.
119
+
120
+ `--page-all` keeps the single-page response envelope and combines its records. The same `--query`
121
+ works with one or many pages. Repeated cursors and page-limit exhaustion exit nonzero instead of
122
+ silently returning an incomplete result. Use an explicit query such as `--query 'cases[]'` to emit
123
+ one record per JSONL line. CSV preserves embedded newlines; case tables show concise columns.
124
+
71
125
  Pagination flags are available only on operations whose contracts declare pagination. Use
72
126
  `--dry-run` to inspect an operation without sending its request. Provide explicit IDs for a fully
73
127
  offline dry run; resolving a saved context can require a read.
74
128
 
75
- Remote mutations prompt before execution. Non-interactive use requires `--yes`. Confirmation does
129
+ Generated remote mutations prompt before execution. Non-interactive use requires `--yes`. Confirmation does
76
130
  not bypass server-side permissions or workflow approvals. Provider consent still requires the
77
131
  provider's authorization flow. Organization administration requires a human login with organization
78
132
  permissions; selecting an organization does not switch tenants or grant machine credentials access.
@@ -84,7 +138,7 @@ Generated upload commands accept `--file`. Download commands require `--output`;
84
138
  protected unless you explicitly pass `--overwrite`. Downloads are published to the destination only
85
139
  after successful completion. Knowledge text, Markdown, and HTML uploads are normalized before
86
140
  storage; downloads return stored content, which is not necessarily byte-for-byte identical to the
87
- original upload.
141
+ original upload. Unexpected non-JSON responses on JSON operations and malformed JSON fail on stderr without creating files.
88
142
 
89
143
  ```sh
90
144
  action knowledge create-upload --file ./guide.txt --folder Guides --availability space --yes
@@ -110,6 +164,21 @@ publishing. Push updates drafts; it does not publish them. Skill projects retain
110
164
  validation, safe file extraction, and guarded tag updates. `action workflows` and `action skills`
111
165
  expose the underlying generated API operations.
112
166
 
167
+ Local commands accept `--format json` and `--schema` as well as the legacy `--json` output switch.
168
+ Local validation and diffs for new or unchanged workflows do not need authentication. A changed,
169
+ tracked workflow needs its remote base revision for a complete diff.
170
+
171
+ ## Environment and shell integration
172
+
173
+ `ACTION_OUTPUT` (or `ACTION_API_OUTPUT`) selects output for resource and operator commands.
174
+ Operator commands support `json`, `text`, and `table`; explicit `--format` overrides the environment.
175
+ `ACTION_API_TIMEOUT_SECS`, `ACTION_API_CA_BUNDLE`, and `ACTION_API_PROXY` configure the HTTP runtime.
176
+ `ACTION_API_URL` (or `ACTION_API_BASE_URL`) overrides the API origin; command-line overrides win.
177
+ TLS verification remains enabled. Success goes to stdout; errors go to stderr with a nonzero exit.
178
+
179
+ `action completion bash|zsh|fish|powershell|elvish` registers completions for `action`, including
180
+ launcher and Copilot commands. `action man` uses the same executable name.
181
+
113
182
  ## Migrating existing scripts
114
183
 
115
184
  - Replace positional resource IDs with the flags shown in command help.
@@ -125,3 +194,58 @@ expose the underlying generated API operations.
125
194
  Install the complete package: the launcher and its platform-specific generated executable must
126
195
  remain together. Generated resource errors are structured JSON on stderr and use Fern's exit codes;
127
196
  local authoring commands retain Action's local validation errors.
197
+
198
+ ## Case threads and resource relationships
199
+
200
+ `action cases reply CASE-42 "I have reviewed the invoice"` replies in an existing linked thread.
201
+ If there is more than one unarchived thread, the CLI returns their IDs and titles without sending;
202
+ use `--thread-id` to select the conversation. `--case-id`, `--input-file`, `--no-wait`, and the
203
+ usual reply receipt/retry options also work. `action copilot --case CASE-42 "..."` starts a separate
204
+ linked conversation.
205
+
206
+ Use group help before joining resources. Assignment groups route cases; canonical organization
207
+ groups define access-profile eligibility; space roles control permissions within Action; access
208
+ roles describe requestable application access. Their IDs are not interchangeable. Access roles
209
+ require a connector instance; discover it with `applications list-applications`. For access profiles, use `--add-group-ids` / `--remove-group-ids`,
210
+ `--add-excluded-group-ids` / `--remove-excluded-group-ids`, and `--add-role-ids` / `--remove-role-ids`
211
+ on `access-profiles update` for atomic relationship edits. Full arrays remain replacements;
212
+ permission lists on space roles also remain replacements. Access profile, role, and policy creates
213
+ publish immediately; they do not create unpublished drafts.
214
+
215
+ Knowledge uploads accept `--availability space` or `org`. A pending upload has not finished indexing.
216
+ Workflow source must default-export a `workflow()` literal from `@action/workflows`, and its inline
217
+ `inputSchema` must match `metadata.inputs`. Updates require `baseRevisionId` and a quoted strong
218
+ `If-Match` value containing `<revisionId>:<draftGeneration>`, plus an idempotency key.
219
+ `workflows token <id>` returns the exact `ifMatch` value and `baseRevisionId` for the next write.
220
+ `workflow-project init` creates project configuration and an editable `workflows/example` scaffold. Knowledge text downloads can contain
221
+ normalized stored text; case attachment downloads preserve the original bytes.
222
+
223
+ `action auth profiles` lists saved profile names and their organization/space context without
224
+ reading credentials or making network calls. Use `--profile <name>` to select one for a command.
225
+ `applications list` and `applications get` are aliases for the longer generated command names.
226
+
227
+ The launcher validates generated requests against their source schemas before authentication.
228
+ Command `--schema` includes the authoritative request-body schema and preserves constraints such
229
+ as required fields, enums, minimum array sizes, and forbidden properties.
230
+
231
+ ### Helpdesk requests
232
+
233
+ The agent can open a request by space name without looking up automation IDs:
234
+
235
+ ```sh
236
+ action requests destinations
237
+ action requests start --to IT "My laptop is broken"
238
+ action requests reply <session-id> "The power light is off"
239
+ action requests get <session-id>
240
+ action cases reply IT-42 "Your replacement is ready"
241
+ ```
242
+
243
+ `requests start` resolves an exact space name, slug, or ID and waits for the initial helpdesk reply.
244
+ Unknown or ambiguous destinations fail before creating anything. `requests get` includes linked
245
+ cases and their identifiers, using the request's selected space even when the current context differs.
246
+
247
+ `requests reply` and `cases reply` confirm message delivery by default. Action's normal smart-reply,
248
+ participation, and pause policies determine whether the helpdesk agent responds. Use `--wait` when
249
+ an agent reply is expected; it does not force a response or unmute the agent. `sessions reply`
250
+ continues to wait by default. Messages can also come from `--input-file` or stdin, and receipts
251
+ retain session/message IDs for recovery. The longer generated commands remain available.