@knowttl/checkpoint-axi 0.1.2 → 0.1.3
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 +12 -1
- package/dist/src/catalogue.d.ts +21 -9
- package/dist/src/catalogue.js +30 -6
- package/dist/src/local-commands.js +4 -2
- package/dist/src/reads.js +101 -3
- package/dist/src/transport.d.ts +1 -1
- package/dist/src/transport.js +3 -3
- package/docs/agent-guide.md +23 -2
- package/docs/commands.md +15 -4
- package/docs/reads.md +43 -1
- package/package.json +1 -1
- package/skills/checkpoint-axi/SKILL.md +17 -2
package/README.md
CHANGED
|
@@ -59,6 +59,9 @@ Use the hook, the skill or both; neither is required for ordinary CLI use.
|
|
|
59
59
|
Start investigations with the compact [agent guide](docs/agent-guide.md), linked from [SKILL.md](skills/checkpoint-axi/SKILL.md).
|
|
60
60
|
Use the [command reference](docs/commands.md) for the full catalogue.
|
|
61
61
|
|
|
62
|
+
Email search and event list support opt-in read-only detail expansion with `--expand`.
|
|
63
|
+
See [bounded detail expansion](docs/reads.md#bounded-detail-expansion) for limits, shared budgets, partial results and examples.
|
|
64
|
+
|
|
62
65
|
## What it covers
|
|
63
66
|
|
|
64
67
|
<!-- command-registry:start -->
|
|
@@ -73,7 +76,15 @@ Use the [command reference](docs/commands.md) for the full catalogue.
|
|
|
73
76
|
| exception | Inspect eight kinds; preview or request supported rule changes | Read / gated write | [Guide](docs/writes.md) |
|
|
74
77
|
| home | Show local profile context without resolving secrets | Local read | [Guide](docs/configuration.md) |
|
|
75
78
|
| profile | List named file profiles | Local read | [Guide](docs/configuration.md) |
|
|
76
|
-
| task | Inspect asynchronous action status
|
|
79
|
+
| task | Inspect asynchronous action status once or with bounded read-only waiting | Read | [Guide](docs/reads.md#event-and-task-reads) |
|
|
80
|
+
|
|
81
|
+
Task show reads once by default; use task show <id> --wait --timeout 30 for bounded read-only polling.
|
|
82
|
+
--timeout is required with --wait (integer seconds, range 1-60); --poll-interval defaults to 2 seconds (range 1-10), and --wait-requests defaults to 10 total HTTP requests (range 2-10), including auth and retries.
|
|
83
|
+
Wait stops on completed, failed or stopped; init, inprogress and paused remain non-terminal.
|
|
84
|
+
The task snapshot contains the final status; wait reports terminal, polls (validated status snapshots) and reason (terminal, timeout or budget).
|
|
85
|
+
A non-terminal stop exits 0 with the last snapshot and a read-only next-step hint; inspect wait even on exit 0 and include task,wait,help with --fields.
|
|
86
|
+
Timeout covers auth, requests, retries and delays within the shared 8 MiB response cap; failures before any snapshot remain errors.
|
|
87
|
+
Waiting never resubmits an action or changes remote state; a failed or stopped task is terminal, not successful execution.
|
|
77
88
|
|
|
78
89
|
Email search --filter accepts a JSON array of {saasAttrName, saasAttrOp, saasAttrValue}.
|
|
79
90
|
saasAttrName is a field path, not a closed enum (guide pages 19-20).
|
package/dist/src/catalogue.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const DESCRIPTION = "Inspect Check Point Email Security through compact, guarded AXI commands";
|
|
2
2
|
export declare const SETUP_GUIDANCE = "Run checkpoint-axi config path; configure a region, clientId and clientSecret env/file SecretRef";
|
|
3
|
+
export declare const TASK_WAIT_GUIDANCE: string;
|
|
4
|
+
export declare const DETAIL_EXPANSION_GUIDANCE: string;
|
|
3
5
|
export declare const EMAIL_PAYLOAD_ATTRIBUTES: string[];
|
|
4
6
|
export declare const EMAIL_FILTER_GUIDANCE: string;
|
|
5
7
|
export declare const catalogue: {
|
|
@@ -194,6 +196,9 @@ export declare const catalogue: {
|
|
|
194
196
|
readonly "event-ids": "Comma-separated event IDs; default unfiltered";
|
|
195
197
|
readonly "confidence-indicator": "Confidence indicator selector; default unfiltered";
|
|
196
198
|
readonly description: "Description selector; default unfiltered";
|
|
199
|
+
readonly expand: string;
|
|
200
|
+
readonly "expand-limit": string;
|
|
201
|
+
readonly "expand-requests": string;
|
|
197
202
|
readonly "start-date": string;
|
|
198
203
|
readonly "end-date": string;
|
|
199
204
|
readonly limit: string;
|
|
@@ -205,7 +210,7 @@ export declare const catalogue: {
|
|
|
205
210
|
readonly full: string;
|
|
206
211
|
readonly help: string;
|
|
207
212
|
};
|
|
208
|
-
readonly examples: readonly ["checkpoint-axi event list", "checkpoint-axi event list --
|
|
213
|
+
readonly examples: readonly ["checkpoint-axi event list", "checkpoint-axi event list --limit 5 --expand --event-types phishing", "checkpoint-axi event list --cursor <cursor>"];
|
|
209
214
|
};
|
|
210
215
|
readonly "event show": {
|
|
211
216
|
readonly description: "Show one event, actions taken and available actions (API guide pages 34-37)";
|
|
@@ -219,20 +224,27 @@ export declare const catalogue: {
|
|
|
219
224
|
readonly examples: readonly ["checkpoint-axi event show <id>", "checkpoint-axi event show <id> --full"];
|
|
220
225
|
};
|
|
221
226
|
readonly "task show": {
|
|
222
|
-
readonly description: "Show asynchronous task status and per-action details (API guide pages 30-33)";
|
|
227
|
+
readonly description: "Show asynchronous task status and per-action details, optionally waiting within explicit bounds (API guide pages 30-33)";
|
|
223
228
|
readonly flags: {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
+
readonly wait: "Poll existing task status only; default false; requires --timeout; terminal: completed, failed, stopped";
|
|
230
|
+
readonly timeout: "Total wait timeout in integer seconds, range 1-60; required with --wait; includes auth and retries";
|
|
231
|
+
readonly "poll-interval": "Seconds between status reads; default 2, range 1-10; requires --wait";
|
|
232
|
+
readonly "wait-requests": "Total HTTP request cap including auth and retries; default 10, range 2-10; requires --wait";
|
|
233
|
+
readonly config: string;
|
|
234
|
+
readonly profile: string;
|
|
235
|
+
readonly fields: string;
|
|
236
|
+
readonly full: string;
|
|
237
|
+
readonly help: string;
|
|
229
238
|
};
|
|
230
|
-
readonly examples: readonly ["checkpoint-axi task show <id>", "checkpoint-axi task show <id> --full"];
|
|
239
|
+
readonly examples: readonly ["checkpoint-axi task show <id>", "checkpoint-axi task show <id> --wait --timeout 30 --fields task,wait,help", "checkpoint-axi task show <id> --full"];
|
|
231
240
|
};
|
|
232
241
|
readonly "email search": {
|
|
233
242
|
readonly description: "Search emails with a bounded date window and scroll continuation (API guide pages 18-27)";
|
|
234
243
|
readonly flags: {
|
|
235
244
|
readonly filter: `JSON array of {saasAttrName, saasAttrOp, saasAttrValue} filters. ${string}`;
|
|
245
|
+
readonly expand: string;
|
|
246
|
+
readonly "expand-limit": string;
|
|
247
|
+
readonly "expand-requests": string;
|
|
236
248
|
readonly "start-date": string;
|
|
237
249
|
readonly "end-date": string;
|
|
238
250
|
readonly limit: string;
|
|
@@ -246,7 +258,7 @@ export declare const catalogue: {
|
|
|
246
258
|
readonly full: string;
|
|
247
259
|
readonly help: string;
|
|
248
260
|
};
|
|
249
|
-
readonly examples: readonly ["checkpoint-axi email search", "checkpoint-axi email search --
|
|
261
|
+
readonly examples: readonly ["checkpoint-axi email search", "checkpoint-axi email search --limit 5 --expand --saas office365_emails", "checkpoint-axi email search --cursor <cursor>"];
|
|
250
262
|
};
|
|
251
263
|
readonly "email show": {
|
|
252
264
|
readonly description: "Show one email with verdicts, actions and available actions (API guide pages 10-18)";
|
package/dist/src/catalogue.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { exceptionFamilies } from "./exceptions.js";
|
|
2
2
|
export const DESCRIPTION = "Inspect Check Point Email Security through compact, guarded AXI commands";
|
|
3
3
|
export const SETUP_GUIDANCE = "Run checkpoint-axi config path; configure a region, clientId and clientSecret env/file SecretRef";
|
|
4
|
+
export const TASK_WAIT_GUIDANCE = "Task show reads once by default; use task show <id> --wait --timeout 30 for bounded read-only polling.\n"
|
|
5
|
+
+ "--timeout is required with --wait (integer seconds, range 1-60); --poll-interval defaults to 2 seconds (range 1-10), and --wait-requests defaults to 10 total HTTP requests (range 2-10), including auth and retries.\n"
|
|
6
|
+
+ "Wait stops on completed, failed or stopped; init, inprogress and paused remain non-terminal.\n"
|
|
7
|
+
+ "The task snapshot contains the final status; wait reports terminal, polls (validated status snapshots) and reason (terminal, timeout or budget).\n"
|
|
8
|
+
+ "A non-terminal stop exits 0 with the last snapshot and a read-only next-step hint; inspect wait even on exit 0 and include task,wait,help with --fields.\n"
|
|
9
|
+
+ "Timeout covers auth, requests, retries and delays within the shared 8 MiB response cap; failures before any snapshot remain errors.\n"
|
|
10
|
+
+ "Waiting never resubmits an action or changes remote state; a failed or stopped task is terminal, not successful execution.";
|
|
11
|
+
export const DETAIL_EXPANSION_GUIDANCE = "Email search and event list accept --expand for read-only show details in each successful row's detail field.\n"
|
|
12
|
+
+ "Expansion is off by default; --expand-limit caps detail attempts (default 5, range 1-8), and --expand-requests caps total HTTP requests (default 10, range 2-10), including auth, list pages and retries.\n"
|
|
13
|
+
+ "Both limit flags require --expand; listing runs first and shares the 60-second and 8 MiB transport budgets with detail reads.\n"
|
|
14
|
+
+ "Inspect the expansion object's expanded, complete and notExpanded fields for every unexpanded ID and its reason: item-cap-reached, request-cap-reached, budget-exhausted or per-item-error (with an error code).\n"
|
|
15
|
+
+ "Partial expansion keeps every list row and successful detail; list complete/cursor describe pagination separately.\n"
|
|
16
|
+
+ "Use --fields emails,expansion or --fields events,expansion to retain expansion status; --full restores full strings after redaction.\n"
|
|
17
|
+
+ "With --all, list pages can consume the entire request budget before any detail is expanded; reduce the list limit or use individual show reads for remaining IDs.\n"
|
|
18
|
+
+ "Expansion never downloads files, invokes available actions or changes remote state.";
|
|
4
19
|
export const EMAIL_PAYLOAD_ATTRIBUTES = ["subject", "fromEmail", "attachmentCount", "internetMessageId", "received", "size", "emailLinks", "attachments", "mode", "recipients", "fromDomain", "fromUser", "fromName", "to", "toUser", "cc", "ccUser", "bcc", "bccUser", "replyToEmail", "replyToNickname", "isRead", "isDeleted", "isIncoming", "isInternal", "isOutgoing", "isQuarantined", "isQuarantineNotification", "isRestored", "isRestoreRequested", "isRestoreDeclined", "saasSpamVerdict", "SpfResult"].map((name) => `entityPayload.${name}`);
|
|
5
20
|
export const EMAIL_FILTER_GUIDANCE = "saasAttrName is a field path, not a closed enum (guide pages 19-20). Documented examples: "
|
|
6
21
|
+ EMAIL_PAYLOAD_ATTRIBUTES.slice(0, 3).join(", ") + ". Other documented email payload paths (pages 15-16, 24-25): "
|
|
@@ -21,6 +36,11 @@ const paging = {
|
|
|
21
36
|
cursor: "Opaque continuation bound to profile, region, operation and selectors; repeat original selectors",
|
|
22
37
|
};
|
|
23
38
|
const exceptionType = `Required for ${["malware", "url", "dlp"].map((kind) => `${kind}: ${exceptionFamilies[kind].types.join(",")}`).join("; ")}`;
|
|
39
|
+
const expansion = {
|
|
40
|
+
expand: "Opt in to read-only show details on returned rows; default false; partial expansion is reported separately",
|
|
41
|
+
"expand-limit": "Maximum detail attempts; default 5, range 1-8; requires --expand",
|
|
42
|
+
"expand-requests": "Total HTTP request cap including auth, list pages, detail and retries; default 10, range 2-10; requires --expand",
|
|
43
|
+
};
|
|
24
44
|
const writeFlags = { ...common,
|
|
25
45
|
ids: "Required comma-separated unique entity IDs; maximum 20",
|
|
26
46
|
execute: "Send once after all write gates; default false (preview)",
|
|
@@ -70,7 +90,7 @@ export const catalogue = {
|
|
|
70
90
|
"exception show": { description: "Show an exception by kind and ID/value; anomaly refuses ENDPOINT_UNVERIFIED pending commissioning (guide pages 52-123)",
|
|
71
91
|
flags: { ...common, type: exceptionType, items: "Click-time item route instead of list route; default false" },
|
|
72
92
|
examples: ["checkpoint-axi exception show phishing-block <id>", "checkpoint-axi exception show url <value> --type allow-url", "checkpoint-axi exception show click-time <id> --items --full"] },
|
|
73
|
-
"event list": { description: "List security events with bounded scroll continuation (API guide pages 37-42)", flags: { ...common, ...paging,
|
|
93
|
+
"event list": { description: "List security events with bounded scroll continuation (API guide pages 37-42)", flags: { ...common, ...paging, ...expansion,
|
|
74
94
|
saas: "Comma-separated SaaS overrides; default selected profile saas or office365_emails",
|
|
75
95
|
"event-types": "Comma-separated event types; default unfiltered",
|
|
76
96
|
"event-states": "Comma-separated event states; default unfiltered",
|
|
@@ -78,17 +98,21 @@ export const catalogue = {
|
|
|
78
98
|
"event-ids": "Comma-separated event IDs; default unfiltered",
|
|
79
99
|
"confidence-indicator": "Confidence indicator selector; default unfiltered",
|
|
80
100
|
description: "Description selector; default unfiltered",
|
|
81
|
-
}, examples: ["checkpoint-axi event list", "checkpoint-axi event list --
|
|
101
|
+
}, examples: ["checkpoint-axi event list", "checkpoint-axi event list --limit 5 --expand --event-types phishing", "checkpoint-axi event list --cursor <cursor>"] },
|
|
82
102
|
"event show": { description: "Show one event, actions taken and available actions (API guide pages 34-37)", flags: common,
|
|
83
103
|
examples: ["checkpoint-axi event show <id>", "checkpoint-axi event show <id> --full"] },
|
|
84
|
-
"task show": { description: "Show asynchronous task status and per-action details (API guide pages 30-33)", flags: common,
|
|
85
|
-
|
|
104
|
+
"task show": { description: "Show asynchronous task status and per-action details, optionally waiting within explicit bounds (API guide pages 30-33)", flags: { ...common,
|
|
105
|
+
wait: "Poll existing task status only; default false; requires --timeout; terminal: completed, failed, stopped",
|
|
106
|
+
timeout: "Total wait timeout in integer seconds, range 1-60; required with --wait; includes auth and retries",
|
|
107
|
+
"poll-interval": "Seconds between status reads; default 2, range 1-10; requires --wait",
|
|
108
|
+
"wait-requests": "Total HTTP request cap including auth and retries; default 10, range 2-10; requires --wait",
|
|
109
|
+
}, examples: ["checkpoint-axi task show <id>", "checkpoint-axi task show <id> --wait --timeout 30 --fields task,wait,help", "checkpoint-axi task show <id> --full"] },
|
|
86
110
|
"email search": { description: "Search emails with a bounded date window and scroll continuation (API guide pages 18-27)", flags: { ...common,
|
|
87
111
|
saas: "SaaS override; default selected profile saas or office365_emails",
|
|
88
112
|
"saas-entity": "Optional SaaS entity type selector",
|
|
89
|
-
...paging,
|
|
113
|
+
...paging, ...expansion,
|
|
90
114
|
filter: `JSON array of {saasAttrName, saasAttrOp, saasAttrValue} filters. ${EMAIL_FILTER_GUIDANCE}`,
|
|
91
|
-
}, examples: ["checkpoint-axi email search", "checkpoint-axi email search --
|
|
115
|
+
}, examples: ["checkpoint-axi email search", "checkpoint-axi email search --limit 5 --expand --saas office365_emails", "checkpoint-axi email search --cursor <cursor>"] },
|
|
92
116
|
"email show": { description: "Show one email with verdicts, actions and available actions (API guide pages 10-18)", flags: common,
|
|
93
117
|
examples: ["checkpoint-axi email show <id>", "checkpoint-axi email show <id> --full"] },
|
|
94
118
|
doctor: { description: "Check regional API authentication and one bounded email search without printing tenant data", flags: { ...common, saas: "SaaS override; default selected profile saas or office365_emails" },
|
|
@@ -38,7 +38,7 @@ export async function localCommand(argv, store, transport) {
|
|
|
38
38
|
const label = flag.split("=")[0];
|
|
39
39
|
usage(/^--[A-Za-z][A-Za-z0-9-]*$/.test(label) ? `Unknown or duplicate flag ${label}` : undefined);
|
|
40
40
|
}
|
|
41
|
-
if (["--help", "--full", "--all", "--items", "--specific", "--original", "--execute", "--dry-run"].includes(flag))
|
|
41
|
+
if (["--help", "--full", "--all", "--expand", "--wait", "--items", "--specific", "--original", "--execute", "--dry-run"].includes(flag))
|
|
42
42
|
flags.set(flag, "true");
|
|
43
43
|
else {
|
|
44
44
|
const value = argv[++index];
|
|
@@ -50,11 +50,13 @@ export async function localCommand(argv, store, transport) {
|
|
|
50
50
|
if (flags.has("--help"))
|
|
51
51
|
return { command: name, ...entry };
|
|
52
52
|
const available = isException ? name === "exception list" ? ["exceptions", "count", "total", "complete", "reason", "responseSchema", "help"] : ["exception", "responseSchema"]
|
|
53
|
-
: name === "email search" || name === "event list" ? [name === "event list" ? "events" : "emails", "count", "total", "complete", "reason", "cursor", "help"] : name.endsWith(" show") ? [name.split(" ")[0]]
|
|
53
|
+
: name === "email search" || name === "event list" ? [name === "event list" ? "events" : "emails", "count", "total", "complete", "reason", "cursor", "expansion", "help"] : name.endsWith(" show") ? [name.split(" ")[0]]
|
|
54
54
|
: name === "doctor" ? ["region", "saas", "checks", "pass", "help"] : name === "auth status" ? ["profile", "source", "region", "origin", "saas", "clientSecret", "readOnly"]
|
|
55
55
|
: name === "profile list" ? ["profiles", "count", "config"] : name === "config path" ? ["config", "state"]
|
|
56
56
|
: ["bin", "description", "status", "profiles", "count", "help"];
|
|
57
57
|
const isWrite = name === "email quarantine" || name === "email restore" || name === "event action" || isExceptionWrite;
|
|
58
|
+
if (name === "task show")
|
|
59
|
+
available.push("wait", "help");
|
|
58
60
|
if (isWrite)
|
|
59
61
|
available.splice(0, available.length, "outcome", "preview", "auditId", "tasks", "response", "responseSchema", "help");
|
|
60
62
|
if (isDownload)
|
package/dist/src/reads.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AxiError } from "axi-sdk-js";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
+
import { setTimeout as delay } from "node:timers/promises";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { REGIONS } from "./regions.js";
|
|
5
6
|
import { gateway, READ_LIMITS } from "./transport.js";
|
|
@@ -30,12 +31,32 @@ export async function readCommand(name, id, flags, store, transport) {
|
|
|
30
31
|
const isEvent = name.startsWith("event ");
|
|
31
32
|
if (name.endsWith(" show") && (!id || !/^[A-Za-z0-9_-]+$/.test(id)))
|
|
32
33
|
invalid(`${name} requires one ID containing letters, digits, underscores or hyphens`);
|
|
34
|
+
const waiting = flags.has("--wait");
|
|
35
|
+
if (!waiting && ["--timeout", "--poll-interval", "--wait-requests"].some((flag) => flags.has(flag)))
|
|
36
|
+
invalid("Wait limits require --wait");
|
|
37
|
+
const timeoutText = flags.get("--timeout") ?? "";
|
|
38
|
+
const intervalText = flags.get("--poll-interval") ?? "2";
|
|
39
|
+
const waitRequestsText = flags.get("--wait-requests") ?? "10";
|
|
40
|
+
if (waiting && (!/^[1-9][0-9]*$/.test(timeoutText) || Number(timeoutText) > 60))
|
|
41
|
+
invalid("--wait requires --timeout in integer seconds from 1 to 60");
|
|
42
|
+
if (!/^(?:[1-9]|10)$/.test(intervalText))
|
|
43
|
+
invalid("--poll-interval must be integer seconds from 1 to 10");
|
|
44
|
+
if (!/^(?:[2-9]|10)$/.test(waitRequestsText))
|
|
45
|
+
invalid("--wait-requests must be an integer from 2 to 10");
|
|
33
46
|
const limitText = flags.get("--limit") ?? "50";
|
|
34
47
|
if (!/^[1-9][0-9]*$/.test(limitText) || Number(limitText) > READ_LIMITS.rows)
|
|
35
48
|
invalid("--limit must be an integer from 1 to 1000");
|
|
36
49
|
if (flags.has("--all") && flags.has("--limit"))
|
|
37
50
|
invalid("Use either --all or --limit");
|
|
38
51
|
const limit = flags.has("--all") ? READ_LIMITS.rows : Number(limitText);
|
|
52
|
+
if (!flags.has("--expand") && (flags.has("--expand-limit") || flags.has("--expand-requests")))
|
|
53
|
+
invalid("Expansion limits require --expand");
|
|
54
|
+
const expandLimitText = flags.get("--expand-limit") ?? "5";
|
|
55
|
+
const expandRequestsText = flags.get("--expand-requests") ?? "10";
|
|
56
|
+
if (!/^[1-8]$/.test(expandLimitText))
|
|
57
|
+
invalid("--expand-limit must be an integer from 1 to 8");
|
|
58
|
+
if (!/^(?:[2-9]|10)$/.test(expandRequestsText))
|
|
59
|
+
invalid("--expand-requests must be an integer from 2 to 10");
|
|
39
60
|
let extended;
|
|
40
61
|
if (flags.has("--filter")) {
|
|
41
62
|
let raw;
|
|
@@ -100,8 +121,14 @@ export async function readCommand(name, id, flags, store, transport) {
|
|
|
100
121
|
origin: REGIONS[profile.region], operation: name, ...(isEvent ? { selectors } : { entityFilter, extended }) })).digest("hex");
|
|
101
122
|
if (cursor && cursor.binding !== binding)
|
|
102
123
|
invalid("Cursor does not match this profile, region or search selectors; repeat the original selectors");
|
|
103
|
-
const
|
|
104
|
-
|
|
124
|
+
const now = transport?.now ?? Date.now;
|
|
125
|
+
const wait = transport?.wait ?? delay;
|
|
126
|
+
const timeout = waiting ? Number(timeoutText) * 1_000 : READ_LIMITS.milliseconds;
|
|
127
|
+
const deadline = now() + timeout;
|
|
128
|
+
const api = gateway(profile, store.credentials(profile, true), store.redactor, transport, false, Number(waiting ? waitRequestsText : expandRequestsText), timeout);
|
|
129
|
+
async function detail(id) {
|
|
130
|
+
if (!/^[A-Za-z0-9_-]+$/.test(id))
|
|
131
|
+
throw new AxiError("Invalid detail ID", "RESPONSE_INVALID", []);
|
|
105
132
|
const kind = name.split(" ")[0];
|
|
106
133
|
const page = await api.read({ path: name === "task show" ? `/task/${id}` : isEvent ? `/event/${id}` : `/search/entity/${id}` });
|
|
107
134
|
const response = { responseData: page.dataIsArray ? page.records : page.records[0] };
|
|
@@ -117,8 +144,43 @@ export async function readCommand(name, id, flags, store, transport) {
|
|
|
117
144
|
const returnedId = name === "task show" ? String(record.id) : isEvent ? record.eventId : record.entityInfo?.entityId;
|
|
118
145
|
if (returnedId !== id)
|
|
119
146
|
throw responseInvalid(`Invalid ${kind} detail response`, response, [[...recordPath, ...(name === "task show" ? ["id"] : isEvent ? ["eventId"] : ["entityInfo", "entityId"])]]);
|
|
120
|
-
return
|
|
147
|
+
return parsed.data;
|
|
121
148
|
}
|
|
149
|
+
if (name === "task show" && waiting) {
|
|
150
|
+
let snapshot;
|
|
151
|
+
let polls = 0;
|
|
152
|
+
let reason;
|
|
153
|
+
for (;;) {
|
|
154
|
+
try {
|
|
155
|
+
snapshot = await detail(id);
|
|
156
|
+
polls++;
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
if (!snapshot || !(error instanceof AxiError) || !["REQUEST_BUDGET", "TIME_BUDGET", "RESPONSE_TOO_LARGE"].includes(error.code))
|
|
160
|
+
throw error;
|
|
161
|
+
reason = error.code === "TIME_BUDGET" ? "timeout" : "budget";
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
if (["completed", "failed", "stopped"].includes(snapshot.status)) {
|
|
165
|
+
reason = "terminal";
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
const remaining = deadline - now();
|
|
169
|
+
if (remaining <= 0) {
|
|
170
|
+
reason = "timeout";
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
await wait(Math.min(Number(intervalText) * 1_000, remaining));
|
|
174
|
+
if (now() >= deadline) {
|
|
175
|
+
reason = "timeout";
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return { task: snapshot, wait: { terminal: reason === "terminal", polls, reason },
|
|
180
|
+
...(reason === "terminal" ? {} : { help: [`Run checkpoint-axi task show ${id}${flags.has("--config") ? " --config <absolute-path>" : ""}${flags.has("--profile") ? " --profile <name>" : ""} to read status again; the task may still run, never resubmit its action to obtain status`] }) };
|
|
181
|
+
}
|
|
182
|
+
if (name.endsWith(" show"))
|
|
183
|
+
return { [name.split(" ")[0]]: await detail(id) };
|
|
122
184
|
const results = [];
|
|
123
185
|
let scroll = cursor?.scroll;
|
|
124
186
|
let offset = cursor?.offset ?? 0;
|
|
@@ -171,7 +233,43 @@ export async function readCommand(name, id, flags, store, transport) {
|
|
|
171
233
|
}
|
|
172
234
|
const next = exhausted ? undefined : Buffer.from(JSON.stringify({ version: 1, binding, start, end, scroll, offset,
|
|
173
235
|
...(replayRisk ? { replayRisk: true } : {}) })).toString("base64url");
|
|
236
|
+
let expansion;
|
|
237
|
+
if (flags.has("--expand")) {
|
|
238
|
+
let attempted = 0;
|
|
239
|
+
let expanded = 0;
|
|
240
|
+
let stopped;
|
|
241
|
+
const notExpanded = [];
|
|
242
|
+
for (const row of results) {
|
|
243
|
+
const itemId = row.id;
|
|
244
|
+
if (stopped) {
|
|
245
|
+
notExpanded.push({ id: itemId, ...stopped });
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
if (attempted >= Number(expandLimitText)) {
|
|
249
|
+
notExpanded.push({ id: itemId, reason: "item-cap-reached" });
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
attempted++;
|
|
253
|
+
try {
|
|
254
|
+
row.detail = await detail(itemId);
|
|
255
|
+
expanded++;
|
|
256
|
+
}
|
|
257
|
+
catch (error) {
|
|
258
|
+
if (!(error instanceof AxiError))
|
|
259
|
+
throw error;
|
|
260
|
+
const code = error.code;
|
|
261
|
+
if (["REQUEST_BUDGET", "TIME_BUDGET", "RESPONSE_TOO_LARGE"].includes(code)) {
|
|
262
|
+
stopped = { reason: code === "REQUEST_BUDGET" ? "request-cap-reached" : "budget-exhausted", code };
|
|
263
|
+
notExpanded.push({ id: itemId, ...stopped });
|
|
264
|
+
}
|
|
265
|
+
else
|
|
266
|
+
notExpanded.push({ id: itemId, reason: "per-item-error", code });
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
expansion = { expanded, attempted, itemLimit: Number(expandLimitText), requestLimit: Number(expandRequestsText), complete: notExpanded.length === 0, notExpanded };
|
|
270
|
+
}
|
|
174
271
|
return { [isEvent ? "events" : "emails"]: results, count: results.length, ...(total === undefined ? {} : { total }), complete: exhausted && !replayRisk,
|
|
272
|
+
...(expansion ? { expansion } : {}),
|
|
175
273
|
...(replayRisk ? { reason: "replay-may-skip-or-repeat" } : {}), ...(next ? { cursor: next } : {}),
|
|
176
274
|
help: [...(results.length ? [isEvent ? "Run checkpoint-axi event show <id> for event details and available actions" : "Run checkpoint-axi email show <id> for verdicts, actions and available actions"] : [`No ${isEvent ? "events" : "emails"} matched this search window and selectors`]),
|
|
177
275
|
...(next ? ["Repeat this search with --cursor <cursor> and the original selectors to continue"] : []),
|
package/dist/src/transport.d.ts
CHANGED
|
@@ -72,7 +72,7 @@ export declare function decodePage(value: unknown, unverified?: boolean): Page;
|
|
|
72
72
|
export declare function gateway(profile: SelectedProfile, credentials: {
|
|
73
73
|
clientId: string;
|
|
74
74
|
clientSecret: string;
|
|
75
|
-
}, redactor: SecretRedactor, dependencies?: Dependencies, mutation?: boolean): {
|
|
75
|
+
}, redactor: SecretRedactor, dependencies?: Dependencies, mutation?: boolean, requestLimit?: number, milliseconds?: number): {
|
|
76
76
|
authenticate: () => Promise<void>;
|
|
77
77
|
read: (query: ReadRequest) => Promise<Page>;
|
|
78
78
|
download: (query: DownloadRequest) => Promise<{
|
package/dist/src/transport.js
CHANGED
|
@@ -66,10 +66,10 @@ function tokenFrom(value, redactor) {
|
|
|
66
66
|
throw failure("AUTH_SHAPE_UNVERIFIED", "Unverified auth token response shape; owner commissioning is required (API guide page 8 does not specify the shape)");
|
|
67
67
|
return [...tokens][0];
|
|
68
68
|
}
|
|
69
|
-
export function gateway(profile, credentials, redactor, dependencies = {}, mutation = false) {
|
|
69
|
+
export function gateway(profile, credentials, redactor, dependencies = {}, mutation = false, requestLimit = READ_LIMITS.requests, milliseconds = READ_LIMITS.milliseconds) {
|
|
70
70
|
const now = dependencies.now ?? Date.now;
|
|
71
71
|
const wait = dependencies.wait ?? delay;
|
|
72
|
-
const deadline = now() + READ_LIMITS.milliseconds;
|
|
72
|
+
const deadline = now() + Math.min(milliseconds, READ_LIMITS.milliseconds);
|
|
73
73
|
let bytes = 0;
|
|
74
74
|
let requests = 0;
|
|
75
75
|
let token;
|
|
@@ -86,7 +86,7 @@ export function gateway(profile, credentials, redactor, dependencies = {}, mutat
|
|
|
86
86
|
const remaining = deadline - now();
|
|
87
87
|
if (remaining <= 0)
|
|
88
88
|
throw failure("TIME_BUDGET", "Read time budget exhausted");
|
|
89
|
-
if (++requests > (mutation ? 44 : READ_LIMITS.requests))
|
|
89
|
+
if (++requests > (mutation ? 44 : Math.min(requestLimit, READ_LIMITS.requests)))
|
|
90
90
|
throw failure("REQUEST_BUDGET", "Request budget exhausted");
|
|
91
91
|
const payload = body === undefined ? undefined : JSON.stringify(body);
|
|
92
92
|
if (bearer)
|
package/docs/agent-guide.md
CHANGED
|
@@ -43,12 +43,13 @@ saasAttrOp: is, contains, startsWith, isEmpty, isNot, notContains, isNotEmpty, g
|
|
|
43
43
|
The guide defines operators globally, without a per-field compatibility matrix; examples pair fromEmail with is and attachmentCount with greaterThan.
|
|
44
44
|
saasAttrValue is a string.
|
|
45
45
|
Event selectors include --event-types, --event-states, --severities, --event-ids (comma-separated), --confidence-indicator and --description; --saas accepts comma-separated SaaS values here.
|
|
46
|
-
Event detail includes available actions; task detail reads status and per-action results once
|
|
46
|
+
Event detail includes available actions; task detail reads status and per-action results once by default:
|
|
47
47
|
|
|
48
48
|
```sh
|
|
49
49
|
checkpoint-axi event list --all --event-types phishing --fields events,count,total,complete,reason,cursor
|
|
50
50
|
checkpoint-axi event show synthetic-event-1 --fields event
|
|
51
51
|
checkpoint-axi task show synthetic-task-1 --fields task
|
|
52
|
+
checkpoint-axi task show synthetic-task-1 --wait --timeout 30 --fields task,wait,help
|
|
52
53
|
```
|
|
53
54
|
|
|
54
55
|
Inspect exception rules with exception list <kind> or exception show <kind> <id-or-value>:
|
|
@@ -74,7 +75,27 @@ Inspect complete, reason and cursor even on exit 0; limits and page replay can l
|
|
|
74
75
|
Resume with --cursor <returned-cursor> and the original selectors/profile; see [continuation limitations](reads.md#email-reads).
|
|
75
76
|
Exception --all bounds returned rows at 1000 but cannot fetch additional pages: no continuation parameter is documented.
|
|
76
77
|
Email/event detail already includes available actions, avoiding a separate action lookup.
|
|
77
|
-
|
|
78
|
+
Email search and event list accept --expand for read-only show details in each successful row's detail field.
|
|
79
|
+
Expansion is off by default; --expand-limit caps detail attempts (default 5, range 1-8), and --expand-requests caps total HTTP requests (default 10, range 2-10), including auth, list pages and retries.
|
|
80
|
+
Both limit flags require --expand; listing runs first and shares the 60-second and 8 MiB transport budgets with detail reads.
|
|
81
|
+
Inspect the expansion object's expanded, complete and notExpanded fields for every unexpanded ID and its reason: item-cap-reached, request-cap-reached, budget-exhausted or per-item-error (with an error code).
|
|
82
|
+
Partial expansion keeps every list row and successful detail; list complete/cursor describe pagination separately.
|
|
83
|
+
Use --fields emails,expansion or --fields events,expansion to retain expansion status; --full restores full strings after redaction.
|
|
84
|
+
With --all, list pages can consume the entire request budget before any detail is expanded; reduce the list limit or use individual show reads for remaining IDs.
|
|
85
|
+
Expansion never downloads files, invokes available actions or changes remote state.
|
|
86
|
+
Task show reads once by default; use task show <id> --wait --timeout 30 for bounded read-only polling.
|
|
87
|
+
--timeout is required with --wait (integer seconds, range 1-60); --poll-interval defaults to 2 seconds (range 1-10), and --wait-requests defaults to 10 total HTTP requests (range 2-10), including auth and retries.
|
|
88
|
+
Wait stops on completed, failed or stopped; init, inprogress and paused remain non-terminal.
|
|
89
|
+
The task snapshot contains the final status; wait reports terminal, polls (validated status snapshots) and reason (terminal, timeout or budget).
|
|
90
|
+
A non-terminal stop exits 0 with the last snapshot and a read-only next-step hint; inspect wait even on exit 0 and include task,wait,help with --fields.
|
|
91
|
+
Timeout covers auth, requests, retries and delays within the shared 8 MiB response cap; failures before any snapshot remain errors.
|
|
92
|
+
Waiting never resubmits an action or changes remote state; a failed or stopped task is terminal, not successful execution.
|
|
93
|
+
There is no cross-resource pivot; use returned IDs for individual reads and never replay an action to obtain its status.
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
checkpoint-axi email search --limit 5 --expand --expand-limit 3 --expand-requests 6 --fields emails,count,complete,cursor,expansion
|
|
97
|
+
checkpoint-axi event list --limit 5 --expand --fields events,count,complete,cursor,expansion
|
|
98
|
+
```
|
|
78
99
|
|
|
79
100
|
--fields selects top-level output keys, not nested row columns: request emails or events together with count,total,complete,reason,cursor for lists, and email,event,task or exception for details.
|
|
80
101
|
Email rows contain id,subject,state,verdict; event rows contain id,type,state,severity; documented exception rows contain id,sender,subject,comment.
|
package/docs/commands.md
CHANGED
|
@@ -32,7 +32,7 @@ Run each command with `--help` for concise help.
|
|
|
32
32
|
| `checkpoint-axi exception update` | Preview or replace one exception; phishing/spam/click-time require an ID; malware/url/dlp identify it in --input without an ID; anomaly unsupported (guide pages 64-67, 78-81, 94-96, 105-107, 116-117, 126-127) |
|
|
33
33
|
| `checkpoint-axi home` | Show local profile context without resolving secrets or making API calls |
|
|
34
34
|
| `checkpoint-axi profile list` | List file profiles without resolving secrets; --profile does not filter this list |
|
|
35
|
-
| `checkpoint-axi task show` | Show asynchronous task status and per-action details (API guide pages 30-33) |
|
|
35
|
+
| `checkpoint-axi task show` | Show asynchronous task status and per-action details, optionally waiting within explicit bounds (API guide pages 30-33) |
|
|
36
36
|
|
|
37
37
|
## attachment download
|
|
38
38
|
|
|
@@ -197,11 +197,14 @@ Search emails with a bounded date window and scroll continuation (API guide page
|
|
|
197
197
|
| `--limit` | Maximum rows; default 50, range 1-1000; cannot combine with --all |
|
|
198
198
|
| `--all` | Read up to 1000 rows / 10 HTTP requests / 60 seconds / 8 MiB; default false |
|
|
199
199
|
| `--cursor` | Opaque continuation bound to profile, region, operation and selectors; repeat original selectors |
|
|
200
|
+
| `--expand` | Opt in to read-only show details on returned rows; default false; partial expansion is reported separately |
|
|
201
|
+
| `--expand-limit` | Maximum detail attempts; default 5, range 1-8; requires --expand |
|
|
202
|
+
| `--expand-requests` | Total HTTP request cap including auth, list pages, detail and retries; default 10, range 2-10; requires --expand |
|
|
200
203
|
| `--filter` | JSON array of {saasAttrName, saasAttrOp, saasAttrValue} filters. saasAttrName is a field path, not a closed enum (guide pages 19-20). Documented examples: entityPayload.subject, entityPayload.fromEmail, entityPayload.attachmentCount. Other documented email payload paths (pages 15-16, 24-25): entityPayload.internetMessageId, entityPayload.received, entityPayload.size, entityPayload.emailLinks, entityPayload.attachments, entityPayload.mode, entityPayload.recipients, entityPayload.fromDomain, entityPayload.fromUser, entityPayload.fromName, entityPayload.to, entityPayload.toUser, entityPayload.cc, entityPayload.ccUser, entityPayload.bcc, entityPayload.bccUser, entityPayload.replyToEmail, entityPayload.replyToNickname, entityPayload.isRead, entityPayload.isDeleted, entityPayload.isIncoming, entityPayload.isInternal, entityPayload.isOutgoing, entityPayload.isQuarantined, entityPayload.isQuarantineNotification, entityPayload.isRestored, entityPayload.isRestoreRequested, entityPayload.isRestoreDeclined, entityPayload.saasSpamVerdict, entityPayload.SpfResult. saasAttrOp: is, contains, startsWith, isEmpty, isNot, notContains, isNotEmpty, greaterThan, lessThan. The guide defines operators globally, without a per-field compatibility matrix; examples pair fromEmail with is and attachmentCount with greaterThan. saasAttrValue is a string. |
|
|
201
204
|
|
|
202
205
|
```sh
|
|
203
206
|
checkpoint-axi email search
|
|
204
|
-
checkpoint-axi email search --
|
|
207
|
+
checkpoint-axi email search --limit 5 --expand --saas office365_emails
|
|
205
208
|
checkpoint-axi email search --cursor <cursor>
|
|
206
209
|
```
|
|
207
210
|
|
|
@@ -260,6 +263,9 @@ List security events with bounded scroll continuation (API guide pages 37-42)
|
|
|
260
263
|
| `--limit` | Maximum rows; default 50, range 1-1000; cannot combine with --all |
|
|
261
264
|
| `--all` | Read up to 1000 rows / 10 HTTP requests / 60 seconds / 8 MiB; default false |
|
|
262
265
|
| `--cursor` | Opaque continuation bound to profile, region, operation and selectors; repeat original selectors |
|
|
266
|
+
| `--expand` | Opt in to read-only show details on returned rows; default false; partial expansion is reported separately |
|
|
267
|
+
| `--expand-limit` | Maximum detail attempts; default 5, range 1-8; requires --expand |
|
|
268
|
+
| `--expand-requests` | Total HTTP request cap including auth, list pages, detail and retries; default 10, range 2-10; requires --expand |
|
|
263
269
|
| `--saas` | Comma-separated SaaS overrides; default selected profile saas or office365_emails |
|
|
264
270
|
| `--event-types` | Comma-separated event types; default unfiltered |
|
|
265
271
|
| `--event-states` | Comma-separated event states; default unfiltered |
|
|
@@ -270,7 +276,7 @@ List security events with bounded scroll continuation (API guide pages 37-42)
|
|
|
270
276
|
|
|
271
277
|
```sh
|
|
272
278
|
checkpoint-axi event list
|
|
273
|
-
checkpoint-axi event list --
|
|
279
|
+
checkpoint-axi event list --limit 5 --expand --event-types phishing
|
|
274
280
|
checkpoint-axi event list --cursor <cursor>
|
|
275
281
|
```
|
|
276
282
|
|
|
@@ -473,7 +479,7 @@ checkpoint-axi profile list --config /example/config.json
|
|
|
473
479
|
|
|
474
480
|
## task show
|
|
475
481
|
|
|
476
|
-
Show asynchronous task status and per-action details (API guide pages 30-33)
|
|
482
|
+
Show asynchronous task status and per-action details, optionally waiting within explicit bounds (API guide pages 30-33)
|
|
477
483
|
|
|
478
484
|
| Flag | Meaning |
|
|
479
485
|
|---|---|
|
|
@@ -482,8 +488,13 @@ Show asynchronous task status and per-action details (API guide pages 30-33)
|
|
|
482
488
|
| `--fields` | Comma-separated output fields; default all |
|
|
483
489
|
| `--full` | Show full strings instead of 500-character previews; default false |
|
|
484
490
|
| `--help` | Show concise command help; default false |
|
|
491
|
+
| `--wait` | Poll existing task status only; default false; requires --timeout; terminal: completed, failed, stopped |
|
|
492
|
+
| `--timeout` | Total wait timeout in integer seconds, range 1-60; required with --wait; includes auth and retries |
|
|
493
|
+
| `--poll-interval` | Seconds between status reads; default 2, range 1-10; requires --wait |
|
|
494
|
+
| `--wait-requests` | Total HTTP request cap including auth and retries; default 10, range 2-10; requires --wait |
|
|
485
495
|
|
|
486
496
|
```sh
|
|
487
497
|
checkpoint-axi task show <id>
|
|
498
|
+
checkpoint-axi task show <id> --wait --timeout 30 --fields task,wait,help
|
|
488
499
|
checkpoint-axi task show <id> --full
|
|
489
500
|
```
|
package/docs/reads.md
CHANGED
|
@@ -54,7 +54,21 @@ These diagnostics support owner commissioning; the actual failing fields behind
|
|
|
54
54
|
`checkpoint-axi event list` returns compact ID, type, state and severity rows (guide pages 37-42).
|
|
55
55
|
`checkpoint-axi event show <id>` preserves event details, action history and available actions (guide pages 34-37).
|
|
56
56
|
`checkpoint-axi task show <id>` returns task status, progress and per-action details for asynchronous actions (guide pages 30-33).
|
|
57
|
-
Task states are `init`, `inprogress`, `completed`, `failed`, `stopped` and `paused`; task show performs one read
|
|
57
|
+
Task states are `init`, `inprogress`, `completed`, `failed`, `stopped` and `paused`; task show performs one read by default.
|
|
58
|
+
Use `checkpoint-axi task show <id> --wait --timeout 30` to poll an already submitted task without resubmitting its action.
|
|
59
|
+
`--wait` requires an explicit `--timeout` in integer seconds, from 1 to 60.
|
|
60
|
+
`--poll-interval` defaults to 2 seconds, from 1 to 10; `--wait-requests` defaults to 10 total HTTP requests, from 2 to 10, including authentication, re-exchange and retries.
|
|
61
|
+
These limits require `--wait` and invalid bounds fail before configuration or network access.
|
|
62
|
+
The timeout includes authentication, requests, retries and delays, and the existing 8 MiB response cap remains shared across polls.
|
|
63
|
+
The first read starts immediately; subsequent reads wait the configured interval after the preceding read, without starting another read at or after the deadline.
|
|
64
|
+
`completed`, `failed` and `stopped` are terminal; `init`, `inprogress` and `paused` remain non-terminal.
|
|
65
|
+
The final `task` snapshot retains status, progress and per-action details; the `wait` object reports `terminal`, `polls` (validated status snapshots, excluding authentication and retries), and `reason`: `terminal`, `timeout` or `budget`.
|
|
66
|
+
Request or response-byte exhaustion reports `budget`; an exhausted deadline or a retry delay that cannot fit reports `timeout`.
|
|
67
|
+
A non-terminal stop exits 0, preserves the last snapshot and includes a `help` hint for another status read.
|
|
68
|
+
Inspect `wait` even on exit 0; terminal failure or stopping does not mean the submitted action succeeded.
|
|
69
|
+
Failures before any snapshot and non-budget read failures remain structured errors rather than reporting stale data as current.
|
|
70
|
+
Use `--fields task,wait,help` to retain wait metadata and recovery guidance when projecting output.
|
|
71
|
+
Waiting only repeats the existing task status GET; it never invokes an available action, downloads a file or resubmits the original mutation.
|
|
58
72
|
Event list accepts comma-separated `--event-types`, `--event-states`, `--severities`, `--event-ids` and `--saas`, plus `--confidence-indicator` and `--description` text selectors.
|
|
59
73
|
SaaS defaults to the selected profile's value or `office365_emails`; other event selectors default to unfiltered.
|
|
60
74
|
Event list uses the same date windows, row and transport budgets, bound continuation and honest page replay flags as [email search](reads.md#email-reads).
|
|
@@ -63,6 +77,34 @@ Event and task text is redacted before 500-character previews; use `--full` for
|
|
|
63
77
|
For writes, see [event actions](writes.md#event-actions).
|
|
64
78
|
These reads are verified offline with synthetic fixtures; authentication, token lifetime and live API behavior require manual verification.
|
|
65
79
|
|
|
80
|
+
## Bounded detail expansion
|
|
81
|
+
|
|
82
|
+
Email search and event list accept `--expand` to inspect returned items through the same validated read-only path as their individual show commands.
|
|
83
|
+
Expansion is off by default; available actions are returned as data and are never invoked.
|
|
84
|
+
|
|
85
|
+
```sh
|
|
86
|
+
checkpoint-axi email search --limit 5 --expand --expand-limit 3 --expand-requests 6
|
|
87
|
+
checkpoint-axi event list --limit 5 --expand --fields events,count,complete,cursor,expansion
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`--expand-limit` caps detail attempts, including failed attempts: default 5, minimum 1, maximum 8.
|
|
91
|
+
`--expand-requests` caps total HTTP requests for the invocation: default 10, minimum 2, maximum 10.
|
|
92
|
+
Both limit flags require `--expand`; invalid bounds are rejected before configuration or network access.
|
|
93
|
+
Authentication, token re-exchange, list pages, detail requests and read retries all consume this request cap.
|
|
94
|
+
Listing runs first; detail reads reuse its token, deadline and response-byte accounting without resetting the 60-second or 8 MiB budgets.
|
|
95
|
+
Using `--all` can therefore consume the entire budget before any detail is fetched.
|
|
96
|
+
Use a smaller list limit to leave room for detail, or inspect remaining IDs with individual show commands.
|
|
97
|
+
|
|
98
|
+
Each successfully expanded row gains `detail`, containing the same validated payload and actions as show, with normal secret redaction and 500-character string previews (`--full` restores full strings).
|
|
99
|
+
Every list row and successful detail survives expansion failures; partial expansion exits 0.
|
|
100
|
+
The `expansion` object reports `expanded`, `attempted`, `itemLimit`, `requestLimit`, `complete` and `notExpanded`.
|
|
101
|
+
Each `notExpanded` entry includes the item `id` and `reason`: `item-cap-reached`, `request-cap-reached`, `budget-exhausted` or `per-item-error`.
|
|
102
|
+
Budget and per-item failures also include a safe error `code`; raw upstream error bodies are never printed.
|
|
103
|
+
Budget exhaustion stops further detail attempts; an individual HTTP, response-validation or other read failure records that item and continues within the caps.
|
|
104
|
+
List `complete`, `reason` and `cursor` still describe pagination; `complete` inside `expansion` independently describes whether every returned row was expanded.
|
|
105
|
+
With `--fields`, include `expansion` alongside `emails` or `events` so omissions remain visible.
|
|
106
|
+
Expansion performs no writes, actions, downloads, cross-resource pivots or task waiting.
|
|
107
|
+
|
|
66
108
|
## Exception reads
|
|
67
109
|
|
|
68
110
|
`checkpoint-axi exception list <kind>` and `exception show <kind> <id-or-value>` cover `phishing-allow`, `phishing-block`, `spam-allow`, `anomaly`, `click-time`, `malware`, `url` and `dlp` (guide pages 49-123).
|
package/package.json
CHANGED
|
@@ -49,6 +49,14 @@ The guide defines operators globally, without a per-field compatibility matrix;
|
|
|
49
49
|
saasAttrValue is a string.
|
|
50
50
|
See [email-read guidance](../../docs/reads.md#email-reads) for continuation, completion status, cursor safety and page replay limitations.
|
|
51
51
|
Email show <id> includes payload, verdicts, actions taken and available actions (guide pages 10-18).
|
|
52
|
+
Email search and event list accept --expand for read-only show details in each successful row's detail field.
|
|
53
|
+
Expansion is off by default; --expand-limit caps detail attempts (default 5, range 1-8), and --expand-requests caps total HTTP requests (default 10, range 2-10), including auth, list pages and retries.
|
|
54
|
+
Both limit flags require --expand; listing runs first and shares the 60-second and 8 MiB transport budgets with detail reads.
|
|
55
|
+
Inspect the expansion object's expanded, complete and notExpanded fields for every unexpanded ID and its reason: item-cap-reached, request-cap-reached, budget-exhausted or per-item-error (with an error code).
|
|
56
|
+
Partial expansion keeps every list row and successful detail; list complete/cursor describe pagination separately.
|
|
57
|
+
Use --fields emails,expansion or --fields events,expansion to retain expansion status; --full restores full strings after redaction.
|
|
58
|
+
With --all, list pages can consume the entire request budget before any detail is expanded; reduce the list limit or use individual show reads for remaining IDs.
|
|
59
|
+
Expansion never downloads files, invokes available actions or changes remote state.
|
|
52
60
|
Use --full for strings truncated at 500 characters and --fields for top-level output projection.
|
|
53
61
|
Cursor strings are never truncated; secret-derived strings are redacted before previews.
|
|
54
62
|
Downloads require file-profile downloads.allow and an absolute new --out file, created exclusively with mode 0600 or a protected Windows DACL.
|
|
@@ -64,7 +72,14 @@ Event action --ids <ids> --name <action> previews by default and requires the ex
|
|
|
64
72
|
Every target must offer the action on both reads; nonempty actionParameter objects or repeated action names refuse ENDPOINT_UNVERIFIED until live commissioning resolves the object/string contradiction (guide pages 36-37, 43).
|
|
65
73
|
Use event show <id> to inspect all available actions, including deferred parameterized actions.
|
|
66
74
|
Accepted actions return task IDs; use task show <taskId> to inspect asynchronous execution without replaying ambiguous outcomes.
|
|
67
|
-
Event list supports documented selectors and shares email search bounds and continuation; event show preserves actions and task show reads asynchronous status
|
|
75
|
+
Event list supports documented selectors and shares email search bounds and continuation; event show preserves actions and task show reads asynchronous status (guide pages 30-42).
|
|
76
|
+
Task show reads once by default; use task show <id> --wait --timeout 30 for bounded read-only polling.
|
|
77
|
+
--timeout is required with --wait (integer seconds, range 1-60); --poll-interval defaults to 2 seconds (range 1-10), and --wait-requests defaults to 10 total HTTP requests (range 2-10), including auth and retries.
|
|
78
|
+
Wait stops on completed, failed or stopped; init, inprogress and paused remain non-terminal.
|
|
79
|
+
The task snapshot contains the final status; wait reports terminal, polls (validated status snapshots) and reason (terminal, timeout or budget).
|
|
80
|
+
A non-terminal stop exits 0 with the last snapshot and a read-only next-step hint; inspect wait even on exit 0 and include task,wait,help with --fields.
|
|
81
|
+
Timeout covers auth, requests, retries and delays within the shared 8 MiB response cap; failures before any snapshot remain errors.
|
|
82
|
+
Waiting never resubmits an action or changes remote state; a failed or stopped task is terminal, not successful execution.
|
|
68
83
|
Exception list/show accept phishing-allow, phishing-block, spam-allow, anomaly, click-time, malware, url and dlp (guide pages 49-123).
|
|
69
84
|
For malware, url and dlp, --type is required; run exception list --help for the documented values.
|
|
70
85
|
Click-time --items selects item routes; by default list routes are used.
|
|
@@ -105,4 +120,4 @@ All live-only facts remain unverified, including token response shape and lifeti
|
|
|
105
120
|
| `npx -y @knowttl/checkpoint-axi exception update` | Preview or replace one exception; phishing/spam/click-time require an ID; malware/url/dlp identify it in --input without an ID; anomaly unsupported (guide pages 64-67, 78-81, 94-96, 105-107, 116-117, 126-127) |
|
|
106
121
|
| `npx -y @knowttl/checkpoint-axi home` | Show local profile context without resolving secrets or making API calls |
|
|
107
122
|
| `npx -y @knowttl/checkpoint-axi profile list` | List file profiles without resolving secrets; --profile does not filter this list |
|
|
108
|
-
| `npx -y @knowttl/checkpoint-axi task show` | Show asynchronous task status and per-action details (API guide pages 30-33) |
|
|
123
|
+
| `npx -y @knowttl/checkpoint-axi task show` | Show asynchronous task status and per-action details, optionally waiting within explicit bounds (API guide pages 30-33) |
|