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