@primitivedotdev/cli 3.0.0-preview.24 → 3.0.0-preview.26
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/dist/{api-command-p-qsR7e6.js → api-command-B-nuABGm.js} +3012 -179
- package/dist/{cli-command-names-DteMqL-H.js → cli-command-names-no0f7d7s.js} +7 -1
- package/dist/{cli-config-DiuUnquY.js → cli-config-CwZJQIcn.js} +330 -24
- package/dist/{machine-session-B7crrlba.js → machine-session-1utuweTi.js} +5 -5
- package/dist/{notify-session-DR1570cm.js → notify-session-CM4_ZYe9.js} +3 -3
- package/dist/oclif/auto-signal-worker.js +3 -3
- package/dist/oclif/auto-signals.js +1 -1
- package/dist/oclif/command-not-found.js +1 -1
- package/dist/oclif/index.js +1824 -164
- package/dist/oclif/receiver-heal.js +2 -2
- package/dist/oclif/root-signup-hint.js +1 -1
- package/dist/{repeats-Dj_o6c-X-x61TNLz-.js → repeats-Dj_o6c-X-CK1wU9lP.js} +128 -0
- package/dist/{scoped-chat-Bss3OjFI.js → scoped-chat-DN0qj4AY.js} +1 -1
- package/dist/{signal-command-7tV4fkDC.js → signal-command-D4ZIidPX.js} +4 -4
- package/package.json +5 -2
|
@@ -1,17 +1,184 @@
|
|
|
1
|
-
import { $t as getThread, Bt as getEndpoint, C as parseRetryAfter, H as assertAwaitingFilterRows, J as isAwaitingRejectedError, U as awaitingRejectedError, V as ReplyStateUnsupportedError, Vn as sdk_gen_exports, W as ensureSearchReportsReplyState, X as replyStateSurfaceForOperation, Yt as getOwnGrant, at as expectedAutomatedVerdicts, et as AutomatedFilterUnsupportedError, it as ensureSearchReportsAutomated, nt as automatedRejectedError, pn as listEndpoints, rt as automatedSurfaceForOperation, st as isAutomatedRejectedError, tt as assertAutomatedVerdict, un as listDomains, zt as getEmail } from "./repeats-Dj_o6c-X-
|
|
2
|
-
import { a as canonicalCommandId, i as canonicalCliText, r as canonicalBodyFlagName } from "./cli-command-names-
|
|
3
|
-
import { C as
|
|
1
|
+
import { $t as getThread, Bt as getEndpoint, C as parseRetryAfter, H as assertAwaitingFilterRows, J as isAwaitingRejectedError, U as awaitingRejectedError, V as ReplyStateUnsupportedError, Vn as sdk_gen_exports, W as ensureSearchReportsReplyState, X as replyStateSurfaceForOperation, Yt as getOwnGrant, at as expectedAutomatedVerdicts, et as AutomatedFilterUnsupportedError, it as ensureSearchReportsAutomated, nt as automatedRejectedError, pn as listEndpoints, rt as automatedSurfaceForOperation, st as isAutomatedRejectedError, tt as assertAutomatedVerdict, un as listDomains, zt as getEmail } from "./repeats-Dj_o6c-X-CK1wU9lP.js";
|
|
2
|
+
import { a as canonicalCommandId, i as canonicalCliText, r as canonicalBodyFlagName } from "./cli-command-names-no0f7d7s.js";
|
|
3
|
+
import { B as agentProfileDirectory, C as normalizeApiBaseUrl, E as saveSignupCredentials, G as loadConnectedAgentProfile, H as agentProfilesDirectory, R as AGENT_PROFILE_ENV, S as loadCliCredentials, T as saveCliCredentials, Y as requireDefaultLoginProfile, b as detectPrimitiveKeyEnvMisname, f as validateCliHeaderName, ft as detectRuntimeSession, h as cliAccessTokenExpiresAt, i as loadCliConfig, l as resolveConfigEnvironment, m as acquireCliCredentialsLock, mt as PrimitiveApiClient, p as validateCliHeaderValue, rt as loadActiveAgentPass, v as deleteCliCredentials, w as resolveCliAuth } from "./cli-config-CwZJQIcn.js";
|
|
4
4
|
import "./oclif/global-org-flag.js";
|
|
5
5
|
import { a as assertRequiredBodyFields, i as operationHelpInputs } from "./help-inputs-NGARVZL_.js";
|
|
6
6
|
import { o as thrownErrorBody } from "./json-output-BMZrLH47.js";
|
|
7
7
|
import { d as readMailJson, h as writeMailJson, m as withMailLock, p as syncMailDirectory, u as privateMailPermissions } from "./shared-mail-files-BAQSGxxz.js";
|
|
8
8
|
import { a as writeRetryIdNotice, n as rememberRetryIds, r as retryIdFields, t as prepareRetryIds } from "./retry-ids-04ZPJCZY.js";
|
|
9
9
|
import { Args, Command, Errors, Flags } from "@oclif/core";
|
|
10
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
10
11
|
import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
11
12
|
import { createHash, randomUUID } from "node:crypto";
|
|
12
13
|
import { dirname, join, win32 } from "node:path";
|
|
13
14
|
import { spawn } from "node:child_process";
|
|
14
15
|
import { createInterface } from "node:readline/promises";
|
|
16
|
+
// src/oclif/activity-context.ts
|
|
17
|
+
const PRIMITIVE_REASON_ENV = "PRIMITIVE_REASON";
|
|
18
|
+
const PRIMITIVE_RUN_ID_ENV = "PRIMITIVE_RUN_ID";
|
|
19
|
+
const PRIMITIVE_REASON_HEADER = "X-Primitive-Reason";
|
|
20
|
+
const PRIMITIVE_RUN_ID_HEADER = "X-Primitive-Run-Id";
|
|
21
|
+
const MAX_REASON_LENGTH = 500;
|
|
22
|
+
const RUN_ID_PATTERN = /^[A-Za-z0-9._:/-]{1,128}$/;
|
|
23
|
+
const WRAPPED_ACTIVITY_CONTEXT = Symbol.for("primitive.cli.activityContextFlags");
|
|
24
|
+
const activityContextStore = new AsyncLocalStorage();
|
|
25
|
+
function hasDisallowedReasonChars(value) {
|
|
26
|
+
for (let i = 0; i < value.length; i += 1) {
|
|
27
|
+
const code = value.charCodeAt(i);
|
|
28
|
+
if (code < 32 || code > 126) return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
/** Validate and normalize an X-Primitive-Reason value. */
|
|
33
|
+
function validateActivityReason(raw, sourceLabel = "--reason") {
|
|
34
|
+
if (/[\r\n\0]/.test(raw)) throw new Errors.CLIError(`${sourceLabel} must not contain newline or null control characters.`, { exit: 2 });
|
|
35
|
+
const normalized = raw.replace(/[ \t]+/g, " ").trim();
|
|
36
|
+
if (!normalized) throw new Errors.CLIError(`${sourceLabel} must not be empty.`, { exit: 2 });
|
|
37
|
+
if (hasDisallowedReasonChars(normalized)) throw new Errors.CLIError(`${sourceLabel} must contain only printable ASCII characters.`, { exit: 2 });
|
|
38
|
+
if (normalized.length > MAX_REASON_LENGTH) throw new Errors.CLIError(`${sourceLabel} must be at most ${MAX_REASON_LENGTH} characters.`, { exit: 2 });
|
|
39
|
+
return normalized;
|
|
40
|
+
}
|
|
41
|
+
/** Validate and normalize an X-Primitive-Run-Id value. */
|
|
42
|
+
function validateActivityRunId(raw, sourceLabel = "--run-id") {
|
|
43
|
+
const trimmed = raw.trim();
|
|
44
|
+
if (!trimmed || !RUN_ID_PATTERN.test(trimmed)) throw new Errors.CLIError(`${sourceLabel} must be 1 to 128 characters matching [A-Za-z0-9._:/-].`, { exit: 2 });
|
|
45
|
+
return trimmed;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Read optional activity context headers (`X-Primitive-Reason` and
|
|
49
|
+
* `X-Primitive-Run-Id`) from scoped CLI flags and environment variables. Safe
|
|
50
|
+
* to attach across all auth modes (API key, OAuth, connected agent, and Access
|
|
51
|
+
* Pass).
|
|
52
|
+
*/
|
|
53
|
+
function cliActivityHeadersFromEnv(env = process.env) {
|
|
54
|
+
const store = env === process.env ? activityContextStore.getStore() : void 0;
|
|
55
|
+
const headers = {};
|
|
56
|
+
const rawReason = store?.reason ?? env["PRIMITIVE_REASON"];
|
|
57
|
+
if (rawReason !== void 0 && rawReason.trim().length > 0) headers[PRIMITIVE_REASON_HEADER] = validateActivityReason(rawReason, store?.reason !== void 0 ? "--reason" : PRIMITIVE_REASON_ENV);
|
|
58
|
+
const rawRunId = store?.runId ?? env["PRIMITIVE_RUN_ID"];
|
|
59
|
+
if (rawRunId !== void 0 && rawRunId.trim().length > 0) headers[PRIMITIVE_RUN_ID_HEADER] = validateActivityRunId(rawRunId, store?.runId !== void 0 ? "--run-id" : PRIMITIVE_RUN_ID_ENV);
|
|
60
|
+
return Object.keys(headers).length > 0 ? headers : void 0;
|
|
61
|
+
}
|
|
62
|
+
function buildFlagSets(declaredFlags) {
|
|
63
|
+
const optionTokens = /* @__PURE__ */ new Set();
|
|
64
|
+
const knownTokens = /* @__PURE__ */ new Set([
|
|
65
|
+
"--json",
|
|
66
|
+
"--help",
|
|
67
|
+
"-h",
|
|
68
|
+
"--reason",
|
|
69
|
+
"--run-id"
|
|
70
|
+
]);
|
|
71
|
+
if (!declaredFlags) return {
|
|
72
|
+
optionTokens,
|
|
73
|
+
knownTokens
|
|
74
|
+
};
|
|
75
|
+
for (const [name, rawSpec] of Object.entries(declaredFlags)) {
|
|
76
|
+
const spec = rawSpec && typeof rawSpec === "object" ? rawSpec : void 0;
|
|
77
|
+
const isOption = spec?.type === "option";
|
|
78
|
+
const tokens = [`--${name}`];
|
|
79
|
+
if (typeof spec?.char === "string" && spec.char.length === 1) tokens.push(`-${spec.char}`);
|
|
80
|
+
if (Array.isArray(spec?.aliases)) {
|
|
81
|
+
for (const alias of spec.aliases) if (typeof alias === "string" && alias.length > 0) tokens.push(alias.length === 1 ? `-${alias}` : `--${alias}`);
|
|
82
|
+
}
|
|
83
|
+
for (const token of tokens) {
|
|
84
|
+
knownTokens.add(token);
|
|
85
|
+
if (isOption) optionTokens.add(token);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
optionTokens,
|
|
90
|
+
knownTokens
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function extractActivityContextFlags(argv, options) {
|
|
94
|
+
const { optionTokens, knownTokens } = buildFlagSets(options.declaredFlags);
|
|
95
|
+
const remaining = [];
|
|
96
|
+
let reason;
|
|
97
|
+
let runId;
|
|
98
|
+
let afterSeparator = false;
|
|
99
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
100
|
+
const token = argv[i] ?? "";
|
|
101
|
+
if (afterSeparator) {
|
|
102
|
+
remaining.push(token);
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
if (token === "--") {
|
|
106
|
+
afterSeparator = true;
|
|
107
|
+
remaining.push(token);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (options.extractReason) {
|
|
111
|
+
if (token === "--reason") {
|
|
112
|
+
const next = argv[i + 1];
|
|
113
|
+
if (next === void 0 || next === "--" || knownTokens.has(next)) throw new Errors.CLIError("Flag --reason expects a value.", { exit: 2 });
|
|
114
|
+
reason = validateActivityReason(next, "--reason");
|
|
115
|
+
i += 1;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (token.startsWith("--reason=")) {
|
|
119
|
+
reason = validateActivityReason(token.slice(9), "--reason");
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (options.extractRunId) {
|
|
124
|
+
if (token === "--run-id") {
|
|
125
|
+
const next = argv[i + 1];
|
|
126
|
+
if (next === void 0 || next === "--" || knownTokens.has(next)) throw new Errors.CLIError("Flag --run-id expects a value.", { exit: 2 });
|
|
127
|
+
runId = validateActivityRunId(next, "--run-id");
|
|
128
|
+
i += 1;
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (token.startsWith("--run-id=")) {
|
|
132
|
+
runId = validateActivityRunId(token.slice(9), "--run-id");
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
remaining.push(token);
|
|
137
|
+
if (optionTokens.has(token) && i + 1 < argv.length) {
|
|
138
|
+
remaining.push(argv[i + 1] ?? "");
|
|
139
|
+
i += 1;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return {
|
|
143
|
+
argv: remaining,
|
|
144
|
+
reason,
|
|
145
|
+
runId
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Enable `--reason <text>` and `--run-id <id>` globally on every command that
|
|
150
|
+
* does not already own a flag with that name. Scopes the values to the single
|
|
151
|
+
* command execution via AsyncLocalStorage without mutating `process.env`.
|
|
152
|
+
*/
|
|
153
|
+
function attachActivityContextFlags(commands) {
|
|
154
|
+
const seen = /* @__PURE__ */ new Set();
|
|
155
|
+
for (const entry of Object.values(commands)) {
|
|
156
|
+
if (typeof entry !== "function" || seen.has(entry)) continue;
|
|
157
|
+
seen.add(entry);
|
|
158
|
+
const commandClass = entry;
|
|
159
|
+
if (Object.hasOwn(commandClass.prototype, WRAPPED_ACTIVITY_CONTEXT)) continue;
|
|
160
|
+
const declaredFlags = commandClass.flags ?? {};
|
|
161
|
+
const extractReason = !("reason" in declaredFlags);
|
|
162
|
+
const extractRunId = !("run-id" in declaredFlags);
|
|
163
|
+
if (!extractReason && !extractRunId) continue;
|
|
164
|
+
const originalRun = commandClass.prototype._run;
|
|
165
|
+
commandClass.prototype[WRAPPED_ACTIVITY_CONTEXT] = true;
|
|
166
|
+
commandClass.prototype._run = async function() {
|
|
167
|
+
const extracted = extractActivityContextFlags(this.argv, {
|
|
168
|
+
extractReason,
|
|
169
|
+
extractRunId,
|
|
170
|
+
declaredFlags
|
|
171
|
+
});
|
|
172
|
+
if (extracted.reason === void 0 && extracted.runId === void 0) return originalRun.call(this);
|
|
173
|
+
this.argv = extracted.argv;
|
|
174
|
+
const previous = activityContextStore.getStore();
|
|
175
|
+
return activityContextStore.run({
|
|
176
|
+
reason: extracted.reason ?? previous?.reason,
|
|
177
|
+
runId: extracted.runId ?? previous?.runId
|
|
178
|
+
}, () => originalRun.call(this));
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
}
|
|
15
182
|
// ../packages/api-core/src/openapi/operations.generated.ts
|
|
16
183
|
const operationManifest = [
|
|
17
184
|
{
|
|
@@ -781,195 +948,2539 @@ const operationManifest = [
|
|
|
781
948
|
},
|
|
782
949
|
{
|
|
783
950
|
"binaryResponse": false,
|
|
784
|
-
"bodyRequired":
|
|
785
|
-
"command": "
|
|
786
|
-
"description": "
|
|
787
|
-
"hasJsonBody":
|
|
788
|
-
"method": "
|
|
789
|
-
"operationId": "
|
|
790
|
-
"path": "/
|
|
791
|
-
"pathParams": [
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
{
|
|
813
|
-
"
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
"
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
"
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
951
|
+
"bodyRequired": true,
|
|
952
|
+
"command": "create-email-activity",
|
|
953
|
+
"description": "Convenience alias for `POST /v1/threads/{id}/activities` that resolves\nthe thread from an inbound email id and anchors the activity to both\nthe thread and that email. Requires `mail.activity:write` and mail\nscope covering the email.\n",
|
|
954
|
+
"hasJsonBody": true,
|
|
955
|
+
"method": "POST",
|
|
956
|
+
"operationId": "createEmailActivity",
|
|
957
|
+
"path": "/emails/{id}/activities",
|
|
958
|
+
"pathParams": [{
|
|
959
|
+
"description": "Inbound email UUID.",
|
|
960
|
+
"enum": null,
|
|
961
|
+
"name": "id",
|
|
962
|
+
"required": true,
|
|
963
|
+
"type": "string"
|
|
964
|
+
}],
|
|
965
|
+
"queryParams": [],
|
|
966
|
+
"headerParams": [{
|
|
967
|
+
"description": "Optional idempotency key for safe retries and in-place upserts (1 to 255 printable ASCII characters).",
|
|
968
|
+
"enum": null,
|
|
969
|
+
"name": "Idempotency-Key",
|
|
970
|
+
"required": false,
|
|
971
|
+
"type": "string"
|
|
972
|
+
}],
|
|
973
|
+
"permissions": ["mail.activity:write"],
|
|
974
|
+
"access": null,
|
|
975
|
+
"requestSchema": {
|
|
976
|
+
"type": "object",
|
|
977
|
+
"additionalProperties": false,
|
|
978
|
+
"required": ["summary"],
|
|
979
|
+
"properties": {
|
|
980
|
+
"kind": {
|
|
981
|
+
"type": "string",
|
|
982
|
+
"enum": [
|
|
983
|
+
"action",
|
|
984
|
+
"note",
|
|
985
|
+
"handoff"
|
|
986
|
+
],
|
|
987
|
+
"description": "Category of an agent-reported thread activity."
|
|
988
|
+
},
|
|
989
|
+
"action": {
|
|
990
|
+
"type": "string",
|
|
991
|
+
"minLength": 1,
|
|
992
|
+
"maxLength": 128,
|
|
993
|
+
"pattern": "^[a-z0-9][a-z0-9._:-]{0,127}$",
|
|
994
|
+
"description": "Lowercase action slug (for example `brex.upload_invoice`)."
|
|
995
|
+
},
|
|
996
|
+
"status": {
|
|
997
|
+
"type": "string",
|
|
998
|
+
"enum": [
|
|
999
|
+
"started",
|
|
1000
|
+
"succeeded",
|
|
1001
|
+
"failed",
|
|
1002
|
+
"skipped",
|
|
1003
|
+
"needs_review"
|
|
1004
|
+
],
|
|
1005
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1006
|
+
},
|
|
1007
|
+
"summary": {
|
|
1008
|
+
"type": "string",
|
|
1009
|
+
"minLength": 1,
|
|
1010
|
+
"maxLength": 1e3
|
|
1011
|
+
},
|
|
1012
|
+
"detail": {
|
|
1013
|
+
"type": ["string", "null"],
|
|
1014
|
+
"maxLength": 8e3
|
|
1015
|
+
},
|
|
1016
|
+
"sent_email_id": {
|
|
1017
|
+
"type": "string",
|
|
1018
|
+
"format": "uuid"
|
|
1019
|
+
},
|
|
1020
|
+
"external_ref": { "oneOf": [{
|
|
1021
|
+
"type": "object",
|
|
1022
|
+
"additionalProperties": false,
|
|
1023
|
+
"required": ["system"],
|
|
1024
|
+
"properties": {
|
|
1025
|
+
"system": {
|
|
1026
|
+
"type": "string",
|
|
1027
|
+
"minLength": 1,
|
|
1028
|
+
"maxLength": 64,
|
|
1029
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
1030
|
+
},
|
|
1031
|
+
"id": {
|
|
1032
|
+
"type": "string",
|
|
1033
|
+
"minLength": 1,
|
|
1034
|
+
"maxLength": 255,
|
|
1035
|
+
"description": "External record identifier."
|
|
1036
|
+
},
|
|
1037
|
+
"url": {
|
|
1038
|
+
"type": "string",
|
|
1039
|
+
"maxLength": 2048,
|
|
1040
|
+
"description": "HTTP(S) link to the external record (validated as an `http://` or `https://` URL)."
|
|
1041
|
+
},
|
|
1042
|
+
"label": {
|
|
1043
|
+
"type": "string",
|
|
1044
|
+
"minLength": 1,
|
|
1045
|
+
"maxLength": 200,
|
|
1046
|
+
"description": "Human-readable display label for the external record."
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
}, { "type": "null" }] },
|
|
1050
|
+
"data": {
|
|
1051
|
+
"type": "object",
|
|
1052
|
+
"additionalProperties": true
|
|
1053
|
+
},
|
|
1054
|
+
"run_id": {
|
|
1055
|
+
"type": ["string", "null"],
|
|
1056
|
+
"minLength": 1,
|
|
1057
|
+
"maxLength": 128,
|
|
1058
|
+
"pattern": "^[A-Za-z0-9._:/-]{1,128}$"
|
|
1059
|
+
},
|
|
1060
|
+
"trace_url": {
|
|
1061
|
+
"type": ["string", "null"],
|
|
1062
|
+
"maxLength": 2048,
|
|
1063
|
+
"description": "Optional `http://` or `https://` URL linking to an execution trace for this activity."
|
|
1064
|
+
},
|
|
1065
|
+
"idempotency_key": {
|
|
1066
|
+
"type": "string",
|
|
1067
|
+
"minLength": 1,
|
|
1068
|
+
"maxLength": 255,
|
|
1069
|
+
"pattern": "^[!-~]{1,255}$"
|
|
1070
|
+
},
|
|
1071
|
+
"visibility": {
|
|
1072
|
+
"type": "string",
|
|
1073
|
+
"enum": ["thread", "actor_only"],
|
|
1074
|
+
"description": "Visibility of a thread activity (`thread` is shared with scoped readers; `actor_only` is private to the creating actor unless an auditor passes `include_private=true`)."
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
"responseSchema": {
|
|
1079
|
+
"type": "object",
|
|
1080
|
+
"additionalProperties": false,
|
|
1081
|
+
"required": ["activity", "updated"],
|
|
1082
|
+
"properties": {
|
|
1083
|
+
"activity": {
|
|
1084
|
+
"type": "object",
|
|
1085
|
+
"additionalProperties": false,
|
|
1086
|
+
"required": [
|
|
1087
|
+
"id",
|
|
1088
|
+
"source",
|
|
1089
|
+
"thread_id",
|
|
1090
|
+
"email_id",
|
|
1091
|
+
"sent_email_id",
|
|
1092
|
+
"actor",
|
|
1093
|
+
"kind",
|
|
1094
|
+
"action",
|
|
1095
|
+
"status",
|
|
1096
|
+
"summary",
|
|
1097
|
+
"detail",
|
|
1098
|
+
"external_ref",
|
|
1099
|
+
"data",
|
|
1100
|
+
"run_id",
|
|
1101
|
+
"trace_url",
|
|
1102
|
+
"idempotency_key",
|
|
1103
|
+
"visibility",
|
|
1104
|
+
"revision",
|
|
1105
|
+
"status_history",
|
|
1106
|
+
"started_at",
|
|
1107
|
+
"completed_at",
|
|
1108
|
+
"updated_by",
|
|
1109
|
+
"created_at",
|
|
1110
|
+
"updated_at",
|
|
1111
|
+
"occurred_at"
|
|
1112
|
+
],
|
|
1113
|
+
"properties": {
|
|
1114
|
+
"id": {
|
|
1115
|
+
"type": "string",
|
|
1116
|
+
"format": "uuid"
|
|
1117
|
+
},
|
|
1118
|
+
"source": {
|
|
1119
|
+
"type": "string",
|
|
1120
|
+
"enum": ["agent"]
|
|
1121
|
+
},
|
|
1122
|
+
"thread_id": {
|
|
1123
|
+
"type": "string",
|
|
1124
|
+
"format": "uuid"
|
|
1125
|
+
},
|
|
1126
|
+
"email_id": {
|
|
1127
|
+
"type": ["string", "null"],
|
|
1128
|
+
"format": "uuid"
|
|
1129
|
+
},
|
|
1130
|
+
"sent_email_id": {
|
|
1131
|
+
"type": ["string", "null"],
|
|
1132
|
+
"format": "uuid"
|
|
1133
|
+
},
|
|
1134
|
+
"actor": {
|
|
1135
|
+
"type": "object",
|
|
1136
|
+
"additionalProperties": false,
|
|
1137
|
+
"required": [
|
|
1138
|
+
"kind",
|
|
1139
|
+
"id",
|
|
1140
|
+
"label",
|
|
1141
|
+
"ownership",
|
|
1142
|
+
"owner_user_id",
|
|
1143
|
+
"owner_label",
|
|
1144
|
+
"agent_connection_id",
|
|
1145
|
+
"oauth_client_id"
|
|
1146
|
+
],
|
|
1147
|
+
"properties": {
|
|
1148
|
+
"kind": { "type": "string" },
|
|
1149
|
+
"id": {
|
|
1150
|
+
"type": ["string", "null"],
|
|
1151
|
+
"format": "uuid"
|
|
1152
|
+
},
|
|
1153
|
+
"label": { "type": ["string", "null"] },
|
|
1154
|
+
"ownership": {
|
|
1155
|
+
"type": "string",
|
|
1156
|
+
"enum": [
|
|
1157
|
+
"human",
|
|
1158
|
+
"personal_agent",
|
|
1159
|
+
"org_key",
|
|
1160
|
+
"function",
|
|
1161
|
+
"app",
|
|
1162
|
+
"system"
|
|
1163
|
+
],
|
|
1164
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
1165
|
+
},
|
|
1166
|
+
"owner_user_id": {
|
|
1167
|
+
"type": ["string", "null"],
|
|
1168
|
+
"format": "uuid"
|
|
1169
|
+
},
|
|
1170
|
+
"owner_label": { "type": ["string", "null"] },
|
|
1171
|
+
"agent_connection_id": {
|
|
1172
|
+
"type": ["string", "null"],
|
|
1173
|
+
"format": "uuid"
|
|
1174
|
+
},
|
|
1175
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
1176
|
+
}
|
|
1177
|
+
},
|
|
1178
|
+
"kind": {
|
|
1179
|
+
"type": "string",
|
|
1180
|
+
"enum": [
|
|
1181
|
+
"action",
|
|
1182
|
+
"note",
|
|
1183
|
+
"handoff"
|
|
1184
|
+
],
|
|
1185
|
+
"description": "Category of an agent-reported thread activity."
|
|
1186
|
+
},
|
|
1187
|
+
"action": { "type": "string" },
|
|
1188
|
+
"status": {
|
|
1189
|
+
"type": "string",
|
|
1190
|
+
"enum": [
|
|
1191
|
+
"started",
|
|
1192
|
+
"succeeded",
|
|
1193
|
+
"failed",
|
|
1194
|
+
"skipped",
|
|
1195
|
+
"needs_review"
|
|
1196
|
+
],
|
|
1197
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1198
|
+
},
|
|
1199
|
+
"summary": { "type": "string" },
|
|
1200
|
+
"detail": { "type": ["string", "null"] },
|
|
1201
|
+
"external_ref": { "oneOf": [{
|
|
1202
|
+
"type": "object",
|
|
1203
|
+
"additionalProperties": false,
|
|
1204
|
+
"required": ["system"],
|
|
1205
|
+
"properties": {
|
|
1206
|
+
"system": {
|
|
1207
|
+
"type": "string",
|
|
1208
|
+
"minLength": 1,
|
|
1209
|
+
"maxLength": 64,
|
|
1210
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
1211
|
+
},
|
|
1212
|
+
"id": {
|
|
1213
|
+
"type": "string",
|
|
1214
|
+
"minLength": 1,
|
|
1215
|
+
"maxLength": 255,
|
|
1216
|
+
"description": "External record identifier."
|
|
1217
|
+
},
|
|
1218
|
+
"url": {
|
|
1219
|
+
"type": "string",
|
|
1220
|
+
"maxLength": 2048,
|
|
1221
|
+
"description": "HTTP(S) link to the external record (validated as an `http://` or `https://` URL)."
|
|
1222
|
+
},
|
|
1223
|
+
"label": {
|
|
1224
|
+
"type": "string",
|
|
1225
|
+
"minLength": 1,
|
|
1226
|
+
"maxLength": 200,
|
|
1227
|
+
"description": "Human-readable display label for the external record."
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
}, { "type": "null" }] },
|
|
1231
|
+
"data": {
|
|
1232
|
+
"type": "object",
|
|
1233
|
+
"additionalProperties": true
|
|
1234
|
+
},
|
|
1235
|
+
"run_id": { "type": ["string", "null"] },
|
|
1236
|
+
"trace_url": { "type": ["string", "null"] },
|
|
1237
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
1238
|
+
"visibility": {
|
|
1239
|
+
"type": "string",
|
|
1240
|
+
"enum": ["thread", "actor_only"],
|
|
1241
|
+
"description": "Visibility of a thread activity (`thread` is shared with scoped readers; `actor_only` is private to the creating actor unless an auditor passes `include_private=true`)."
|
|
1242
|
+
},
|
|
1243
|
+
"revision": {
|
|
1244
|
+
"type": "integer",
|
|
1245
|
+
"minimum": 1
|
|
1246
|
+
},
|
|
1247
|
+
"status_history": {
|
|
1248
|
+
"type": "array",
|
|
1249
|
+
"items": {
|
|
1250
|
+
"type": "object",
|
|
1251
|
+
"additionalProperties": false,
|
|
1252
|
+
"required": [
|
|
1253
|
+
"status",
|
|
1254
|
+
"summary",
|
|
1255
|
+
"changed_at",
|
|
1256
|
+
"actor_kind",
|
|
1257
|
+
"actor_id",
|
|
1258
|
+
"actor_label"
|
|
1259
|
+
],
|
|
1260
|
+
"properties": {
|
|
1261
|
+
"status": {
|
|
1262
|
+
"type": "string",
|
|
1263
|
+
"enum": [
|
|
1264
|
+
"started",
|
|
1265
|
+
"succeeded",
|
|
1266
|
+
"failed",
|
|
1267
|
+
"skipped",
|
|
1268
|
+
"needs_review"
|
|
1269
|
+
],
|
|
1270
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1271
|
+
},
|
|
1272
|
+
"summary": { "type": "string" },
|
|
1273
|
+
"changed_at": {
|
|
1274
|
+
"type": "string",
|
|
1275
|
+
"format": "date-time"
|
|
1276
|
+
},
|
|
1277
|
+
"actor_kind": { "type": "string" },
|
|
1278
|
+
"actor_id": {
|
|
1279
|
+
"type": ["string", "null"],
|
|
1280
|
+
"format": "uuid"
|
|
1281
|
+
},
|
|
1282
|
+
"actor_label": { "type": ["string", "null"] }
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
},
|
|
1286
|
+
"started_at": {
|
|
1287
|
+
"type": "string",
|
|
1288
|
+
"format": "date-time"
|
|
1289
|
+
},
|
|
1290
|
+
"completed_at": {
|
|
1291
|
+
"type": ["string", "null"],
|
|
1292
|
+
"format": "date-time"
|
|
1293
|
+
},
|
|
1294
|
+
"updated_by": { "oneOf": [{
|
|
1295
|
+
"type": "object",
|
|
1296
|
+
"additionalProperties": false,
|
|
1297
|
+
"required": [
|
|
1298
|
+
"kind",
|
|
1299
|
+
"id",
|
|
1300
|
+
"label"
|
|
1301
|
+
],
|
|
1302
|
+
"properties": {
|
|
1303
|
+
"kind": { "type": "string" },
|
|
1304
|
+
"id": {
|
|
1305
|
+
"type": ["string", "null"],
|
|
1306
|
+
"format": "uuid"
|
|
1307
|
+
},
|
|
1308
|
+
"label": { "type": ["string", "null"] }
|
|
1309
|
+
}
|
|
1310
|
+
}, { "type": "null" }] },
|
|
1311
|
+
"created_at": {
|
|
1312
|
+
"type": "string",
|
|
1313
|
+
"format": "date-time"
|
|
1314
|
+
},
|
|
1315
|
+
"updated_at": {
|
|
1316
|
+
"type": "string",
|
|
1317
|
+
"format": "date-time"
|
|
1318
|
+
},
|
|
1319
|
+
"occurred_at": {
|
|
1320
|
+
"type": "string",
|
|
1321
|
+
"format": "date-time"
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
"updated": { "type": "boolean" }
|
|
1326
|
+
}
|
|
1327
|
+
},
|
|
1328
|
+
"sdkName": "createEmailActivity",
|
|
1329
|
+
"summary": "Record or upsert an agent work activity anchored to an inbound email",
|
|
1330
|
+
"tag": "Activity",
|
|
1331
|
+
"tagCommand": "activity"
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
"binaryResponse": false,
|
|
1335
|
+
"bodyRequired": true,
|
|
1336
|
+
"command": "create-thread-activity",
|
|
1337
|
+
"description": "Records an agent-reported note, external action outcome (such as\nuploading an invoice to Brex or creating a CRM record), or human\nhandoff on a thread. Supplying `idempotency_key` (or an\n`Idempotency-Key` header) upserts the calling actor's existing\nactivity on that thread in place, advancing `revision` and appending\nto `status_history`. Requires `mail.activity:write` and mail scope\ncovering the thread.\n",
|
|
1338
|
+
"hasJsonBody": true,
|
|
1339
|
+
"method": "POST",
|
|
1340
|
+
"operationId": "createThreadActivity",
|
|
1341
|
+
"path": "/threads/{id}/activities",
|
|
1342
|
+
"pathParams": [{
|
|
1343
|
+
"description": "Thread UUID.",
|
|
1344
|
+
"enum": null,
|
|
1345
|
+
"name": "id",
|
|
1346
|
+
"required": true,
|
|
1347
|
+
"type": "string"
|
|
1348
|
+
}],
|
|
1349
|
+
"queryParams": [],
|
|
1350
|
+
"headerParams": [{
|
|
1351
|
+
"description": "Optional idempotency key for safe retries and in-place upserts (1 to 255 printable ASCII characters).",
|
|
1352
|
+
"enum": null,
|
|
1353
|
+
"name": "Idempotency-Key",
|
|
1354
|
+
"required": false,
|
|
1355
|
+
"type": "string"
|
|
1356
|
+
}],
|
|
1357
|
+
"permissions": ["mail.activity:write"],
|
|
1358
|
+
"access": null,
|
|
1359
|
+
"requestSchema": {
|
|
1360
|
+
"type": "object",
|
|
1361
|
+
"additionalProperties": false,
|
|
1362
|
+
"required": ["summary"],
|
|
1363
|
+
"properties": {
|
|
1364
|
+
"kind": {
|
|
1365
|
+
"type": "string",
|
|
1366
|
+
"enum": [
|
|
1367
|
+
"action",
|
|
1368
|
+
"note",
|
|
1369
|
+
"handoff"
|
|
1370
|
+
],
|
|
1371
|
+
"description": "Category of an agent-reported thread activity."
|
|
1372
|
+
},
|
|
1373
|
+
"action": {
|
|
1374
|
+
"type": "string",
|
|
1375
|
+
"minLength": 1,
|
|
1376
|
+
"maxLength": 128,
|
|
1377
|
+
"pattern": "^[a-z0-9][a-z0-9._:-]{0,127}$",
|
|
1378
|
+
"description": "Lowercase action slug (for example `brex.upload_invoice`)."
|
|
1379
|
+
},
|
|
1380
|
+
"status": {
|
|
1381
|
+
"type": "string",
|
|
1382
|
+
"enum": [
|
|
1383
|
+
"started",
|
|
1384
|
+
"succeeded",
|
|
1385
|
+
"failed",
|
|
1386
|
+
"skipped",
|
|
1387
|
+
"needs_review"
|
|
1388
|
+
],
|
|
1389
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1390
|
+
},
|
|
1391
|
+
"summary": {
|
|
1392
|
+
"type": "string",
|
|
1393
|
+
"minLength": 1,
|
|
1394
|
+
"maxLength": 1e3
|
|
1395
|
+
},
|
|
1396
|
+
"detail": {
|
|
1397
|
+
"type": ["string", "null"],
|
|
1398
|
+
"maxLength": 8e3
|
|
1399
|
+
},
|
|
1400
|
+
"email_id": {
|
|
1401
|
+
"type": "string",
|
|
1402
|
+
"format": "uuid"
|
|
1403
|
+
},
|
|
1404
|
+
"sent_email_id": {
|
|
1405
|
+
"type": "string",
|
|
1406
|
+
"format": "uuid"
|
|
1407
|
+
},
|
|
1408
|
+
"external_ref": { "oneOf": [{
|
|
1409
|
+
"type": "object",
|
|
1410
|
+
"additionalProperties": false,
|
|
1411
|
+
"required": ["system"],
|
|
1412
|
+
"properties": {
|
|
1413
|
+
"system": {
|
|
1414
|
+
"type": "string",
|
|
1415
|
+
"minLength": 1,
|
|
1416
|
+
"maxLength": 64,
|
|
1417
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
1418
|
+
},
|
|
1419
|
+
"id": {
|
|
1420
|
+
"type": "string",
|
|
1421
|
+
"minLength": 1,
|
|
1422
|
+
"maxLength": 255,
|
|
1423
|
+
"description": "External record identifier."
|
|
1424
|
+
},
|
|
1425
|
+
"url": {
|
|
1426
|
+
"type": "string",
|
|
1427
|
+
"maxLength": 2048,
|
|
1428
|
+
"description": "HTTP(S) link to the external record (validated as an `http://` or `https://` URL)."
|
|
1429
|
+
},
|
|
1430
|
+
"label": {
|
|
1431
|
+
"type": "string",
|
|
1432
|
+
"minLength": 1,
|
|
1433
|
+
"maxLength": 200,
|
|
1434
|
+
"description": "Human-readable display label for the external record."
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
}, { "type": "null" }] },
|
|
1438
|
+
"data": {
|
|
1439
|
+
"type": "object",
|
|
1440
|
+
"additionalProperties": true
|
|
1441
|
+
},
|
|
1442
|
+
"run_id": {
|
|
1443
|
+
"type": ["string", "null"],
|
|
1444
|
+
"minLength": 1,
|
|
1445
|
+
"maxLength": 128,
|
|
1446
|
+
"pattern": "^[A-Za-z0-9._:/-]{1,128}$"
|
|
1447
|
+
},
|
|
1448
|
+
"trace_url": {
|
|
1449
|
+
"type": ["string", "null"],
|
|
1450
|
+
"maxLength": 2048,
|
|
1451
|
+
"description": "Optional `http://` or `https://` URL linking to an execution trace for this activity."
|
|
1452
|
+
},
|
|
1453
|
+
"idempotency_key": {
|
|
1454
|
+
"type": "string",
|
|
1455
|
+
"minLength": 1,
|
|
1456
|
+
"maxLength": 255,
|
|
1457
|
+
"pattern": "^[!-~]{1,255}$"
|
|
1458
|
+
},
|
|
1459
|
+
"visibility": {
|
|
1460
|
+
"type": "string",
|
|
1461
|
+
"enum": ["thread", "actor_only"],
|
|
1462
|
+
"description": "Visibility of a thread activity (`thread` is shared with scoped readers; `actor_only` is private to the creating actor unless an auditor passes `include_private=true`)."
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
},
|
|
1466
|
+
"responseSchema": {
|
|
1467
|
+
"type": "object",
|
|
1468
|
+
"additionalProperties": false,
|
|
1469
|
+
"required": ["activity", "updated"],
|
|
1470
|
+
"properties": {
|
|
1471
|
+
"activity": {
|
|
1472
|
+
"type": "object",
|
|
1473
|
+
"additionalProperties": false,
|
|
1474
|
+
"required": [
|
|
1475
|
+
"id",
|
|
1476
|
+
"source",
|
|
1477
|
+
"thread_id",
|
|
1478
|
+
"email_id",
|
|
1479
|
+
"sent_email_id",
|
|
1480
|
+
"actor",
|
|
1481
|
+
"kind",
|
|
1482
|
+
"action",
|
|
1483
|
+
"status",
|
|
1484
|
+
"summary",
|
|
1485
|
+
"detail",
|
|
1486
|
+
"external_ref",
|
|
1487
|
+
"data",
|
|
1488
|
+
"run_id",
|
|
1489
|
+
"trace_url",
|
|
1490
|
+
"idempotency_key",
|
|
1491
|
+
"visibility",
|
|
1492
|
+
"revision",
|
|
1493
|
+
"status_history",
|
|
1494
|
+
"started_at",
|
|
1495
|
+
"completed_at",
|
|
1496
|
+
"updated_by",
|
|
1497
|
+
"created_at",
|
|
1498
|
+
"updated_at",
|
|
1499
|
+
"occurred_at"
|
|
1500
|
+
],
|
|
1501
|
+
"properties": {
|
|
1502
|
+
"id": {
|
|
1503
|
+
"type": "string",
|
|
1504
|
+
"format": "uuid"
|
|
1505
|
+
},
|
|
1506
|
+
"source": {
|
|
1507
|
+
"type": "string",
|
|
1508
|
+
"enum": ["agent"]
|
|
1509
|
+
},
|
|
1510
|
+
"thread_id": {
|
|
1511
|
+
"type": "string",
|
|
1512
|
+
"format": "uuid"
|
|
1513
|
+
},
|
|
1514
|
+
"email_id": {
|
|
1515
|
+
"type": ["string", "null"],
|
|
1516
|
+
"format": "uuid"
|
|
1517
|
+
},
|
|
1518
|
+
"sent_email_id": {
|
|
1519
|
+
"type": ["string", "null"],
|
|
1520
|
+
"format": "uuid"
|
|
1521
|
+
},
|
|
1522
|
+
"actor": {
|
|
1523
|
+
"type": "object",
|
|
1524
|
+
"additionalProperties": false,
|
|
1525
|
+
"required": [
|
|
1526
|
+
"kind",
|
|
1527
|
+
"id",
|
|
1528
|
+
"label",
|
|
1529
|
+
"ownership",
|
|
1530
|
+
"owner_user_id",
|
|
1531
|
+
"owner_label",
|
|
1532
|
+
"agent_connection_id",
|
|
1533
|
+
"oauth_client_id"
|
|
1534
|
+
],
|
|
1535
|
+
"properties": {
|
|
1536
|
+
"kind": { "type": "string" },
|
|
1537
|
+
"id": {
|
|
1538
|
+
"type": ["string", "null"],
|
|
1539
|
+
"format": "uuid"
|
|
1540
|
+
},
|
|
1541
|
+
"label": { "type": ["string", "null"] },
|
|
1542
|
+
"ownership": {
|
|
1543
|
+
"type": "string",
|
|
1544
|
+
"enum": [
|
|
1545
|
+
"human",
|
|
1546
|
+
"personal_agent",
|
|
1547
|
+
"org_key",
|
|
1548
|
+
"function",
|
|
1549
|
+
"app",
|
|
1550
|
+
"system"
|
|
1551
|
+
],
|
|
1552
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
1553
|
+
},
|
|
1554
|
+
"owner_user_id": {
|
|
1555
|
+
"type": ["string", "null"],
|
|
1556
|
+
"format": "uuid"
|
|
1557
|
+
},
|
|
1558
|
+
"owner_label": { "type": ["string", "null"] },
|
|
1559
|
+
"agent_connection_id": {
|
|
1560
|
+
"type": ["string", "null"],
|
|
1561
|
+
"format": "uuid"
|
|
1562
|
+
},
|
|
1563
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
1564
|
+
}
|
|
1565
|
+
},
|
|
1566
|
+
"kind": {
|
|
1567
|
+
"type": "string",
|
|
1568
|
+
"enum": [
|
|
1569
|
+
"action",
|
|
1570
|
+
"note",
|
|
1571
|
+
"handoff"
|
|
1572
|
+
],
|
|
1573
|
+
"description": "Category of an agent-reported thread activity."
|
|
1574
|
+
},
|
|
1575
|
+
"action": { "type": "string" },
|
|
1576
|
+
"status": {
|
|
1577
|
+
"type": "string",
|
|
1578
|
+
"enum": [
|
|
1579
|
+
"started",
|
|
1580
|
+
"succeeded",
|
|
1581
|
+
"failed",
|
|
1582
|
+
"skipped",
|
|
1583
|
+
"needs_review"
|
|
1584
|
+
],
|
|
1585
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1586
|
+
},
|
|
1587
|
+
"summary": { "type": "string" },
|
|
1588
|
+
"detail": { "type": ["string", "null"] },
|
|
1589
|
+
"external_ref": { "oneOf": [{
|
|
1590
|
+
"type": "object",
|
|
1591
|
+
"additionalProperties": false,
|
|
1592
|
+
"required": ["system"],
|
|
1593
|
+
"properties": {
|
|
1594
|
+
"system": {
|
|
1595
|
+
"type": "string",
|
|
1596
|
+
"minLength": 1,
|
|
1597
|
+
"maxLength": 64,
|
|
1598
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
1599
|
+
},
|
|
1600
|
+
"id": {
|
|
1601
|
+
"type": "string",
|
|
1602
|
+
"minLength": 1,
|
|
1603
|
+
"maxLength": 255,
|
|
1604
|
+
"description": "External record identifier."
|
|
1605
|
+
},
|
|
1606
|
+
"url": {
|
|
1607
|
+
"type": "string",
|
|
1608
|
+
"maxLength": 2048,
|
|
1609
|
+
"description": "HTTP(S) link to the external record (validated as an `http://` or `https://` URL)."
|
|
1610
|
+
},
|
|
1611
|
+
"label": {
|
|
1612
|
+
"type": "string",
|
|
1613
|
+
"minLength": 1,
|
|
1614
|
+
"maxLength": 200,
|
|
1615
|
+
"description": "Human-readable display label for the external record."
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
}, { "type": "null" }] },
|
|
1619
|
+
"data": {
|
|
1620
|
+
"type": "object",
|
|
1621
|
+
"additionalProperties": true
|
|
1622
|
+
},
|
|
1623
|
+
"run_id": { "type": ["string", "null"] },
|
|
1624
|
+
"trace_url": { "type": ["string", "null"] },
|
|
1625
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
1626
|
+
"visibility": {
|
|
1627
|
+
"type": "string",
|
|
1628
|
+
"enum": ["thread", "actor_only"],
|
|
1629
|
+
"description": "Visibility of a thread activity (`thread` is shared with scoped readers; `actor_only` is private to the creating actor unless an auditor passes `include_private=true`)."
|
|
1630
|
+
},
|
|
1631
|
+
"revision": {
|
|
1632
|
+
"type": "integer",
|
|
1633
|
+
"minimum": 1
|
|
1634
|
+
},
|
|
1635
|
+
"status_history": {
|
|
1636
|
+
"type": "array",
|
|
1637
|
+
"items": {
|
|
1638
|
+
"type": "object",
|
|
1639
|
+
"additionalProperties": false,
|
|
1640
|
+
"required": [
|
|
1641
|
+
"status",
|
|
1642
|
+
"summary",
|
|
1643
|
+
"changed_at",
|
|
1644
|
+
"actor_kind",
|
|
1645
|
+
"actor_id",
|
|
1646
|
+
"actor_label"
|
|
1647
|
+
],
|
|
1648
|
+
"properties": {
|
|
1649
|
+
"status": {
|
|
1650
|
+
"type": "string",
|
|
1651
|
+
"enum": [
|
|
1652
|
+
"started",
|
|
1653
|
+
"succeeded",
|
|
1654
|
+
"failed",
|
|
1655
|
+
"skipped",
|
|
1656
|
+
"needs_review"
|
|
1657
|
+
],
|
|
1658
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1659
|
+
},
|
|
1660
|
+
"summary": { "type": "string" },
|
|
1661
|
+
"changed_at": {
|
|
1662
|
+
"type": "string",
|
|
1663
|
+
"format": "date-time"
|
|
1664
|
+
},
|
|
1665
|
+
"actor_kind": { "type": "string" },
|
|
1666
|
+
"actor_id": {
|
|
1667
|
+
"type": ["string", "null"],
|
|
1668
|
+
"format": "uuid"
|
|
1669
|
+
},
|
|
1670
|
+
"actor_label": { "type": ["string", "null"] }
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
},
|
|
1674
|
+
"started_at": {
|
|
1675
|
+
"type": "string",
|
|
1676
|
+
"format": "date-time"
|
|
1677
|
+
},
|
|
1678
|
+
"completed_at": {
|
|
1679
|
+
"type": ["string", "null"],
|
|
1680
|
+
"format": "date-time"
|
|
1681
|
+
},
|
|
1682
|
+
"updated_by": { "oneOf": [{
|
|
1683
|
+
"type": "object",
|
|
1684
|
+
"additionalProperties": false,
|
|
1685
|
+
"required": [
|
|
1686
|
+
"kind",
|
|
1687
|
+
"id",
|
|
1688
|
+
"label"
|
|
1689
|
+
],
|
|
1690
|
+
"properties": {
|
|
1691
|
+
"kind": { "type": "string" },
|
|
1692
|
+
"id": {
|
|
1693
|
+
"type": ["string", "null"],
|
|
1694
|
+
"format": "uuid"
|
|
1695
|
+
},
|
|
1696
|
+
"label": { "type": ["string", "null"] }
|
|
1697
|
+
}
|
|
1698
|
+
}, { "type": "null" }] },
|
|
1699
|
+
"created_at": {
|
|
1700
|
+
"type": "string",
|
|
1701
|
+
"format": "date-time"
|
|
1702
|
+
},
|
|
1703
|
+
"updated_at": {
|
|
1704
|
+
"type": "string",
|
|
1705
|
+
"format": "date-time"
|
|
1706
|
+
},
|
|
1707
|
+
"occurred_at": {
|
|
1708
|
+
"type": "string",
|
|
1709
|
+
"format": "date-time"
|
|
1710
|
+
}
|
|
1711
|
+
}
|
|
1712
|
+
},
|
|
1713
|
+
"updated": { "type": "boolean" }
|
|
1714
|
+
}
|
|
1715
|
+
},
|
|
1716
|
+
"sdkName": "createThreadActivity",
|
|
1717
|
+
"summary": "Record or upsert an agent work activity on a thread",
|
|
1718
|
+
"tag": "Activity",
|
|
1719
|
+
"tagCommand": "activity"
|
|
1720
|
+
},
|
|
1721
|
+
{
|
|
1722
|
+
"binaryResponse": false,
|
|
1723
|
+
"bodyRequired": false,
|
|
1724
|
+
"command": "get-thread-timeline",
|
|
1725
|
+
"description": "Returns a cursor-paginated timeline for a thread combining\nsystem-verified Primitive actions (`source: \"primitive\"`, such as\n`email.read`, `email.replied`, `email.sent`, `email.attachment_read`,\nalong with any `X-Primitive-Reason` and `X-Primitive-Run-Id` headers)\nand agent-reported work records (`source: \"agent\"`). Strictly filtered\nby the caller's mail scope; `actor_only` activities are hidden from\nother callers unless `include_private=true` is passed with\n`activity:read`.\n",
|
|
1726
|
+
"hasJsonBody": false,
|
|
1727
|
+
"method": "GET",
|
|
1728
|
+
"operationId": "getThreadTimeline",
|
|
1729
|
+
"path": "/threads/{id}/timeline",
|
|
1730
|
+
"pathParams": [{
|
|
1731
|
+
"description": "Thread UUID.",
|
|
1732
|
+
"enum": null,
|
|
1733
|
+
"name": "id",
|
|
1734
|
+
"required": true,
|
|
1735
|
+
"type": "string"
|
|
1736
|
+
}],
|
|
1737
|
+
"queryParams": [
|
|
1738
|
+
{
|
|
1739
|
+
"description": "Filter timeline entries by source: all (default), primitive, or agent.",
|
|
1740
|
+
"enum": null,
|
|
1741
|
+
"name": "source",
|
|
1742
|
+
"required": false,
|
|
1743
|
+
"type": "string"
|
|
1744
|
+
},
|
|
1745
|
+
{
|
|
1746
|
+
"description": "For agent activities: action, note, or handoff.",
|
|
1747
|
+
"enum": null,
|
|
1748
|
+
"name": "kind",
|
|
1749
|
+
"required": false,
|
|
1750
|
+
"type": "string"
|
|
1751
|
+
},
|
|
1752
|
+
{
|
|
1753
|
+
"description": "For agent activities: comma-separated statuses from started, succeeded, failed, skipped, needs_review.",
|
|
1754
|
+
"enum": null,
|
|
1755
|
+
"name": "status",
|
|
1756
|
+
"required": false,
|
|
1757
|
+
"type": "string"
|
|
1758
|
+
},
|
|
1759
|
+
{
|
|
1760
|
+
"description": "When `\"true\"`, limits to agent activities with status `failed` or `needs_review`.",
|
|
1761
|
+
"enum": ["true", "false"],
|
|
1762
|
+
"name": "attention",
|
|
1763
|
+
"required": false,
|
|
1764
|
+
"type": "string"
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
"description": "Exact action name filter (for example `brex.upload_invoice` or `email.read`).",
|
|
1768
|
+
"enum": null,
|
|
1769
|
+
"name": "action",
|
|
1770
|
+
"required": false,
|
|
1771
|
+
"type": "string"
|
|
1772
|
+
},
|
|
1773
|
+
{
|
|
1774
|
+
"description": "Filter by actor ownership class: human, personal_agent, org_key, function, app, or system.",
|
|
1775
|
+
"enum": null,
|
|
1776
|
+
"name": "actor_ownership",
|
|
1777
|
+
"required": false,
|
|
1778
|
+
"type": "string"
|
|
1779
|
+
},
|
|
1780
|
+
{
|
|
1781
|
+
"description": "Filter to events or activities recorded by a specific actor UUID.",
|
|
1782
|
+
"enum": null,
|
|
1783
|
+
"name": "actor_id",
|
|
1784
|
+
"required": false,
|
|
1785
|
+
"type": "string"
|
|
1786
|
+
},
|
|
1787
|
+
{
|
|
1788
|
+
"description": "Filter to events or activities carrying this run_id.",
|
|
1789
|
+
"enum": null,
|
|
1790
|
+
"name": "run_id",
|
|
1791
|
+
"required": false,
|
|
1792
|
+
"type": "string"
|
|
1793
|
+
},
|
|
1794
|
+
{
|
|
1795
|
+
"description": "When `\"true\"`, includes `actor_only` activities written by other actors if the caller holds `activity:read`.",
|
|
1796
|
+
"enum": ["true", "false"],
|
|
1797
|
+
"name": "include_private",
|
|
1798
|
+
"required": false,
|
|
1799
|
+
"type": "string"
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
"description": "Sort order by occurred_at: desc (default, newest first) or asc (chronological).",
|
|
1803
|
+
"enum": ["desc", "asc"],
|
|
1804
|
+
"name": "order",
|
|
1805
|
+
"required": false,
|
|
1806
|
+
"type": "string"
|
|
1807
|
+
},
|
|
1808
|
+
{
|
|
1809
|
+
"default": 50,
|
|
1810
|
+
"description": "Items per page, from 1 to 200; defaults to 50.",
|
|
1811
|
+
"enum": null,
|
|
1812
|
+
"maximum": 200,
|
|
1813
|
+
"minimum": 1,
|
|
1814
|
+
"name": "limit",
|
|
1815
|
+
"required": false,
|
|
1816
|
+
"type": "integer"
|
|
1817
|
+
},
|
|
1818
|
+
{
|
|
1819
|
+
"description": "`next_cursor` from the previous page.",
|
|
1820
|
+
"enum": null,
|
|
1821
|
+
"name": "cursor",
|
|
1822
|
+
"required": false,
|
|
1823
|
+
"type": "string"
|
|
1824
|
+
}
|
|
1825
|
+
],
|
|
1826
|
+
"headerParams": [],
|
|
1827
|
+
"permissions": ["mail.activity:read"],
|
|
1828
|
+
"access": null,
|
|
1829
|
+
"requestSchema": null,
|
|
1830
|
+
"responseSchema": {
|
|
1831
|
+
"type": "object",
|
|
1832
|
+
"additionalProperties": false,
|
|
1833
|
+
"required": [
|
|
1834
|
+
"thread_id",
|
|
1835
|
+
"items",
|
|
1836
|
+
"next_cursor"
|
|
1837
|
+
],
|
|
1838
|
+
"properties": {
|
|
1839
|
+
"thread_id": {
|
|
1840
|
+
"type": "string",
|
|
1841
|
+
"format": "uuid"
|
|
1842
|
+
},
|
|
1843
|
+
"items": {
|
|
1844
|
+
"type": "array",
|
|
1845
|
+
"items": {
|
|
1846
|
+
"description": "A single entry in a thread or org activity timeline. `source` `\"primitive\"` is a verified Primitive mail event; `\"agent\"` is an agent-reported work record.",
|
|
1847
|
+
"oneOf": [{
|
|
1848
|
+
"type": "object",
|
|
1849
|
+
"additionalProperties": false,
|
|
1850
|
+
"required": [
|
|
1851
|
+
"id",
|
|
1852
|
+
"source",
|
|
1853
|
+
"thread_id",
|
|
1854
|
+
"email_id",
|
|
1855
|
+
"sent_email_id",
|
|
1856
|
+
"mailbox_address",
|
|
1857
|
+
"action",
|
|
1858
|
+
"actor",
|
|
1859
|
+
"request_id",
|
|
1860
|
+
"reason",
|
|
1861
|
+
"run_id",
|
|
1862
|
+
"metadata",
|
|
1863
|
+
"occurred_at"
|
|
1864
|
+
],
|
|
1865
|
+
"properties": {
|
|
1866
|
+
"id": {
|
|
1867
|
+
"type": "string",
|
|
1868
|
+
"format": "uuid"
|
|
1869
|
+
},
|
|
1870
|
+
"source": {
|
|
1871
|
+
"type": "string",
|
|
1872
|
+
"enum": ["primitive"]
|
|
1873
|
+
},
|
|
1874
|
+
"thread_id": {
|
|
1875
|
+
"type": ["string", "null"],
|
|
1876
|
+
"format": "uuid"
|
|
1877
|
+
},
|
|
1878
|
+
"email_id": {
|
|
1879
|
+
"type": ["string", "null"],
|
|
1880
|
+
"format": "uuid"
|
|
1881
|
+
},
|
|
1882
|
+
"sent_email_id": {
|
|
1883
|
+
"type": ["string", "null"],
|
|
1884
|
+
"format": "uuid"
|
|
1885
|
+
},
|
|
1886
|
+
"mailbox_address": { "type": ["string", "null"] },
|
|
1887
|
+
"action": {
|
|
1888
|
+
"type": "string",
|
|
1889
|
+
"enum": [
|
|
1890
|
+
"email.read",
|
|
1891
|
+
"email.readable_read",
|
|
1892
|
+
"email.conversation_read",
|
|
1893
|
+
"email.raw_read",
|
|
1894
|
+
"email.attachment_read",
|
|
1895
|
+
"email.replied",
|
|
1896
|
+
"email.sent",
|
|
1897
|
+
"email.signaled",
|
|
1898
|
+
"email.deleted",
|
|
1899
|
+
"email.content_discarded"
|
|
1900
|
+
],
|
|
1901
|
+
"description": "System-verified mail action recorded automatically by Primitive."
|
|
1902
|
+
},
|
|
1903
|
+
"actor": {
|
|
1904
|
+
"type": "object",
|
|
1905
|
+
"additionalProperties": false,
|
|
1906
|
+
"required": [
|
|
1907
|
+
"kind",
|
|
1908
|
+
"id",
|
|
1909
|
+
"label",
|
|
1910
|
+
"ownership",
|
|
1911
|
+
"owner_user_id",
|
|
1912
|
+
"owner_label",
|
|
1913
|
+
"agent_connection_id",
|
|
1914
|
+
"oauth_client_id"
|
|
1915
|
+
],
|
|
1916
|
+
"properties": {
|
|
1917
|
+
"kind": { "type": "string" },
|
|
1918
|
+
"id": {
|
|
1919
|
+
"type": ["string", "null"],
|
|
1920
|
+
"format": "uuid"
|
|
1921
|
+
},
|
|
1922
|
+
"label": { "type": ["string", "null"] },
|
|
1923
|
+
"ownership": {
|
|
1924
|
+
"type": "string",
|
|
1925
|
+
"enum": [
|
|
1926
|
+
"human",
|
|
1927
|
+
"personal_agent",
|
|
1928
|
+
"org_key",
|
|
1929
|
+
"function",
|
|
1930
|
+
"app",
|
|
1931
|
+
"system"
|
|
1932
|
+
],
|
|
1933
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
1934
|
+
},
|
|
1935
|
+
"owner_user_id": {
|
|
1936
|
+
"type": ["string", "null"],
|
|
1937
|
+
"format": "uuid"
|
|
1938
|
+
},
|
|
1939
|
+
"owner_label": { "type": ["string", "null"] },
|
|
1940
|
+
"agent_connection_id": {
|
|
1941
|
+
"type": ["string", "null"],
|
|
1942
|
+
"format": "uuid"
|
|
1943
|
+
},
|
|
1944
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
1945
|
+
}
|
|
1946
|
+
},
|
|
1947
|
+
"request_id": { "type": ["string", "null"] },
|
|
1948
|
+
"reason": { "type": ["string", "null"] },
|
|
1949
|
+
"run_id": { "type": ["string", "null"] },
|
|
1950
|
+
"metadata": {
|
|
1951
|
+
"type": "object",
|
|
1952
|
+
"additionalProperties": true
|
|
1953
|
+
},
|
|
1954
|
+
"occurred_at": {
|
|
1955
|
+
"type": "string",
|
|
1956
|
+
"format": "date-time"
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
}, {
|
|
1960
|
+
"type": "object",
|
|
1961
|
+
"additionalProperties": false,
|
|
1962
|
+
"required": [
|
|
1963
|
+
"id",
|
|
1964
|
+
"source",
|
|
1965
|
+
"thread_id",
|
|
1966
|
+
"email_id",
|
|
1967
|
+
"sent_email_id",
|
|
1968
|
+
"actor",
|
|
1969
|
+
"kind",
|
|
1970
|
+
"action",
|
|
1971
|
+
"status",
|
|
1972
|
+
"summary",
|
|
1973
|
+
"detail",
|
|
1974
|
+
"external_ref",
|
|
1975
|
+
"data",
|
|
1976
|
+
"run_id",
|
|
1977
|
+
"trace_url",
|
|
1978
|
+
"idempotency_key",
|
|
1979
|
+
"visibility",
|
|
1980
|
+
"revision",
|
|
1981
|
+
"status_history",
|
|
1982
|
+
"started_at",
|
|
1983
|
+
"completed_at",
|
|
1984
|
+
"updated_by",
|
|
1985
|
+
"created_at",
|
|
1986
|
+
"updated_at",
|
|
1987
|
+
"occurred_at"
|
|
1988
|
+
],
|
|
1989
|
+
"properties": {
|
|
1990
|
+
"id": {
|
|
1991
|
+
"type": "string",
|
|
1992
|
+
"format": "uuid"
|
|
1993
|
+
},
|
|
1994
|
+
"source": {
|
|
1995
|
+
"type": "string",
|
|
1996
|
+
"enum": ["agent"]
|
|
1997
|
+
},
|
|
1998
|
+
"thread_id": {
|
|
1999
|
+
"type": "string",
|
|
2000
|
+
"format": "uuid"
|
|
2001
|
+
},
|
|
2002
|
+
"email_id": {
|
|
2003
|
+
"type": ["string", "null"],
|
|
2004
|
+
"format": "uuid"
|
|
2005
|
+
},
|
|
2006
|
+
"sent_email_id": {
|
|
2007
|
+
"type": ["string", "null"],
|
|
2008
|
+
"format": "uuid"
|
|
2009
|
+
},
|
|
2010
|
+
"actor": {
|
|
2011
|
+
"type": "object",
|
|
2012
|
+
"additionalProperties": false,
|
|
2013
|
+
"required": [
|
|
2014
|
+
"kind",
|
|
2015
|
+
"id",
|
|
2016
|
+
"label",
|
|
2017
|
+
"ownership",
|
|
2018
|
+
"owner_user_id",
|
|
2019
|
+
"owner_label",
|
|
2020
|
+
"agent_connection_id",
|
|
2021
|
+
"oauth_client_id"
|
|
2022
|
+
],
|
|
2023
|
+
"properties": {
|
|
2024
|
+
"kind": { "type": "string" },
|
|
2025
|
+
"id": {
|
|
2026
|
+
"type": ["string", "null"],
|
|
2027
|
+
"format": "uuid"
|
|
2028
|
+
},
|
|
2029
|
+
"label": { "type": ["string", "null"] },
|
|
2030
|
+
"ownership": {
|
|
2031
|
+
"type": "string",
|
|
2032
|
+
"enum": [
|
|
2033
|
+
"human",
|
|
2034
|
+
"personal_agent",
|
|
2035
|
+
"org_key",
|
|
2036
|
+
"function",
|
|
2037
|
+
"app",
|
|
2038
|
+
"system"
|
|
2039
|
+
],
|
|
2040
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
2041
|
+
},
|
|
2042
|
+
"owner_user_id": {
|
|
2043
|
+
"type": ["string", "null"],
|
|
2044
|
+
"format": "uuid"
|
|
2045
|
+
},
|
|
2046
|
+
"owner_label": { "type": ["string", "null"] },
|
|
2047
|
+
"agent_connection_id": {
|
|
2048
|
+
"type": ["string", "null"],
|
|
2049
|
+
"format": "uuid"
|
|
2050
|
+
},
|
|
2051
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
2052
|
+
}
|
|
2053
|
+
},
|
|
2054
|
+
"kind": {
|
|
2055
|
+
"type": "string",
|
|
2056
|
+
"enum": [
|
|
2057
|
+
"action",
|
|
2058
|
+
"note",
|
|
2059
|
+
"handoff"
|
|
2060
|
+
],
|
|
2061
|
+
"description": "Category of an agent-reported thread activity."
|
|
2062
|
+
},
|
|
2063
|
+
"action": { "type": "string" },
|
|
2064
|
+
"status": {
|
|
2065
|
+
"type": "string",
|
|
2066
|
+
"enum": [
|
|
2067
|
+
"started",
|
|
2068
|
+
"succeeded",
|
|
2069
|
+
"failed",
|
|
2070
|
+
"skipped",
|
|
2071
|
+
"needs_review"
|
|
2072
|
+
],
|
|
2073
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
2074
|
+
},
|
|
2075
|
+
"summary": { "type": "string" },
|
|
2076
|
+
"detail": { "type": ["string", "null"] },
|
|
2077
|
+
"external_ref": { "oneOf": [{
|
|
2078
|
+
"type": "object",
|
|
2079
|
+
"additionalProperties": false,
|
|
2080
|
+
"required": ["system"],
|
|
2081
|
+
"properties": {
|
|
2082
|
+
"system": {
|
|
2083
|
+
"type": "string",
|
|
2084
|
+
"minLength": 1,
|
|
2085
|
+
"maxLength": 64,
|
|
2086
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
2087
|
+
},
|
|
2088
|
+
"id": {
|
|
2089
|
+
"type": "string",
|
|
2090
|
+
"minLength": 1,
|
|
2091
|
+
"maxLength": 255,
|
|
2092
|
+
"description": "External record identifier."
|
|
2093
|
+
},
|
|
2094
|
+
"url": {
|
|
2095
|
+
"type": "string",
|
|
2096
|
+
"maxLength": 2048,
|
|
2097
|
+
"description": "HTTP(S) link to the external record (validated as an `http://` or `https://` URL)."
|
|
2098
|
+
},
|
|
2099
|
+
"label": {
|
|
2100
|
+
"type": "string",
|
|
2101
|
+
"minLength": 1,
|
|
2102
|
+
"maxLength": 200,
|
|
2103
|
+
"description": "Human-readable display label for the external record."
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
}, { "type": "null" }] },
|
|
2107
|
+
"data": {
|
|
2108
|
+
"type": "object",
|
|
2109
|
+
"additionalProperties": true
|
|
2110
|
+
},
|
|
2111
|
+
"run_id": { "type": ["string", "null"] },
|
|
2112
|
+
"trace_url": { "type": ["string", "null"] },
|
|
2113
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
2114
|
+
"visibility": {
|
|
2115
|
+
"type": "string",
|
|
2116
|
+
"enum": ["thread", "actor_only"],
|
|
2117
|
+
"description": "Visibility of a thread activity (`thread` is shared with scoped readers; `actor_only` is private to the creating actor unless an auditor passes `include_private=true`)."
|
|
2118
|
+
},
|
|
2119
|
+
"revision": {
|
|
2120
|
+
"type": "integer",
|
|
2121
|
+
"minimum": 1
|
|
2122
|
+
},
|
|
2123
|
+
"status_history": {
|
|
2124
|
+
"type": "array",
|
|
2125
|
+
"items": {
|
|
2126
|
+
"type": "object",
|
|
2127
|
+
"additionalProperties": false,
|
|
2128
|
+
"required": [
|
|
2129
|
+
"status",
|
|
2130
|
+
"summary",
|
|
2131
|
+
"changed_at",
|
|
2132
|
+
"actor_kind",
|
|
2133
|
+
"actor_id",
|
|
2134
|
+
"actor_label"
|
|
2135
|
+
],
|
|
2136
|
+
"properties": {
|
|
2137
|
+
"status": {
|
|
2138
|
+
"type": "string",
|
|
2139
|
+
"enum": [
|
|
2140
|
+
"started",
|
|
2141
|
+
"succeeded",
|
|
2142
|
+
"failed",
|
|
2143
|
+
"skipped",
|
|
2144
|
+
"needs_review"
|
|
2145
|
+
],
|
|
2146
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
2147
|
+
},
|
|
2148
|
+
"summary": { "type": "string" },
|
|
2149
|
+
"changed_at": {
|
|
2150
|
+
"type": "string",
|
|
2151
|
+
"format": "date-time"
|
|
2152
|
+
},
|
|
2153
|
+
"actor_kind": { "type": "string" },
|
|
2154
|
+
"actor_id": {
|
|
2155
|
+
"type": ["string", "null"],
|
|
2156
|
+
"format": "uuid"
|
|
2157
|
+
},
|
|
2158
|
+
"actor_label": { "type": ["string", "null"] }
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
},
|
|
2162
|
+
"started_at": {
|
|
2163
|
+
"type": "string",
|
|
2164
|
+
"format": "date-time"
|
|
2165
|
+
},
|
|
2166
|
+
"completed_at": {
|
|
2167
|
+
"type": ["string", "null"],
|
|
2168
|
+
"format": "date-time"
|
|
2169
|
+
},
|
|
2170
|
+
"updated_by": { "oneOf": [{
|
|
2171
|
+
"type": "object",
|
|
2172
|
+
"additionalProperties": false,
|
|
2173
|
+
"required": [
|
|
2174
|
+
"kind",
|
|
2175
|
+
"id",
|
|
2176
|
+
"label"
|
|
2177
|
+
],
|
|
2178
|
+
"properties": {
|
|
2179
|
+
"kind": { "type": "string" },
|
|
2180
|
+
"id": {
|
|
2181
|
+
"type": ["string", "null"],
|
|
2182
|
+
"format": "uuid"
|
|
2183
|
+
},
|
|
2184
|
+
"label": { "type": ["string", "null"] }
|
|
2185
|
+
}
|
|
2186
|
+
}, { "type": "null" }] },
|
|
2187
|
+
"created_at": {
|
|
2188
|
+
"type": "string",
|
|
2189
|
+
"format": "date-time"
|
|
2190
|
+
},
|
|
2191
|
+
"updated_at": {
|
|
2192
|
+
"type": "string",
|
|
2193
|
+
"format": "date-time"
|
|
2194
|
+
},
|
|
2195
|
+
"occurred_at": {
|
|
2196
|
+
"type": "string",
|
|
2197
|
+
"format": "date-time"
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
2200
|
+
}],
|
|
2201
|
+
"discriminator": {
|
|
2202
|
+
"propertyName": "source",
|
|
2203
|
+
"mapping": {
|
|
2204
|
+
"primitive": "#/components/schemas/MailActivityEvent",
|
|
2205
|
+
"agent": "#/components/schemas/ThreadActivity"
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
},
|
|
2210
|
+
"next_cursor": { "type": ["string", "null"] }
|
|
2211
|
+
}
|
|
2212
|
+
},
|
|
2213
|
+
"sdkName": "getThreadTimeline",
|
|
2214
|
+
"summary": "Read the unified timeline of verified mail actions and agent work on a thread",
|
|
2215
|
+
"tag": "Activity",
|
|
2216
|
+
"tagCommand": "activity"
|
|
2217
|
+
},
|
|
2218
|
+
{
|
|
2219
|
+
"binaryResponse": false,
|
|
2220
|
+
"bodyRequired": false,
|
|
2221
|
+
"command": "list-activity-objects",
|
|
2222
|
+
"description": "The objects the caller created, newest first, each with where it stands now, including ones since disabled, deleted or revoked where the object keeps a row: Functions, endpoints, Function triggers, pull subscriptions, recipient routes, filters, wake schedules, repeating sends and scheduled sends. An API key, an app or an agent sees what it created itself; a webhook given to an API key lists under that key. A person (a dashboard session, or their own Primitive CLI or app login) sees what they created through any credential of theirs, each item naming it, and also their API keys, personal agents, email rules, rule requests and objections to rules over their mail (objections only on the dashboard or the Primitive CLI). Each kind is listed only if the caller could list it through that kind's own route; a kind it could not is named in withheld, with no count. Ids, names and states only: never a webhook URL or mail content. Needs activity:read_self. With relation=asked it lists instead what other members asked of the person, open or answered: the rule requests made to them, and the objections to rules they wrote, under their current membership, each naming the member who asked or objected in created_through. A key, an app or an agent has none, and gets both kinds in withheld. With relation=concerning it lists instead what other members did that concerns the person's own mail: each time a rule in observe or active started covering one of their mailboxes, turned active after they were told of it in observe, saved a new version while covering it, or stopped covering it, named as the rule was then, naming its author in created_through, under their current membership; only on the dashboard or the Primitive CLI. A key, an app or an agent has none, and gets email_rule_coverage in withheld. A notice never reads as ended. Notices are written by a periodic job and can lag, a held new version by up to about 15 minutes; GET /v1/email-rules/covering-me is the live view. For what covers you now, read GET /email-rules/covering-me.",
|
|
2223
|
+
"hasJsonBody": false,
|
|
2224
|
+
"method": "GET",
|
|
2225
|
+
"operationId": "listActivityObjects",
|
|
2226
|
+
"path": "/activity/objects",
|
|
2227
|
+
"pathParams": [],
|
|
2228
|
+
"queryParams": [
|
|
2229
|
+
{
|
|
2230
|
+
"default": "created",
|
|
2231
|
+
"description": "created (the default), asked or concerning.",
|
|
2232
|
+
"enum": [
|
|
2233
|
+
"created",
|
|
2234
|
+
"asked",
|
|
2235
|
+
"concerning"
|
|
2236
|
+
],
|
|
2237
|
+
"name": "relation",
|
|
2238
|
+
"required": false,
|
|
2239
|
+
"type": "string"
|
|
2240
|
+
},
|
|
2241
|
+
{
|
|
2242
|
+
"description": "Only these kinds, comma-separated: function, endpoint, function_trigger, pull_subscription, recipient_route, filter_rule, wake_schedule, repeating_send, scheduled_send, api_key, agent_connection, email_rule, email_rule_request, email_rule_objection, email_rule_coverage. Defaults to every kind the caller can have created (a person's own kinds only for a person). With relation=asked, only email_rule_request and email_rule_objection, which are also the default; with relation=concerning, only email_rule_coverage, the default. email_rule_coverage is listed only with relation=concerning.",
|
|
2243
|
+
"enum": null,
|
|
2244
|
+
"name": "kind",
|
|
2245
|
+
"required": false,
|
|
2246
|
+
"type": "string"
|
|
2247
|
+
},
|
|
2248
|
+
{
|
|
2249
|
+
"default": "all",
|
|
2250
|
+
"description": "all (the default), live (still there, enabled or not) or ended (deleted, replaced or finished).",
|
|
2251
|
+
"enum": [
|
|
2252
|
+
"all",
|
|
2253
|
+
"live",
|
|
2254
|
+
"ended"
|
|
2255
|
+
],
|
|
2256
|
+
"name": "state",
|
|
2257
|
+
"required": false,
|
|
2258
|
+
"type": "string"
|
|
2259
|
+
},
|
|
2260
|
+
{
|
|
2261
|
+
"default": 50,
|
|
2262
|
+
"description": "Objects per page, from 1 to 200; defaults to 50.",
|
|
2263
|
+
"enum": null,
|
|
2264
|
+
"maximum": 200,
|
|
2265
|
+
"minimum": 1,
|
|
2266
|
+
"name": "limit",
|
|
2267
|
+
"required": false,
|
|
2268
|
+
"type": "integer"
|
|
2269
|
+
},
|
|
2270
|
+
{
|
|
2271
|
+
"description": "next_cursor from the preceding page. Omit for the first page.",
|
|
2272
|
+
"enum": null,
|
|
2273
|
+
"name": "cursor",
|
|
2274
|
+
"required": false,
|
|
2275
|
+
"type": "string"
|
|
2276
|
+
}
|
|
2277
|
+
],
|
|
2278
|
+
"headerParams": [],
|
|
2279
|
+
"permissions": ["activity:read_self"],
|
|
2280
|
+
"access": null,
|
|
2281
|
+
"requestSchema": null,
|
|
2282
|
+
"responseSchema": {
|
|
2283
|
+
"type": "object",
|
|
2284
|
+
"properties": {
|
|
2285
|
+
"covers": {
|
|
2286
|
+
"type": "string",
|
|
2287
|
+
"description": "you: what a person created through any credential of theirs, or with relation=asked what others asked of them (their dashboard session, their own CLI or app login, apps and agent delegates acting for them, their API keys while theirs, their personal agents). this_credential: what the calling key, app or agent created itself."
|
|
2288
|
+
},
|
|
2289
|
+
"items": {
|
|
2290
|
+
"type": "array",
|
|
2291
|
+
"items": {
|
|
2292
|
+
"type": "object",
|
|
2293
|
+
"properties": {
|
|
2294
|
+
"kind": {
|
|
2295
|
+
"type": "string",
|
|
2296
|
+
"description": "One of: function, endpoint, function_trigger, pull_subscription, recipient_route, filter_rule, wake_schedule, repeating_send, scheduled_send, api_key, agent_connection, email_rule, email_rule_request, email_rule_objection, email_rule_coverage."
|
|
2297
|
+
},
|
|
2298
|
+
"id": { "type": "string" },
|
|
2299
|
+
"name": {
|
|
2300
|
+
"description": "The name the object is known by: an endpoint's display name, a route's or filter's pattern, a Function's name, a send's From address, a wake schedule's command and the address it wakes, an API key's name, an agent's address, a rule's or rule request's name, and for an objection or a coverage notice the name its rule had then (for a stopped notice, when you were last told of it, or while it last covered you). Never a webhook URL and never mail content.",
|
|
2301
|
+
"type": ["string", "null"]
|
|
2302
|
+
},
|
|
2303
|
+
"state": {
|
|
2304
|
+
"type": "string",
|
|
2305
|
+
"description": "Where it stands now: enabled, disabled, deleted or replaced (endpoints and routes), enabled or disabled (filters, wake schedules), live, suspended or deleted (Functions), active, paused or ended (repeating sends), scheduled (scheduled sends), active, suspended, expired or revoked (API keys), pending, claimed, connected or revoked (agents), draft, observe, active or deleted (email rules), pending, accepted, declined or withdrawn (rule requests and objections; an objection may also be amended or closed), and for a coverage notice what it told: started (a rule in observe or active came to cover your mailboxes: made, turned on, or reaching you; once per rule, not per mailbox), activated (a rule you were told of while it was being tested in observe is now active), new_version, stopped (it no longer covers you, why in stop_reason), or baseline (it already covered you when notices began)."
|
|
2306
|
+
},
|
|
2307
|
+
"created_at": {
|
|
2308
|
+
"type": "string",
|
|
2309
|
+
"format": "date-time"
|
|
2310
|
+
},
|
|
2311
|
+
"ended_at": {
|
|
2312
|
+
"type": ["string", "null"],
|
|
2313
|
+
"format": "date-time",
|
|
2314
|
+
"description": "When it was deleted, replaced or revoked, when an API key expired, when a repeating send stopped, or when a rule request or objection was decided (accepted, declined, withdrawn or, for an objection, amended); null otherwise, a closed objection included, as on every coverage notice."
|
|
2315
|
+
},
|
|
2316
|
+
"owned_now": {
|
|
2317
|
+
"type": "string",
|
|
2318
|
+
"enum": ["you", "someone_else"],
|
|
2319
|
+
"description": "you: it is still yours: never transferred, or transferred back to you. someone_else: it was transferred and another person holds it now, or, with relation=asked or concerning, another member made it."
|
|
2320
|
+
},
|
|
2321
|
+
"created_through": {
|
|
2322
|
+
"type": "object",
|
|
2323
|
+
"properties": {
|
|
2324
|
+
"kind": {
|
|
2325
|
+
"type": "string",
|
|
2326
|
+
"description": "The kind of credential it was created through: org_key, function_key, connected_key, oauth, agent_delegate or member (the person themselves). With relation=asked, member: the member who asked or objected; with relation=concerning, member: the rule's author."
|
|
2327
|
+
},
|
|
2328
|
+
"id": {
|
|
2329
|
+
"description": "In a person's view, the person's own user id for member, and an API key's id where they may read their keys (for a person limited to their own keys, only a key they still hold). Null otherwise, and always null in one credential's view, where it is the calling credential itself. With relation=asked, the user id of the member who asked or objected; with relation=concerning, of the rule's author.",
|
|
2330
|
+
"type": ["string", "null"]
|
|
2331
|
+
},
|
|
2332
|
+
"name": {
|
|
2333
|
+
"description": "In a person's view, what that credential of theirs is called: an app login by its app, an API key by its name, an agent's key by its address. Null otherwise, and for the person themselves. With relation=asked, the name of the member who asked or objected; with relation=concerning, of the rule's author.",
|
|
2334
|
+
"type": ["string", "null"]
|
|
2335
|
+
}
|
|
2336
|
+
},
|
|
2337
|
+
"required": [
|
|
2338
|
+
"kind",
|
|
2339
|
+
"id",
|
|
2340
|
+
"name"
|
|
2341
|
+
]
|
|
2342
|
+
},
|
|
2343
|
+
"rule_id": {
|
|
2344
|
+
"description": "For email_rule_coverage, always: the rule it is about, since names need not be unique. GET /v1/email-rules/covering-me/{rule_id} shows the rule while it covers you, or as it last decided on your mail; otherwise it answers not_found. A deleted rule is told by a stopped notice with stop_reason deleted.",
|
|
2345
|
+
"type": "string",
|
|
2346
|
+
"format": "uuid"
|
|
2347
|
+
},
|
|
2348
|
+
"stop_reason": {
|
|
2349
|
+
"description": "For a stopped notice: deleted, turned_off (set to draft), or no_longer_covers (in observe or active, reaching none of your mailboxes now). A rule moved from active back to observe still covers you and is not stopped.",
|
|
2350
|
+
"type": "string",
|
|
2351
|
+
"enum": [
|
|
2352
|
+
"deleted",
|
|
2353
|
+
"turned_off",
|
|
2354
|
+
"no_longer_covers"
|
|
2355
|
+
]
|
|
2356
|
+
}
|
|
2357
|
+
},
|
|
2358
|
+
"required": [
|
|
2359
|
+
"kind",
|
|
2360
|
+
"id",
|
|
2361
|
+
"name",
|
|
2362
|
+
"state",
|
|
2363
|
+
"created_at",
|
|
2364
|
+
"ended_at",
|
|
2365
|
+
"owned_now",
|
|
2366
|
+
"created_through"
|
|
2367
|
+
]
|
|
2368
|
+
}
|
|
2369
|
+
},
|
|
2370
|
+
"withheld": {
|
|
2371
|
+
"type": "array",
|
|
2372
|
+
"items": {
|
|
2373
|
+
"type": "object",
|
|
2374
|
+
"properties": {
|
|
2375
|
+
"kind": { "type": "string" },
|
|
2376
|
+
"reason": {
|
|
2377
|
+
"type": "string",
|
|
2378
|
+
"enum": [
|
|
2379
|
+
"permission_missing",
|
|
2380
|
+
"mail_scope",
|
|
2381
|
+
"not_for_this_credential"
|
|
2382
|
+
],
|
|
2383
|
+
"description": "permission_missing: the caller lacks the permission the kind's own list needs (named in permission). mail_scope: listed only to a caller that reads every mailbox. not_for_this_credential: this kind of credential never lists them (a person's own kinds asked for by a key, an app or an agent), or the kind's own list refuses it (email rules, rule requests and objections for a token narrowed below the person; objections anywhere but the dashboard and the Primitive CLI)."
|
|
2384
|
+
},
|
|
2385
|
+
"permission": { "type": ["string", "null"] }
|
|
2386
|
+
},
|
|
2387
|
+
"required": [
|
|
2388
|
+
"kind",
|
|
2389
|
+
"reason",
|
|
2390
|
+
"permission"
|
|
2391
|
+
]
|
|
2392
|
+
},
|
|
2393
|
+
"description": "Kinds left out because the caller could not list them through their own routes. Nothing is said about how many there are."
|
|
2394
|
+
},
|
|
2395
|
+
"next_cursor": {
|
|
2396
|
+
"description": "Pass as cursor to read the next page; null on the last page. A page can hold fewer items than limit, or none, while next_cursor is set.",
|
|
2397
|
+
"type": ["string", "null"]
|
|
2398
|
+
}
|
|
2399
|
+
},
|
|
2400
|
+
"required": [
|
|
2401
|
+
"covers",
|
|
2402
|
+
"items",
|
|
2403
|
+
"withheld",
|
|
2404
|
+
"next_cursor"
|
|
2405
|
+
]
|
|
2406
|
+
},
|
|
2407
|
+
"sdkName": "listActivityObjects",
|
|
2408
|
+
"summary": "List what you created, or what you were asked",
|
|
2409
|
+
"tag": "Activity",
|
|
2410
|
+
"tagCommand": "activity"
|
|
2411
|
+
},
|
|
2412
|
+
{
|
|
2413
|
+
"binaryResponse": false,
|
|
2414
|
+
"bodyRequired": false,
|
|
2415
|
+
"command": "list-mail-activity-actors",
|
|
2416
|
+
"description": "Returns per-actor rollups (threads touched, verified mail actions, and\nagent work outcomes by status) for every agent, API key, Function,\nconnected app, or member that touched mail within the caller's mail\nscope. Requires `mail.activity:read`.\n",
|
|
2417
|
+
"hasJsonBody": false,
|
|
2418
|
+
"method": "GET",
|
|
2419
|
+
"operationId": "listMailActivityActors",
|
|
2420
|
+
"path": "/activity/mail/actors",
|
|
2421
|
+
"pathParams": [],
|
|
2422
|
+
"queryParams": [
|
|
2423
|
+
{
|
|
2424
|
+
"description": "Filter by actor ownership class: human, personal_agent, org_key, function, app, or system.",
|
|
2425
|
+
"enum": null,
|
|
2426
|
+
"name": "actor_ownership",
|
|
2427
|
+
"required": false,
|
|
2428
|
+
"type": "string"
|
|
2429
|
+
},
|
|
2430
|
+
{
|
|
2431
|
+
"description": "Filter to actors owned by a specific organization member UUID.",
|
|
2432
|
+
"enum": null,
|
|
2433
|
+
"name": "owner_user_id",
|
|
2434
|
+
"required": false,
|
|
2435
|
+
"type": "string"
|
|
2436
|
+
},
|
|
2437
|
+
{
|
|
2438
|
+
"description": "When `\"true\"`, includes `actor_only` activities from other actors if the caller holds `activity:read`.",
|
|
2439
|
+
"enum": ["true", "false"],
|
|
2440
|
+
"name": "include_private",
|
|
2441
|
+
"required": false,
|
|
2442
|
+
"type": "string"
|
|
2443
|
+
},
|
|
2444
|
+
{
|
|
2445
|
+
"description": "Include activity at or after this ISO 8601 timestamp.",
|
|
2446
|
+
"enum": null,
|
|
2447
|
+
"name": "since",
|
|
2448
|
+
"required": false,
|
|
2449
|
+
"type": "string"
|
|
2450
|
+
},
|
|
2451
|
+
{
|
|
2452
|
+
"description": "Include activity at or before this ISO 8601 timestamp.",
|
|
2453
|
+
"enum": null,
|
|
2454
|
+
"name": "until",
|
|
2455
|
+
"required": false,
|
|
2456
|
+
"type": "string"
|
|
2457
|
+
},
|
|
2458
|
+
{
|
|
2459
|
+
"default": 50,
|
|
2460
|
+
"description": "Maximum actors to return, from 1 to 100; defaults to 50.",
|
|
2461
|
+
"enum": null,
|
|
2462
|
+
"maximum": 100,
|
|
2463
|
+
"minimum": 1,
|
|
2464
|
+
"name": "limit",
|
|
2465
|
+
"required": false,
|
|
2466
|
+
"type": "integer"
|
|
2467
|
+
}
|
|
2468
|
+
],
|
|
2469
|
+
"headerParams": [],
|
|
2470
|
+
"permissions": ["mail.activity:read"],
|
|
2471
|
+
"access": null,
|
|
2472
|
+
"requestSchema": null,
|
|
2473
|
+
"responseSchema": {
|
|
2474
|
+
"type": "object",
|
|
2475
|
+
"additionalProperties": false,
|
|
2476
|
+
"required": ["actors"],
|
|
2477
|
+
"properties": { "actors": {
|
|
2478
|
+
"type": "array",
|
|
2479
|
+
"items": {
|
|
2480
|
+
"type": "object",
|
|
2481
|
+
"additionalProperties": false,
|
|
2482
|
+
"required": [
|
|
2483
|
+
"actor",
|
|
2484
|
+
"threads_touched",
|
|
2485
|
+
"verified_events",
|
|
2486
|
+
"work_total",
|
|
2487
|
+
"work_succeeded",
|
|
2488
|
+
"work_failed",
|
|
2489
|
+
"work_needs_review",
|
|
2490
|
+
"work_started",
|
|
2491
|
+
"work_skipped",
|
|
2492
|
+
"recent_actions",
|
|
2493
|
+
"first_active_at",
|
|
2494
|
+
"last_active_at"
|
|
2495
|
+
],
|
|
2496
|
+
"properties": {
|
|
2497
|
+
"actor": {
|
|
2498
|
+
"type": "object",
|
|
2499
|
+
"additionalProperties": false,
|
|
2500
|
+
"required": [
|
|
2501
|
+
"kind",
|
|
2502
|
+
"id",
|
|
2503
|
+
"label",
|
|
2504
|
+
"ownership",
|
|
2505
|
+
"owner_user_id",
|
|
2506
|
+
"owner_label",
|
|
2507
|
+
"agent_connection_id",
|
|
2508
|
+
"oauth_client_id"
|
|
2509
|
+
],
|
|
2510
|
+
"properties": {
|
|
2511
|
+
"kind": { "type": "string" },
|
|
2512
|
+
"id": {
|
|
2513
|
+
"type": ["string", "null"],
|
|
2514
|
+
"format": "uuid"
|
|
2515
|
+
},
|
|
2516
|
+
"label": { "type": ["string", "null"] },
|
|
2517
|
+
"ownership": {
|
|
2518
|
+
"type": "string",
|
|
2519
|
+
"enum": [
|
|
2520
|
+
"human",
|
|
2521
|
+
"personal_agent",
|
|
2522
|
+
"org_key",
|
|
2523
|
+
"function",
|
|
2524
|
+
"app",
|
|
2525
|
+
"system"
|
|
2526
|
+
],
|
|
2527
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
2528
|
+
},
|
|
2529
|
+
"owner_user_id": {
|
|
2530
|
+
"type": ["string", "null"],
|
|
2531
|
+
"format": "uuid"
|
|
2532
|
+
},
|
|
2533
|
+
"owner_label": { "type": ["string", "null"] },
|
|
2534
|
+
"agent_connection_id": {
|
|
2535
|
+
"type": ["string", "null"],
|
|
2536
|
+
"format": "uuid"
|
|
2537
|
+
},
|
|
2538
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
2539
|
+
}
|
|
2540
|
+
},
|
|
2541
|
+
"threads_touched": {
|
|
2542
|
+
"type": "integer",
|
|
2543
|
+
"minimum": 0
|
|
2544
|
+
},
|
|
2545
|
+
"verified_events": {
|
|
2546
|
+
"type": "integer",
|
|
2547
|
+
"minimum": 0
|
|
2548
|
+
},
|
|
2549
|
+
"work_total": {
|
|
2550
|
+
"type": "integer",
|
|
2551
|
+
"minimum": 0
|
|
2552
|
+
},
|
|
2553
|
+
"work_succeeded": {
|
|
2554
|
+
"type": "integer",
|
|
2555
|
+
"minimum": 0
|
|
2556
|
+
},
|
|
2557
|
+
"work_failed": {
|
|
2558
|
+
"type": "integer",
|
|
2559
|
+
"minimum": 0
|
|
2560
|
+
},
|
|
2561
|
+
"work_needs_review": {
|
|
2562
|
+
"type": "integer",
|
|
2563
|
+
"minimum": 0
|
|
2564
|
+
},
|
|
2565
|
+
"work_started": {
|
|
2566
|
+
"type": "integer",
|
|
2567
|
+
"minimum": 0
|
|
2568
|
+
},
|
|
2569
|
+
"work_skipped": {
|
|
2570
|
+
"type": "integer",
|
|
2571
|
+
"minimum": 0
|
|
2572
|
+
},
|
|
2573
|
+
"recent_actions": {
|
|
2574
|
+
"type": "array",
|
|
2575
|
+
"items": { "type": "string" }
|
|
2576
|
+
},
|
|
2577
|
+
"first_active_at": {
|
|
2578
|
+
"type": "string",
|
|
2579
|
+
"format": "date-time"
|
|
2580
|
+
},
|
|
2581
|
+
"last_active_at": {
|
|
2582
|
+
"type": "string",
|
|
2583
|
+
"format": "date-time"
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
} }
|
|
2588
|
+
},
|
|
2589
|
+
"sdkName": "listMailActivityActors",
|
|
2590
|
+
"summary": "List deployed agents, keys, functions, and apps with mail activity rollups",
|
|
2591
|
+
"tag": "Activity",
|
|
2592
|
+
"tagCommand": "activity"
|
|
2593
|
+
},
|
|
2594
|
+
{
|
|
2595
|
+
"binaryResponse": false,
|
|
2596
|
+
"bodyRequired": false,
|
|
2597
|
+
"command": "list-org-mail-activity",
|
|
2598
|
+
"description": "Returns a cursor-paginated feed (JSON by default, or CSV when\n`format=csv`) of verified Primitive mail actions and agent-reported\nthread activities across all threads within the caller's mail scope.\nFilter by actor, human owner of a key or personal agent, OAuth client,\naction, status, run_id, or time window.\n",
|
|
2599
|
+
"hasJsonBody": false,
|
|
2600
|
+
"method": "GET",
|
|
2601
|
+
"operationId": "listOrgMailActivity",
|
|
2602
|
+
"path": "/activity/mail",
|
|
2603
|
+
"pathParams": [],
|
|
2604
|
+
"queryParams": [
|
|
2605
|
+
{
|
|
2606
|
+
"description": "Filter by source: all (default), primitive, or agent.",
|
|
2607
|
+
"enum": null,
|
|
2608
|
+
"name": "source",
|
|
2609
|
+
"required": false,
|
|
2610
|
+
"type": "string"
|
|
2611
|
+
},
|
|
2612
|
+
{
|
|
2613
|
+
"description": "Limit to a single thread UUID.",
|
|
2614
|
+
"enum": null,
|
|
2615
|
+
"name": "thread_id",
|
|
2616
|
+
"required": false,
|
|
2617
|
+
"type": "string"
|
|
2618
|
+
},
|
|
2619
|
+
{
|
|
2620
|
+
"description": "Limit to entries anchored to an inbound email UUID.",
|
|
2621
|
+
"enum": null,
|
|
2622
|
+
"name": "email_id",
|
|
2623
|
+
"required": false,
|
|
2624
|
+
"type": "string"
|
|
2625
|
+
},
|
|
2626
|
+
{
|
|
2627
|
+
"description": "Limit to entries anchored to an outbound sent email UUID.",
|
|
2628
|
+
"enum": null,
|
|
2629
|
+
"name": "sent_email_id",
|
|
2630
|
+
"required": false,
|
|
2631
|
+
"type": "string"
|
|
2632
|
+
},
|
|
2633
|
+
{
|
|
2634
|
+
"description": "For agent activities: action, note, or handoff.",
|
|
2635
|
+
"enum": null,
|
|
2636
|
+
"name": "kind",
|
|
2637
|
+
"required": false,
|
|
2638
|
+
"type": "string"
|
|
2639
|
+
},
|
|
2640
|
+
{
|
|
2641
|
+
"description": "For agent activities: comma-separated statuses from started, succeeded, failed, skipped, needs_review.",
|
|
2642
|
+
"enum": null,
|
|
2643
|
+
"name": "status",
|
|
2644
|
+
"required": false,
|
|
2645
|
+
"type": "string"
|
|
2646
|
+
},
|
|
2647
|
+
{
|
|
2648
|
+
"description": "When `\"true\"`, limits to agent activities with status `failed` or `needs_review`.",
|
|
2649
|
+
"enum": ["true", "false"],
|
|
2650
|
+
"name": "attention",
|
|
2651
|
+
"required": false,
|
|
2652
|
+
"type": "string"
|
|
2653
|
+
},
|
|
2654
|
+
{
|
|
2655
|
+
"description": "Exact action name filter.",
|
|
2656
|
+
"enum": null,
|
|
2657
|
+
"name": "action",
|
|
2658
|
+
"required": false,
|
|
2659
|
+
"type": "string"
|
|
2660
|
+
},
|
|
2661
|
+
{
|
|
2662
|
+
"description": "Filter by actor kind (member, org_key, connected_key, function_key, oauth, agent_delegate).",
|
|
2663
|
+
"enum": null,
|
|
2664
|
+
"name": "actor_kind",
|
|
2665
|
+
"required": false,
|
|
2666
|
+
"type": "string"
|
|
2667
|
+
},
|
|
2668
|
+
{
|
|
2669
|
+
"description": "Filter by actor ownership class: human, personal_agent, org_key, function, app, or system.",
|
|
2670
|
+
"enum": null,
|
|
2671
|
+
"name": "actor_ownership",
|
|
2672
|
+
"required": false,
|
|
2673
|
+
"type": "string"
|
|
2674
|
+
},
|
|
2675
|
+
{
|
|
2676
|
+
"description": "Filter by specific actor UUID.",
|
|
2677
|
+
"enum": null,
|
|
2678
|
+
"name": "actor_id",
|
|
2679
|
+
"required": false,
|
|
2680
|
+
"type": "string"
|
|
2681
|
+
},
|
|
2682
|
+
{
|
|
2683
|
+
"description": "Filter to actions taken by a human member or by API keys, OAuth grants, and personal agents owned by that member.",
|
|
2684
|
+
"enum": null,
|
|
2685
|
+
"name": "owner_user_id",
|
|
2686
|
+
"required": false,
|
|
2687
|
+
"type": "string"
|
|
2688
|
+
},
|
|
2689
|
+
{
|
|
2690
|
+
"description": "Filter to actions taken through a specific OAuth client id.",
|
|
2691
|
+
"enum": null,
|
|
2692
|
+
"name": "oauth_client_id",
|
|
2693
|
+
"required": false,
|
|
2694
|
+
"type": "string"
|
|
2695
|
+
},
|
|
2696
|
+
{
|
|
2697
|
+
"description": "Filter to entries sharing a run_id.",
|
|
2698
|
+
"enum": null,
|
|
2699
|
+
"name": "run_id",
|
|
2700
|
+
"required": false,
|
|
2701
|
+
"type": "string"
|
|
2702
|
+
},
|
|
2703
|
+
{
|
|
2704
|
+
"description": "When `\"true\"`, includes `actor_only` activities from other actors if the caller holds `activity:read`.",
|
|
2705
|
+
"enum": ["true", "false"],
|
|
2706
|
+
"name": "include_private",
|
|
2707
|
+
"required": false,
|
|
2708
|
+
"type": "string"
|
|
2709
|
+
},
|
|
2710
|
+
{
|
|
2711
|
+
"description": "Include entries at or after this ISO 8601 timestamp.",
|
|
2712
|
+
"enum": null,
|
|
2713
|
+
"name": "since",
|
|
2714
|
+
"required": false,
|
|
2715
|
+
"type": "string"
|
|
2716
|
+
},
|
|
2717
|
+
{
|
|
2718
|
+
"description": "Include entries at or before this ISO 8601 timestamp.",
|
|
2719
|
+
"enum": null,
|
|
2720
|
+
"name": "until",
|
|
2721
|
+
"required": false,
|
|
2722
|
+
"type": "string"
|
|
2723
|
+
},
|
|
2724
|
+
{
|
|
2725
|
+
"description": "Response format: json (default) or csv.",
|
|
2726
|
+
"enum": ["json", "csv"],
|
|
2727
|
+
"name": "format",
|
|
2728
|
+
"required": false,
|
|
2729
|
+
"type": "string"
|
|
2730
|
+
},
|
|
2731
|
+
{
|
|
2732
|
+
"default": 50,
|
|
2733
|
+
"description": "Items per page, from 1 to 200; defaults to 50.",
|
|
2734
|
+
"enum": null,
|
|
2735
|
+
"maximum": 200,
|
|
2736
|
+
"minimum": 1,
|
|
2737
|
+
"name": "limit",
|
|
2738
|
+
"required": false,
|
|
2739
|
+
"type": "integer"
|
|
2740
|
+
},
|
|
2741
|
+
{
|
|
2742
|
+
"description": "`next_cursor` from the previous page.",
|
|
2743
|
+
"enum": null,
|
|
2744
|
+
"name": "cursor",
|
|
2745
|
+
"required": false,
|
|
2746
|
+
"type": "string"
|
|
2747
|
+
}
|
|
2748
|
+
],
|
|
2749
|
+
"headerParams": [],
|
|
2750
|
+
"permissions": ["mail.activity:read"],
|
|
2751
|
+
"access": null,
|
|
2752
|
+
"requestSchema": null,
|
|
2753
|
+
"responseSchema": {
|
|
2754
|
+
"type": "object",
|
|
2755
|
+
"additionalProperties": false,
|
|
2756
|
+
"required": ["items", "next_cursor"],
|
|
2757
|
+
"properties": {
|
|
2758
|
+
"items": {
|
|
2759
|
+
"type": "array",
|
|
2760
|
+
"items": {
|
|
2761
|
+
"description": "A single entry in a thread or org activity timeline. `source` `\"primitive\"` is a verified Primitive mail event; `\"agent\"` is an agent-reported work record.",
|
|
2762
|
+
"oneOf": [{
|
|
2763
|
+
"type": "object",
|
|
2764
|
+
"additionalProperties": false,
|
|
2765
|
+
"required": [
|
|
2766
|
+
"id",
|
|
2767
|
+
"source",
|
|
2768
|
+
"thread_id",
|
|
2769
|
+
"email_id",
|
|
2770
|
+
"sent_email_id",
|
|
2771
|
+
"mailbox_address",
|
|
2772
|
+
"action",
|
|
2773
|
+
"actor",
|
|
2774
|
+
"request_id",
|
|
2775
|
+
"reason",
|
|
2776
|
+
"run_id",
|
|
2777
|
+
"metadata",
|
|
2778
|
+
"occurred_at"
|
|
2779
|
+
],
|
|
2780
|
+
"properties": {
|
|
2781
|
+
"id": {
|
|
2782
|
+
"type": "string",
|
|
2783
|
+
"format": "uuid"
|
|
2784
|
+
},
|
|
2785
|
+
"source": {
|
|
2786
|
+
"type": "string",
|
|
2787
|
+
"enum": ["primitive"]
|
|
2788
|
+
},
|
|
2789
|
+
"thread_id": {
|
|
2790
|
+
"type": ["string", "null"],
|
|
2791
|
+
"format": "uuid"
|
|
2792
|
+
},
|
|
2793
|
+
"email_id": {
|
|
2794
|
+
"type": ["string", "null"],
|
|
2795
|
+
"format": "uuid"
|
|
2796
|
+
},
|
|
2797
|
+
"sent_email_id": {
|
|
2798
|
+
"type": ["string", "null"],
|
|
2799
|
+
"format": "uuid"
|
|
2800
|
+
},
|
|
2801
|
+
"mailbox_address": { "type": ["string", "null"] },
|
|
2802
|
+
"action": {
|
|
2803
|
+
"type": "string",
|
|
2804
|
+
"enum": [
|
|
2805
|
+
"email.read",
|
|
2806
|
+
"email.readable_read",
|
|
2807
|
+
"email.conversation_read",
|
|
2808
|
+
"email.raw_read",
|
|
2809
|
+
"email.attachment_read",
|
|
2810
|
+
"email.replied",
|
|
2811
|
+
"email.sent",
|
|
2812
|
+
"email.signaled",
|
|
2813
|
+
"email.deleted",
|
|
2814
|
+
"email.content_discarded"
|
|
2815
|
+
],
|
|
2816
|
+
"description": "System-verified mail action recorded automatically by Primitive."
|
|
2817
|
+
},
|
|
2818
|
+
"actor": {
|
|
2819
|
+
"type": "object",
|
|
2820
|
+
"additionalProperties": false,
|
|
2821
|
+
"required": [
|
|
2822
|
+
"kind",
|
|
2823
|
+
"id",
|
|
2824
|
+
"label",
|
|
2825
|
+
"ownership",
|
|
2826
|
+
"owner_user_id",
|
|
2827
|
+
"owner_label",
|
|
2828
|
+
"agent_connection_id",
|
|
2829
|
+
"oauth_client_id"
|
|
2830
|
+
],
|
|
2831
|
+
"properties": {
|
|
2832
|
+
"kind": { "type": "string" },
|
|
2833
|
+
"id": {
|
|
2834
|
+
"type": ["string", "null"],
|
|
2835
|
+
"format": "uuid"
|
|
2836
|
+
},
|
|
2837
|
+
"label": { "type": ["string", "null"] },
|
|
2838
|
+
"ownership": {
|
|
2839
|
+
"type": "string",
|
|
2840
|
+
"enum": [
|
|
2841
|
+
"human",
|
|
2842
|
+
"personal_agent",
|
|
2843
|
+
"org_key",
|
|
2844
|
+
"function",
|
|
2845
|
+
"app",
|
|
2846
|
+
"system"
|
|
2847
|
+
],
|
|
2848
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
2849
|
+
},
|
|
2850
|
+
"owner_user_id": {
|
|
2851
|
+
"type": ["string", "null"],
|
|
2852
|
+
"format": "uuid"
|
|
2853
|
+
},
|
|
2854
|
+
"owner_label": { "type": ["string", "null"] },
|
|
2855
|
+
"agent_connection_id": {
|
|
2856
|
+
"type": ["string", "null"],
|
|
2857
|
+
"format": "uuid"
|
|
2858
|
+
},
|
|
2859
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
2860
|
+
}
|
|
2861
|
+
},
|
|
2862
|
+
"request_id": { "type": ["string", "null"] },
|
|
2863
|
+
"reason": { "type": ["string", "null"] },
|
|
2864
|
+
"run_id": { "type": ["string", "null"] },
|
|
2865
|
+
"metadata": {
|
|
2866
|
+
"type": "object",
|
|
2867
|
+
"additionalProperties": true
|
|
2868
|
+
},
|
|
2869
|
+
"occurred_at": {
|
|
2870
|
+
"type": "string",
|
|
2871
|
+
"format": "date-time"
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
}, {
|
|
2875
|
+
"type": "object",
|
|
2876
|
+
"additionalProperties": false,
|
|
2877
|
+
"required": [
|
|
2878
|
+
"id",
|
|
2879
|
+
"source",
|
|
2880
|
+
"thread_id",
|
|
2881
|
+
"email_id",
|
|
2882
|
+
"sent_email_id",
|
|
2883
|
+
"actor",
|
|
2884
|
+
"kind",
|
|
2885
|
+
"action",
|
|
2886
|
+
"status",
|
|
2887
|
+
"summary",
|
|
2888
|
+
"detail",
|
|
2889
|
+
"external_ref",
|
|
2890
|
+
"data",
|
|
2891
|
+
"run_id",
|
|
2892
|
+
"trace_url",
|
|
2893
|
+
"idempotency_key",
|
|
2894
|
+
"visibility",
|
|
2895
|
+
"revision",
|
|
2896
|
+
"status_history",
|
|
2897
|
+
"started_at",
|
|
2898
|
+
"completed_at",
|
|
2899
|
+
"updated_by",
|
|
2900
|
+
"created_at",
|
|
2901
|
+
"updated_at",
|
|
2902
|
+
"occurred_at"
|
|
2903
|
+
],
|
|
2904
|
+
"properties": {
|
|
2905
|
+
"id": {
|
|
2906
|
+
"type": "string",
|
|
2907
|
+
"format": "uuid"
|
|
2908
|
+
},
|
|
2909
|
+
"source": {
|
|
2910
|
+
"type": "string",
|
|
2911
|
+
"enum": ["agent"]
|
|
2912
|
+
},
|
|
2913
|
+
"thread_id": {
|
|
2914
|
+
"type": "string",
|
|
2915
|
+
"format": "uuid"
|
|
2916
|
+
},
|
|
2917
|
+
"email_id": {
|
|
2918
|
+
"type": ["string", "null"],
|
|
2919
|
+
"format": "uuid"
|
|
2920
|
+
},
|
|
2921
|
+
"sent_email_id": {
|
|
2922
|
+
"type": ["string", "null"],
|
|
2923
|
+
"format": "uuid"
|
|
2924
|
+
},
|
|
2925
|
+
"actor": {
|
|
2926
|
+
"type": "object",
|
|
2927
|
+
"additionalProperties": false,
|
|
2928
|
+
"required": [
|
|
2929
|
+
"kind",
|
|
2930
|
+
"id",
|
|
2931
|
+
"label",
|
|
2932
|
+
"ownership",
|
|
2933
|
+
"owner_user_id",
|
|
2934
|
+
"owner_label",
|
|
2935
|
+
"agent_connection_id",
|
|
2936
|
+
"oauth_client_id"
|
|
2937
|
+
],
|
|
2938
|
+
"properties": {
|
|
2939
|
+
"kind": { "type": "string" },
|
|
2940
|
+
"id": {
|
|
2941
|
+
"type": ["string", "null"],
|
|
2942
|
+
"format": "uuid"
|
|
2943
|
+
},
|
|
2944
|
+
"label": { "type": ["string", "null"] },
|
|
2945
|
+
"ownership": {
|
|
2946
|
+
"type": "string",
|
|
2947
|
+
"enum": [
|
|
2948
|
+
"human",
|
|
2949
|
+
"personal_agent",
|
|
2950
|
+
"org_key",
|
|
2951
|
+
"function",
|
|
2952
|
+
"app",
|
|
2953
|
+
"system"
|
|
2954
|
+
],
|
|
2955
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
2956
|
+
},
|
|
2957
|
+
"owner_user_id": {
|
|
2958
|
+
"type": ["string", "null"],
|
|
2959
|
+
"format": "uuid"
|
|
2960
|
+
},
|
|
2961
|
+
"owner_label": { "type": ["string", "null"] },
|
|
2962
|
+
"agent_connection_id": {
|
|
2963
|
+
"type": ["string", "null"],
|
|
2964
|
+
"format": "uuid"
|
|
2965
|
+
},
|
|
2966
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
2967
|
+
}
|
|
2968
|
+
},
|
|
2969
|
+
"kind": {
|
|
2970
|
+
"type": "string",
|
|
2971
|
+
"enum": [
|
|
2972
|
+
"action",
|
|
2973
|
+
"note",
|
|
2974
|
+
"handoff"
|
|
2975
|
+
],
|
|
2976
|
+
"description": "Category of an agent-reported thread activity."
|
|
2977
|
+
},
|
|
2978
|
+
"action": { "type": "string" },
|
|
2979
|
+
"status": {
|
|
2980
|
+
"type": "string",
|
|
2981
|
+
"enum": [
|
|
2982
|
+
"started",
|
|
2983
|
+
"succeeded",
|
|
2984
|
+
"failed",
|
|
2985
|
+
"skipped",
|
|
2986
|
+
"needs_review"
|
|
2987
|
+
],
|
|
2988
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
2989
|
+
},
|
|
2990
|
+
"summary": { "type": "string" },
|
|
2991
|
+
"detail": { "type": ["string", "null"] },
|
|
2992
|
+
"external_ref": { "oneOf": [{
|
|
2993
|
+
"type": "object",
|
|
2994
|
+
"additionalProperties": false,
|
|
2995
|
+
"required": ["system"],
|
|
2996
|
+
"properties": {
|
|
2997
|
+
"system": {
|
|
2998
|
+
"type": "string",
|
|
2999
|
+
"minLength": 1,
|
|
3000
|
+
"maxLength": 64,
|
|
3001
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
3002
|
+
},
|
|
3003
|
+
"id": {
|
|
3004
|
+
"type": "string",
|
|
3005
|
+
"minLength": 1,
|
|
3006
|
+
"maxLength": 255,
|
|
3007
|
+
"description": "External record identifier."
|
|
3008
|
+
},
|
|
3009
|
+
"url": {
|
|
3010
|
+
"type": "string",
|
|
3011
|
+
"maxLength": 2048,
|
|
3012
|
+
"description": "HTTP(S) link to the external record (validated as an `http://` or `https://` URL)."
|
|
3013
|
+
},
|
|
3014
|
+
"label": {
|
|
3015
|
+
"type": "string",
|
|
3016
|
+
"minLength": 1,
|
|
3017
|
+
"maxLength": 200,
|
|
3018
|
+
"description": "Human-readable display label for the external record."
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
3021
|
+
}, { "type": "null" }] },
|
|
3022
|
+
"data": {
|
|
3023
|
+
"type": "object",
|
|
3024
|
+
"additionalProperties": true
|
|
3025
|
+
},
|
|
3026
|
+
"run_id": { "type": ["string", "null"] },
|
|
3027
|
+
"trace_url": { "type": ["string", "null"] },
|
|
3028
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
3029
|
+
"visibility": {
|
|
3030
|
+
"type": "string",
|
|
3031
|
+
"enum": ["thread", "actor_only"],
|
|
3032
|
+
"description": "Visibility of a thread activity (`thread` is shared with scoped readers; `actor_only` is private to the creating actor unless an auditor passes `include_private=true`)."
|
|
3033
|
+
},
|
|
3034
|
+
"revision": {
|
|
3035
|
+
"type": "integer",
|
|
3036
|
+
"minimum": 1
|
|
3037
|
+
},
|
|
3038
|
+
"status_history": {
|
|
3039
|
+
"type": "array",
|
|
3040
|
+
"items": {
|
|
3041
|
+
"type": "object",
|
|
3042
|
+
"additionalProperties": false,
|
|
3043
|
+
"required": [
|
|
3044
|
+
"status",
|
|
3045
|
+
"summary",
|
|
3046
|
+
"changed_at",
|
|
3047
|
+
"actor_kind",
|
|
3048
|
+
"actor_id",
|
|
3049
|
+
"actor_label"
|
|
3050
|
+
],
|
|
3051
|
+
"properties": {
|
|
3052
|
+
"status": {
|
|
3053
|
+
"type": "string",
|
|
3054
|
+
"enum": [
|
|
3055
|
+
"started",
|
|
3056
|
+
"succeeded",
|
|
3057
|
+
"failed",
|
|
3058
|
+
"skipped",
|
|
3059
|
+
"needs_review"
|
|
3060
|
+
],
|
|
3061
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
3062
|
+
},
|
|
3063
|
+
"summary": { "type": "string" },
|
|
3064
|
+
"changed_at": {
|
|
3065
|
+
"type": "string",
|
|
3066
|
+
"format": "date-time"
|
|
3067
|
+
},
|
|
3068
|
+
"actor_kind": { "type": "string" },
|
|
3069
|
+
"actor_id": {
|
|
3070
|
+
"type": ["string", "null"],
|
|
3071
|
+
"format": "uuid"
|
|
3072
|
+
},
|
|
3073
|
+
"actor_label": { "type": ["string", "null"] }
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
},
|
|
3077
|
+
"started_at": {
|
|
3078
|
+
"type": "string",
|
|
3079
|
+
"format": "date-time"
|
|
3080
|
+
},
|
|
3081
|
+
"completed_at": {
|
|
3082
|
+
"type": ["string", "null"],
|
|
3083
|
+
"format": "date-time"
|
|
3084
|
+
},
|
|
3085
|
+
"updated_by": { "oneOf": [{
|
|
3086
|
+
"type": "object",
|
|
3087
|
+
"additionalProperties": false,
|
|
3088
|
+
"required": [
|
|
3089
|
+
"kind",
|
|
3090
|
+
"id",
|
|
3091
|
+
"label"
|
|
3092
|
+
],
|
|
3093
|
+
"properties": {
|
|
3094
|
+
"kind": { "type": "string" },
|
|
3095
|
+
"id": {
|
|
3096
|
+
"type": ["string", "null"],
|
|
3097
|
+
"format": "uuid"
|
|
3098
|
+
},
|
|
3099
|
+
"label": { "type": ["string", "null"] }
|
|
3100
|
+
}
|
|
3101
|
+
}, { "type": "null" }] },
|
|
3102
|
+
"created_at": {
|
|
3103
|
+
"type": "string",
|
|
3104
|
+
"format": "date-time"
|
|
3105
|
+
},
|
|
3106
|
+
"updated_at": {
|
|
3107
|
+
"type": "string",
|
|
3108
|
+
"format": "date-time"
|
|
3109
|
+
},
|
|
3110
|
+
"occurred_at": {
|
|
3111
|
+
"type": "string",
|
|
3112
|
+
"format": "date-time"
|
|
3113
|
+
}
|
|
3114
|
+
}
|
|
3115
|
+
}],
|
|
3116
|
+
"discriminator": {
|
|
3117
|
+
"propertyName": "source",
|
|
3118
|
+
"mapping": {
|
|
3119
|
+
"primitive": "#/components/schemas/MailActivityEvent",
|
|
3120
|
+
"agent": "#/components/schemas/ThreadActivity"
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3124
|
+
},
|
|
3125
|
+
"next_cursor": { "type": ["string", "null"] }
|
|
840
3126
|
}
|
|
841
|
-
|
|
3127
|
+
},
|
|
3128
|
+
"sdkName": "listOrgMailActivity",
|
|
3129
|
+
"summary": "Search verified mail actions and agent work across the organization",
|
|
3130
|
+
"tag": "Activity",
|
|
3131
|
+
"tagCommand": "activity"
|
|
3132
|
+
},
|
|
3133
|
+
{
|
|
3134
|
+
"binaryResponse": false,
|
|
3135
|
+
"bodyRequired": true,
|
|
3136
|
+
"command": "update-thread-activity",
|
|
3137
|
+
"description": "Updates the status, summary, detail, external_ref, data, run_id,\ntrace_url, or visibility of a thread activity. The creating actor may\nupdate any field; an organization member with `mail.activity:write`\ncovering the thread may resolve a `needs_review` or `handoff` activity.\n",
|
|
3138
|
+
"hasJsonBody": true,
|
|
3139
|
+
"method": "PATCH",
|
|
3140
|
+
"operationId": "updateThreadActivity",
|
|
3141
|
+
"path": "/threads/{id}/activities/{activity_id}",
|
|
3142
|
+
"pathParams": [{
|
|
3143
|
+
"description": "Thread UUID.",
|
|
3144
|
+
"enum": null,
|
|
3145
|
+
"name": "id",
|
|
3146
|
+
"required": true,
|
|
3147
|
+
"type": "string"
|
|
3148
|
+
}, {
|
|
3149
|
+
"description": "Thread activity UUID.",
|
|
3150
|
+
"enum": null,
|
|
3151
|
+
"name": "activity_id",
|
|
3152
|
+
"required": true,
|
|
3153
|
+
"type": "string"
|
|
3154
|
+
}],
|
|
3155
|
+
"queryParams": [],
|
|
842
3156
|
"headerParams": [],
|
|
843
|
-
"permissions": ["activity:
|
|
3157
|
+
"permissions": ["mail.activity:write"],
|
|
844
3158
|
"access": null,
|
|
845
|
-
"requestSchema":
|
|
846
|
-
"responseSchema": {
|
|
3159
|
+
"requestSchema": {
|
|
847
3160
|
"type": "object",
|
|
3161
|
+
"additionalProperties": false,
|
|
848
3162
|
"properties": {
|
|
849
|
-
"
|
|
3163
|
+
"status": {
|
|
850
3164
|
"type": "string",
|
|
851
|
-
"
|
|
3165
|
+
"enum": [
|
|
3166
|
+
"started",
|
|
3167
|
+
"succeeded",
|
|
3168
|
+
"failed",
|
|
3169
|
+
"skipped",
|
|
3170
|
+
"needs_review"
|
|
3171
|
+
],
|
|
3172
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
852
3173
|
},
|
|
853
|
-
"
|
|
854
|
-
"type": "
|
|
855
|
-
"
|
|
3174
|
+
"summary": {
|
|
3175
|
+
"type": "string",
|
|
3176
|
+
"minLength": 1,
|
|
3177
|
+
"maxLength": 1e3
|
|
3178
|
+
},
|
|
3179
|
+
"detail": {
|
|
3180
|
+
"type": ["string", "null"],
|
|
3181
|
+
"maxLength": 8e3
|
|
3182
|
+
},
|
|
3183
|
+
"external_ref": { "oneOf": [{
|
|
3184
|
+
"type": "object",
|
|
3185
|
+
"additionalProperties": false,
|
|
3186
|
+
"required": ["system"],
|
|
3187
|
+
"properties": {
|
|
3188
|
+
"system": {
|
|
3189
|
+
"type": "string",
|
|
3190
|
+
"minLength": 1,
|
|
3191
|
+
"maxLength": 64,
|
|
3192
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
3193
|
+
},
|
|
3194
|
+
"id": {
|
|
3195
|
+
"type": "string",
|
|
3196
|
+
"minLength": 1,
|
|
3197
|
+
"maxLength": 255,
|
|
3198
|
+
"description": "External record identifier."
|
|
3199
|
+
},
|
|
3200
|
+
"url": {
|
|
3201
|
+
"type": "string",
|
|
3202
|
+
"maxLength": 2048,
|
|
3203
|
+
"description": "HTTP(S) link to the external record (validated as an `http://` or `https://` URL)."
|
|
3204
|
+
},
|
|
3205
|
+
"label": {
|
|
3206
|
+
"type": "string",
|
|
3207
|
+
"minLength": 1,
|
|
3208
|
+
"maxLength": 200,
|
|
3209
|
+
"description": "Human-readable display label for the external record."
|
|
3210
|
+
}
|
|
3211
|
+
}
|
|
3212
|
+
}, { "type": "null" }] },
|
|
3213
|
+
"data": {
|
|
3214
|
+
"type": "object",
|
|
3215
|
+
"additionalProperties": true
|
|
3216
|
+
},
|
|
3217
|
+
"run_id": {
|
|
3218
|
+
"type": ["string", "null"],
|
|
3219
|
+
"minLength": 1,
|
|
3220
|
+
"maxLength": 128,
|
|
3221
|
+
"pattern": "^[A-Za-z0-9._:/-]{1,128}$"
|
|
3222
|
+
},
|
|
3223
|
+
"trace_url": {
|
|
3224
|
+
"type": ["string", "null"],
|
|
3225
|
+
"maxLength": 2048,
|
|
3226
|
+
"description": "Optional `http://` or `https://` URL linking to an execution trace for this activity."
|
|
3227
|
+
},
|
|
3228
|
+
"visibility": {
|
|
3229
|
+
"type": "string",
|
|
3230
|
+
"enum": ["thread", "actor_only"],
|
|
3231
|
+
"description": "Visibility of a thread activity (`thread` is shared with scoped readers; `actor_only` is private to the creating actor unless an auditor passes `include_private=true`)."
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3234
|
+
},
|
|
3235
|
+
"responseSchema": {
|
|
3236
|
+
"type": "object",
|
|
3237
|
+
"additionalProperties": false,
|
|
3238
|
+
"required": ["activity"],
|
|
3239
|
+
"properties": { "activity": {
|
|
3240
|
+
"type": "object",
|
|
3241
|
+
"additionalProperties": false,
|
|
3242
|
+
"required": [
|
|
3243
|
+
"id",
|
|
3244
|
+
"source",
|
|
3245
|
+
"thread_id",
|
|
3246
|
+
"email_id",
|
|
3247
|
+
"sent_email_id",
|
|
3248
|
+
"actor",
|
|
3249
|
+
"kind",
|
|
3250
|
+
"action",
|
|
3251
|
+
"status",
|
|
3252
|
+
"summary",
|
|
3253
|
+
"detail",
|
|
3254
|
+
"external_ref",
|
|
3255
|
+
"data",
|
|
3256
|
+
"run_id",
|
|
3257
|
+
"trace_url",
|
|
3258
|
+
"idempotency_key",
|
|
3259
|
+
"visibility",
|
|
3260
|
+
"revision",
|
|
3261
|
+
"status_history",
|
|
3262
|
+
"started_at",
|
|
3263
|
+
"completed_at",
|
|
3264
|
+
"updated_by",
|
|
3265
|
+
"created_at",
|
|
3266
|
+
"updated_at",
|
|
3267
|
+
"occurred_at"
|
|
3268
|
+
],
|
|
3269
|
+
"properties": {
|
|
3270
|
+
"id": {
|
|
3271
|
+
"type": "string",
|
|
3272
|
+
"format": "uuid"
|
|
3273
|
+
},
|
|
3274
|
+
"source": {
|
|
3275
|
+
"type": "string",
|
|
3276
|
+
"enum": ["agent"]
|
|
3277
|
+
},
|
|
3278
|
+
"thread_id": {
|
|
3279
|
+
"type": "string",
|
|
3280
|
+
"format": "uuid"
|
|
3281
|
+
},
|
|
3282
|
+
"email_id": {
|
|
3283
|
+
"type": ["string", "null"],
|
|
3284
|
+
"format": "uuid"
|
|
3285
|
+
},
|
|
3286
|
+
"sent_email_id": {
|
|
3287
|
+
"type": ["string", "null"],
|
|
3288
|
+
"format": "uuid"
|
|
3289
|
+
},
|
|
3290
|
+
"actor": {
|
|
856
3291
|
"type": "object",
|
|
3292
|
+
"additionalProperties": false,
|
|
3293
|
+
"required": [
|
|
3294
|
+
"kind",
|
|
3295
|
+
"id",
|
|
3296
|
+
"label",
|
|
3297
|
+
"ownership",
|
|
3298
|
+
"owner_user_id",
|
|
3299
|
+
"owner_label",
|
|
3300
|
+
"agent_connection_id",
|
|
3301
|
+
"oauth_client_id"
|
|
3302
|
+
],
|
|
857
3303
|
"properties": {
|
|
858
|
-
"kind": {
|
|
859
|
-
|
|
860
|
-
"
|
|
861
|
-
|
|
862
|
-
"id": { "type": "string" },
|
|
863
|
-
"name": {
|
|
864
|
-
"description": "The name the object is known by: an endpoint's display name, a route's or filter's pattern, a Function's name, a send's From address, a wake schedule's command and the address it wakes, an API key's name, an agent's address, a rule's or rule request's name, and for an objection or a coverage notice the name its rule had then (for a stopped notice, when you were last told of it, or while it last covered you). Never a webhook URL and never mail content.",
|
|
865
|
-
"type": ["string", "null"]
|
|
3304
|
+
"kind": { "type": "string" },
|
|
3305
|
+
"id": {
|
|
3306
|
+
"type": ["string", "null"],
|
|
3307
|
+
"format": "uuid"
|
|
866
3308
|
},
|
|
867
|
-
"
|
|
3309
|
+
"label": { "type": ["string", "null"] },
|
|
3310
|
+
"ownership": {
|
|
868
3311
|
"type": "string",
|
|
869
|
-
"
|
|
3312
|
+
"enum": [
|
|
3313
|
+
"human",
|
|
3314
|
+
"personal_agent",
|
|
3315
|
+
"org_key",
|
|
3316
|
+
"function",
|
|
3317
|
+
"app",
|
|
3318
|
+
"system"
|
|
3319
|
+
],
|
|
3320
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
870
3321
|
},
|
|
871
|
-
"
|
|
872
|
-
"type": "string",
|
|
873
|
-
"format": "
|
|
3322
|
+
"owner_user_id": {
|
|
3323
|
+
"type": ["string", "null"],
|
|
3324
|
+
"format": "uuid"
|
|
874
3325
|
},
|
|
875
|
-
"
|
|
3326
|
+
"owner_label": { "type": ["string", "null"] },
|
|
3327
|
+
"agent_connection_id": {
|
|
876
3328
|
"type": ["string", "null"],
|
|
877
|
-
"format": "
|
|
878
|
-
"description": "When it was deleted, replaced or revoked, when an API key expired, when a repeating send stopped, or when a rule request or objection was decided (accepted, declined, withdrawn or, for an objection, amended); null otherwise, a closed objection included, as on every coverage notice."
|
|
3329
|
+
"format": "uuid"
|
|
879
3330
|
},
|
|
880
|
-
"
|
|
3331
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
3332
|
+
}
|
|
3333
|
+
},
|
|
3334
|
+
"kind": {
|
|
3335
|
+
"type": "string",
|
|
3336
|
+
"enum": [
|
|
3337
|
+
"action",
|
|
3338
|
+
"note",
|
|
3339
|
+
"handoff"
|
|
3340
|
+
],
|
|
3341
|
+
"description": "Category of an agent-reported thread activity."
|
|
3342
|
+
},
|
|
3343
|
+
"action": { "type": "string" },
|
|
3344
|
+
"status": {
|
|
3345
|
+
"type": "string",
|
|
3346
|
+
"enum": [
|
|
3347
|
+
"started",
|
|
3348
|
+
"succeeded",
|
|
3349
|
+
"failed",
|
|
3350
|
+
"skipped",
|
|
3351
|
+
"needs_review"
|
|
3352
|
+
],
|
|
3353
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
3354
|
+
},
|
|
3355
|
+
"summary": { "type": "string" },
|
|
3356
|
+
"detail": { "type": ["string", "null"] },
|
|
3357
|
+
"external_ref": { "oneOf": [{
|
|
3358
|
+
"type": "object",
|
|
3359
|
+
"additionalProperties": false,
|
|
3360
|
+
"required": ["system"],
|
|
3361
|
+
"properties": {
|
|
3362
|
+
"system": {
|
|
881
3363
|
"type": "string",
|
|
882
|
-
"
|
|
883
|
-
"
|
|
3364
|
+
"minLength": 1,
|
|
3365
|
+
"maxLength": 64,
|
|
3366
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
884
3367
|
},
|
|
885
|
-
"
|
|
886
|
-
"type": "
|
|
887
|
-
"
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
"description": "The kind of credential it was created through: org_key, function_key, connected_key, oauth, agent_delegate or member (the person themselves). With relation=asked, member: the member who asked or objected; with relation=concerning, member: the rule's author."
|
|
891
|
-
},
|
|
892
|
-
"id": {
|
|
893
|
-
"description": "In a person's view, the person's own user id for member, and an API key's id where they may read their keys (for a person limited to their own keys, only a key they still hold). Null otherwise, and always null in one credential's view, where it is the calling credential itself. With relation=asked, the user id of the member who asked or objected; with relation=concerning, of the rule's author.",
|
|
894
|
-
"type": ["string", "null"]
|
|
895
|
-
},
|
|
896
|
-
"name": {
|
|
897
|
-
"description": "In a person's view, what that credential of theirs is called: an app login by its app, an API key by its name, an agent's key by its address. Null otherwise, and for the person themselves. With relation=asked, the name of the member who asked or objected; with relation=concerning, of the rule's author.",
|
|
898
|
-
"type": ["string", "null"]
|
|
899
|
-
}
|
|
900
|
-
},
|
|
901
|
-
"required": [
|
|
902
|
-
"kind",
|
|
903
|
-
"id",
|
|
904
|
-
"name"
|
|
905
|
-
]
|
|
3368
|
+
"id": {
|
|
3369
|
+
"type": "string",
|
|
3370
|
+
"minLength": 1,
|
|
3371
|
+
"maxLength": 255,
|
|
3372
|
+
"description": "External record identifier."
|
|
906
3373
|
},
|
|
907
|
-
"
|
|
908
|
-
"description": "For email_rule_coverage, always: the rule it is about, since names need not be unique. GET /v1/email-rules/covering-me/{rule_id} shows the rule while it covers you, or as it last decided on your mail; otherwise it answers not_found. A deleted rule is told by a stopped notice with stop_reason deleted.",
|
|
3374
|
+
"url": {
|
|
909
3375
|
"type": "string",
|
|
910
|
-
"
|
|
3376
|
+
"maxLength": 2048,
|
|
3377
|
+
"description": "HTTP(S) link to the external record (validated as an `http://` or `https://` URL)."
|
|
911
3378
|
},
|
|
912
|
-
"
|
|
913
|
-
"description": "For a stopped notice: deleted, turned_off (set to draft), or no_longer_covers (in observe or active, reaching none of your mailboxes now). A rule moved from active back to observe still covers you and is not stopped.",
|
|
3379
|
+
"label": {
|
|
914
3380
|
"type": "string",
|
|
915
|
-
"
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
"no_longer_covers"
|
|
919
|
-
]
|
|
3381
|
+
"minLength": 1,
|
|
3382
|
+
"maxLength": 200,
|
|
3383
|
+
"description": "Human-readable display label for the external record."
|
|
920
3384
|
}
|
|
921
|
-
}
|
|
3385
|
+
}
|
|
3386
|
+
}, { "type": "null" }] },
|
|
3387
|
+
"data": {
|
|
3388
|
+
"type": "object",
|
|
3389
|
+
"additionalProperties": true
|
|
3390
|
+
},
|
|
3391
|
+
"run_id": { "type": ["string", "null"] },
|
|
3392
|
+
"trace_url": { "type": ["string", "null"] },
|
|
3393
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
3394
|
+
"visibility": {
|
|
3395
|
+
"type": "string",
|
|
3396
|
+
"enum": ["thread", "actor_only"],
|
|
3397
|
+
"description": "Visibility of a thread activity (`thread` is shared with scoped readers; `actor_only` is private to the creating actor unless an auditor passes `include_private=true`)."
|
|
3398
|
+
},
|
|
3399
|
+
"revision": {
|
|
3400
|
+
"type": "integer",
|
|
3401
|
+
"minimum": 1
|
|
3402
|
+
},
|
|
3403
|
+
"status_history": {
|
|
3404
|
+
"type": "array",
|
|
3405
|
+
"items": {
|
|
3406
|
+
"type": "object",
|
|
3407
|
+
"additionalProperties": false,
|
|
3408
|
+
"required": [
|
|
3409
|
+
"status",
|
|
3410
|
+
"summary",
|
|
3411
|
+
"changed_at",
|
|
3412
|
+
"actor_kind",
|
|
3413
|
+
"actor_id",
|
|
3414
|
+
"actor_label"
|
|
3415
|
+
],
|
|
3416
|
+
"properties": {
|
|
3417
|
+
"status": {
|
|
3418
|
+
"type": "string",
|
|
3419
|
+
"enum": [
|
|
3420
|
+
"started",
|
|
3421
|
+
"succeeded",
|
|
3422
|
+
"failed",
|
|
3423
|
+
"skipped",
|
|
3424
|
+
"needs_review"
|
|
3425
|
+
],
|
|
3426
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
3427
|
+
},
|
|
3428
|
+
"summary": { "type": "string" },
|
|
3429
|
+
"changed_at": {
|
|
3430
|
+
"type": "string",
|
|
3431
|
+
"format": "date-time"
|
|
3432
|
+
},
|
|
3433
|
+
"actor_kind": { "type": "string" },
|
|
3434
|
+
"actor_id": {
|
|
3435
|
+
"type": ["string", "null"],
|
|
3436
|
+
"format": "uuid"
|
|
3437
|
+
},
|
|
3438
|
+
"actor_label": { "type": ["string", "null"] }
|
|
3439
|
+
}
|
|
3440
|
+
}
|
|
3441
|
+
},
|
|
3442
|
+
"started_at": {
|
|
3443
|
+
"type": "string",
|
|
3444
|
+
"format": "date-time"
|
|
3445
|
+
},
|
|
3446
|
+
"completed_at": {
|
|
3447
|
+
"type": ["string", "null"],
|
|
3448
|
+
"format": "date-time"
|
|
3449
|
+
},
|
|
3450
|
+
"updated_by": { "oneOf": [{
|
|
3451
|
+
"type": "object",
|
|
3452
|
+
"additionalProperties": false,
|
|
922
3453
|
"required": [
|
|
923
3454
|
"kind",
|
|
924
3455
|
"id",
|
|
925
|
-
"
|
|
926
|
-
|
|
927
|
-
"created_at",
|
|
928
|
-
"ended_at",
|
|
929
|
-
"owned_now",
|
|
930
|
-
"created_through"
|
|
931
|
-
]
|
|
932
|
-
}
|
|
933
|
-
},
|
|
934
|
-
"withheld": {
|
|
935
|
-
"type": "array",
|
|
936
|
-
"items": {
|
|
937
|
-
"type": "object",
|
|
3456
|
+
"label"
|
|
3457
|
+
],
|
|
938
3458
|
"properties": {
|
|
939
3459
|
"kind": { "type": "string" },
|
|
940
|
-
"
|
|
941
|
-
"type": "string",
|
|
942
|
-
"
|
|
943
|
-
"permission_missing",
|
|
944
|
-
"mail_scope",
|
|
945
|
-
"not_for_this_credential"
|
|
946
|
-
],
|
|
947
|
-
"description": "permission_missing: the caller lacks the permission the kind's own list needs (named in permission). mail_scope: listed only to a caller that reads every mailbox. not_for_this_credential: this kind of credential never lists them (a person's own kinds asked for by a key, an app or an agent), or the kind's own list refuses it (email rules, rule requests and objections for a token narrowed below the person; objections anywhere but the dashboard and the Primitive CLI)."
|
|
3460
|
+
"id": {
|
|
3461
|
+
"type": ["string", "null"],
|
|
3462
|
+
"format": "uuid"
|
|
948
3463
|
},
|
|
949
|
-
"
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
]
|
|
3464
|
+
"label": { "type": ["string", "null"] }
|
|
3465
|
+
}
|
|
3466
|
+
}, { "type": "null" }] },
|
|
3467
|
+
"created_at": {
|
|
3468
|
+
"type": "string",
|
|
3469
|
+
"format": "date-time"
|
|
956
3470
|
},
|
|
957
|
-
"
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
"
|
|
3471
|
+
"updated_at": {
|
|
3472
|
+
"type": "string",
|
|
3473
|
+
"format": "date-time"
|
|
3474
|
+
},
|
|
3475
|
+
"occurred_at": {
|
|
3476
|
+
"type": "string",
|
|
3477
|
+
"format": "date-time"
|
|
3478
|
+
}
|
|
962
3479
|
}
|
|
963
|
-
}
|
|
964
|
-
"required": [
|
|
965
|
-
"covers",
|
|
966
|
-
"items",
|
|
967
|
-
"withheld",
|
|
968
|
-
"next_cursor"
|
|
969
|
-
]
|
|
3480
|
+
} }
|
|
970
3481
|
},
|
|
971
|
-
"sdkName": "
|
|
972
|
-
"summary": "
|
|
3482
|
+
"sdkName": "updateThreadActivity",
|
|
3483
|
+
"summary": "Update an existing thread activity",
|
|
973
3484
|
"tag": "Activity",
|
|
974
3485
|
"tagCommand": "activity"
|
|
975
3486
|
},
|
|
@@ -25347,6 +27858,13 @@ const operationManifest = [
|
|
|
25347
27858
|
"name": "text",
|
|
25348
27859
|
"required": false,
|
|
25349
27860
|
"type": "string"
|
|
27861
|
+
},
|
|
27862
|
+
{
|
|
27863
|
+
"description": "When `\"true\"`, includes recent agent-reported thread activities\nalongside the conversation messages so agents can inspect prior\nwork in one round trip. Requires `mail.activity:read`.\n",
|
|
27864
|
+
"enum": ["true", "false"],
|
|
27865
|
+
"name": "include_activity",
|
|
27866
|
+
"required": false,
|
|
27867
|
+
"type": "string"
|
|
25350
27868
|
}
|
|
25351
27869
|
],
|
|
25352
27870
|
"headerParams": [],
|
|
@@ -25661,6 +28179,254 @@ const operationManifest = [
|
|
|
25661
28179
|
"type": "integer",
|
|
25662
28180
|
"minimum": 0,
|
|
25663
28181
|
"description": "Present only with `text=readable`: characters of quoted history removed from the messages in this response, in total."
|
|
28182
|
+
},
|
|
28183
|
+
"activities": {
|
|
28184
|
+
"oneOf": [{
|
|
28185
|
+
"type": "array",
|
|
28186
|
+
"items": {
|
|
28187
|
+
"type": "object",
|
|
28188
|
+
"additionalProperties": false,
|
|
28189
|
+
"required": [
|
|
28190
|
+
"id",
|
|
28191
|
+
"source",
|
|
28192
|
+
"thread_id",
|
|
28193
|
+
"email_id",
|
|
28194
|
+
"sent_email_id",
|
|
28195
|
+
"actor",
|
|
28196
|
+
"kind",
|
|
28197
|
+
"action",
|
|
28198
|
+
"status",
|
|
28199
|
+
"summary",
|
|
28200
|
+
"detail",
|
|
28201
|
+
"external_ref",
|
|
28202
|
+
"data",
|
|
28203
|
+
"run_id",
|
|
28204
|
+
"trace_url",
|
|
28205
|
+
"idempotency_key",
|
|
28206
|
+
"visibility",
|
|
28207
|
+
"revision",
|
|
28208
|
+
"status_history",
|
|
28209
|
+
"started_at",
|
|
28210
|
+
"completed_at",
|
|
28211
|
+
"updated_by",
|
|
28212
|
+
"created_at",
|
|
28213
|
+
"updated_at",
|
|
28214
|
+
"occurred_at"
|
|
28215
|
+
],
|
|
28216
|
+
"properties": {
|
|
28217
|
+
"id": {
|
|
28218
|
+
"type": "string",
|
|
28219
|
+
"format": "uuid"
|
|
28220
|
+
},
|
|
28221
|
+
"source": {
|
|
28222
|
+
"type": "string",
|
|
28223
|
+
"enum": ["agent"]
|
|
28224
|
+
},
|
|
28225
|
+
"thread_id": {
|
|
28226
|
+
"type": "string",
|
|
28227
|
+
"format": "uuid"
|
|
28228
|
+
},
|
|
28229
|
+
"email_id": {
|
|
28230
|
+
"type": ["string", "null"],
|
|
28231
|
+
"format": "uuid"
|
|
28232
|
+
},
|
|
28233
|
+
"sent_email_id": {
|
|
28234
|
+
"type": ["string", "null"],
|
|
28235
|
+
"format": "uuid"
|
|
28236
|
+
},
|
|
28237
|
+
"actor": {
|
|
28238
|
+
"type": "object",
|
|
28239
|
+
"additionalProperties": false,
|
|
28240
|
+
"required": [
|
|
28241
|
+
"kind",
|
|
28242
|
+
"id",
|
|
28243
|
+
"label",
|
|
28244
|
+
"ownership",
|
|
28245
|
+
"owner_user_id",
|
|
28246
|
+
"owner_label",
|
|
28247
|
+
"agent_connection_id",
|
|
28248
|
+
"oauth_client_id"
|
|
28249
|
+
],
|
|
28250
|
+
"properties": {
|
|
28251
|
+
"kind": { "type": "string" },
|
|
28252
|
+
"id": {
|
|
28253
|
+
"type": ["string", "null"],
|
|
28254
|
+
"format": "uuid"
|
|
28255
|
+
},
|
|
28256
|
+
"label": { "type": ["string", "null"] },
|
|
28257
|
+
"ownership": {
|
|
28258
|
+
"type": "string",
|
|
28259
|
+
"enum": [
|
|
28260
|
+
"human",
|
|
28261
|
+
"personal_agent",
|
|
28262
|
+
"org_key",
|
|
28263
|
+
"function",
|
|
28264
|
+
"app",
|
|
28265
|
+
"system"
|
|
28266
|
+
],
|
|
28267
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
28268
|
+
},
|
|
28269
|
+
"owner_user_id": {
|
|
28270
|
+
"type": ["string", "null"],
|
|
28271
|
+
"format": "uuid"
|
|
28272
|
+
},
|
|
28273
|
+
"owner_label": { "type": ["string", "null"] },
|
|
28274
|
+
"agent_connection_id": {
|
|
28275
|
+
"type": ["string", "null"],
|
|
28276
|
+
"format": "uuid"
|
|
28277
|
+
},
|
|
28278
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
28279
|
+
}
|
|
28280
|
+
},
|
|
28281
|
+
"kind": {
|
|
28282
|
+
"type": "string",
|
|
28283
|
+
"enum": [
|
|
28284
|
+
"action",
|
|
28285
|
+
"note",
|
|
28286
|
+
"handoff"
|
|
28287
|
+
],
|
|
28288
|
+
"description": "Category of an agent-reported thread activity."
|
|
28289
|
+
},
|
|
28290
|
+
"action": { "type": "string" },
|
|
28291
|
+
"status": {
|
|
28292
|
+
"type": "string",
|
|
28293
|
+
"enum": [
|
|
28294
|
+
"started",
|
|
28295
|
+
"succeeded",
|
|
28296
|
+
"failed",
|
|
28297
|
+
"skipped",
|
|
28298
|
+
"needs_review"
|
|
28299
|
+
],
|
|
28300
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
28301
|
+
},
|
|
28302
|
+
"summary": { "type": "string" },
|
|
28303
|
+
"detail": { "type": ["string", "null"] },
|
|
28304
|
+
"external_ref": { "oneOf": [{
|
|
28305
|
+
"type": "object",
|
|
28306
|
+
"additionalProperties": false,
|
|
28307
|
+
"required": ["system"],
|
|
28308
|
+
"properties": {
|
|
28309
|
+
"system": {
|
|
28310
|
+
"type": "string",
|
|
28311
|
+
"minLength": 1,
|
|
28312
|
+
"maxLength": 64,
|
|
28313
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
28314
|
+
},
|
|
28315
|
+
"id": {
|
|
28316
|
+
"type": "string",
|
|
28317
|
+
"minLength": 1,
|
|
28318
|
+
"maxLength": 255,
|
|
28319
|
+
"description": "External record identifier."
|
|
28320
|
+
},
|
|
28321
|
+
"url": {
|
|
28322
|
+
"type": "string",
|
|
28323
|
+
"maxLength": 2048,
|
|
28324
|
+
"description": "HTTP(S) link to the external record (validated as an `http://` or `https://` URL)."
|
|
28325
|
+
},
|
|
28326
|
+
"label": {
|
|
28327
|
+
"type": "string",
|
|
28328
|
+
"minLength": 1,
|
|
28329
|
+
"maxLength": 200,
|
|
28330
|
+
"description": "Human-readable display label for the external record."
|
|
28331
|
+
}
|
|
28332
|
+
}
|
|
28333
|
+
}, { "type": "null" }] },
|
|
28334
|
+
"data": {
|
|
28335
|
+
"type": "object",
|
|
28336
|
+
"additionalProperties": true
|
|
28337
|
+
},
|
|
28338
|
+
"run_id": { "type": ["string", "null"] },
|
|
28339
|
+
"trace_url": { "type": ["string", "null"] },
|
|
28340
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
28341
|
+
"visibility": {
|
|
28342
|
+
"type": "string",
|
|
28343
|
+
"enum": ["thread", "actor_only"],
|
|
28344
|
+
"description": "Visibility of a thread activity (`thread` is shared with scoped readers; `actor_only` is private to the creating actor unless an auditor passes `include_private=true`)."
|
|
28345
|
+
},
|
|
28346
|
+
"revision": {
|
|
28347
|
+
"type": "integer",
|
|
28348
|
+
"minimum": 1
|
|
28349
|
+
},
|
|
28350
|
+
"status_history": {
|
|
28351
|
+
"type": "array",
|
|
28352
|
+
"items": {
|
|
28353
|
+
"type": "object",
|
|
28354
|
+
"additionalProperties": false,
|
|
28355
|
+
"required": [
|
|
28356
|
+
"status",
|
|
28357
|
+
"summary",
|
|
28358
|
+
"changed_at",
|
|
28359
|
+
"actor_kind",
|
|
28360
|
+
"actor_id",
|
|
28361
|
+
"actor_label"
|
|
28362
|
+
],
|
|
28363
|
+
"properties": {
|
|
28364
|
+
"status": {
|
|
28365
|
+
"type": "string",
|
|
28366
|
+
"enum": [
|
|
28367
|
+
"started",
|
|
28368
|
+
"succeeded",
|
|
28369
|
+
"failed",
|
|
28370
|
+
"skipped",
|
|
28371
|
+
"needs_review"
|
|
28372
|
+
],
|
|
28373
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
28374
|
+
},
|
|
28375
|
+
"summary": { "type": "string" },
|
|
28376
|
+
"changed_at": {
|
|
28377
|
+
"type": "string",
|
|
28378
|
+
"format": "date-time"
|
|
28379
|
+
},
|
|
28380
|
+
"actor_kind": { "type": "string" },
|
|
28381
|
+
"actor_id": {
|
|
28382
|
+
"type": ["string", "null"],
|
|
28383
|
+
"format": "uuid"
|
|
28384
|
+
},
|
|
28385
|
+
"actor_label": { "type": ["string", "null"] }
|
|
28386
|
+
}
|
|
28387
|
+
}
|
|
28388
|
+
},
|
|
28389
|
+
"started_at": {
|
|
28390
|
+
"type": "string",
|
|
28391
|
+
"format": "date-time"
|
|
28392
|
+
},
|
|
28393
|
+
"completed_at": {
|
|
28394
|
+
"type": ["string", "null"],
|
|
28395
|
+
"format": "date-time"
|
|
28396
|
+
},
|
|
28397
|
+
"updated_by": { "oneOf": [{
|
|
28398
|
+
"type": "object",
|
|
28399
|
+
"additionalProperties": false,
|
|
28400
|
+
"required": [
|
|
28401
|
+
"kind",
|
|
28402
|
+
"id",
|
|
28403
|
+
"label"
|
|
28404
|
+
],
|
|
28405
|
+
"properties": {
|
|
28406
|
+
"kind": { "type": "string" },
|
|
28407
|
+
"id": {
|
|
28408
|
+
"type": ["string", "null"],
|
|
28409
|
+
"format": "uuid"
|
|
28410
|
+
},
|
|
28411
|
+
"label": { "type": ["string", "null"] }
|
|
28412
|
+
}
|
|
28413
|
+
}, { "type": "null" }] },
|
|
28414
|
+
"created_at": {
|
|
28415
|
+
"type": "string",
|
|
28416
|
+
"format": "date-time"
|
|
28417
|
+
},
|
|
28418
|
+
"updated_at": {
|
|
28419
|
+
"type": "string",
|
|
28420
|
+
"format": "date-time"
|
|
28421
|
+
},
|
|
28422
|
+
"occurred_at": {
|
|
28423
|
+
"type": "string",
|
|
28424
|
+
"format": "date-time"
|
|
28425
|
+
}
|
|
28426
|
+
}
|
|
28427
|
+
}
|
|
28428
|
+
}, { "type": "null" }],
|
|
28429
|
+
"description": "Present when `include_activity=true`: recent agent-reported work\nactivities on this thread visible to the caller (null below content\ndepth).\n"
|
|
25664
28430
|
}
|
|
25665
28431
|
},
|
|
25666
28432
|
"required": ["thread_id", "messages"]
|
|
@@ -55409,14 +58175,24 @@ function credentialsFromUserLogin(params) {
|
|
|
55409
58175
|
const API_HEADERS_ENV = "PRIMITIVE_API_HEADERS";
|
|
55410
58176
|
const OAUTH_REFRESH_SKEW_MS = 6e4;
|
|
55411
58177
|
const SAVED_CLI_OAUTH_SESSION_EXPIRED_MESSAGE = "Saved Primitive CLI OAuth session expired or was revoked. Run `primitive signin` to authenticate again.";
|
|
55412
|
-
function
|
|
58178
|
+
function mergeHeadersCaseInsensitive(...headers) {
|
|
55413
58179
|
const merged = {};
|
|
58180
|
+
const keyByLower = /* @__PURE__ */ new Map();
|
|
55414
58181
|
for (const headerSet of headers) {
|
|
55415
58182
|
if (!headerSet) continue;
|
|
55416
|
-
for (const [name, value] of Object.entries(headerSet))
|
|
58183
|
+
for (const [name, value] of Object.entries(headerSet)) {
|
|
58184
|
+
const lower = name.toLowerCase();
|
|
58185
|
+
const existingKey = keyByLower.get(lower);
|
|
58186
|
+
if (existingKey !== void 0 && existingKey !== name) delete merged[existingKey];
|
|
58187
|
+
merged[name] = value;
|
|
58188
|
+
keyByLower.set(lower, name);
|
|
58189
|
+
}
|
|
55417
58190
|
}
|
|
55418
58191
|
return Object.keys(merged).length > 0 ? merged : void 0;
|
|
55419
58192
|
}
|
|
58193
|
+
function mergeHeaders(...headers) {
|
|
58194
|
+
return mergeHeadersCaseInsensitive(...headers);
|
|
58195
|
+
}
|
|
55420
58196
|
function parseHeadersJson(raw) {
|
|
55421
58197
|
let parsed;
|
|
55422
58198
|
try {
|
|
@@ -55656,27 +58432,48 @@ async function createAuthenticatedCliApiClient(params) {
|
|
|
55656
58432
|
if (refreshed.auth_method === "user_grant") userLoginToken = { current: refreshed.access_token };
|
|
55657
58433
|
}
|
|
55658
58434
|
const tokenHolder = userLoginToken;
|
|
58435
|
+
const activityHeaders = cliActivityHeadersFromEnv(params.env);
|
|
58436
|
+
const rawFetch = tokenHolder && auth.credentials ? reexchangingFetch({
|
|
58437
|
+
base: params.fetch,
|
|
58438
|
+
reexchange: savedLoginReexchange({
|
|
58439
|
+
apiBaseUrl: auth.apiBaseUrl,
|
|
58440
|
+
configDir: params.configDir,
|
|
58441
|
+
fetch: params.fetch,
|
|
58442
|
+
headers: requestConfig.headers,
|
|
58443
|
+
now: params.now,
|
|
58444
|
+
orgId: auth.credentials.org_id
|
|
58445
|
+
}),
|
|
58446
|
+
token: tokenHolder
|
|
58447
|
+
}) : (input, init) => (params.fetch ?? globalThis.fetch)(input, init);
|
|
58448
|
+
const authenticatedFetch = (async (input, init) => {
|
|
58449
|
+
const activeToken = tokenHolder ? tokenHolder.current : auth.apiKey;
|
|
58450
|
+
const baseHeaders = mergeHeadersCaseInsensitive(auth.connectedAgent || auth.agentPass ? void 0 : requestConfig.headers, cliActivityHeadersFromEnv(params.env), activeToken ? { authorization: `Bearer ${activeToken}` } : void 0);
|
|
58451
|
+
const merged = new Headers(baseHeaders);
|
|
58452
|
+
if (init?.headers) new Headers(init.headers).forEach((value, key) => {
|
|
58453
|
+
if (key.toLowerCase() === "authorization") return;
|
|
58454
|
+
merged.set(key, value);
|
|
58455
|
+
});
|
|
58456
|
+
else if (input instanceof Request) input.headers.forEach((value, key) => {
|
|
58457
|
+
if (key.toLowerCase() === "authorization") return;
|
|
58458
|
+
merged.set(key, value);
|
|
58459
|
+
});
|
|
58460
|
+
return rawFetch(input, {
|
|
58461
|
+
...init,
|
|
58462
|
+
headers: merged
|
|
58463
|
+
});
|
|
58464
|
+
});
|
|
55659
58465
|
return {
|
|
55660
58466
|
apiClient: new PrimitiveApiClient({
|
|
55661
58467
|
...tokenHolder && auth.credentials ? {
|
|
55662
58468
|
auth: (security) => security.type === "http" && security.scheme === "bearer" ? tokenHolder.current : void 0,
|
|
55663
|
-
fetch:
|
|
55664
|
-
reexchange: savedLoginReexchange({
|
|
55665
|
-
apiBaseUrl: auth.apiBaseUrl,
|
|
55666
|
-
configDir: params.configDir,
|
|
55667
|
-
fetch: params.fetch,
|
|
55668
|
-
headers: requestConfig.headers,
|
|
55669
|
-
now: params.now,
|
|
55670
|
-
orgId: auth.credentials.org_id
|
|
55671
|
-
}),
|
|
55672
|
-
token: tokenHolder
|
|
55673
|
-
})
|
|
58469
|
+
fetch: rawFetch
|
|
55674
58470
|
} : { apiKey: auth.apiKey },
|
|
55675
58471
|
apiBaseUrl: auth.apiBaseUrl,
|
|
55676
|
-
headers: auth.connectedAgent || auth.agentPass ? void 0 : requestConfig.headers
|
|
58472
|
+
headers: mergeHeaders(auth.connectedAgent || auth.agentPass ? void 0 : requestConfig.headers, activityHeaders)
|
|
55677
58473
|
}),
|
|
55678
58474
|
auth,
|
|
55679
58475
|
baseUrlOverridden: requestConfig.baseUrlOverridden,
|
|
58476
|
+
fetch: authenticatedFetch,
|
|
55680
58477
|
requestConfig
|
|
55681
58478
|
};
|
|
55682
58479
|
}
|
|
@@ -57906,6 +60703,7 @@ async function resolveFocus(params) {
|
|
|
57906
60703
|
widen: []
|
|
57907
60704
|
}
|
|
57908
60705
|
};
|
|
60706
|
+
if (!asked && params.auth.agentPass) return NO_FOCUS;
|
|
57909
60707
|
const profile = focusProfile(params.configDir, params.auth);
|
|
57910
60708
|
const { readable, refusal } = params.readDomains ? {
|
|
57911
60709
|
readable: await params.readDomains(params.client),
|
|
@@ -59801,7 +62599,7 @@ function savedConnectedProfiles(configDir, exclude) {
|
|
|
59801
62599
|
*/
|
|
59802
62600
|
async function otherProfiles(configDir, session, current) {
|
|
59803
62601
|
if (session) try {
|
|
59804
|
-
const { connectedProfilesForSession } = await import("./machine-session-
|
|
62602
|
+
const { connectedProfilesForSession } = await import("./machine-session-1utuweTi.js").then((n) => n.s);
|
|
59805
62603
|
return {
|
|
59806
62604
|
inSession: true,
|
|
59807
62605
|
profiles: connectedProfilesForSession(configDir, session, current)
|
|
@@ -60554,7 +63352,11 @@ function extractErrorCode(payload) {
|
|
|
60554
63352
|
if (typeof direct === "string") return direct;
|
|
60555
63353
|
}
|
|
60556
63354
|
}
|
|
60557
|
-
const ERROR_CODE_HINTS = {
|
|
63355
|
+
const ERROR_CODE_HINTS = {
|
|
63356
|
+
[API_ERROR_CODES.unauthorized]: "Hint: run `primitive signin`, pass --api-key explicitly, or set PRIMITIVE_API_KEY in your environment. `primitive whoami` is the fastest way to verify auth is live.",
|
|
63357
|
+
access_reason_required: "Hint: this organization requires an access reason on mail requests. Pass --reason \"...\" or set PRIMITIVE_REASON.",
|
|
63358
|
+
activity_header_invalid: "Hint: X-Primitive-Reason must be 1 to 500 printable ASCII characters without newlines; X-Primitive-Run-Id must be 1 to 128 characters matching [A-Za-z0-9._:/-]."
|
|
63359
|
+
};
|
|
60558
63360
|
const NETWORK_ERROR_HINTS = {
|
|
60559
63361
|
ENETUNREACH: "Hint: the network is unreachable. If you're behind a proxy and set HTTP(S)_PROXY, re-run with NODE_USE_ENV_PROXY=1 (Node 22+ ignores those env vars by default). `primitive doctor` reports the local environment in one shot.",
|
|
60560
63362
|
ECONNREFUSED: "Hint: the server refused the connection. Check that your firewall allows egress to *.primitive.dev, that your PRIMITIVE_API_BASE_URL_* overrides (if any) point at a reachable host, and re-run with NODE_USE_ENV_PROXY=1 if you're behind a proxy. `primitive doctor` reports the local environment in one shot.",
|
|
@@ -60613,6 +63415,16 @@ function forbiddenHint(payload) {
|
|
|
60613
63415
|
if (!permission || record.reason !== "permission_missing") return null;
|
|
60614
63416
|
return `Hint: This operation needs ${permission}, which this credential does not have. Some operations stay closed to keys and the CLI even with it. Check a credential with \`primitive whoami --check ${permission}\`.`;
|
|
60615
63417
|
}
|
|
63418
|
+
function agentPassErrorHint(pass, code) {
|
|
63419
|
+
const disconnectCmd = pass.binding.kind === "profile" ? `primitive disconnect --profile ${pass.binding.profile} --local-only` : "primitive disconnect --local-only";
|
|
63420
|
+
if (code === API_ERROR_CODES.unauthorized) {
|
|
63421
|
+
const extendBit = pass.manage_url ? ` Ask the owner to extend it at ${pass.manage_url}?action=extend&add=4h, or` : " Request a fresh pass or";
|
|
63422
|
+
return `Hint: The bound Access Pass "${pass.label}" was rejected (it may have expired or been revoked).${extendBit} run \`${disconnectCmd}\` to clear the local binding.`;
|
|
63423
|
+
}
|
|
63424
|
+
if (code === "key_revoked") return `Hint: The bound Access Pass "${pass.label}" has been revoked. Run \`${disconnectCmd}\` to clear the local binding, or ask the owner for a fresh pass.`;
|
|
63425
|
+
if ((code === "grant_forbidden" || code === API_ERROR_CODES.forbidden) && pass.manage_url) return `Hint: To expand this Access Pass in place, send the owner ${pass.manage_url}?action=expand`;
|
|
63426
|
+
return null;
|
|
63427
|
+
}
|
|
60616
63428
|
function writeErrorWithHints(payload, response, options = {}) {
|
|
60617
63429
|
const formatted = formatErrorPayload(payload);
|
|
60618
63430
|
process.stderr.write(`${formatted}\n`);
|
|
@@ -60623,6 +63435,24 @@ function writeErrorWithHints(payload, response, options = {}) {
|
|
|
60623
63435
|
return;
|
|
60624
63436
|
}
|
|
60625
63437
|
if (!code || options.codeHint === false) return;
|
|
63438
|
+
if (options.auth?.source === "agent-pass" && options.auth.agentPass) {
|
|
63439
|
+
const passHint = agentPassErrorHint(options.auth.agentPass, code);
|
|
63440
|
+
if (code === "grant_forbidden") {
|
|
63441
|
+
process.stderr.write(`${grantForbiddenHint(payload)}\n`);
|
|
63442
|
+
if (passHint) process.stderr.write(`${passHint}\n`);
|
|
63443
|
+
return;
|
|
63444
|
+
}
|
|
63445
|
+
if (code === API_ERROR_CODES.forbidden) {
|
|
63446
|
+
const hint = forbiddenHint(payload);
|
|
63447
|
+
if (hint) process.stderr.write(`${hint}\n`);
|
|
63448
|
+
if (passHint) process.stderr.write(`${passHint}\n`);
|
|
63449
|
+
return;
|
|
63450
|
+
}
|
|
63451
|
+
if (passHint) {
|
|
63452
|
+
process.stderr.write(`${passHint}\n`);
|
|
63453
|
+
return;
|
|
63454
|
+
}
|
|
63455
|
+
}
|
|
60626
63456
|
if (code === "grant_forbidden") {
|
|
60627
63457
|
process.stderr.write(`${grantForbiddenHint(payload)}\n`);
|
|
60628
63458
|
return;
|
|
@@ -61225,7 +64055,10 @@ function createOperationCommand(operation) {
|
|
|
61225
64055
|
if (result.error) {
|
|
61226
64056
|
const errorPayload = extractErrorPayload(result.error);
|
|
61227
64057
|
const operationErrorHint = OPERATION_ERROR_HINTS[operation.sdkName]?.(extractErrorCode(errorPayload), body, errorPayload, collectValues(operation.pathParams, parsedFlags, operation.sdkName), parsedFlags);
|
|
61228
|
-
writeErrorWithHints(errorPayload, result.response, {
|
|
64058
|
+
writeErrorWithHints(errorPayload, result.response, {
|
|
64059
|
+
auth,
|
|
64060
|
+
codeHint: !(operationErrorHint && OPERATION_ERROR_HINTS_REPLACING_CODE_HINT.has(operation.sdkName))
|
|
64061
|
+
});
|
|
61229
64062
|
if (operationErrorHint) process.stderr.write(`${operationErrorHint}\n`);
|
|
61230
64063
|
if (stepUpUrl) process.stderr.write(approveThenRerunHint(stepUpUrl));
|
|
61231
64064
|
if (replyStateSurface && isAwaitingRejectedError(errorPayload)) process.stderr.write(`${awaitingRejectedError(replyStateSurface).message}\n`);
|
|
@@ -61421,4 +64254,4 @@ function emptyDeliveriesHint(sdkName, query) {
|
|
|
61421
64254
|
function canonicalizeCliReferences(description) {
|
|
61422
64255
|
return canonicalCliText(description).replaceAll("`primitive emails:latest`", "`primitive emails latest`").replaceAll("`primitive describe emails:get-email | jq '.responseSchema.properties'`", "`primitive describe emails:get | jq '.responseSchema.properties'`");
|
|
61423
64256
|
}
|
|
61424
|
-
export {
|
|
64257
|
+
export { replyExpectation as $, readDomainsOrRefusal as $t, bareAddress as A, fetchCliOrgs as An, cliInvocation as At, wakeReadCommand as B, operationManifest as Bn, NO_FOCUS as Bt, terminalApprovalIo as C, refuseOrgSelectionForProfile as Cn, sendOutcomeExitCode as Ct, listenForCopyHotkey as D, RESTRICTED_ROLE_NOTE as Dn, successfulSendOutcome as Dt, formatBrowserLoginInstructions as E, CliOrgRefusedError as En, serializeErrorPayload as Et, readThreadContext as F, switchCurrentOrg as Fn, loadSkillLine as Ft, clearReadPendingMail as G, validateActivityReason as Gn, focusForCorpus as Gt, wakeRelationship as H, PRIMITIVE_RUN_ID_HEADER as Hn, focusEmptyHint as Ht, sentInThread as I, routeWarningLines as In, currentMailSessionKey as It, recordPendingMail as J, loadSavedFocus as Jt, pendingMailPath as K, validateActivityRunId as Kn, focusProfile as Kt, serverMuted as L, sanitizeForTerminal as Ln, formatAlreadySentNotice as Lt, displayAddress as M, revokeUserLogin as Mn, defaultConnectionName as Mt, formatMailWakeLine as N, roleKeyLabel as Nn, generatedAgentName as Nt, openBrowser as O, credentialsFromUserLogin as On, thrownErrorExitCode as Ot, latestOwnOutbound as P, roleKeyText as Pn, identitySuggestions as Pt, readEmailInteraction as Q, queryScopesItself as Qt, serverRelationship as R, shownLine as Rn, FOCUS_ENV as Rt, promptLine as S, refreshStoredCliCredentials as Sn, sendIdentityFields as St, canOfferCopyHotkey as T, selectedOrgFromEnv as Tn, sentHistoryWindowStart as Tt, claimPendingMail as U, attachActivityContextFlags as Un, focusFlagValues as Ut, wakeRecipientField as V, PRIMITIVE_REASON_HEADER as Vn, countFromMeta as Vt, clearConsumedPendingMail as W, cliActivityHeadersFromEnv as Wn, focusFlags as Wt, interactionHumanLine as X, normalizeDomainNames as Xt, removePendingMail as Y, manyDomainsSupported as Yt, interactionNextActions as Z, oneDomainAtATimeError as Zt, writeErrorWithHints as _, ConnectedAgentKeyRequiredError as _n, formatSendFailureSummary as _t, agentPassErrorHint as a, writeFocusLine as an, apiResultHttpStatus as at, STEP_UP_TOKEN_FLAG_DESCRIPTION as b, createCliApiClient as bn, reportSendCommandResult as bt, extractErrorPayload as c, mailReach as cn, buildThrownSendFailureEnvelope as ct, isGrantRefusal as d, isEmailId as dn, deriveSendIdempotencyKey as dt, resolveDomainNames as en, replyInteractionWarning as et, networkErrorHint as f, fetchBoundedPages as fn, excludeSignalReplies as ft, surfaceUnauthorizedHint as g, withAttachmentWait as gn, formatPriorRepliesWarning as gt, runWithTiming as h, ATTACHMENT_WAIT_MAX_MS as hn, formatPriorRepliesCheckSkipped as ht, TIME_FLAG_DESCRIPTION as i, withoutFocus as in, SEND_OUTCOME_HELP as it, describeWake as j, isBuiltInRoleKey as jn, connectNextSteps as jt, explainPendingMailNotFound as k, displayedRoleKey as kn, DEFAULT_ENROLL_NAME as kt, formatErrorPayload as l, readCallerMailFor as ln, checkPriorReplies as lt, refusesCredential as m, ATTACHMENT_WAIT_FLAG_DESCRIPTION as mn, formatDeletedEarlierSendNotice as mt, API_ERROR_CODES as n, saveFocus as nn, IDEMPOTENCY_KEY_FLAG_DESCRIPTION as nt, createOperationCommand as o, withFlagSuggestion as on, assertValidIdempotencyKey as ot, readTextFileFlag as p, withBooleanFlagValues as pn, followUpCommandPrefix as pt, readPendingMail as q, joinNames as qt, PAGED_LIMIT_MAX as r, withFocusMeta as rn, MAX_SEND_WAIT_TIMEOUT_MS as rt, extractErrorCode as s, emptyEmailListHint as sn, buildFollowUpCommand as st, API_BASE_URL_FLAG_DESCRIPTION as t, resolveFocus as tn, wakeInteractionSentence as tt, hasControlCharacter as u, formatFact as un, classifySendError as ut, BROWSER_FLAG_DESCRIPTION as v, SAVED_CLI_OAUTH_SESSION_EXPIRED_MESSAGE as vn, formatSendRecordFailureSummary as vt, withApproval as w, resolveCliApiRequestConfig as wn, sendWaitClampNotice as wt, approveThenRerunHint as x, mergeHeadersCaseInsensitive as xn, sendErrorMessage as xt, STEP_UP_HEADER as y, createAuthenticatedCliApiClient as yn, priorRepliesThatWentOut as yt, skillFirstLine as z, setKnownCommands as zn, FOCUS_SERVER_SUPPORT as zt };
|