@primitivedotdev/cli 3.0.0-preview.23 → 3.0.0-preview.25
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-CP8ir5Pv.js → api-command-DhY2wrh5.js} +2945 -171
- package/dist/{cli-command-names-DteMqL-H.js → cli-command-names-DiNDwwDX.js} +1 -1
- package/dist/{cli-config-DUQEYQ42.js → cli-config-D2MU7PiU.js} +50 -2
- package/dist/{machine-session-CE31cwx2.js → machine-session-BTJXO0vi.js} +5 -5
- package/dist/{notify-session-Dx54UpkT.js → notify-session-DrgOcIT6.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 +1354 -29
- 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-CA55RTJh.js → signal-command-BmxZqCot.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 resolveCliAuth, I as agentProfilesDirectory, M as AGENT_PROFILE_ENV, P as agentProfileDirectory, Q as loadActiveAgentPass, S as normalizeApiBaseUrl, T as saveSignupCredentials, U as requireDefaultLoginProfile, b as detectPrimitiveKeyEnvMisname, ct as PrimitiveApiClient, f as validateCliHeaderName, h as cliAccessTokenExpiresAt, i as loadCliConfig, l as resolveConfigEnvironment, m as acquireCliCredentialsLock, ot as detectRuntimeSession, p as validateCliHeaderValue, v as deleteCliCredentials, w as saveCliCredentials, x as loadCliCredentials, z as loadConnectedAgentProfile } from "./cli-config-
|
|
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-DiNDwwDX.js";
|
|
3
|
+
import { C as resolveCliAuth, I as agentProfilesDirectory, M as AGENT_PROFILE_ENV, P as agentProfileDirectory, Q as loadActiveAgentPass, S as normalizeApiBaseUrl, T as saveSignupCredentials, U as requireDefaultLoginProfile, b as detectPrimitiveKeyEnvMisname, ct as PrimitiveApiClient, f as validateCliHeaderName, h as cliAccessTokenExpiresAt, i as loadCliConfig, l as resolveConfigEnvironment, m as acquireCliCredentialsLock, ot as detectRuntimeSession, p as validateCliHeaderValue, v as deleteCliCredentials, w as saveCliCredentials, x as loadCliCredentials, z as loadConnectedAgentProfile } from "./cli-config-D2MU7PiU.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
|
{
|
|
@@ -774,202 +941,2542 @@ const operationManifest = [
|
|
|
774
941
|
"role_name"
|
|
775
942
|
]
|
|
776
943
|
},
|
|
777
|
-
"sdkName": "whoami",
|
|
778
|
-
"summary": "Get current caller identity",
|
|
779
|
-
"tag": "Account",
|
|
780
|
-
"tagCommand": "account"
|
|
944
|
+
"sdkName": "whoami",
|
|
945
|
+
"summary": "Get current caller identity",
|
|
946
|
+
"tag": "Account",
|
|
947
|
+
"tagCommand": "account"
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
"binaryResponse": false,
|
|
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
|
+
"maxLength": 128,
|
|
992
|
+
"description": "Lowercase action slug (for example `brex.upload_invoice`)."
|
|
993
|
+
},
|
|
994
|
+
"status": {
|
|
995
|
+
"type": "string",
|
|
996
|
+
"enum": [
|
|
997
|
+
"started",
|
|
998
|
+
"succeeded",
|
|
999
|
+
"failed",
|
|
1000
|
+
"skipped",
|
|
1001
|
+
"needs_review"
|
|
1002
|
+
],
|
|
1003
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1004
|
+
},
|
|
1005
|
+
"summary": {
|
|
1006
|
+
"type": "string",
|
|
1007
|
+
"minLength": 1,
|
|
1008
|
+
"maxLength": 1e3
|
|
1009
|
+
},
|
|
1010
|
+
"detail": {
|
|
1011
|
+
"type": ["string", "null"],
|
|
1012
|
+
"maxLength": 8e3
|
|
1013
|
+
},
|
|
1014
|
+
"sent_email_id": {
|
|
1015
|
+
"type": "string",
|
|
1016
|
+
"format": "uuid"
|
|
1017
|
+
},
|
|
1018
|
+
"external_ref": { "oneOf": [{
|
|
1019
|
+
"type": "object",
|
|
1020
|
+
"additionalProperties": false,
|
|
1021
|
+
"required": ["system"],
|
|
1022
|
+
"properties": {
|
|
1023
|
+
"system": {
|
|
1024
|
+
"type": "string",
|
|
1025
|
+
"minLength": 1,
|
|
1026
|
+
"maxLength": 64,
|
|
1027
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
1028
|
+
},
|
|
1029
|
+
"id": {
|
|
1030
|
+
"type": "string",
|
|
1031
|
+
"minLength": 1,
|
|
1032
|
+
"maxLength": 255,
|
|
1033
|
+
"description": "External record identifier."
|
|
1034
|
+
},
|
|
1035
|
+
"url": {
|
|
1036
|
+
"type": "string",
|
|
1037
|
+
"format": "uri",
|
|
1038
|
+
"maxLength": 2048,
|
|
1039
|
+
"description": "HTTP(S) link to the external record."
|
|
1040
|
+
},
|
|
1041
|
+
"label": {
|
|
1042
|
+
"type": "string",
|
|
1043
|
+
"minLength": 1,
|
|
1044
|
+
"maxLength": 200,
|
|
1045
|
+
"description": "Human-readable display label for the external record."
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}, { "type": "null" }] },
|
|
1049
|
+
"data": {
|
|
1050
|
+
"type": "object",
|
|
1051
|
+
"additionalProperties": true
|
|
1052
|
+
},
|
|
1053
|
+
"run_id": {
|
|
1054
|
+
"type": ["string", "null"],
|
|
1055
|
+
"maxLength": 128
|
|
1056
|
+
},
|
|
1057
|
+
"trace_url": {
|
|
1058
|
+
"type": ["string", "null"],
|
|
1059
|
+
"format": "uri",
|
|
1060
|
+
"maxLength": 2048
|
|
1061
|
+
},
|
|
1062
|
+
"idempotency_key": {
|
|
1063
|
+
"type": "string",
|
|
1064
|
+
"minLength": 1,
|
|
1065
|
+
"maxLength": 255
|
|
1066
|
+
},
|
|
1067
|
+
"visibility": {
|
|
1068
|
+
"type": "string",
|
|
1069
|
+
"enum": ["thread", "actor_only"],
|
|
1070
|
+
"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`)."
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
},
|
|
1074
|
+
"responseSchema": {
|
|
1075
|
+
"type": "object",
|
|
1076
|
+
"additionalProperties": false,
|
|
1077
|
+
"required": ["activity", "updated"],
|
|
1078
|
+
"properties": {
|
|
1079
|
+
"activity": {
|
|
1080
|
+
"type": "object",
|
|
1081
|
+
"additionalProperties": false,
|
|
1082
|
+
"required": [
|
|
1083
|
+
"id",
|
|
1084
|
+
"source",
|
|
1085
|
+
"thread_id",
|
|
1086
|
+
"email_id",
|
|
1087
|
+
"sent_email_id",
|
|
1088
|
+
"actor",
|
|
1089
|
+
"kind",
|
|
1090
|
+
"action",
|
|
1091
|
+
"status",
|
|
1092
|
+
"summary",
|
|
1093
|
+
"detail",
|
|
1094
|
+
"external_ref",
|
|
1095
|
+
"data",
|
|
1096
|
+
"run_id",
|
|
1097
|
+
"trace_url",
|
|
1098
|
+
"idempotency_key",
|
|
1099
|
+
"visibility",
|
|
1100
|
+
"revision",
|
|
1101
|
+
"status_history",
|
|
1102
|
+
"started_at",
|
|
1103
|
+
"completed_at",
|
|
1104
|
+
"updated_by",
|
|
1105
|
+
"created_at",
|
|
1106
|
+
"updated_at",
|
|
1107
|
+
"occurred_at"
|
|
1108
|
+
],
|
|
1109
|
+
"properties": {
|
|
1110
|
+
"id": {
|
|
1111
|
+
"type": "string",
|
|
1112
|
+
"format": "uuid"
|
|
1113
|
+
},
|
|
1114
|
+
"source": {
|
|
1115
|
+
"type": "string",
|
|
1116
|
+
"enum": ["agent"]
|
|
1117
|
+
},
|
|
1118
|
+
"thread_id": {
|
|
1119
|
+
"type": "string",
|
|
1120
|
+
"format": "uuid"
|
|
1121
|
+
},
|
|
1122
|
+
"email_id": {
|
|
1123
|
+
"type": ["string", "null"],
|
|
1124
|
+
"format": "uuid"
|
|
1125
|
+
},
|
|
1126
|
+
"sent_email_id": {
|
|
1127
|
+
"type": ["string", "null"],
|
|
1128
|
+
"format": "uuid"
|
|
1129
|
+
},
|
|
1130
|
+
"actor": {
|
|
1131
|
+
"type": "object",
|
|
1132
|
+
"additionalProperties": false,
|
|
1133
|
+
"required": [
|
|
1134
|
+
"kind",
|
|
1135
|
+
"id",
|
|
1136
|
+
"label",
|
|
1137
|
+
"ownership",
|
|
1138
|
+
"owner_user_id",
|
|
1139
|
+
"owner_label",
|
|
1140
|
+
"agent_connection_id",
|
|
1141
|
+
"oauth_client_id"
|
|
1142
|
+
],
|
|
1143
|
+
"properties": {
|
|
1144
|
+
"kind": { "type": "string" },
|
|
1145
|
+
"id": {
|
|
1146
|
+
"type": ["string", "null"],
|
|
1147
|
+
"format": "uuid"
|
|
1148
|
+
},
|
|
1149
|
+
"label": { "type": ["string", "null"] },
|
|
1150
|
+
"ownership": {
|
|
1151
|
+
"type": "string",
|
|
1152
|
+
"enum": [
|
|
1153
|
+
"human",
|
|
1154
|
+
"personal_agent",
|
|
1155
|
+
"org_key",
|
|
1156
|
+
"function",
|
|
1157
|
+
"app",
|
|
1158
|
+
"system"
|
|
1159
|
+
],
|
|
1160
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
1161
|
+
},
|
|
1162
|
+
"owner_user_id": {
|
|
1163
|
+
"type": ["string", "null"],
|
|
1164
|
+
"format": "uuid"
|
|
1165
|
+
},
|
|
1166
|
+
"owner_label": { "type": ["string", "null"] },
|
|
1167
|
+
"agent_connection_id": {
|
|
1168
|
+
"type": ["string", "null"],
|
|
1169
|
+
"format": "uuid"
|
|
1170
|
+
},
|
|
1171
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
1172
|
+
}
|
|
1173
|
+
},
|
|
1174
|
+
"kind": {
|
|
1175
|
+
"type": "string",
|
|
1176
|
+
"enum": [
|
|
1177
|
+
"action",
|
|
1178
|
+
"note",
|
|
1179
|
+
"handoff"
|
|
1180
|
+
],
|
|
1181
|
+
"description": "Category of an agent-reported thread activity."
|
|
1182
|
+
},
|
|
1183
|
+
"action": { "type": "string" },
|
|
1184
|
+
"status": {
|
|
1185
|
+
"type": "string",
|
|
1186
|
+
"enum": [
|
|
1187
|
+
"started",
|
|
1188
|
+
"succeeded",
|
|
1189
|
+
"failed",
|
|
1190
|
+
"skipped",
|
|
1191
|
+
"needs_review"
|
|
1192
|
+
],
|
|
1193
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1194
|
+
},
|
|
1195
|
+
"summary": { "type": "string" },
|
|
1196
|
+
"detail": { "type": ["string", "null"] },
|
|
1197
|
+
"external_ref": { "oneOf": [{
|
|
1198
|
+
"type": "object",
|
|
1199
|
+
"additionalProperties": false,
|
|
1200
|
+
"required": ["system"],
|
|
1201
|
+
"properties": {
|
|
1202
|
+
"system": {
|
|
1203
|
+
"type": "string",
|
|
1204
|
+
"minLength": 1,
|
|
1205
|
+
"maxLength": 64,
|
|
1206
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
1207
|
+
},
|
|
1208
|
+
"id": {
|
|
1209
|
+
"type": "string",
|
|
1210
|
+
"minLength": 1,
|
|
1211
|
+
"maxLength": 255,
|
|
1212
|
+
"description": "External record identifier."
|
|
1213
|
+
},
|
|
1214
|
+
"url": {
|
|
1215
|
+
"type": "string",
|
|
1216
|
+
"format": "uri",
|
|
1217
|
+
"maxLength": 2048,
|
|
1218
|
+
"description": "HTTP(S) link to the external record."
|
|
1219
|
+
},
|
|
1220
|
+
"label": {
|
|
1221
|
+
"type": "string",
|
|
1222
|
+
"minLength": 1,
|
|
1223
|
+
"maxLength": 200,
|
|
1224
|
+
"description": "Human-readable display label for the external record."
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
}, { "type": "null" }] },
|
|
1228
|
+
"data": {
|
|
1229
|
+
"type": "object",
|
|
1230
|
+
"additionalProperties": true
|
|
1231
|
+
},
|
|
1232
|
+
"run_id": { "type": ["string", "null"] },
|
|
1233
|
+
"trace_url": { "type": ["string", "null"] },
|
|
1234
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
1235
|
+
"visibility": {
|
|
1236
|
+
"type": "string",
|
|
1237
|
+
"enum": ["thread", "actor_only"],
|
|
1238
|
+
"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`)."
|
|
1239
|
+
},
|
|
1240
|
+
"revision": {
|
|
1241
|
+
"type": "integer",
|
|
1242
|
+
"minimum": 1
|
|
1243
|
+
},
|
|
1244
|
+
"status_history": {
|
|
1245
|
+
"type": "array",
|
|
1246
|
+
"items": {
|
|
1247
|
+
"type": "object",
|
|
1248
|
+
"additionalProperties": false,
|
|
1249
|
+
"required": [
|
|
1250
|
+
"status",
|
|
1251
|
+
"summary",
|
|
1252
|
+
"changed_at",
|
|
1253
|
+
"actor_kind",
|
|
1254
|
+
"actor_id",
|
|
1255
|
+
"actor_label"
|
|
1256
|
+
],
|
|
1257
|
+
"properties": {
|
|
1258
|
+
"status": {
|
|
1259
|
+
"type": "string",
|
|
1260
|
+
"enum": [
|
|
1261
|
+
"started",
|
|
1262
|
+
"succeeded",
|
|
1263
|
+
"failed",
|
|
1264
|
+
"skipped",
|
|
1265
|
+
"needs_review"
|
|
1266
|
+
],
|
|
1267
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1268
|
+
},
|
|
1269
|
+
"summary": { "type": "string" },
|
|
1270
|
+
"changed_at": {
|
|
1271
|
+
"type": "string",
|
|
1272
|
+
"format": "date-time"
|
|
1273
|
+
},
|
|
1274
|
+
"actor_kind": { "type": "string" },
|
|
1275
|
+
"actor_id": {
|
|
1276
|
+
"type": ["string", "null"],
|
|
1277
|
+
"format": "uuid"
|
|
1278
|
+
},
|
|
1279
|
+
"actor_label": { "type": ["string", "null"] }
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
},
|
|
1283
|
+
"started_at": {
|
|
1284
|
+
"type": "string",
|
|
1285
|
+
"format": "date-time"
|
|
1286
|
+
},
|
|
1287
|
+
"completed_at": {
|
|
1288
|
+
"type": ["string", "null"],
|
|
1289
|
+
"format": "date-time"
|
|
1290
|
+
},
|
|
1291
|
+
"updated_by": { "oneOf": [{
|
|
1292
|
+
"type": "object",
|
|
1293
|
+
"additionalProperties": false,
|
|
1294
|
+
"required": [
|
|
1295
|
+
"kind",
|
|
1296
|
+
"id",
|
|
1297
|
+
"label"
|
|
1298
|
+
],
|
|
1299
|
+
"properties": {
|
|
1300
|
+
"kind": { "type": "string" },
|
|
1301
|
+
"id": {
|
|
1302
|
+
"type": ["string", "null"],
|
|
1303
|
+
"format": "uuid"
|
|
1304
|
+
},
|
|
1305
|
+
"label": { "type": ["string", "null"] }
|
|
1306
|
+
}
|
|
1307
|
+
}, { "type": "null" }] },
|
|
1308
|
+
"created_at": {
|
|
1309
|
+
"type": "string",
|
|
1310
|
+
"format": "date-time"
|
|
1311
|
+
},
|
|
1312
|
+
"updated_at": {
|
|
1313
|
+
"type": "string",
|
|
1314
|
+
"format": "date-time"
|
|
1315
|
+
},
|
|
1316
|
+
"occurred_at": {
|
|
1317
|
+
"type": "string",
|
|
1318
|
+
"format": "date-time"
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
},
|
|
1322
|
+
"updated": { "type": "boolean" }
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
"sdkName": "createEmailActivity",
|
|
1326
|
+
"summary": "Record or upsert an agent work activity anchored to an inbound email",
|
|
1327
|
+
"tag": "Activity",
|
|
1328
|
+
"tagCommand": "activity"
|
|
1329
|
+
},
|
|
1330
|
+
{
|
|
1331
|
+
"binaryResponse": false,
|
|
1332
|
+
"bodyRequired": true,
|
|
1333
|
+
"command": "create-thread-activity",
|
|
1334
|
+
"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",
|
|
1335
|
+
"hasJsonBody": true,
|
|
1336
|
+
"method": "POST",
|
|
1337
|
+
"operationId": "createThreadActivity",
|
|
1338
|
+
"path": "/threads/{id}/activities",
|
|
1339
|
+
"pathParams": [{
|
|
1340
|
+
"description": "Thread UUID.",
|
|
1341
|
+
"enum": null,
|
|
1342
|
+
"name": "id",
|
|
1343
|
+
"required": true,
|
|
1344
|
+
"type": "string"
|
|
1345
|
+
}],
|
|
1346
|
+
"queryParams": [],
|
|
1347
|
+
"headerParams": [{
|
|
1348
|
+
"description": "Optional idempotency key for safe retries and in-place upserts (1 to 255 printable ASCII characters).",
|
|
1349
|
+
"enum": null,
|
|
1350
|
+
"name": "Idempotency-Key",
|
|
1351
|
+
"required": false,
|
|
1352
|
+
"type": "string"
|
|
1353
|
+
}],
|
|
1354
|
+
"permissions": ["mail.activity:write"],
|
|
1355
|
+
"access": null,
|
|
1356
|
+
"requestSchema": {
|
|
1357
|
+
"type": "object",
|
|
1358
|
+
"additionalProperties": false,
|
|
1359
|
+
"required": ["summary"],
|
|
1360
|
+
"properties": {
|
|
1361
|
+
"kind": {
|
|
1362
|
+
"type": "string",
|
|
1363
|
+
"enum": [
|
|
1364
|
+
"action",
|
|
1365
|
+
"note",
|
|
1366
|
+
"handoff"
|
|
1367
|
+
],
|
|
1368
|
+
"description": "Category of an agent-reported thread activity."
|
|
1369
|
+
},
|
|
1370
|
+
"action": {
|
|
1371
|
+
"type": "string",
|
|
1372
|
+
"maxLength": 128,
|
|
1373
|
+
"description": "Lowercase action slug (for example `brex.upload_invoice`)."
|
|
1374
|
+
},
|
|
1375
|
+
"status": {
|
|
1376
|
+
"type": "string",
|
|
1377
|
+
"enum": [
|
|
1378
|
+
"started",
|
|
1379
|
+
"succeeded",
|
|
1380
|
+
"failed",
|
|
1381
|
+
"skipped",
|
|
1382
|
+
"needs_review"
|
|
1383
|
+
],
|
|
1384
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1385
|
+
},
|
|
1386
|
+
"summary": {
|
|
1387
|
+
"type": "string",
|
|
1388
|
+
"minLength": 1,
|
|
1389
|
+
"maxLength": 1e3
|
|
1390
|
+
},
|
|
1391
|
+
"detail": {
|
|
1392
|
+
"type": ["string", "null"],
|
|
1393
|
+
"maxLength": 8e3
|
|
1394
|
+
},
|
|
1395
|
+
"email_id": {
|
|
1396
|
+
"type": "string",
|
|
1397
|
+
"format": "uuid"
|
|
1398
|
+
},
|
|
1399
|
+
"sent_email_id": {
|
|
1400
|
+
"type": "string",
|
|
1401
|
+
"format": "uuid"
|
|
1402
|
+
},
|
|
1403
|
+
"external_ref": { "oneOf": [{
|
|
1404
|
+
"type": "object",
|
|
1405
|
+
"additionalProperties": false,
|
|
1406
|
+
"required": ["system"],
|
|
1407
|
+
"properties": {
|
|
1408
|
+
"system": {
|
|
1409
|
+
"type": "string",
|
|
1410
|
+
"minLength": 1,
|
|
1411
|
+
"maxLength": 64,
|
|
1412
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
1413
|
+
},
|
|
1414
|
+
"id": {
|
|
1415
|
+
"type": "string",
|
|
1416
|
+
"minLength": 1,
|
|
1417
|
+
"maxLength": 255,
|
|
1418
|
+
"description": "External record identifier."
|
|
1419
|
+
},
|
|
1420
|
+
"url": {
|
|
1421
|
+
"type": "string",
|
|
1422
|
+
"format": "uri",
|
|
1423
|
+
"maxLength": 2048,
|
|
1424
|
+
"description": "HTTP(S) link to the external record."
|
|
1425
|
+
},
|
|
1426
|
+
"label": {
|
|
1427
|
+
"type": "string",
|
|
1428
|
+
"minLength": 1,
|
|
1429
|
+
"maxLength": 200,
|
|
1430
|
+
"description": "Human-readable display label for the external record."
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
}, { "type": "null" }] },
|
|
1434
|
+
"data": {
|
|
1435
|
+
"type": "object",
|
|
1436
|
+
"additionalProperties": true
|
|
1437
|
+
},
|
|
1438
|
+
"run_id": {
|
|
1439
|
+
"type": ["string", "null"],
|
|
1440
|
+
"maxLength": 128
|
|
1441
|
+
},
|
|
1442
|
+
"trace_url": {
|
|
1443
|
+
"type": ["string", "null"],
|
|
1444
|
+
"format": "uri",
|
|
1445
|
+
"maxLength": 2048
|
|
1446
|
+
},
|
|
1447
|
+
"idempotency_key": {
|
|
1448
|
+
"type": "string",
|
|
1449
|
+
"minLength": 1,
|
|
1450
|
+
"maxLength": 255
|
|
1451
|
+
},
|
|
1452
|
+
"visibility": {
|
|
1453
|
+
"type": "string",
|
|
1454
|
+
"enum": ["thread", "actor_only"],
|
|
1455
|
+
"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`)."
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
},
|
|
1459
|
+
"responseSchema": {
|
|
1460
|
+
"type": "object",
|
|
1461
|
+
"additionalProperties": false,
|
|
1462
|
+
"required": ["activity", "updated"],
|
|
1463
|
+
"properties": {
|
|
1464
|
+
"activity": {
|
|
1465
|
+
"type": "object",
|
|
1466
|
+
"additionalProperties": false,
|
|
1467
|
+
"required": [
|
|
1468
|
+
"id",
|
|
1469
|
+
"source",
|
|
1470
|
+
"thread_id",
|
|
1471
|
+
"email_id",
|
|
1472
|
+
"sent_email_id",
|
|
1473
|
+
"actor",
|
|
1474
|
+
"kind",
|
|
1475
|
+
"action",
|
|
1476
|
+
"status",
|
|
1477
|
+
"summary",
|
|
1478
|
+
"detail",
|
|
1479
|
+
"external_ref",
|
|
1480
|
+
"data",
|
|
1481
|
+
"run_id",
|
|
1482
|
+
"trace_url",
|
|
1483
|
+
"idempotency_key",
|
|
1484
|
+
"visibility",
|
|
1485
|
+
"revision",
|
|
1486
|
+
"status_history",
|
|
1487
|
+
"started_at",
|
|
1488
|
+
"completed_at",
|
|
1489
|
+
"updated_by",
|
|
1490
|
+
"created_at",
|
|
1491
|
+
"updated_at",
|
|
1492
|
+
"occurred_at"
|
|
1493
|
+
],
|
|
1494
|
+
"properties": {
|
|
1495
|
+
"id": {
|
|
1496
|
+
"type": "string",
|
|
1497
|
+
"format": "uuid"
|
|
1498
|
+
},
|
|
1499
|
+
"source": {
|
|
1500
|
+
"type": "string",
|
|
1501
|
+
"enum": ["agent"]
|
|
1502
|
+
},
|
|
1503
|
+
"thread_id": {
|
|
1504
|
+
"type": "string",
|
|
1505
|
+
"format": "uuid"
|
|
1506
|
+
},
|
|
1507
|
+
"email_id": {
|
|
1508
|
+
"type": ["string", "null"],
|
|
1509
|
+
"format": "uuid"
|
|
1510
|
+
},
|
|
1511
|
+
"sent_email_id": {
|
|
1512
|
+
"type": ["string", "null"],
|
|
1513
|
+
"format": "uuid"
|
|
1514
|
+
},
|
|
1515
|
+
"actor": {
|
|
1516
|
+
"type": "object",
|
|
1517
|
+
"additionalProperties": false,
|
|
1518
|
+
"required": [
|
|
1519
|
+
"kind",
|
|
1520
|
+
"id",
|
|
1521
|
+
"label",
|
|
1522
|
+
"ownership",
|
|
1523
|
+
"owner_user_id",
|
|
1524
|
+
"owner_label",
|
|
1525
|
+
"agent_connection_id",
|
|
1526
|
+
"oauth_client_id"
|
|
1527
|
+
],
|
|
1528
|
+
"properties": {
|
|
1529
|
+
"kind": { "type": "string" },
|
|
1530
|
+
"id": {
|
|
1531
|
+
"type": ["string", "null"],
|
|
1532
|
+
"format": "uuid"
|
|
1533
|
+
},
|
|
1534
|
+
"label": { "type": ["string", "null"] },
|
|
1535
|
+
"ownership": {
|
|
1536
|
+
"type": "string",
|
|
1537
|
+
"enum": [
|
|
1538
|
+
"human",
|
|
1539
|
+
"personal_agent",
|
|
1540
|
+
"org_key",
|
|
1541
|
+
"function",
|
|
1542
|
+
"app",
|
|
1543
|
+
"system"
|
|
1544
|
+
],
|
|
1545
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
1546
|
+
},
|
|
1547
|
+
"owner_user_id": {
|
|
1548
|
+
"type": ["string", "null"],
|
|
1549
|
+
"format": "uuid"
|
|
1550
|
+
},
|
|
1551
|
+
"owner_label": { "type": ["string", "null"] },
|
|
1552
|
+
"agent_connection_id": {
|
|
1553
|
+
"type": ["string", "null"],
|
|
1554
|
+
"format": "uuid"
|
|
1555
|
+
},
|
|
1556
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
1557
|
+
}
|
|
1558
|
+
},
|
|
1559
|
+
"kind": {
|
|
1560
|
+
"type": "string",
|
|
1561
|
+
"enum": [
|
|
1562
|
+
"action",
|
|
1563
|
+
"note",
|
|
1564
|
+
"handoff"
|
|
1565
|
+
],
|
|
1566
|
+
"description": "Category of an agent-reported thread activity."
|
|
1567
|
+
},
|
|
1568
|
+
"action": { "type": "string" },
|
|
1569
|
+
"status": {
|
|
1570
|
+
"type": "string",
|
|
1571
|
+
"enum": [
|
|
1572
|
+
"started",
|
|
1573
|
+
"succeeded",
|
|
1574
|
+
"failed",
|
|
1575
|
+
"skipped",
|
|
1576
|
+
"needs_review"
|
|
1577
|
+
],
|
|
1578
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1579
|
+
},
|
|
1580
|
+
"summary": { "type": "string" },
|
|
1581
|
+
"detail": { "type": ["string", "null"] },
|
|
1582
|
+
"external_ref": { "oneOf": [{
|
|
1583
|
+
"type": "object",
|
|
1584
|
+
"additionalProperties": false,
|
|
1585
|
+
"required": ["system"],
|
|
1586
|
+
"properties": {
|
|
1587
|
+
"system": {
|
|
1588
|
+
"type": "string",
|
|
1589
|
+
"minLength": 1,
|
|
1590
|
+
"maxLength": 64,
|
|
1591
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
1592
|
+
},
|
|
1593
|
+
"id": {
|
|
1594
|
+
"type": "string",
|
|
1595
|
+
"minLength": 1,
|
|
1596
|
+
"maxLength": 255,
|
|
1597
|
+
"description": "External record identifier."
|
|
1598
|
+
},
|
|
1599
|
+
"url": {
|
|
1600
|
+
"type": "string",
|
|
1601
|
+
"format": "uri",
|
|
1602
|
+
"maxLength": 2048,
|
|
1603
|
+
"description": "HTTP(S) link to the external record."
|
|
1604
|
+
},
|
|
1605
|
+
"label": {
|
|
1606
|
+
"type": "string",
|
|
1607
|
+
"minLength": 1,
|
|
1608
|
+
"maxLength": 200,
|
|
1609
|
+
"description": "Human-readable display label for the external record."
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
}, { "type": "null" }] },
|
|
1613
|
+
"data": {
|
|
1614
|
+
"type": "object",
|
|
1615
|
+
"additionalProperties": true
|
|
1616
|
+
},
|
|
1617
|
+
"run_id": { "type": ["string", "null"] },
|
|
1618
|
+
"trace_url": { "type": ["string", "null"] },
|
|
1619
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
1620
|
+
"visibility": {
|
|
1621
|
+
"type": "string",
|
|
1622
|
+
"enum": ["thread", "actor_only"],
|
|
1623
|
+
"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`)."
|
|
1624
|
+
},
|
|
1625
|
+
"revision": {
|
|
1626
|
+
"type": "integer",
|
|
1627
|
+
"minimum": 1
|
|
1628
|
+
},
|
|
1629
|
+
"status_history": {
|
|
1630
|
+
"type": "array",
|
|
1631
|
+
"items": {
|
|
1632
|
+
"type": "object",
|
|
1633
|
+
"additionalProperties": false,
|
|
1634
|
+
"required": [
|
|
1635
|
+
"status",
|
|
1636
|
+
"summary",
|
|
1637
|
+
"changed_at",
|
|
1638
|
+
"actor_kind",
|
|
1639
|
+
"actor_id",
|
|
1640
|
+
"actor_label"
|
|
1641
|
+
],
|
|
1642
|
+
"properties": {
|
|
1643
|
+
"status": {
|
|
1644
|
+
"type": "string",
|
|
1645
|
+
"enum": [
|
|
1646
|
+
"started",
|
|
1647
|
+
"succeeded",
|
|
1648
|
+
"failed",
|
|
1649
|
+
"skipped",
|
|
1650
|
+
"needs_review"
|
|
1651
|
+
],
|
|
1652
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
1653
|
+
},
|
|
1654
|
+
"summary": { "type": "string" },
|
|
1655
|
+
"changed_at": {
|
|
1656
|
+
"type": "string",
|
|
1657
|
+
"format": "date-time"
|
|
1658
|
+
},
|
|
1659
|
+
"actor_kind": { "type": "string" },
|
|
1660
|
+
"actor_id": {
|
|
1661
|
+
"type": ["string", "null"],
|
|
1662
|
+
"format": "uuid"
|
|
1663
|
+
},
|
|
1664
|
+
"actor_label": { "type": ["string", "null"] }
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
},
|
|
1668
|
+
"started_at": {
|
|
1669
|
+
"type": "string",
|
|
1670
|
+
"format": "date-time"
|
|
1671
|
+
},
|
|
1672
|
+
"completed_at": {
|
|
1673
|
+
"type": ["string", "null"],
|
|
1674
|
+
"format": "date-time"
|
|
1675
|
+
},
|
|
1676
|
+
"updated_by": { "oneOf": [{
|
|
1677
|
+
"type": "object",
|
|
1678
|
+
"additionalProperties": false,
|
|
1679
|
+
"required": [
|
|
1680
|
+
"kind",
|
|
1681
|
+
"id",
|
|
1682
|
+
"label"
|
|
1683
|
+
],
|
|
1684
|
+
"properties": {
|
|
1685
|
+
"kind": { "type": "string" },
|
|
1686
|
+
"id": {
|
|
1687
|
+
"type": ["string", "null"],
|
|
1688
|
+
"format": "uuid"
|
|
1689
|
+
},
|
|
1690
|
+
"label": { "type": ["string", "null"] }
|
|
1691
|
+
}
|
|
1692
|
+
}, { "type": "null" }] },
|
|
1693
|
+
"created_at": {
|
|
1694
|
+
"type": "string",
|
|
1695
|
+
"format": "date-time"
|
|
1696
|
+
},
|
|
1697
|
+
"updated_at": {
|
|
1698
|
+
"type": "string",
|
|
1699
|
+
"format": "date-time"
|
|
1700
|
+
},
|
|
1701
|
+
"occurred_at": {
|
|
1702
|
+
"type": "string",
|
|
1703
|
+
"format": "date-time"
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
},
|
|
1707
|
+
"updated": { "type": "boolean" }
|
|
1708
|
+
}
|
|
1709
|
+
},
|
|
1710
|
+
"sdkName": "createThreadActivity",
|
|
1711
|
+
"summary": "Record or upsert an agent work activity on a thread",
|
|
1712
|
+
"tag": "Activity",
|
|
1713
|
+
"tagCommand": "activity"
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
"binaryResponse": false,
|
|
1717
|
+
"bodyRequired": false,
|
|
1718
|
+
"command": "get-thread-timeline",
|
|
1719
|
+
"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",
|
|
1720
|
+
"hasJsonBody": false,
|
|
1721
|
+
"method": "GET",
|
|
1722
|
+
"operationId": "getThreadTimeline",
|
|
1723
|
+
"path": "/threads/{id}/timeline",
|
|
1724
|
+
"pathParams": [{
|
|
1725
|
+
"description": "Thread UUID.",
|
|
1726
|
+
"enum": null,
|
|
1727
|
+
"name": "id",
|
|
1728
|
+
"required": true,
|
|
1729
|
+
"type": "string"
|
|
1730
|
+
}],
|
|
1731
|
+
"queryParams": [
|
|
1732
|
+
{
|
|
1733
|
+
"description": "Filter timeline entries by source: all (default), primitive, or agent.",
|
|
1734
|
+
"enum": null,
|
|
1735
|
+
"name": "source",
|
|
1736
|
+
"required": false,
|
|
1737
|
+
"type": "string"
|
|
1738
|
+
},
|
|
1739
|
+
{
|
|
1740
|
+
"description": "For agent activities: action, note, or handoff.",
|
|
1741
|
+
"enum": null,
|
|
1742
|
+
"name": "kind",
|
|
1743
|
+
"required": false,
|
|
1744
|
+
"type": "string"
|
|
1745
|
+
},
|
|
1746
|
+
{
|
|
1747
|
+
"description": "For agent activities: comma-separated statuses from started, succeeded, failed, skipped, needs_review.",
|
|
1748
|
+
"enum": null,
|
|
1749
|
+
"name": "status",
|
|
1750
|
+
"required": false,
|
|
1751
|
+
"type": "string"
|
|
1752
|
+
},
|
|
1753
|
+
{
|
|
1754
|
+
"description": "When `\"true\"`, limits to agent activities with status `failed` or `needs_review`.",
|
|
1755
|
+
"enum": ["true", "false"],
|
|
1756
|
+
"name": "attention",
|
|
1757
|
+
"required": false,
|
|
1758
|
+
"type": "string"
|
|
1759
|
+
},
|
|
1760
|
+
{
|
|
1761
|
+
"description": "Exact action name filter (for example `brex.upload_invoice` or `email.read`).",
|
|
1762
|
+
"enum": null,
|
|
1763
|
+
"name": "action",
|
|
1764
|
+
"required": false,
|
|
1765
|
+
"type": "string"
|
|
1766
|
+
},
|
|
1767
|
+
{
|
|
1768
|
+
"description": "Filter by actor ownership class: human, personal_agent, org_key, function, app, or system.",
|
|
1769
|
+
"enum": null,
|
|
1770
|
+
"name": "actor_ownership",
|
|
1771
|
+
"required": false,
|
|
1772
|
+
"type": "string"
|
|
1773
|
+
},
|
|
1774
|
+
{
|
|
1775
|
+
"description": "Filter to events or activities recorded by a specific actor UUID.",
|
|
1776
|
+
"enum": null,
|
|
1777
|
+
"name": "actor_id",
|
|
1778
|
+
"required": false,
|
|
1779
|
+
"type": "string"
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
"description": "Filter to events or activities carrying this run_id.",
|
|
1783
|
+
"enum": null,
|
|
1784
|
+
"name": "run_id",
|
|
1785
|
+
"required": false,
|
|
1786
|
+
"type": "string"
|
|
1787
|
+
},
|
|
1788
|
+
{
|
|
1789
|
+
"description": "When `\"true\"`, includes `actor_only` activities written by other actors if the caller holds `activity:read`.",
|
|
1790
|
+
"enum": ["true", "false"],
|
|
1791
|
+
"name": "include_private",
|
|
1792
|
+
"required": false,
|
|
1793
|
+
"type": "string"
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
"description": "Sort order by occurred_at: desc (default, newest first) or asc (chronological).",
|
|
1797
|
+
"enum": ["desc", "asc"],
|
|
1798
|
+
"name": "order",
|
|
1799
|
+
"required": false,
|
|
1800
|
+
"type": "string"
|
|
1801
|
+
},
|
|
1802
|
+
{
|
|
1803
|
+
"default": 50,
|
|
1804
|
+
"description": "Items per page, from 1 to 200; defaults to 50.",
|
|
1805
|
+
"enum": null,
|
|
1806
|
+
"maximum": 200,
|
|
1807
|
+
"minimum": 1,
|
|
1808
|
+
"name": "limit",
|
|
1809
|
+
"required": false,
|
|
1810
|
+
"type": "integer"
|
|
1811
|
+
},
|
|
1812
|
+
{
|
|
1813
|
+
"description": "`next_cursor` from the previous page.",
|
|
1814
|
+
"enum": null,
|
|
1815
|
+
"name": "cursor",
|
|
1816
|
+
"required": false,
|
|
1817
|
+
"type": "string"
|
|
1818
|
+
}
|
|
1819
|
+
],
|
|
1820
|
+
"headerParams": [],
|
|
1821
|
+
"permissions": ["mail.activity:read"],
|
|
1822
|
+
"access": null,
|
|
1823
|
+
"requestSchema": null,
|
|
1824
|
+
"responseSchema": {
|
|
1825
|
+
"type": "object",
|
|
1826
|
+
"additionalProperties": false,
|
|
1827
|
+
"required": [
|
|
1828
|
+
"thread_id",
|
|
1829
|
+
"items",
|
|
1830
|
+
"next_cursor"
|
|
1831
|
+
],
|
|
1832
|
+
"properties": {
|
|
1833
|
+
"thread_id": {
|
|
1834
|
+
"type": "string",
|
|
1835
|
+
"format": "uuid"
|
|
1836
|
+
},
|
|
1837
|
+
"items": {
|
|
1838
|
+
"type": "array",
|
|
1839
|
+
"items": {
|
|
1840
|
+
"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.",
|
|
1841
|
+
"oneOf": [{
|
|
1842
|
+
"type": "object",
|
|
1843
|
+
"additionalProperties": false,
|
|
1844
|
+
"required": [
|
|
1845
|
+
"id",
|
|
1846
|
+
"source",
|
|
1847
|
+
"thread_id",
|
|
1848
|
+
"email_id",
|
|
1849
|
+
"sent_email_id",
|
|
1850
|
+
"mailbox_address",
|
|
1851
|
+
"action",
|
|
1852
|
+
"actor",
|
|
1853
|
+
"request_id",
|
|
1854
|
+
"reason",
|
|
1855
|
+
"run_id",
|
|
1856
|
+
"metadata",
|
|
1857
|
+
"occurred_at"
|
|
1858
|
+
],
|
|
1859
|
+
"properties": {
|
|
1860
|
+
"id": {
|
|
1861
|
+
"type": "string",
|
|
1862
|
+
"format": "uuid"
|
|
1863
|
+
},
|
|
1864
|
+
"source": {
|
|
1865
|
+
"type": "string",
|
|
1866
|
+
"enum": ["primitive"]
|
|
1867
|
+
},
|
|
1868
|
+
"thread_id": {
|
|
1869
|
+
"type": ["string", "null"],
|
|
1870
|
+
"format": "uuid"
|
|
1871
|
+
},
|
|
1872
|
+
"email_id": {
|
|
1873
|
+
"type": ["string", "null"],
|
|
1874
|
+
"format": "uuid"
|
|
1875
|
+
},
|
|
1876
|
+
"sent_email_id": {
|
|
1877
|
+
"type": ["string", "null"],
|
|
1878
|
+
"format": "uuid"
|
|
1879
|
+
},
|
|
1880
|
+
"mailbox_address": { "type": ["string", "null"] },
|
|
1881
|
+
"action": {
|
|
1882
|
+
"type": "string",
|
|
1883
|
+
"enum": [
|
|
1884
|
+
"email.read",
|
|
1885
|
+
"email.readable_read",
|
|
1886
|
+
"email.conversation_read",
|
|
1887
|
+
"email.raw_read",
|
|
1888
|
+
"email.attachment_read",
|
|
1889
|
+
"email.replied",
|
|
1890
|
+
"email.sent",
|
|
1891
|
+
"email.signaled",
|
|
1892
|
+
"email.deleted",
|
|
1893
|
+
"email.content_discarded"
|
|
1894
|
+
],
|
|
1895
|
+
"description": "System-verified mail action recorded automatically by Primitive."
|
|
1896
|
+
},
|
|
1897
|
+
"actor": {
|
|
1898
|
+
"type": "object",
|
|
1899
|
+
"additionalProperties": false,
|
|
1900
|
+
"required": [
|
|
1901
|
+
"kind",
|
|
1902
|
+
"id",
|
|
1903
|
+
"label",
|
|
1904
|
+
"ownership",
|
|
1905
|
+
"owner_user_id",
|
|
1906
|
+
"owner_label",
|
|
1907
|
+
"agent_connection_id",
|
|
1908
|
+
"oauth_client_id"
|
|
1909
|
+
],
|
|
1910
|
+
"properties": {
|
|
1911
|
+
"kind": { "type": "string" },
|
|
1912
|
+
"id": {
|
|
1913
|
+
"type": ["string", "null"],
|
|
1914
|
+
"format": "uuid"
|
|
1915
|
+
},
|
|
1916
|
+
"label": { "type": ["string", "null"] },
|
|
1917
|
+
"ownership": {
|
|
1918
|
+
"type": "string",
|
|
1919
|
+
"enum": [
|
|
1920
|
+
"human",
|
|
1921
|
+
"personal_agent",
|
|
1922
|
+
"org_key",
|
|
1923
|
+
"function",
|
|
1924
|
+
"app",
|
|
1925
|
+
"system"
|
|
1926
|
+
],
|
|
1927
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
1928
|
+
},
|
|
1929
|
+
"owner_user_id": {
|
|
1930
|
+
"type": ["string", "null"],
|
|
1931
|
+
"format": "uuid"
|
|
1932
|
+
},
|
|
1933
|
+
"owner_label": { "type": ["string", "null"] },
|
|
1934
|
+
"agent_connection_id": {
|
|
1935
|
+
"type": ["string", "null"],
|
|
1936
|
+
"format": "uuid"
|
|
1937
|
+
},
|
|
1938
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
1939
|
+
}
|
|
1940
|
+
},
|
|
1941
|
+
"request_id": { "type": ["string", "null"] },
|
|
1942
|
+
"reason": { "type": ["string", "null"] },
|
|
1943
|
+
"run_id": { "type": ["string", "null"] },
|
|
1944
|
+
"metadata": {
|
|
1945
|
+
"type": "object",
|
|
1946
|
+
"additionalProperties": true
|
|
1947
|
+
},
|
|
1948
|
+
"occurred_at": {
|
|
1949
|
+
"type": "string",
|
|
1950
|
+
"format": "date-time"
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1953
|
+
}, {
|
|
1954
|
+
"type": "object",
|
|
1955
|
+
"additionalProperties": false,
|
|
1956
|
+
"required": [
|
|
1957
|
+
"id",
|
|
1958
|
+
"source",
|
|
1959
|
+
"thread_id",
|
|
1960
|
+
"email_id",
|
|
1961
|
+
"sent_email_id",
|
|
1962
|
+
"actor",
|
|
1963
|
+
"kind",
|
|
1964
|
+
"action",
|
|
1965
|
+
"status",
|
|
1966
|
+
"summary",
|
|
1967
|
+
"detail",
|
|
1968
|
+
"external_ref",
|
|
1969
|
+
"data",
|
|
1970
|
+
"run_id",
|
|
1971
|
+
"trace_url",
|
|
1972
|
+
"idempotency_key",
|
|
1973
|
+
"visibility",
|
|
1974
|
+
"revision",
|
|
1975
|
+
"status_history",
|
|
1976
|
+
"started_at",
|
|
1977
|
+
"completed_at",
|
|
1978
|
+
"updated_by",
|
|
1979
|
+
"created_at",
|
|
1980
|
+
"updated_at",
|
|
1981
|
+
"occurred_at"
|
|
1982
|
+
],
|
|
1983
|
+
"properties": {
|
|
1984
|
+
"id": {
|
|
1985
|
+
"type": "string",
|
|
1986
|
+
"format": "uuid"
|
|
1987
|
+
},
|
|
1988
|
+
"source": {
|
|
1989
|
+
"type": "string",
|
|
1990
|
+
"enum": ["agent"]
|
|
1991
|
+
},
|
|
1992
|
+
"thread_id": {
|
|
1993
|
+
"type": "string",
|
|
1994
|
+
"format": "uuid"
|
|
1995
|
+
},
|
|
1996
|
+
"email_id": {
|
|
1997
|
+
"type": ["string", "null"],
|
|
1998
|
+
"format": "uuid"
|
|
1999
|
+
},
|
|
2000
|
+
"sent_email_id": {
|
|
2001
|
+
"type": ["string", "null"],
|
|
2002
|
+
"format": "uuid"
|
|
2003
|
+
},
|
|
2004
|
+
"actor": {
|
|
2005
|
+
"type": "object",
|
|
2006
|
+
"additionalProperties": false,
|
|
2007
|
+
"required": [
|
|
2008
|
+
"kind",
|
|
2009
|
+
"id",
|
|
2010
|
+
"label",
|
|
2011
|
+
"ownership",
|
|
2012
|
+
"owner_user_id",
|
|
2013
|
+
"owner_label",
|
|
2014
|
+
"agent_connection_id",
|
|
2015
|
+
"oauth_client_id"
|
|
2016
|
+
],
|
|
2017
|
+
"properties": {
|
|
2018
|
+
"kind": { "type": "string" },
|
|
2019
|
+
"id": {
|
|
2020
|
+
"type": ["string", "null"],
|
|
2021
|
+
"format": "uuid"
|
|
2022
|
+
},
|
|
2023
|
+
"label": { "type": ["string", "null"] },
|
|
2024
|
+
"ownership": {
|
|
2025
|
+
"type": "string",
|
|
2026
|
+
"enum": [
|
|
2027
|
+
"human",
|
|
2028
|
+
"personal_agent",
|
|
2029
|
+
"org_key",
|
|
2030
|
+
"function",
|
|
2031
|
+
"app",
|
|
2032
|
+
"system"
|
|
2033
|
+
],
|
|
2034
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
2035
|
+
},
|
|
2036
|
+
"owner_user_id": {
|
|
2037
|
+
"type": ["string", "null"],
|
|
2038
|
+
"format": "uuid"
|
|
2039
|
+
},
|
|
2040
|
+
"owner_label": { "type": ["string", "null"] },
|
|
2041
|
+
"agent_connection_id": {
|
|
2042
|
+
"type": ["string", "null"],
|
|
2043
|
+
"format": "uuid"
|
|
2044
|
+
},
|
|
2045
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
2046
|
+
}
|
|
2047
|
+
},
|
|
2048
|
+
"kind": {
|
|
2049
|
+
"type": "string",
|
|
2050
|
+
"enum": [
|
|
2051
|
+
"action",
|
|
2052
|
+
"note",
|
|
2053
|
+
"handoff"
|
|
2054
|
+
],
|
|
2055
|
+
"description": "Category of an agent-reported thread activity."
|
|
2056
|
+
},
|
|
2057
|
+
"action": { "type": "string" },
|
|
2058
|
+
"status": {
|
|
2059
|
+
"type": "string",
|
|
2060
|
+
"enum": [
|
|
2061
|
+
"started",
|
|
2062
|
+
"succeeded",
|
|
2063
|
+
"failed",
|
|
2064
|
+
"skipped",
|
|
2065
|
+
"needs_review"
|
|
2066
|
+
],
|
|
2067
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
2068
|
+
},
|
|
2069
|
+
"summary": { "type": "string" },
|
|
2070
|
+
"detail": { "type": ["string", "null"] },
|
|
2071
|
+
"external_ref": { "oneOf": [{
|
|
2072
|
+
"type": "object",
|
|
2073
|
+
"additionalProperties": false,
|
|
2074
|
+
"required": ["system"],
|
|
2075
|
+
"properties": {
|
|
2076
|
+
"system": {
|
|
2077
|
+
"type": "string",
|
|
2078
|
+
"minLength": 1,
|
|
2079
|
+
"maxLength": 64,
|
|
2080
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
2081
|
+
},
|
|
2082
|
+
"id": {
|
|
2083
|
+
"type": "string",
|
|
2084
|
+
"minLength": 1,
|
|
2085
|
+
"maxLength": 255,
|
|
2086
|
+
"description": "External record identifier."
|
|
2087
|
+
},
|
|
2088
|
+
"url": {
|
|
2089
|
+
"type": "string",
|
|
2090
|
+
"format": "uri",
|
|
2091
|
+
"maxLength": 2048,
|
|
2092
|
+
"description": "HTTP(S) link to the external record."
|
|
2093
|
+
},
|
|
2094
|
+
"label": {
|
|
2095
|
+
"type": "string",
|
|
2096
|
+
"minLength": 1,
|
|
2097
|
+
"maxLength": 200,
|
|
2098
|
+
"description": "Human-readable display label for the external record."
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
}, { "type": "null" }] },
|
|
2102
|
+
"data": {
|
|
2103
|
+
"type": "object",
|
|
2104
|
+
"additionalProperties": true
|
|
2105
|
+
},
|
|
2106
|
+
"run_id": { "type": ["string", "null"] },
|
|
2107
|
+
"trace_url": { "type": ["string", "null"] },
|
|
2108
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
2109
|
+
"visibility": {
|
|
2110
|
+
"type": "string",
|
|
2111
|
+
"enum": ["thread", "actor_only"],
|
|
2112
|
+
"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`)."
|
|
2113
|
+
},
|
|
2114
|
+
"revision": {
|
|
2115
|
+
"type": "integer",
|
|
2116
|
+
"minimum": 1
|
|
2117
|
+
},
|
|
2118
|
+
"status_history": {
|
|
2119
|
+
"type": "array",
|
|
2120
|
+
"items": {
|
|
2121
|
+
"type": "object",
|
|
2122
|
+
"additionalProperties": false,
|
|
2123
|
+
"required": [
|
|
2124
|
+
"status",
|
|
2125
|
+
"summary",
|
|
2126
|
+
"changed_at",
|
|
2127
|
+
"actor_kind",
|
|
2128
|
+
"actor_id",
|
|
2129
|
+
"actor_label"
|
|
2130
|
+
],
|
|
2131
|
+
"properties": {
|
|
2132
|
+
"status": {
|
|
2133
|
+
"type": "string",
|
|
2134
|
+
"enum": [
|
|
2135
|
+
"started",
|
|
2136
|
+
"succeeded",
|
|
2137
|
+
"failed",
|
|
2138
|
+
"skipped",
|
|
2139
|
+
"needs_review"
|
|
2140
|
+
],
|
|
2141
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
2142
|
+
},
|
|
2143
|
+
"summary": { "type": "string" },
|
|
2144
|
+
"changed_at": {
|
|
2145
|
+
"type": "string",
|
|
2146
|
+
"format": "date-time"
|
|
2147
|
+
},
|
|
2148
|
+
"actor_kind": { "type": "string" },
|
|
2149
|
+
"actor_id": {
|
|
2150
|
+
"type": ["string", "null"],
|
|
2151
|
+
"format": "uuid"
|
|
2152
|
+
},
|
|
2153
|
+
"actor_label": { "type": ["string", "null"] }
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
},
|
|
2157
|
+
"started_at": {
|
|
2158
|
+
"type": "string",
|
|
2159
|
+
"format": "date-time"
|
|
2160
|
+
},
|
|
2161
|
+
"completed_at": {
|
|
2162
|
+
"type": ["string", "null"],
|
|
2163
|
+
"format": "date-time"
|
|
2164
|
+
},
|
|
2165
|
+
"updated_by": { "oneOf": [{
|
|
2166
|
+
"type": "object",
|
|
2167
|
+
"additionalProperties": false,
|
|
2168
|
+
"required": [
|
|
2169
|
+
"kind",
|
|
2170
|
+
"id",
|
|
2171
|
+
"label"
|
|
2172
|
+
],
|
|
2173
|
+
"properties": {
|
|
2174
|
+
"kind": { "type": "string" },
|
|
2175
|
+
"id": {
|
|
2176
|
+
"type": ["string", "null"],
|
|
2177
|
+
"format": "uuid"
|
|
2178
|
+
},
|
|
2179
|
+
"label": { "type": ["string", "null"] }
|
|
2180
|
+
}
|
|
2181
|
+
}, { "type": "null" }] },
|
|
2182
|
+
"created_at": {
|
|
2183
|
+
"type": "string",
|
|
2184
|
+
"format": "date-time"
|
|
2185
|
+
},
|
|
2186
|
+
"updated_at": {
|
|
2187
|
+
"type": "string",
|
|
2188
|
+
"format": "date-time"
|
|
2189
|
+
},
|
|
2190
|
+
"occurred_at": {
|
|
2191
|
+
"type": "string",
|
|
2192
|
+
"format": "date-time"
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
}],
|
|
2196
|
+
"discriminator": {
|
|
2197
|
+
"propertyName": "source",
|
|
2198
|
+
"mapping": {
|
|
2199
|
+
"primitive": "#/components/schemas/MailActivityEvent",
|
|
2200
|
+
"agent": "#/components/schemas/ThreadActivity"
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
},
|
|
2205
|
+
"next_cursor": { "type": ["string", "null"] }
|
|
2206
|
+
}
|
|
2207
|
+
},
|
|
2208
|
+
"sdkName": "getThreadTimeline",
|
|
2209
|
+
"summary": "Read the unified timeline of verified mail actions and agent work on a thread",
|
|
2210
|
+
"tag": "Activity",
|
|
2211
|
+
"tagCommand": "activity"
|
|
2212
|
+
},
|
|
2213
|
+
{
|
|
2214
|
+
"binaryResponse": false,
|
|
2215
|
+
"bodyRequired": false,
|
|
2216
|
+
"command": "list-activity-objects",
|
|
2217
|
+
"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.",
|
|
2218
|
+
"hasJsonBody": false,
|
|
2219
|
+
"method": "GET",
|
|
2220
|
+
"operationId": "listActivityObjects",
|
|
2221
|
+
"path": "/activity/objects",
|
|
2222
|
+
"pathParams": [],
|
|
2223
|
+
"queryParams": [
|
|
2224
|
+
{
|
|
2225
|
+
"default": "created",
|
|
2226
|
+
"description": "created (the default), asked or concerning.",
|
|
2227
|
+
"enum": [
|
|
2228
|
+
"created",
|
|
2229
|
+
"asked",
|
|
2230
|
+
"concerning"
|
|
2231
|
+
],
|
|
2232
|
+
"name": "relation",
|
|
2233
|
+
"required": false,
|
|
2234
|
+
"type": "string"
|
|
2235
|
+
},
|
|
2236
|
+
{
|
|
2237
|
+
"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.",
|
|
2238
|
+
"enum": null,
|
|
2239
|
+
"name": "kind",
|
|
2240
|
+
"required": false,
|
|
2241
|
+
"type": "string"
|
|
2242
|
+
},
|
|
2243
|
+
{
|
|
2244
|
+
"default": "all",
|
|
2245
|
+
"description": "all (the default), live (still there, enabled or not) or ended (deleted, replaced or finished).",
|
|
2246
|
+
"enum": [
|
|
2247
|
+
"all",
|
|
2248
|
+
"live",
|
|
2249
|
+
"ended"
|
|
2250
|
+
],
|
|
2251
|
+
"name": "state",
|
|
2252
|
+
"required": false,
|
|
2253
|
+
"type": "string"
|
|
2254
|
+
},
|
|
2255
|
+
{
|
|
2256
|
+
"default": 50,
|
|
2257
|
+
"description": "Objects per page, from 1 to 200; defaults to 50.",
|
|
2258
|
+
"enum": null,
|
|
2259
|
+
"maximum": 200,
|
|
2260
|
+
"minimum": 1,
|
|
2261
|
+
"name": "limit",
|
|
2262
|
+
"required": false,
|
|
2263
|
+
"type": "integer"
|
|
2264
|
+
},
|
|
2265
|
+
{
|
|
2266
|
+
"description": "next_cursor from the preceding page. Omit for the first page.",
|
|
2267
|
+
"enum": null,
|
|
2268
|
+
"name": "cursor",
|
|
2269
|
+
"required": false,
|
|
2270
|
+
"type": "string"
|
|
2271
|
+
}
|
|
2272
|
+
],
|
|
2273
|
+
"headerParams": [],
|
|
2274
|
+
"permissions": ["activity:read_self"],
|
|
2275
|
+
"access": null,
|
|
2276
|
+
"requestSchema": null,
|
|
2277
|
+
"responseSchema": {
|
|
2278
|
+
"type": "object",
|
|
2279
|
+
"properties": {
|
|
2280
|
+
"covers": {
|
|
2281
|
+
"type": "string",
|
|
2282
|
+
"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."
|
|
2283
|
+
},
|
|
2284
|
+
"items": {
|
|
2285
|
+
"type": "array",
|
|
2286
|
+
"items": {
|
|
2287
|
+
"type": "object",
|
|
2288
|
+
"properties": {
|
|
2289
|
+
"kind": {
|
|
2290
|
+
"type": "string",
|
|
2291
|
+
"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."
|
|
2292
|
+
},
|
|
2293
|
+
"id": { "type": "string" },
|
|
2294
|
+
"name": {
|
|
2295
|
+
"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.",
|
|
2296
|
+
"type": ["string", "null"]
|
|
2297
|
+
},
|
|
2298
|
+
"state": {
|
|
2299
|
+
"type": "string",
|
|
2300
|
+
"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)."
|
|
2301
|
+
},
|
|
2302
|
+
"created_at": {
|
|
2303
|
+
"type": "string",
|
|
2304
|
+
"format": "date-time"
|
|
2305
|
+
},
|
|
2306
|
+
"ended_at": {
|
|
2307
|
+
"type": ["string", "null"],
|
|
2308
|
+
"format": "date-time",
|
|
2309
|
+
"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."
|
|
2310
|
+
},
|
|
2311
|
+
"owned_now": {
|
|
2312
|
+
"type": "string",
|
|
2313
|
+
"enum": ["you", "someone_else"],
|
|
2314
|
+
"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."
|
|
2315
|
+
},
|
|
2316
|
+
"created_through": {
|
|
2317
|
+
"type": "object",
|
|
2318
|
+
"properties": {
|
|
2319
|
+
"kind": {
|
|
2320
|
+
"type": "string",
|
|
2321
|
+
"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."
|
|
2322
|
+
},
|
|
2323
|
+
"id": {
|
|
2324
|
+
"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.",
|
|
2325
|
+
"type": ["string", "null"]
|
|
2326
|
+
},
|
|
2327
|
+
"name": {
|
|
2328
|
+
"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.",
|
|
2329
|
+
"type": ["string", "null"]
|
|
2330
|
+
}
|
|
2331
|
+
},
|
|
2332
|
+
"required": [
|
|
2333
|
+
"kind",
|
|
2334
|
+
"id",
|
|
2335
|
+
"name"
|
|
2336
|
+
]
|
|
2337
|
+
},
|
|
2338
|
+
"rule_id": {
|
|
2339
|
+
"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.",
|
|
2340
|
+
"type": "string",
|
|
2341
|
+
"format": "uuid"
|
|
2342
|
+
},
|
|
2343
|
+
"stop_reason": {
|
|
2344
|
+
"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.",
|
|
2345
|
+
"type": "string",
|
|
2346
|
+
"enum": [
|
|
2347
|
+
"deleted",
|
|
2348
|
+
"turned_off",
|
|
2349
|
+
"no_longer_covers"
|
|
2350
|
+
]
|
|
2351
|
+
}
|
|
2352
|
+
},
|
|
2353
|
+
"required": [
|
|
2354
|
+
"kind",
|
|
2355
|
+
"id",
|
|
2356
|
+
"name",
|
|
2357
|
+
"state",
|
|
2358
|
+
"created_at",
|
|
2359
|
+
"ended_at",
|
|
2360
|
+
"owned_now",
|
|
2361
|
+
"created_through"
|
|
2362
|
+
]
|
|
2363
|
+
}
|
|
2364
|
+
},
|
|
2365
|
+
"withheld": {
|
|
2366
|
+
"type": "array",
|
|
2367
|
+
"items": {
|
|
2368
|
+
"type": "object",
|
|
2369
|
+
"properties": {
|
|
2370
|
+
"kind": { "type": "string" },
|
|
2371
|
+
"reason": {
|
|
2372
|
+
"type": "string",
|
|
2373
|
+
"enum": [
|
|
2374
|
+
"permission_missing",
|
|
2375
|
+
"mail_scope",
|
|
2376
|
+
"not_for_this_credential"
|
|
2377
|
+
],
|
|
2378
|
+
"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)."
|
|
2379
|
+
},
|
|
2380
|
+
"permission": { "type": ["string", "null"] }
|
|
2381
|
+
},
|
|
2382
|
+
"required": [
|
|
2383
|
+
"kind",
|
|
2384
|
+
"reason",
|
|
2385
|
+
"permission"
|
|
2386
|
+
]
|
|
2387
|
+
},
|
|
2388
|
+
"description": "Kinds left out because the caller could not list them through their own routes. Nothing is said about how many there are."
|
|
2389
|
+
},
|
|
2390
|
+
"next_cursor": {
|
|
2391
|
+
"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.",
|
|
2392
|
+
"type": ["string", "null"]
|
|
2393
|
+
}
|
|
2394
|
+
},
|
|
2395
|
+
"required": [
|
|
2396
|
+
"covers",
|
|
2397
|
+
"items",
|
|
2398
|
+
"withheld",
|
|
2399
|
+
"next_cursor"
|
|
2400
|
+
]
|
|
2401
|
+
},
|
|
2402
|
+
"sdkName": "listActivityObjects",
|
|
2403
|
+
"summary": "List what you created, or what you were asked",
|
|
2404
|
+
"tag": "Activity",
|
|
2405
|
+
"tagCommand": "activity"
|
|
2406
|
+
},
|
|
2407
|
+
{
|
|
2408
|
+
"binaryResponse": false,
|
|
2409
|
+
"bodyRequired": false,
|
|
2410
|
+
"command": "list-mail-activity-actors",
|
|
2411
|
+
"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",
|
|
2412
|
+
"hasJsonBody": false,
|
|
2413
|
+
"method": "GET",
|
|
2414
|
+
"operationId": "listMailActivityActors",
|
|
2415
|
+
"path": "/activity/mail/actors",
|
|
2416
|
+
"pathParams": [],
|
|
2417
|
+
"queryParams": [
|
|
2418
|
+
{
|
|
2419
|
+
"description": "Filter by actor ownership class: human, personal_agent, org_key, function, app, or system.",
|
|
2420
|
+
"enum": null,
|
|
2421
|
+
"name": "actor_ownership",
|
|
2422
|
+
"required": false,
|
|
2423
|
+
"type": "string"
|
|
2424
|
+
},
|
|
2425
|
+
{
|
|
2426
|
+
"description": "Filter to actors owned by a specific organization member UUID.",
|
|
2427
|
+
"enum": null,
|
|
2428
|
+
"name": "owner_user_id",
|
|
2429
|
+
"required": false,
|
|
2430
|
+
"type": "string"
|
|
2431
|
+
},
|
|
2432
|
+
{
|
|
2433
|
+
"description": "When `\"true\"`, includes `actor_only` activities from other actors if the caller holds `activity:read`.",
|
|
2434
|
+
"enum": ["true", "false"],
|
|
2435
|
+
"name": "include_private",
|
|
2436
|
+
"required": false,
|
|
2437
|
+
"type": "string"
|
|
2438
|
+
},
|
|
2439
|
+
{
|
|
2440
|
+
"description": "Include activity at or after this ISO 8601 timestamp.",
|
|
2441
|
+
"enum": null,
|
|
2442
|
+
"name": "since",
|
|
2443
|
+
"required": false,
|
|
2444
|
+
"type": "string"
|
|
2445
|
+
},
|
|
2446
|
+
{
|
|
2447
|
+
"description": "Include activity at or before this ISO 8601 timestamp.",
|
|
2448
|
+
"enum": null,
|
|
2449
|
+
"name": "until",
|
|
2450
|
+
"required": false,
|
|
2451
|
+
"type": "string"
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
"default": 50,
|
|
2455
|
+
"description": "Maximum actors to return, from 1 to 100; defaults to 50.",
|
|
2456
|
+
"enum": null,
|
|
2457
|
+
"maximum": 100,
|
|
2458
|
+
"minimum": 1,
|
|
2459
|
+
"name": "limit",
|
|
2460
|
+
"required": false,
|
|
2461
|
+
"type": "integer"
|
|
2462
|
+
}
|
|
2463
|
+
],
|
|
2464
|
+
"headerParams": [],
|
|
2465
|
+
"permissions": ["mail.activity:read"],
|
|
2466
|
+
"access": null,
|
|
2467
|
+
"requestSchema": null,
|
|
2468
|
+
"responseSchema": {
|
|
2469
|
+
"type": "object",
|
|
2470
|
+
"additionalProperties": false,
|
|
2471
|
+
"required": ["actors"],
|
|
2472
|
+
"properties": { "actors": {
|
|
2473
|
+
"type": "array",
|
|
2474
|
+
"items": {
|
|
2475
|
+
"type": "object",
|
|
2476
|
+
"additionalProperties": false,
|
|
2477
|
+
"required": [
|
|
2478
|
+
"actor",
|
|
2479
|
+
"threads_touched",
|
|
2480
|
+
"verified_events",
|
|
2481
|
+
"work_total",
|
|
2482
|
+
"work_succeeded",
|
|
2483
|
+
"work_failed",
|
|
2484
|
+
"work_needs_review",
|
|
2485
|
+
"work_started",
|
|
2486
|
+
"work_skipped",
|
|
2487
|
+
"recent_actions",
|
|
2488
|
+
"first_active_at",
|
|
2489
|
+
"last_active_at"
|
|
2490
|
+
],
|
|
2491
|
+
"properties": {
|
|
2492
|
+
"actor": {
|
|
2493
|
+
"type": "object",
|
|
2494
|
+
"additionalProperties": false,
|
|
2495
|
+
"required": [
|
|
2496
|
+
"kind",
|
|
2497
|
+
"id",
|
|
2498
|
+
"label",
|
|
2499
|
+
"ownership",
|
|
2500
|
+
"owner_user_id",
|
|
2501
|
+
"owner_label",
|
|
2502
|
+
"agent_connection_id",
|
|
2503
|
+
"oauth_client_id"
|
|
2504
|
+
],
|
|
2505
|
+
"properties": {
|
|
2506
|
+
"kind": { "type": "string" },
|
|
2507
|
+
"id": {
|
|
2508
|
+
"type": ["string", "null"],
|
|
2509
|
+
"format": "uuid"
|
|
2510
|
+
},
|
|
2511
|
+
"label": { "type": ["string", "null"] },
|
|
2512
|
+
"ownership": {
|
|
2513
|
+
"type": "string",
|
|
2514
|
+
"enum": [
|
|
2515
|
+
"human",
|
|
2516
|
+
"personal_agent",
|
|
2517
|
+
"org_key",
|
|
2518
|
+
"function",
|
|
2519
|
+
"app",
|
|
2520
|
+
"system"
|
|
2521
|
+
],
|
|
2522
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
2523
|
+
},
|
|
2524
|
+
"owner_user_id": {
|
|
2525
|
+
"type": ["string", "null"],
|
|
2526
|
+
"format": "uuid"
|
|
2527
|
+
},
|
|
2528
|
+
"owner_label": { "type": ["string", "null"] },
|
|
2529
|
+
"agent_connection_id": {
|
|
2530
|
+
"type": ["string", "null"],
|
|
2531
|
+
"format": "uuid"
|
|
2532
|
+
},
|
|
2533
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
2534
|
+
}
|
|
2535
|
+
},
|
|
2536
|
+
"threads_touched": {
|
|
2537
|
+
"type": "integer",
|
|
2538
|
+
"minimum": 0
|
|
2539
|
+
},
|
|
2540
|
+
"verified_events": {
|
|
2541
|
+
"type": "integer",
|
|
2542
|
+
"minimum": 0
|
|
2543
|
+
},
|
|
2544
|
+
"work_total": {
|
|
2545
|
+
"type": "integer",
|
|
2546
|
+
"minimum": 0
|
|
2547
|
+
},
|
|
2548
|
+
"work_succeeded": {
|
|
2549
|
+
"type": "integer",
|
|
2550
|
+
"minimum": 0
|
|
2551
|
+
},
|
|
2552
|
+
"work_failed": {
|
|
2553
|
+
"type": "integer",
|
|
2554
|
+
"minimum": 0
|
|
2555
|
+
},
|
|
2556
|
+
"work_needs_review": {
|
|
2557
|
+
"type": "integer",
|
|
2558
|
+
"minimum": 0
|
|
2559
|
+
},
|
|
2560
|
+
"work_started": {
|
|
2561
|
+
"type": "integer",
|
|
2562
|
+
"minimum": 0
|
|
2563
|
+
},
|
|
2564
|
+
"work_skipped": {
|
|
2565
|
+
"type": "integer",
|
|
2566
|
+
"minimum": 0
|
|
2567
|
+
},
|
|
2568
|
+
"recent_actions": {
|
|
2569
|
+
"type": "array",
|
|
2570
|
+
"items": { "type": "string" }
|
|
2571
|
+
},
|
|
2572
|
+
"first_active_at": {
|
|
2573
|
+
"type": "string",
|
|
2574
|
+
"format": "date-time"
|
|
2575
|
+
},
|
|
2576
|
+
"last_active_at": {
|
|
2577
|
+
"type": "string",
|
|
2578
|
+
"format": "date-time"
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
} }
|
|
2583
|
+
},
|
|
2584
|
+
"sdkName": "listMailActivityActors",
|
|
2585
|
+
"summary": "List deployed agents, keys, functions, and apps with mail activity rollups",
|
|
2586
|
+
"tag": "Activity",
|
|
2587
|
+
"tagCommand": "activity"
|
|
2588
|
+
},
|
|
2589
|
+
{
|
|
2590
|
+
"binaryResponse": false,
|
|
2591
|
+
"bodyRequired": false,
|
|
2592
|
+
"command": "list-org-mail-activity",
|
|
2593
|
+
"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",
|
|
2594
|
+
"hasJsonBody": false,
|
|
2595
|
+
"method": "GET",
|
|
2596
|
+
"operationId": "listOrgMailActivity",
|
|
2597
|
+
"path": "/activity/mail",
|
|
2598
|
+
"pathParams": [],
|
|
2599
|
+
"queryParams": [
|
|
2600
|
+
{
|
|
2601
|
+
"description": "Filter by source: all (default), primitive, or agent.",
|
|
2602
|
+
"enum": null,
|
|
2603
|
+
"name": "source",
|
|
2604
|
+
"required": false,
|
|
2605
|
+
"type": "string"
|
|
2606
|
+
},
|
|
2607
|
+
{
|
|
2608
|
+
"description": "Limit to a single thread UUID.",
|
|
2609
|
+
"enum": null,
|
|
2610
|
+
"name": "thread_id",
|
|
2611
|
+
"required": false,
|
|
2612
|
+
"type": "string"
|
|
2613
|
+
},
|
|
2614
|
+
{
|
|
2615
|
+
"description": "Limit to entries anchored to an inbound email UUID.",
|
|
2616
|
+
"enum": null,
|
|
2617
|
+
"name": "email_id",
|
|
2618
|
+
"required": false,
|
|
2619
|
+
"type": "string"
|
|
2620
|
+
},
|
|
2621
|
+
{
|
|
2622
|
+
"description": "Limit to entries anchored to an outbound sent email UUID.",
|
|
2623
|
+
"enum": null,
|
|
2624
|
+
"name": "sent_email_id",
|
|
2625
|
+
"required": false,
|
|
2626
|
+
"type": "string"
|
|
2627
|
+
},
|
|
2628
|
+
{
|
|
2629
|
+
"description": "For agent activities: action, note, or handoff.",
|
|
2630
|
+
"enum": null,
|
|
2631
|
+
"name": "kind",
|
|
2632
|
+
"required": false,
|
|
2633
|
+
"type": "string"
|
|
2634
|
+
},
|
|
2635
|
+
{
|
|
2636
|
+
"description": "For agent activities: comma-separated statuses from started, succeeded, failed, skipped, needs_review.",
|
|
2637
|
+
"enum": null,
|
|
2638
|
+
"name": "status",
|
|
2639
|
+
"required": false,
|
|
2640
|
+
"type": "string"
|
|
2641
|
+
},
|
|
2642
|
+
{
|
|
2643
|
+
"description": "When `\"true\"`, limits to agent activities with status `failed` or `needs_review`.",
|
|
2644
|
+
"enum": ["true", "false"],
|
|
2645
|
+
"name": "attention",
|
|
2646
|
+
"required": false,
|
|
2647
|
+
"type": "string"
|
|
2648
|
+
},
|
|
2649
|
+
{
|
|
2650
|
+
"description": "Exact action name filter.",
|
|
2651
|
+
"enum": null,
|
|
2652
|
+
"name": "action",
|
|
2653
|
+
"required": false,
|
|
2654
|
+
"type": "string"
|
|
2655
|
+
},
|
|
2656
|
+
{
|
|
2657
|
+
"description": "Filter by actor kind (member, org_key, connected_key, function_key, oauth, agent_delegate).",
|
|
2658
|
+
"enum": null,
|
|
2659
|
+
"name": "actor_kind",
|
|
2660
|
+
"required": false,
|
|
2661
|
+
"type": "string"
|
|
2662
|
+
},
|
|
2663
|
+
{
|
|
2664
|
+
"description": "Filter by actor ownership class: human, personal_agent, org_key, function, app, or system.",
|
|
2665
|
+
"enum": null,
|
|
2666
|
+
"name": "actor_ownership",
|
|
2667
|
+
"required": false,
|
|
2668
|
+
"type": "string"
|
|
2669
|
+
},
|
|
2670
|
+
{
|
|
2671
|
+
"description": "Filter by specific actor UUID.",
|
|
2672
|
+
"enum": null,
|
|
2673
|
+
"name": "actor_id",
|
|
2674
|
+
"required": false,
|
|
2675
|
+
"type": "string"
|
|
2676
|
+
},
|
|
2677
|
+
{
|
|
2678
|
+
"description": "Filter to actions taken by a human member or by API keys, OAuth grants, and personal agents owned by that member.",
|
|
2679
|
+
"enum": null,
|
|
2680
|
+
"name": "owner_user_id",
|
|
2681
|
+
"required": false,
|
|
2682
|
+
"type": "string"
|
|
2683
|
+
},
|
|
2684
|
+
{
|
|
2685
|
+
"description": "Filter to actions taken through a specific OAuth client id.",
|
|
2686
|
+
"enum": null,
|
|
2687
|
+
"name": "oauth_client_id",
|
|
2688
|
+
"required": false,
|
|
2689
|
+
"type": "string"
|
|
2690
|
+
},
|
|
2691
|
+
{
|
|
2692
|
+
"description": "Filter to entries sharing a run_id.",
|
|
2693
|
+
"enum": null,
|
|
2694
|
+
"name": "run_id",
|
|
2695
|
+
"required": false,
|
|
2696
|
+
"type": "string"
|
|
2697
|
+
},
|
|
2698
|
+
{
|
|
2699
|
+
"description": "When `\"true\"`, includes `actor_only` activities from other actors if the caller holds `activity:read`.",
|
|
2700
|
+
"enum": ["true", "false"],
|
|
2701
|
+
"name": "include_private",
|
|
2702
|
+
"required": false,
|
|
2703
|
+
"type": "string"
|
|
2704
|
+
},
|
|
2705
|
+
{
|
|
2706
|
+
"description": "Include entries at or after this ISO 8601 timestamp.",
|
|
2707
|
+
"enum": null,
|
|
2708
|
+
"name": "since",
|
|
2709
|
+
"required": false,
|
|
2710
|
+
"type": "string"
|
|
2711
|
+
},
|
|
2712
|
+
{
|
|
2713
|
+
"description": "Include entries at or before this ISO 8601 timestamp.",
|
|
2714
|
+
"enum": null,
|
|
2715
|
+
"name": "until",
|
|
2716
|
+
"required": false,
|
|
2717
|
+
"type": "string"
|
|
2718
|
+
},
|
|
2719
|
+
{
|
|
2720
|
+
"description": "Response format: json (default) or csv.",
|
|
2721
|
+
"enum": ["json", "csv"],
|
|
2722
|
+
"name": "format",
|
|
2723
|
+
"required": false,
|
|
2724
|
+
"type": "string"
|
|
2725
|
+
},
|
|
2726
|
+
{
|
|
2727
|
+
"default": 50,
|
|
2728
|
+
"description": "Items per page, from 1 to 200; defaults to 50.",
|
|
2729
|
+
"enum": null,
|
|
2730
|
+
"maximum": 200,
|
|
2731
|
+
"minimum": 1,
|
|
2732
|
+
"name": "limit",
|
|
2733
|
+
"required": false,
|
|
2734
|
+
"type": "integer"
|
|
2735
|
+
},
|
|
2736
|
+
{
|
|
2737
|
+
"description": "`next_cursor` from the previous page.",
|
|
2738
|
+
"enum": null,
|
|
2739
|
+
"name": "cursor",
|
|
2740
|
+
"required": false,
|
|
2741
|
+
"type": "string"
|
|
2742
|
+
}
|
|
2743
|
+
],
|
|
2744
|
+
"headerParams": [],
|
|
2745
|
+
"permissions": ["mail.activity:read"],
|
|
2746
|
+
"access": null,
|
|
2747
|
+
"requestSchema": null,
|
|
2748
|
+
"responseSchema": {
|
|
2749
|
+
"type": "object",
|
|
2750
|
+
"additionalProperties": false,
|
|
2751
|
+
"required": ["items", "next_cursor"],
|
|
2752
|
+
"properties": {
|
|
2753
|
+
"items": {
|
|
2754
|
+
"type": "array",
|
|
2755
|
+
"items": {
|
|
2756
|
+
"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.",
|
|
2757
|
+
"oneOf": [{
|
|
2758
|
+
"type": "object",
|
|
2759
|
+
"additionalProperties": false,
|
|
2760
|
+
"required": [
|
|
2761
|
+
"id",
|
|
2762
|
+
"source",
|
|
2763
|
+
"thread_id",
|
|
2764
|
+
"email_id",
|
|
2765
|
+
"sent_email_id",
|
|
2766
|
+
"mailbox_address",
|
|
2767
|
+
"action",
|
|
2768
|
+
"actor",
|
|
2769
|
+
"request_id",
|
|
2770
|
+
"reason",
|
|
2771
|
+
"run_id",
|
|
2772
|
+
"metadata",
|
|
2773
|
+
"occurred_at"
|
|
2774
|
+
],
|
|
2775
|
+
"properties": {
|
|
2776
|
+
"id": {
|
|
2777
|
+
"type": "string",
|
|
2778
|
+
"format": "uuid"
|
|
2779
|
+
},
|
|
2780
|
+
"source": {
|
|
2781
|
+
"type": "string",
|
|
2782
|
+
"enum": ["primitive"]
|
|
2783
|
+
},
|
|
2784
|
+
"thread_id": {
|
|
2785
|
+
"type": ["string", "null"],
|
|
2786
|
+
"format": "uuid"
|
|
2787
|
+
},
|
|
2788
|
+
"email_id": {
|
|
2789
|
+
"type": ["string", "null"],
|
|
2790
|
+
"format": "uuid"
|
|
2791
|
+
},
|
|
2792
|
+
"sent_email_id": {
|
|
2793
|
+
"type": ["string", "null"],
|
|
2794
|
+
"format": "uuid"
|
|
2795
|
+
},
|
|
2796
|
+
"mailbox_address": { "type": ["string", "null"] },
|
|
2797
|
+
"action": {
|
|
2798
|
+
"type": "string",
|
|
2799
|
+
"enum": [
|
|
2800
|
+
"email.read",
|
|
2801
|
+
"email.readable_read",
|
|
2802
|
+
"email.conversation_read",
|
|
2803
|
+
"email.raw_read",
|
|
2804
|
+
"email.attachment_read",
|
|
2805
|
+
"email.replied",
|
|
2806
|
+
"email.sent",
|
|
2807
|
+
"email.signaled",
|
|
2808
|
+
"email.deleted",
|
|
2809
|
+
"email.content_discarded"
|
|
2810
|
+
],
|
|
2811
|
+
"description": "System-verified mail action recorded automatically by Primitive."
|
|
2812
|
+
},
|
|
2813
|
+
"actor": {
|
|
2814
|
+
"type": "object",
|
|
2815
|
+
"additionalProperties": false,
|
|
2816
|
+
"required": [
|
|
2817
|
+
"kind",
|
|
2818
|
+
"id",
|
|
2819
|
+
"label",
|
|
2820
|
+
"ownership",
|
|
2821
|
+
"owner_user_id",
|
|
2822
|
+
"owner_label",
|
|
2823
|
+
"agent_connection_id",
|
|
2824
|
+
"oauth_client_id"
|
|
2825
|
+
],
|
|
2826
|
+
"properties": {
|
|
2827
|
+
"kind": { "type": "string" },
|
|
2828
|
+
"id": {
|
|
2829
|
+
"type": ["string", "null"],
|
|
2830
|
+
"format": "uuid"
|
|
2831
|
+
},
|
|
2832
|
+
"label": { "type": ["string", "null"] },
|
|
2833
|
+
"ownership": {
|
|
2834
|
+
"type": "string",
|
|
2835
|
+
"enum": [
|
|
2836
|
+
"human",
|
|
2837
|
+
"personal_agent",
|
|
2838
|
+
"org_key",
|
|
2839
|
+
"function",
|
|
2840
|
+
"app",
|
|
2841
|
+
"system"
|
|
2842
|
+
],
|
|
2843
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
2844
|
+
},
|
|
2845
|
+
"owner_user_id": {
|
|
2846
|
+
"type": ["string", "null"],
|
|
2847
|
+
"format": "uuid"
|
|
2848
|
+
},
|
|
2849
|
+
"owner_label": { "type": ["string", "null"] },
|
|
2850
|
+
"agent_connection_id": {
|
|
2851
|
+
"type": ["string", "null"],
|
|
2852
|
+
"format": "uuid"
|
|
2853
|
+
},
|
|
2854
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
2855
|
+
}
|
|
2856
|
+
},
|
|
2857
|
+
"request_id": { "type": ["string", "null"] },
|
|
2858
|
+
"reason": { "type": ["string", "null"] },
|
|
2859
|
+
"run_id": { "type": ["string", "null"] },
|
|
2860
|
+
"metadata": {
|
|
2861
|
+
"type": "object",
|
|
2862
|
+
"additionalProperties": true
|
|
2863
|
+
},
|
|
2864
|
+
"occurred_at": {
|
|
2865
|
+
"type": "string",
|
|
2866
|
+
"format": "date-time"
|
|
2867
|
+
}
|
|
2868
|
+
}
|
|
2869
|
+
}, {
|
|
2870
|
+
"type": "object",
|
|
2871
|
+
"additionalProperties": false,
|
|
2872
|
+
"required": [
|
|
2873
|
+
"id",
|
|
2874
|
+
"source",
|
|
2875
|
+
"thread_id",
|
|
2876
|
+
"email_id",
|
|
2877
|
+
"sent_email_id",
|
|
2878
|
+
"actor",
|
|
2879
|
+
"kind",
|
|
2880
|
+
"action",
|
|
2881
|
+
"status",
|
|
2882
|
+
"summary",
|
|
2883
|
+
"detail",
|
|
2884
|
+
"external_ref",
|
|
2885
|
+
"data",
|
|
2886
|
+
"run_id",
|
|
2887
|
+
"trace_url",
|
|
2888
|
+
"idempotency_key",
|
|
2889
|
+
"visibility",
|
|
2890
|
+
"revision",
|
|
2891
|
+
"status_history",
|
|
2892
|
+
"started_at",
|
|
2893
|
+
"completed_at",
|
|
2894
|
+
"updated_by",
|
|
2895
|
+
"created_at",
|
|
2896
|
+
"updated_at",
|
|
2897
|
+
"occurred_at"
|
|
2898
|
+
],
|
|
2899
|
+
"properties": {
|
|
2900
|
+
"id": {
|
|
2901
|
+
"type": "string",
|
|
2902
|
+
"format": "uuid"
|
|
2903
|
+
},
|
|
2904
|
+
"source": {
|
|
2905
|
+
"type": "string",
|
|
2906
|
+
"enum": ["agent"]
|
|
2907
|
+
},
|
|
2908
|
+
"thread_id": {
|
|
2909
|
+
"type": "string",
|
|
2910
|
+
"format": "uuid"
|
|
2911
|
+
},
|
|
2912
|
+
"email_id": {
|
|
2913
|
+
"type": ["string", "null"],
|
|
2914
|
+
"format": "uuid"
|
|
2915
|
+
},
|
|
2916
|
+
"sent_email_id": {
|
|
2917
|
+
"type": ["string", "null"],
|
|
2918
|
+
"format": "uuid"
|
|
2919
|
+
},
|
|
2920
|
+
"actor": {
|
|
2921
|
+
"type": "object",
|
|
2922
|
+
"additionalProperties": false,
|
|
2923
|
+
"required": [
|
|
2924
|
+
"kind",
|
|
2925
|
+
"id",
|
|
2926
|
+
"label",
|
|
2927
|
+
"ownership",
|
|
2928
|
+
"owner_user_id",
|
|
2929
|
+
"owner_label",
|
|
2930
|
+
"agent_connection_id",
|
|
2931
|
+
"oauth_client_id"
|
|
2932
|
+
],
|
|
2933
|
+
"properties": {
|
|
2934
|
+
"kind": { "type": "string" },
|
|
2935
|
+
"id": {
|
|
2936
|
+
"type": ["string", "null"],
|
|
2937
|
+
"format": "uuid"
|
|
2938
|
+
},
|
|
2939
|
+
"label": { "type": ["string", "null"] },
|
|
2940
|
+
"ownership": {
|
|
2941
|
+
"type": "string",
|
|
2942
|
+
"enum": [
|
|
2943
|
+
"human",
|
|
2944
|
+
"personal_agent",
|
|
2945
|
+
"org_key",
|
|
2946
|
+
"function",
|
|
2947
|
+
"app",
|
|
2948
|
+
"system"
|
|
2949
|
+
],
|
|
2950
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
2951
|
+
},
|
|
2952
|
+
"owner_user_id": {
|
|
2953
|
+
"type": ["string", "null"],
|
|
2954
|
+
"format": "uuid"
|
|
2955
|
+
},
|
|
2956
|
+
"owner_label": { "type": ["string", "null"] },
|
|
2957
|
+
"agent_connection_id": {
|
|
2958
|
+
"type": ["string", "null"],
|
|
2959
|
+
"format": "uuid"
|
|
2960
|
+
},
|
|
2961
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
2962
|
+
}
|
|
2963
|
+
},
|
|
2964
|
+
"kind": {
|
|
2965
|
+
"type": "string",
|
|
2966
|
+
"enum": [
|
|
2967
|
+
"action",
|
|
2968
|
+
"note",
|
|
2969
|
+
"handoff"
|
|
2970
|
+
],
|
|
2971
|
+
"description": "Category of an agent-reported thread activity."
|
|
2972
|
+
},
|
|
2973
|
+
"action": { "type": "string" },
|
|
2974
|
+
"status": {
|
|
2975
|
+
"type": "string",
|
|
2976
|
+
"enum": [
|
|
2977
|
+
"started",
|
|
2978
|
+
"succeeded",
|
|
2979
|
+
"failed",
|
|
2980
|
+
"skipped",
|
|
2981
|
+
"needs_review"
|
|
2982
|
+
],
|
|
2983
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
2984
|
+
},
|
|
2985
|
+
"summary": { "type": "string" },
|
|
2986
|
+
"detail": { "type": ["string", "null"] },
|
|
2987
|
+
"external_ref": { "oneOf": [{
|
|
2988
|
+
"type": "object",
|
|
2989
|
+
"additionalProperties": false,
|
|
2990
|
+
"required": ["system"],
|
|
2991
|
+
"properties": {
|
|
2992
|
+
"system": {
|
|
2993
|
+
"type": "string",
|
|
2994
|
+
"minLength": 1,
|
|
2995
|
+
"maxLength": 64,
|
|
2996
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
2997
|
+
},
|
|
2998
|
+
"id": {
|
|
2999
|
+
"type": "string",
|
|
3000
|
+
"minLength": 1,
|
|
3001
|
+
"maxLength": 255,
|
|
3002
|
+
"description": "External record identifier."
|
|
3003
|
+
},
|
|
3004
|
+
"url": {
|
|
3005
|
+
"type": "string",
|
|
3006
|
+
"format": "uri",
|
|
3007
|
+
"maxLength": 2048,
|
|
3008
|
+
"description": "HTTP(S) link to the external record."
|
|
3009
|
+
},
|
|
3010
|
+
"label": {
|
|
3011
|
+
"type": "string",
|
|
3012
|
+
"minLength": 1,
|
|
3013
|
+
"maxLength": 200,
|
|
3014
|
+
"description": "Human-readable display label for the external record."
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
3017
|
+
}, { "type": "null" }] },
|
|
3018
|
+
"data": {
|
|
3019
|
+
"type": "object",
|
|
3020
|
+
"additionalProperties": true
|
|
3021
|
+
},
|
|
3022
|
+
"run_id": { "type": ["string", "null"] },
|
|
3023
|
+
"trace_url": { "type": ["string", "null"] },
|
|
3024
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
3025
|
+
"visibility": {
|
|
3026
|
+
"type": "string",
|
|
3027
|
+
"enum": ["thread", "actor_only"],
|
|
3028
|
+
"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`)."
|
|
3029
|
+
},
|
|
3030
|
+
"revision": {
|
|
3031
|
+
"type": "integer",
|
|
3032
|
+
"minimum": 1
|
|
3033
|
+
},
|
|
3034
|
+
"status_history": {
|
|
3035
|
+
"type": "array",
|
|
3036
|
+
"items": {
|
|
3037
|
+
"type": "object",
|
|
3038
|
+
"additionalProperties": false,
|
|
3039
|
+
"required": [
|
|
3040
|
+
"status",
|
|
3041
|
+
"summary",
|
|
3042
|
+
"changed_at",
|
|
3043
|
+
"actor_kind",
|
|
3044
|
+
"actor_id",
|
|
3045
|
+
"actor_label"
|
|
3046
|
+
],
|
|
3047
|
+
"properties": {
|
|
3048
|
+
"status": {
|
|
3049
|
+
"type": "string",
|
|
3050
|
+
"enum": [
|
|
3051
|
+
"started",
|
|
3052
|
+
"succeeded",
|
|
3053
|
+
"failed",
|
|
3054
|
+
"skipped",
|
|
3055
|
+
"needs_review"
|
|
3056
|
+
],
|
|
3057
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
3058
|
+
},
|
|
3059
|
+
"summary": { "type": "string" },
|
|
3060
|
+
"changed_at": {
|
|
3061
|
+
"type": "string",
|
|
3062
|
+
"format": "date-time"
|
|
3063
|
+
},
|
|
3064
|
+
"actor_kind": { "type": "string" },
|
|
3065
|
+
"actor_id": {
|
|
3066
|
+
"type": ["string", "null"],
|
|
3067
|
+
"format": "uuid"
|
|
3068
|
+
},
|
|
3069
|
+
"actor_label": { "type": ["string", "null"] }
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
},
|
|
3073
|
+
"started_at": {
|
|
3074
|
+
"type": "string",
|
|
3075
|
+
"format": "date-time"
|
|
3076
|
+
},
|
|
3077
|
+
"completed_at": {
|
|
3078
|
+
"type": ["string", "null"],
|
|
3079
|
+
"format": "date-time"
|
|
3080
|
+
},
|
|
3081
|
+
"updated_by": { "oneOf": [{
|
|
3082
|
+
"type": "object",
|
|
3083
|
+
"additionalProperties": false,
|
|
3084
|
+
"required": [
|
|
3085
|
+
"kind",
|
|
3086
|
+
"id",
|
|
3087
|
+
"label"
|
|
3088
|
+
],
|
|
3089
|
+
"properties": {
|
|
3090
|
+
"kind": { "type": "string" },
|
|
3091
|
+
"id": {
|
|
3092
|
+
"type": ["string", "null"],
|
|
3093
|
+
"format": "uuid"
|
|
3094
|
+
},
|
|
3095
|
+
"label": { "type": ["string", "null"] }
|
|
3096
|
+
}
|
|
3097
|
+
}, { "type": "null" }] },
|
|
3098
|
+
"created_at": {
|
|
3099
|
+
"type": "string",
|
|
3100
|
+
"format": "date-time"
|
|
3101
|
+
},
|
|
3102
|
+
"updated_at": {
|
|
3103
|
+
"type": "string",
|
|
3104
|
+
"format": "date-time"
|
|
3105
|
+
},
|
|
3106
|
+
"occurred_at": {
|
|
3107
|
+
"type": "string",
|
|
3108
|
+
"format": "date-time"
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
3111
|
+
}],
|
|
3112
|
+
"discriminator": {
|
|
3113
|
+
"propertyName": "source",
|
|
3114
|
+
"mapping": {
|
|
3115
|
+
"primitive": "#/components/schemas/MailActivityEvent",
|
|
3116
|
+
"agent": "#/components/schemas/ThreadActivity"
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
},
|
|
3121
|
+
"next_cursor": { "type": ["string", "null"] }
|
|
3122
|
+
}
|
|
3123
|
+
},
|
|
3124
|
+
"sdkName": "listOrgMailActivity",
|
|
3125
|
+
"summary": "Search verified mail actions and agent work across the organization",
|
|
3126
|
+
"tag": "Activity",
|
|
3127
|
+
"tagCommand": "activity"
|
|
781
3128
|
},
|
|
782
3129
|
{
|
|
783
3130
|
"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
|
-
"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.",
|
|
807
|
-
"enum": null,
|
|
808
|
-
"name": "kind",
|
|
809
|
-
"required": false,
|
|
810
|
-
"type": "string"
|
|
811
|
-
},
|
|
812
|
-
{
|
|
813
|
-
"default": "all",
|
|
814
|
-
"description": "all (the default), live (still there, enabled or not) or ended (deleted, replaced or finished).",
|
|
815
|
-
"enum": [
|
|
816
|
-
"all",
|
|
817
|
-
"live",
|
|
818
|
-
"ended"
|
|
819
|
-
],
|
|
820
|
-
"name": "state",
|
|
821
|
-
"required": false,
|
|
822
|
-
"type": "string"
|
|
823
|
-
},
|
|
824
|
-
{
|
|
825
|
-
"default": 50,
|
|
826
|
-
"description": "Objects per page, from 1 to 200; defaults to 50.",
|
|
827
|
-
"enum": null,
|
|
828
|
-
"maximum": 200,
|
|
829
|
-
"minimum": 1,
|
|
830
|
-
"name": "limit",
|
|
831
|
-
"required": false,
|
|
832
|
-
"type": "integer"
|
|
833
|
-
},
|
|
834
|
-
{
|
|
835
|
-
"description": "next_cursor from the preceding page. Omit for the first page.",
|
|
836
|
-
"enum": null,
|
|
837
|
-
"name": "cursor",
|
|
838
|
-
"required": false,
|
|
839
|
-
"type": "string"
|
|
840
|
-
}
|
|
841
|
-
],
|
|
3131
|
+
"bodyRequired": true,
|
|
3132
|
+
"command": "update-thread-activity",
|
|
3133
|
+
"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",
|
|
3134
|
+
"hasJsonBody": true,
|
|
3135
|
+
"method": "PATCH",
|
|
3136
|
+
"operationId": "updateThreadActivity",
|
|
3137
|
+
"path": "/threads/{id}/activities/{activity_id}",
|
|
3138
|
+
"pathParams": [{
|
|
3139
|
+
"description": "Thread UUID.",
|
|
3140
|
+
"enum": null,
|
|
3141
|
+
"name": "id",
|
|
3142
|
+
"required": true,
|
|
3143
|
+
"type": "string"
|
|
3144
|
+
}, {
|
|
3145
|
+
"description": "Thread activity UUID.",
|
|
3146
|
+
"enum": null,
|
|
3147
|
+
"name": "activity_id",
|
|
3148
|
+
"required": true,
|
|
3149
|
+
"type": "string"
|
|
3150
|
+
}],
|
|
3151
|
+
"queryParams": [],
|
|
842
3152
|
"headerParams": [],
|
|
843
|
-
"permissions": ["activity:
|
|
3153
|
+
"permissions": ["mail.activity:write"],
|
|
844
3154
|
"access": null,
|
|
845
|
-
"requestSchema":
|
|
846
|
-
"responseSchema": {
|
|
3155
|
+
"requestSchema": {
|
|
847
3156
|
"type": "object",
|
|
3157
|
+
"additionalProperties": false,
|
|
848
3158
|
"properties": {
|
|
849
|
-
"
|
|
3159
|
+
"status": {
|
|
850
3160
|
"type": "string",
|
|
851
|
-
"
|
|
3161
|
+
"enum": [
|
|
3162
|
+
"started",
|
|
3163
|
+
"succeeded",
|
|
3164
|
+
"failed",
|
|
3165
|
+
"skipped",
|
|
3166
|
+
"needs_review"
|
|
3167
|
+
],
|
|
3168
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
852
3169
|
},
|
|
853
|
-
"
|
|
854
|
-
"type": "
|
|
855
|
-
"
|
|
3170
|
+
"summary": {
|
|
3171
|
+
"type": "string",
|
|
3172
|
+
"minLength": 1,
|
|
3173
|
+
"maxLength": 1e3
|
|
3174
|
+
},
|
|
3175
|
+
"detail": {
|
|
3176
|
+
"type": ["string", "null"],
|
|
3177
|
+
"maxLength": 8e3
|
|
3178
|
+
},
|
|
3179
|
+
"external_ref": { "oneOf": [{
|
|
3180
|
+
"type": "object",
|
|
3181
|
+
"additionalProperties": false,
|
|
3182
|
+
"required": ["system"],
|
|
3183
|
+
"properties": {
|
|
3184
|
+
"system": {
|
|
3185
|
+
"type": "string",
|
|
3186
|
+
"minLength": 1,
|
|
3187
|
+
"maxLength": 64,
|
|
3188
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
3189
|
+
},
|
|
3190
|
+
"id": {
|
|
3191
|
+
"type": "string",
|
|
3192
|
+
"minLength": 1,
|
|
3193
|
+
"maxLength": 255,
|
|
3194
|
+
"description": "External record identifier."
|
|
3195
|
+
},
|
|
3196
|
+
"url": {
|
|
3197
|
+
"type": "string",
|
|
3198
|
+
"format": "uri",
|
|
3199
|
+
"maxLength": 2048,
|
|
3200
|
+
"description": "HTTP(S) link to the external record."
|
|
3201
|
+
},
|
|
3202
|
+
"label": {
|
|
3203
|
+
"type": "string",
|
|
3204
|
+
"minLength": 1,
|
|
3205
|
+
"maxLength": 200,
|
|
3206
|
+
"description": "Human-readable display label for the external record."
|
|
3207
|
+
}
|
|
3208
|
+
}
|
|
3209
|
+
}, { "type": "null" }] },
|
|
3210
|
+
"data": {
|
|
3211
|
+
"type": "object",
|
|
3212
|
+
"additionalProperties": true
|
|
3213
|
+
},
|
|
3214
|
+
"run_id": {
|
|
3215
|
+
"type": ["string", "null"],
|
|
3216
|
+
"maxLength": 128
|
|
3217
|
+
},
|
|
3218
|
+
"trace_url": {
|
|
3219
|
+
"type": ["string", "null"],
|
|
3220
|
+
"format": "uri",
|
|
3221
|
+
"maxLength": 2048
|
|
3222
|
+
},
|
|
3223
|
+
"visibility": {
|
|
3224
|
+
"type": "string",
|
|
3225
|
+
"enum": ["thread", "actor_only"],
|
|
3226
|
+
"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`)."
|
|
3227
|
+
}
|
|
3228
|
+
}
|
|
3229
|
+
},
|
|
3230
|
+
"responseSchema": {
|
|
3231
|
+
"type": "object",
|
|
3232
|
+
"additionalProperties": false,
|
|
3233
|
+
"required": ["activity"],
|
|
3234
|
+
"properties": { "activity": {
|
|
3235
|
+
"type": "object",
|
|
3236
|
+
"additionalProperties": false,
|
|
3237
|
+
"required": [
|
|
3238
|
+
"id",
|
|
3239
|
+
"source",
|
|
3240
|
+
"thread_id",
|
|
3241
|
+
"email_id",
|
|
3242
|
+
"sent_email_id",
|
|
3243
|
+
"actor",
|
|
3244
|
+
"kind",
|
|
3245
|
+
"action",
|
|
3246
|
+
"status",
|
|
3247
|
+
"summary",
|
|
3248
|
+
"detail",
|
|
3249
|
+
"external_ref",
|
|
3250
|
+
"data",
|
|
3251
|
+
"run_id",
|
|
3252
|
+
"trace_url",
|
|
3253
|
+
"idempotency_key",
|
|
3254
|
+
"visibility",
|
|
3255
|
+
"revision",
|
|
3256
|
+
"status_history",
|
|
3257
|
+
"started_at",
|
|
3258
|
+
"completed_at",
|
|
3259
|
+
"updated_by",
|
|
3260
|
+
"created_at",
|
|
3261
|
+
"updated_at",
|
|
3262
|
+
"occurred_at"
|
|
3263
|
+
],
|
|
3264
|
+
"properties": {
|
|
3265
|
+
"id": {
|
|
3266
|
+
"type": "string",
|
|
3267
|
+
"format": "uuid"
|
|
3268
|
+
},
|
|
3269
|
+
"source": {
|
|
3270
|
+
"type": "string",
|
|
3271
|
+
"enum": ["agent"]
|
|
3272
|
+
},
|
|
3273
|
+
"thread_id": {
|
|
3274
|
+
"type": "string",
|
|
3275
|
+
"format": "uuid"
|
|
3276
|
+
},
|
|
3277
|
+
"email_id": {
|
|
3278
|
+
"type": ["string", "null"],
|
|
3279
|
+
"format": "uuid"
|
|
3280
|
+
},
|
|
3281
|
+
"sent_email_id": {
|
|
3282
|
+
"type": ["string", "null"],
|
|
3283
|
+
"format": "uuid"
|
|
3284
|
+
},
|
|
3285
|
+
"actor": {
|
|
856
3286
|
"type": "object",
|
|
3287
|
+
"additionalProperties": false,
|
|
3288
|
+
"required": [
|
|
3289
|
+
"kind",
|
|
3290
|
+
"id",
|
|
3291
|
+
"label",
|
|
3292
|
+
"ownership",
|
|
3293
|
+
"owner_user_id",
|
|
3294
|
+
"owner_label",
|
|
3295
|
+
"agent_connection_id",
|
|
3296
|
+
"oauth_client_id"
|
|
3297
|
+
],
|
|
857
3298
|
"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"]
|
|
3299
|
+
"kind": { "type": "string" },
|
|
3300
|
+
"id": {
|
|
3301
|
+
"type": ["string", "null"],
|
|
3302
|
+
"format": "uuid"
|
|
866
3303
|
},
|
|
867
|
-
"
|
|
3304
|
+
"label": { "type": ["string", "null"] },
|
|
3305
|
+
"ownership": {
|
|
868
3306
|
"type": "string",
|
|
869
|
-
"
|
|
3307
|
+
"enum": [
|
|
3308
|
+
"human",
|
|
3309
|
+
"personal_agent",
|
|
3310
|
+
"org_key",
|
|
3311
|
+
"function",
|
|
3312
|
+
"app",
|
|
3313
|
+
"system"
|
|
3314
|
+
],
|
|
3315
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
870
3316
|
},
|
|
871
|
-
"
|
|
872
|
-
"type": "string",
|
|
873
|
-
"format": "
|
|
3317
|
+
"owner_user_id": {
|
|
3318
|
+
"type": ["string", "null"],
|
|
3319
|
+
"format": "uuid"
|
|
874
3320
|
},
|
|
875
|
-
"
|
|
3321
|
+
"owner_label": { "type": ["string", "null"] },
|
|
3322
|
+
"agent_connection_id": {
|
|
876
3323
|
"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."
|
|
3324
|
+
"format": "uuid"
|
|
879
3325
|
},
|
|
880
|
-
"
|
|
3326
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
3327
|
+
}
|
|
3328
|
+
},
|
|
3329
|
+
"kind": {
|
|
3330
|
+
"type": "string",
|
|
3331
|
+
"enum": [
|
|
3332
|
+
"action",
|
|
3333
|
+
"note",
|
|
3334
|
+
"handoff"
|
|
3335
|
+
],
|
|
3336
|
+
"description": "Category of an agent-reported thread activity."
|
|
3337
|
+
},
|
|
3338
|
+
"action": { "type": "string" },
|
|
3339
|
+
"status": {
|
|
3340
|
+
"type": "string",
|
|
3341
|
+
"enum": [
|
|
3342
|
+
"started",
|
|
3343
|
+
"succeeded",
|
|
3344
|
+
"failed",
|
|
3345
|
+
"skipped",
|
|
3346
|
+
"needs_review"
|
|
3347
|
+
],
|
|
3348
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
3349
|
+
},
|
|
3350
|
+
"summary": { "type": "string" },
|
|
3351
|
+
"detail": { "type": ["string", "null"] },
|
|
3352
|
+
"external_ref": { "oneOf": [{
|
|
3353
|
+
"type": "object",
|
|
3354
|
+
"additionalProperties": false,
|
|
3355
|
+
"required": ["system"],
|
|
3356
|
+
"properties": {
|
|
3357
|
+
"system": {
|
|
881
3358
|
"type": "string",
|
|
882
|
-
"
|
|
883
|
-
"
|
|
3359
|
+
"minLength": 1,
|
|
3360
|
+
"maxLength": 64,
|
|
3361
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
884
3362
|
},
|
|
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
|
-
]
|
|
3363
|
+
"id": {
|
|
3364
|
+
"type": "string",
|
|
3365
|
+
"minLength": 1,
|
|
3366
|
+
"maxLength": 255,
|
|
3367
|
+
"description": "External record identifier."
|
|
906
3368
|
},
|
|
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.",
|
|
3369
|
+
"url": {
|
|
909
3370
|
"type": "string",
|
|
910
|
-
"format": "
|
|
3371
|
+
"format": "uri",
|
|
3372
|
+
"maxLength": 2048,
|
|
3373
|
+
"description": "HTTP(S) link to the external record."
|
|
911
3374
|
},
|
|
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.",
|
|
3375
|
+
"label": {
|
|
914
3376
|
"type": "string",
|
|
915
|
-
"
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
"no_longer_covers"
|
|
919
|
-
]
|
|
3377
|
+
"minLength": 1,
|
|
3378
|
+
"maxLength": 200,
|
|
3379
|
+
"description": "Human-readable display label for the external record."
|
|
920
3380
|
}
|
|
921
|
-
}
|
|
3381
|
+
}
|
|
3382
|
+
}, { "type": "null" }] },
|
|
3383
|
+
"data": {
|
|
3384
|
+
"type": "object",
|
|
3385
|
+
"additionalProperties": true
|
|
3386
|
+
},
|
|
3387
|
+
"run_id": { "type": ["string", "null"] },
|
|
3388
|
+
"trace_url": { "type": ["string", "null"] },
|
|
3389
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
3390
|
+
"visibility": {
|
|
3391
|
+
"type": "string",
|
|
3392
|
+
"enum": ["thread", "actor_only"],
|
|
3393
|
+
"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`)."
|
|
3394
|
+
},
|
|
3395
|
+
"revision": {
|
|
3396
|
+
"type": "integer",
|
|
3397
|
+
"minimum": 1
|
|
3398
|
+
},
|
|
3399
|
+
"status_history": {
|
|
3400
|
+
"type": "array",
|
|
3401
|
+
"items": {
|
|
3402
|
+
"type": "object",
|
|
3403
|
+
"additionalProperties": false,
|
|
3404
|
+
"required": [
|
|
3405
|
+
"status",
|
|
3406
|
+
"summary",
|
|
3407
|
+
"changed_at",
|
|
3408
|
+
"actor_kind",
|
|
3409
|
+
"actor_id",
|
|
3410
|
+
"actor_label"
|
|
3411
|
+
],
|
|
3412
|
+
"properties": {
|
|
3413
|
+
"status": {
|
|
3414
|
+
"type": "string",
|
|
3415
|
+
"enum": [
|
|
3416
|
+
"started",
|
|
3417
|
+
"succeeded",
|
|
3418
|
+
"failed",
|
|
3419
|
+
"skipped",
|
|
3420
|
+
"needs_review"
|
|
3421
|
+
],
|
|
3422
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
3423
|
+
},
|
|
3424
|
+
"summary": { "type": "string" },
|
|
3425
|
+
"changed_at": {
|
|
3426
|
+
"type": "string",
|
|
3427
|
+
"format": "date-time"
|
|
3428
|
+
},
|
|
3429
|
+
"actor_kind": { "type": "string" },
|
|
3430
|
+
"actor_id": {
|
|
3431
|
+
"type": ["string", "null"],
|
|
3432
|
+
"format": "uuid"
|
|
3433
|
+
},
|
|
3434
|
+
"actor_label": { "type": ["string", "null"] }
|
|
3435
|
+
}
|
|
3436
|
+
}
|
|
3437
|
+
},
|
|
3438
|
+
"started_at": {
|
|
3439
|
+
"type": "string",
|
|
3440
|
+
"format": "date-time"
|
|
3441
|
+
},
|
|
3442
|
+
"completed_at": {
|
|
3443
|
+
"type": ["string", "null"],
|
|
3444
|
+
"format": "date-time"
|
|
3445
|
+
},
|
|
3446
|
+
"updated_by": { "oneOf": [{
|
|
3447
|
+
"type": "object",
|
|
3448
|
+
"additionalProperties": false,
|
|
922
3449
|
"required": [
|
|
923
3450
|
"kind",
|
|
924
3451
|
"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",
|
|
3452
|
+
"label"
|
|
3453
|
+
],
|
|
938
3454
|
"properties": {
|
|
939
3455
|
"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)."
|
|
3456
|
+
"id": {
|
|
3457
|
+
"type": ["string", "null"],
|
|
3458
|
+
"format": "uuid"
|
|
948
3459
|
},
|
|
949
|
-
"
|
|
950
|
-
}
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
]
|
|
3460
|
+
"label": { "type": ["string", "null"] }
|
|
3461
|
+
}
|
|
3462
|
+
}, { "type": "null" }] },
|
|
3463
|
+
"created_at": {
|
|
3464
|
+
"type": "string",
|
|
3465
|
+
"format": "date-time"
|
|
956
3466
|
},
|
|
957
|
-
"
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
"
|
|
3467
|
+
"updated_at": {
|
|
3468
|
+
"type": "string",
|
|
3469
|
+
"format": "date-time"
|
|
3470
|
+
},
|
|
3471
|
+
"occurred_at": {
|
|
3472
|
+
"type": "string",
|
|
3473
|
+
"format": "date-time"
|
|
3474
|
+
}
|
|
962
3475
|
}
|
|
963
|
-
}
|
|
964
|
-
"required": [
|
|
965
|
-
"covers",
|
|
966
|
-
"items",
|
|
967
|
-
"withheld",
|
|
968
|
-
"next_cursor"
|
|
969
|
-
]
|
|
3476
|
+
} }
|
|
970
3477
|
},
|
|
971
|
-
"sdkName": "
|
|
972
|
-
"summary": "
|
|
3478
|
+
"sdkName": "updateThreadActivity",
|
|
3479
|
+
"summary": "Update an existing thread activity",
|
|
973
3480
|
"tag": "Activity",
|
|
974
3481
|
"tagCommand": "activity"
|
|
975
3482
|
},
|
|
@@ -25347,6 +27854,13 @@ const operationManifest = [
|
|
|
25347
27854
|
"name": "text",
|
|
25348
27855
|
"required": false,
|
|
25349
27856
|
"type": "string"
|
|
27857
|
+
},
|
|
27858
|
+
{
|
|
27859
|
+
"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",
|
|
27860
|
+
"enum": ["true", "false"],
|
|
27861
|
+
"name": "include_activity",
|
|
27862
|
+
"required": false,
|
|
27863
|
+
"type": "string"
|
|
25350
27864
|
}
|
|
25351
27865
|
],
|
|
25352
27866
|
"headerParams": [],
|
|
@@ -25661,6 +28175,255 @@ const operationManifest = [
|
|
|
25661
28175
|
"type": "integer",
|
|
25662
28176
|
"minimum": 0,
|
|
25663
28177
|
"description": "Present only with `text=readable`: characters of quoted history removed from the messages in this response, in total."
|
|
28178
|
+
},
|
|
28179
|
+
"activities": {
|
|
28180
|
+
"oneOf": [{
|
|
28181
|
+
"type": "array",
|
|
28182
|
+
"items": {
|
|
28183
|
+
"type": "object",
|
|
28184
|
+
"additionalProperties": false,
|
|
28185
|
+
"required": [
|
|
28186
|
+
"id",
|
|
28187
|
+
"source",
|
|
28188
|
+
"thread_id",
|
|
28189
|
+
"email_id",
|
|
28190
|
+
"sent_email_id",
|
|
28191
|
+
"actor",
|
|
28192
|
+
"kind",
|
|
28193
|
+
"action",
|
|
28194
|
+
"status",
|
|
28195
|
+
"summary",
|
|
28196
|
+
"detail",
|
|
28197
|
+
"external_ref",
|
|
28198
|
+
"data",
|
|
28199
|
+
"run_id",
|
|
28200
|
+
"trace_url",
|
|
28201
|
+
"idempotency_key",
|
|
28202
|
+
"visibility",
|
|
28203
|
+
"revision",
|
|
28204
|
+
"status_history",
|
|
28205
|
+
"started_at",
|
|
28206
|
+
"completed_at",
|
|
28207
|
+
"updated_by",
|
|
28208
|
+
"created_at",
|
|
28209
|
+
"updated_at",
|
|
28210
|
+
"occurred_at"
|
|
28211
|
+
],
|
|
28212
|
+
"properties": {
|
|
28213
|
+
"id": {
|
|
28214
|
+
"type": "string",
|
|
28215
|
+
"format": "uuid"
|
|
28216
|
+
},
|
|
28217
|
+
"source": {
|
|
28218
|
+
"type": "string",
|
|
28219
|
+
"enum": ["agent"]
|
|
28220
|
+
},
|
|
28221
|
+
"thread_id": {
|
|
28222
|
+
"type": "string",
|
|
28223
|
+
"format": "uuid"
|
|
28224
|
+
},
|
|
28225
|
+
"email_id": {
|
|
28226
|
+
"type": ["string", "null"],
|
|
28227
|
+
"format": "uuid"
|
|
28228
|
+
},
|
|
28229
|
+
"sent_email_id": {
|
|
28230
|
+
"type": ["string", "null"],
|
|
28231
|
+
"format": "uuid"
|
|
28232
|
+
},
|
|
28233
|
+
"actor": {
|
|
28234
|
+
"type": "object",
|
|
28235
|
+
"additionalProperties": false,
|
|
28236
|
+
"required": [
|
|
28237
|
+
"kind",
|
|
28238
|
+
"id",
|
|
28239
|
+
"label",
|
|
28240
|
+
"ownership",
|
|
28241
|
+
"owner_user_id",
|
|
28242
|
+
"owner_label",
|
|
28243
|
+
"agent_connection_id",
|
|
28244
|
+
"oauth_client_id"
|
|
28245
|
+
],
|
|
28246
|
+
"properties": {
|
|
28247
|
+
"kind": { "type": "string" },
|
|
28248
|
+
"id": {
|
|
28249
|
+
"type": ["string", "null"],
|
|
28250
|
+
"format": "uuid"
|
|
28251
|
+
},
|
|
28252
|
+
"label": { "type": ["string", "null"] },
|
|
28253
|
+
"ownership": {
|
|
28254
|
+
"type": "string",
|
|
28255
|
+
"enum": [
|
|
28256
|
+
"human",
|
|
28257
|
+
"personal_agent",
|
|
28258
|
+
"org_key",
|
|
28259
|
+
"function",
|
|
28260
|
+
"app",
|
|
28261
|
+
"system"
|
|
28262
|
+
],
|
|
28263
|
+
"description": "Ownership classification for an actor that read, acted on, or annotated mail."
|
|
28264
|
+
},
|
|
28265
|
+
"owner_user_id": {
|
|
28266
|
+
"type": ["string", "null"],
|
|
28267
|
+
"format": "uuid"
|
|
28268
|
+
},
|
|
28269
|
+
"owner_label": { "type": ["string", "null"] },
|
|
28270
|
+
"agent_connection_id": {
|
|
28271
|
+
"type": ["string", "null"],
|
|
28272
|
+
"format": "uuid"
|
|
28273
|
+
},
|
|
28274
|
+
"oauth_client_id": { "type": ["string", "null"] }
|
|
28275
|
+
}
|
|
28276
|
+
},
|
|
28277
|
+
"kind": {
|
|
28278
|
+
"type": "string",
|
|
28279
|
+
"enum": [
|
|
28280
|
+
"action",
|
|
28281
|
+
"note",
|
|
28282
|
+
"handoff"
|
|
28283
|
+
],
|
|
28284
|
+
"description": "Category of an agent-reported thread activity."
|
|
28285
|
+
},
|
|
28286
|
+
"action": { "type": "string" },
|
|
28287
|
+
"status": {
|
|
28288
|
+
"type": "string",
|
|
28289
|
+
"enum": [
|
|
28290
|
+
"started",
|
|
28291
|
+
"succeeded",
|
|
28292
|
+
"failed",
|
|
28293
|
+
"skipped",
|
|
28294
|
+
"needs_review"
|
|
28295
|
+
],
|
|
28296
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
28297
|
+
},
|
|
28298
|
+
"summary": { "type": "string" },
|
|
28299
|
+
"detail": { "type": ["string", "null"] },
|
|
28300
|
+
"external_ref": { "oneOf": [{
|
|
28301
|
+
"type": "object",
|
|
28302
|
+
"additionalProperties": false,
|
|
28303
|
+
"required": ["system"],
|
|
28304
|
+
"properties": {
|
|
28305
|
+
"system": {
|
|
28306
|
+
"type": "string",
|
|
28307
|
+
"minLength": 1,
|
|
28308
|
+
"maxLength": 64,
|
|
28309
|
+
"description": "External system identifier (for example `brex`, `salesforce`, or `linear`)."
|
|
28310
|
+
},
|
|
28311
|
+
"id": {
|
|
28312
|
+
"type": "string",
|
|
28313
|
+
"minLength": 1,
|
|
28314
|
+
"maxLength": 255,
|
|
28315
|
+
"description": "External record identifier."
|
|
28316
|
+
},
|
|
28317
|
+
"url": {
|
|
28318
|
+
"type": "string",
|
|
28319
|
+
"format": "uri",
|
|
28320
|
+
"maxLength": 2048,
|
|
28321
|
+
"description": "HTTP(S) link to the external record."
|
|
28322
|
+
},
|
|
28323
|
+
"label": {
|
|
28324
|
+
"type": "string",
|
|
28325
|
+
"minLength": 1,
|
|
28326
|
+
"maxLength": 200,
|
|
28327
|
+
"description": "Human-readable display label for the external record."
|
|
28328
|
+
}
|
|
28329
|
+
}
|
|
28330
|
+
}, { "type": "null" }] },
|
|
28331
|
+
"data": {
|
|
28332
|
+
"type": "object",
|
|
28333
|
+
"additionalProperties": true
|
|
28334
|
+
},
|
|
28335
|
+
"run_id": { "type": ["string", "null"] },
|
|
28336
|
+
"trace_url": { "type": ["string", "null"] },
|
|
28337
|
+
"idempotency_key": { "type": ["string", "null"] },
|
|
28338
|
+
"visibility": {
|
|
28339
|
+
"type": "string",
|
|
28340
|
+
"enum": ["thread", "actor_only"],
|
|
28341
|
+
"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`)."
|
|
28342
|
+
},
|
|
28343
|
+
"revision": {
|
|
28344
|
+
"type": "integer",
|
|
28345
|
+
"minimum": 1
|
|
28346
|
+
},
|
|
28347
|
+
"status_history": {
|
|
28348
|
+
"type": "array",
|
|
28349
|
+
"items": {
|
|
28350
|
+
"type": "object",
|
|
28351
|
+
"additionalProperties": false,
|
|
28352
|
+
"required": [
|
|
28353
|
+
"status",
|
|
28354
|
+
"summary",
|
|
28355
|
+
"changed_at",
|
|
28356
|
+
"actor_kind",
|
|
28357
|
+
"actor_id",
|
|
28358
|
+
"actor_label"
|
|
28359
|
+
],
|
|
28360
|
+
"properties": {
|
|
28361
|
+
"status": {
|
|
28362
|
+
"type": "string",
|
|
28363
|
+
"enum": [
|
|
28364
|
+
"started",
|
|
28365
|
+
"succeeded",
|
|
28366
|
+
"failed",
|
|
28367
|
+
"skipped",
|
|
28368
|
+
"needs_review"
|
|
28369
|
+
],
|
|
28370
|
+
"description": "Outcome status of an agent-reported thread activity."
|
|
28371
|
+
},
|
|
28372
|
+
"summary": { "type": "string" },
|
|
28373
|
+
"changed_at": {
|
|
28374
|
+
"type": "string",
|
|
28375
|
+
"format": "date-time"
|
|
28376
|
+
},
|
|
28377
|
+
"actor_kind": { "type": "string" },
|
|
28378
|
+
"actor_id": {
|
|
28379
|
+
"type": ["string", "null"],
|
|
28380
|
+
"format": "uuid"
|
|
28381
|
+
},
|
|
28382
|
+
"actor_label": { "type": ["string", "null"] }
|
|
28383
|
+
}
|
|
28384
|
+
}
|
|
28385
|
+
},
|
|
28386
|
+
"started_at": {
|
|
28387
|
+
"type": "string",
|
|
28388
|
+
"format": "date-time"
|
|
28389
|
+
},
|
|
28390
|
+
"completed_at": {
|
|
28391
|
+
"type": ["string", "null"],
|
|
28392
|
+
"format": "date-time"
|
|
28393
|
+
},
|
|
28394
|
+
"updated_by": { "oneOf": [{
|
|
28395
|
+
"type": "object",
|
|
28396
|
+
"additionalProperties": false,
|
|
28397
|
+
"required": [
|
|
28398
|
+
"kind",
|
|
28399
|
+
"id",
|
|
28400
|
+
"label"
|
|
28401
|
+
],
|
|
28402
|
+
"properties": {
|
|
28403
|
+
"kind": { "type": "string" },
|
|
28404
|
+
"id": {
|
|
28405
|
+
"type": ["string", "null"],
|
|
28406
|
+
"format": "uuid"
|
|
28407
|
+
},
|
|
28408
|
+
"label": { "type": ["string", "null"] }
|
|
28409
|
+
}
|
|
28410
|
+
}, { "type": "null" }] },
|
|
28411
|
+
"created_at": {
|
|
28412
|
+
"type": "string",
|
|
28413
|
+
"format": "date-time"
|
|
28414
|
+
},
|
|
28415
|
+
"updated_at": {
|
|
28416
|
+
"type": "string",
|
|
28417
|
+
"format": "date-time"
|
|
28418
|
+
},
|
|
28419
|
+
"occurred_at": {
|
|
28420
|
+
"type": "string",
|
|
28421
|
+
"format": "date-time"
|
|
28422
|
+
}
|
|
28423
|
+
}
|
|
28424
|
+
}
|
|
28425
|
+
}, { "type": "null" }],
|
|
28426
|
+
"description": "Present when `include_activity=true`: recent agent-reported work\nactivities on this thread visible to the caller (null below content\ndepth).\n"
|
|
25664
28427
|
}
|
|
25665
28428
|
},
|
|
25666
28429
|
"required": ["thread_id", "messages"]
|
|
@@ -55409,14 +58172,24 @@ function credentialsFromUserLogin(params) {
|
|
|
55409
58172
|
const API_HEADERS_ENV = "PRIMITIVE_API_HEADERS";
|
|
55410
58173
|
const OAUTH_REFRESH_SKEW_MS = 6e4;
|
|
55411
58174
|
const SAVED_CLI_OAUTH_SESSION_EXPIRED_MESSAGE = "Saved Primitive CLI OAuth session expired or was revoked. Run `primitive signin` to authenticate again.";
|
|
55412
|
-
function
|
|
58175
|
+
function mergeHeadersCaseInsensitive(...headers) {
|
|
55413
58176
|
const merged = {};
|
|
58177
|
+
const keyByLower = /* @__PURE__ */ new Map();
|
|
55414
58178
|
for (const headerSet of headers) {
|
|
55415
58179
|
if (!headerSet) continue;
|
|
55416
|
-
for (const [name, value] of Object.entries(headerSet))
|
|
58180
|
+
for (const [name, value] of Object.entries(headerSet)) {
|
|
58181
|
+
const lower = name.toLowerCase();
|
|
58182
|
+
const existingKey = keyByLower.get(lower);
|
|
58183
|
+
if (existingKey !== void 0 && existingKey !== name) delete merged[existingKey];
|
|
58184
|
+
merged[name] = value;
|
|
58185
|
+
keyByLower.set(lower, name);
|
|
58186
|
+
}
|
|
55417
58187
|
}
|
|
55418
58188
|
return Object.keys(merged).length > 0 ? merged : void 0;
|
|
55419
58189
|
}
|
|
58190
|
+
function mergeHeaders(...headers) {
|
|
58191
|
+
return mergeHeadersCaseInsensitive(...headers);
|
|
58192
|
+
}
|
|
55420
58193
|
function parseHeadersJson(raw) {
|
|
55421
58194
|
let parsed;
|
|
55422
58195
|
try {
|
|
@@ -55656,6 +58429,7 @@ async function createAuthenticatedCliApiClient(params) {
|
|
|
55656
58429
|
if (refreshed.auth_method === "user_grant") userLoginToken = { current: refreshed.access_token };
|
|
55657
58430
|
}
|
|
55658
58431
|
const tokenHolder = userLoginToken;
|
|
58432
|
+
const activityHeaders = cliActivityHeadersFromEnv(params.env);
|
|
55659
58433
|
return {
|
|
55660
58434
|
apiClient: new PrimitiveApiClient({
|
|
55661
58435
|
...tokenHolder && auth.credentials ? {
|
|
@@ -55673,7 +58447,7 @@ async function createAuthenticatedCliApiClient(params) {
|
|
|
55673
58447
|
})
|
|
55674
58448
|
} : { apiKey: auth.apiKey },
|
|
55675
58449
|
apiBaseUrl: auth.apiBaseUrl,
|
|
55676
|
-
headers: auth.connectedAgent || auth.agentPass ? void 0 : requestConfig.headers
|
|
58450
|
+
headers: mergeHeaders(auth.connectedAgent || auth.agentPass ? void 0 : requestConfig.headers, activityHeaders)
|
|
55677
58451
|
}),
|
|
55678
58452
|
auth,
|
|
55679
58453
|
baseUrlOverridden: requestConfig.baseUrlOverridden,
|
|
@@ -59801,7 +62575,7 @@ function savedConnectedProfiles(configDir, exclude) {
|
|
|
59801
62575
|
*/
|
|
59802
62576
|
async function otherProfiles(configDir, session, current) {
|
|
59803
62577
|
if (session) try {
|
|
59804
|
-
const { connectedProfilesForSession } = await import("./machine-session-
|
|
62578
|
+
const { connectedProfilesForSession } = await import("./machine-session-BTJXO0vi.js").then((n) => n.s);
|
|
59805
62579
|
return {
|
|
59806
62580
|
inSession: true,
|
|
59807
62581
|
profiles: connectedProfilesForSession(configDir, session, current)
|
|
@@ -61421,4 +64195,4 @@ function emptyDeliveriesHint(sdkName, query) {
|
|
|
61421
64195
|
function canonicalizeCliReferences(description) {
|
|
61422
64196
|
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
64197
|
}
|
|
61424
|
-
export { replyInteractionWarning as $, resolveDomainNames as $t, describeWake as A,
|
|
64198
|
+
export { replyInteractionWarning as $, resolveDomainNames as $t, describeWake as A, isBuiltInRoleKey as An, connectNextSteps as At, wakeRecipientField as B, PRIMITIVE_REASON_HEADER as Bn, countFromMeta as Bt, withApproval as C, resolveCliApiRequestConfig as Cn, sendWaitClampNotice as Ct, openBrowser as D, credentialsFromUserLogin as Dn, thrownErrorExitCode as Dt, listenForCopyHotkey as E, RESTRICTED_ROLE_NOTE as En, successfulSendOutcome as Et, sentInThread as F, routeWarningLines as Fn, currentMailSessionKey as Ft, pendingMailPath as G, validateActivityRunId as Gn, focusProfile as Gt, claimPendingMail as H, attachActivityContextFlags as Hn, focusFlagValues as Ht, serverMuted as I, sanitizeForTerminal as In, formatAlreadySentNotice as It, removePendingMail as J, manyDomainsSupported as Jt, readPendingMail as K, joinNames as Kt, serverRelationship as L, shownLine as Ln, FOCUS_ENV as Lt, formatMailWakeLine as M, roleKeyLabel as Mn, generatedAgentName as Mt, latestOwnOutbound as N, roleKeyText as Nn, identitySuggestions as Nt, explainPendingMailNotFound as O, displayedRoleKey as On, DEFAULT_ENROLL_NAME as Ot, readThreadContext as P, switchCurrentOrg as Pn, loadSkillLine as Pt, replyExpectation as Q, readDomainsOrRefusal as Qt, skillFirstLine as R, setKnownCommands as Rn, FOCUS_SERVER_SUPPORT as Rt, terminalApprovalIo as S, refuseOrgSelectionForProfile as Sn, sendOutcomeExitCode as St, formatBrowserLoginInstructions as T, CliOrgRefusedError as Tn, serializeErrorPayload as Tt, clearConsumedPendingMail as U, cliActivityHeadersFromEnv as Un, focusFlags as Ut, wakeRelationship as V, PRIMITIVE_RUN_ID_HEADER as Vn, focusEmptyHint as Vt, clearReadPendingMail as W, validateActivityReason as Wn, focusForCorpus as Wt, interactionNextActions as X, oneDomainAtATimeError as Xt, interactionHumanLine as Y, normalizeDomainNames as Yt, readEmailInteraction as Z, queryScopesItself as Zt, BROWSER_FLAG_DESCRIPTION as _, SAVED_CLI_OAUTH_SESSION_EXPIRED_MESSAGE as _n, formatSendRecordFailureSummary as _t, createOperationCommand as a, withFlagSuggestion as an, assertValidIdempotencyKey as at, approveThenRerunHint as b, mergeHeadersCaseInsensitive as bn, sendErrorMessage as bt, formatErrorPayload as c, readCallerMailFor as cn, checkPriorReplies as ct, networkErrorHint as d, fetchBoundedPages as dn, excludeSignalReplies as dt, resolveFocus as en, wakeInteractionSentence as et, readTextFileFlag as f, withBooleanFlagValues as fn, followUpCommandPrefix as ft, writeErrorWithHints as g, ConnectedAgentKeyRequiredError as gn, formatSendFailureSummary as gt, surfaceUnauthorizedHint as h, withAttachmentWait as hn, formatPriorRepliesWarning as ht, TIME_FLAG_DESCRIPTION as i, writeFocusLine as in, apiResultHttpStatus as it, displayAddress as j, revokeUserLogin as jn, defaultConnectionName as jt, bareAddress as k, fetchCliOrgs as kn, cliInvocation as kt, hasControlCharacter as l, formatFact as ln, classifySendError as lt, runWithTiming as m, ATTACHMENT_WAIT_MAX_MS as mn, formatPriorRepliesCheckSkipped as mt, API_ERROR_CODES as n, withFocusMeta as nn, MAX_SEND_WAIT_TIMEOUT_MS as nt, extractErrorCode as o, emptyEmailListHint as on, buildFollowUpCommand as ot, refusesCredential as p, ATTACHMENT_WAIT_FLAG_DESCRIPTION as pn, formatDeletedEarlierSendNotice as pt, recordPendingMail as q, loadSavedFocus as qt, PAGED_LIMIT_MAX as r, withoutFocus as rn, SEND_OUTCOME_HELP as rt, extractErrorPayload as s, mailReach as sn, buildThrownSendFailureEnvelope as st, API_BASE_URL_FLAG_DESCRIPTION as t, saveFocus as tn, IDEMPOTENCY_KEY_FLAG_DESCRIPTION as tt, isGrantRefusal as u, isEmailId as un, deriveSendIdempotencyKey as ut, STEP_UP_HEADER as v, createAuthenticatedCliApiClient as vn, priorRepliesThatWentOut as vt, canOfferCopyHotkey as w, selectedOrgFromEnv as wn, sentHistoryWindowStart as wt, promptLine as x, refreshStoredCliCredentials as xn, sendIdentityFields as xt, STEP_UP_TOKEN_FLAG_DESCRIPTION as y, createCliApiClient as yn, reportSendCommandResult as yt, wakeReadCommand as z, operationManifest as zn, NO_FOCUS as zt };
|