@oxygen-agent/cli 1.638.1 → 1.677.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/command-manifest.js +5 -2
- package/dist/index.js +1033 -135
- package/node_modules/@oxygen/shared/dist/axiom-field-budget.d.ts +91 -0
- package/node_modules/@oxygen/shared/dist/axiom-field-budget.js +262 -0
- package/node_modules/@oxygen/shared/dist/capability-discovery.js +61 -1
- package/node_modules/@oxygen/shared/dist/collab.d.ts +229 -0
- package/node_modules/@oxygen/shared/dist/collab.js +417 -0
- package/node_modules/@oxygen/shared/dist/column-types.d.ts +3 -3
- package/node_modules/@oxygen/shared/dist/column-types.js +26 -1
- package/node_modules/@oxygen/shared/dist/credit-guidance.d.ts +9 -0
- package/node_modules/@oxygen/shared/dist/credit-guidance.js +90 -1
- package/node_modules/@oxygen/shared/dist/index.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/index.js +2 -0
- package/node_modules/@oxygen/shared/dist/pricing-sheet.d.ts +30 -0
- package/node_modules/@oxygen/shared/dist/pricing-sheet.js +30 -0
- package/node_modules/@oxygen/shared/dist/social-capabilities.d.ts +7 -6
- package/node_modules/@oxygen/shared/dist/social-capabilities.js +69 -8
- package/node_modules/@oxygen/shared/dist/tags.d.ts +2 -2
- package/node_modules/@oxygen/shared/dist/tags.js +8 -5
- package/node_modules/@oxygen/shared/dist/version.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/version.js +1 -1
- package/node_modules/@oxygen/shared/package.json +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { type TagKind } from "./tags.js";
|
|
2
|
+
/**
|
|
3
|
+
* Workspace objects that can carry a comment thread or an approval request.
|
|
4
|
+
*
|
|
5
|
+
* Seeded from {@link TAG_KINDS}: anything worth labelling for a campaign is
|
|
6
|
+
* worth discussing with the client who signs that campaign off. The list is
|
|
7
|
+
* RESTATED rather than aliased because it is also a stored value — existing
|
|
8
|
+
* `ox_collab` rows pin it — so widening the tag vocabulary must be a deliberate
|
|
9
|
+
* decision here, not a silent side effect. (`subject_kind` deliberately carries
|
|
10
|
+
* no enum CHECK; 0182_collab.sql explains why, so adding a kind here needs no
|
|
11
|
+
* tenant migration.) The alignment is enforced
|
|
12
|
+
* both ways: {@link EveryTagKindIsCommentable} fails the build if a taggable
|
|
13
|
+
* kind is missing, and the paired test pins today's list exactly.
|
|
14
|
+
*/
|
|
15
|
+
export declare const COLLAB_SUBJECT_KINDS: readonly ["knowledge_page", "publishing_post", "sequence", "table", "workflow", "recipe", "conversation", "mailbox", "sender", "record", "domain", "project", "sender_profile", "voice_number"];
|
|
16
|
+
export type CollabSubjectKind = (typeof COLLAB_SUBJECT_KINDS)[number];
|
|
17
|
+
/** Compile-time assertion helper: instantiating with `false` is a type error. */
|
|
18
|
+
type AssertTrue<T extends true> = T;
|
|
19
|
+
/**
|
|
20
|
+
* Build-time proof that every taggable kind is also commentable. Adding a kind
|
|
21
|
+
* to {@link TAG_KINDS} without adding it here is a compile error, which is the
|
|
22
|
+
* point: the alternative is an API that accepts `--on <newkind>:<id>` and a
|
|
23
|
+
* database that rejects the insert.
|
|
24
|
+
*
|
|
25
|
+
* Divergence is legal in the other direction only — Collaboration may grow a
|
|
26
|
+
* subject kind that carries no tags.
|
|
27
|
+
*/
|
|
28
|
+
export type EveryTagKindIsCommentable = AssertTrue<TagKind extends CollabSubjectKind ? true : false>;
|
|
29
|
+
export declare function isCollabSubjectKind(value: unknown): value is CollabSubjectKind;
|
|
30
|
+
/**
|
|
31
|
+
* How each subject kind is named in output. Total over CollabSubjectKind, so
|
|
32
|
+
* adding a kind is a compile error until it is labelled — the guarantee
|
|
33
|
+
* `TAG_KIND_LABELS` had to learn the hard way when three hand-maintained copies
|
|
34
|
+
* of the same map drifted apart.
|
|
35
|
+
*
|
|
36
|
+
* `many` keeps proper nouns intact ("CRM records") so an inline count reads
|
|
37
|
+
* correctly; headings run it through {@link collabSubjectHeading}, which only
|
|
38
|
+
* uppercases a leading lowercase letter.
|
|
39
|
+
*/
|
|
40
|
+
export declare const COLLAB_SUBJECT_LABELS: Record<CollabSubjectKind, {
|
|
41
|
+
one: string;
|
|
42
|
+
many: string;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* What a thread on each kind is usually about, for `--help` and MCP tool
|
|
46
|
+
* descriptions. Total over CollabSubjectKind for the same reason the labels
|
|
47
|
+
* are: a blind-user eval (2026-07-21) found `tags --help` still advertising 7
|
|
48
|
+
* of 13 kinds because the prose was hand-written beside a hand-maintained
|
|
49
|
+
* marker map, so six taggable kinds were invisible from the one place a user
|
|
50
|
+
* looks. Here the help text cannot omit a kind — the compiler rejects the map
|
|
51
|
+
* until the kind is glossed, and {@link COLLAB_SUBJECT_KINDS_PROSE} is DERIVED
|
|
52
|
+
* from the labels rather than typed out a second time.
|
|
53
|
+
*/
|
|
54
|
+
export declare const COLLAB_SUBJECT_PROSE: Record<CollabSubjectKind, string>;
|
|
55
|
+
/**
|
|
56
|
+
* Every commentable kind in prose, for CLI `--help` and MCP tool descriptions.
|
|
57
|
+
* Derived from {@link COLLAB_SUBJECT_LABELS} on purpose: a hand-written copy is
|
|
58
|
+
* exactly what drifted in the tags help.
|
|
59
|
+
*/
|
|
60
|
+
export declare const COLLAB_SUBJECT_KINDS_PROSE: string;
|
|
61
|
+
/** Inline label for a count: `collabSubjectLabel("sequence", 1)` -> "sequence". */
|
|
62
|
+
export declare function collabSubjectLabel(kind: string, count: number): string;
|
|
63
|
+
/** Section heading for a kind: "Sequences", "CRM records". */
|
|
64
|
+
export declare function collabSubjectHeading(kind: string): string;
|
|
65
|
+
/** A thread's or request's subject: which kind of object, and which one. */
|
|
66
|
+
export type CollabSubjectRef = {
|
|
67
|
+
kind: CollabSubjectKind;
|
|
68
|
+
id: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Render a subject as the `<kind>:<id>` string every surface accepts
|
|
72
|
+
* (`--on sequence:9f1c...`). Throws rather than emitting an unparseable ref,
|
|
73
|
+
* because a malformed ref written into a stored row is drift nobody notices
|
|
74
|
+
* until a read fails.
|
|
75
|
+
*/
|
|
76
|
+
export declare function formatSubjectRef(ref: CollabSubjectRef): string;
|
|
77
|
+
/**
|
|
78
|
+
* Parse `<kind>:<id>`. Splits on the FIRST colon only, so an id that itself
|
|
79
|
+
* contains colons survives the round trip; an input with no colon at all is
|
|
80
|
+
* rejected rather than being guessed at (there is no default kind — a bare id
|
|
81
|
+
* would silently address the wrong store).
|
|
82
|
+
*/
|
|
83
|
+
export declare function tryParseSubjectRef(value: unknown): CollabSubjectRef | null;
|
|
84
|
+
/** Throwing variant of {@link tryParseSubjectRef}, for surfaces that want the typed error. */
|
|
85
|
+
export declare function parseSubjectRef(value: unknown): CollabSubjectRef;
|
|
86
|
+
/**
|
|
87
|
+
* Sub-object addressing inside one subject, so commenting on a single cell does
|
|
88
|
+
* not need a thread table per kind: `row:<rowId>` for a whole row,
|
|
89
|
+
* `row:<rowId>#<columnKey>` for one cell, `column:<columnKey>` for a whole
|
|
90
|
+
* column. Unknown prefixes are still rejected rather than stored — an address no
|
|
91
|
+
* reader understands is worse than a refusal.
|
|
92
|
+
*
|
|
93
|
+
* `column:` was added in the second Collaboration pass because a column is what
|
|
94
|
+
* an agency and its client actually argue about ("why is Stage set this way?"),
|
|
95
|
+
* and it had no address at all: every path had to name a row first. It is a
|
|
96
|
+
* SIBLING of `row:`, not a variant of it, which is why the type below is a
|
|
97
|
+
* discriminated union — a column path has no row, and an optional `rowId` would
|
|
98
|
+
* let `{}` typecheck as a valid path.
|
|
99
|
+
*/
|
|
100
|
+
export declare const SUBJECT_PATH_ROW_PREFIX = "row:";
|
|
101
|
+
export declare const SUBJECT_PATH_COLUMN_PREFIX = "column:";
|
|
102
|
+
export type CollabSubjectPath = {
|
|
103
|
+
kind: "row";
|
|
104
|
+
rowId: string;
|
|
105
|
+
columnKey?: string;
|
|
106
|
+
} | {
|
|
107
|
+
kind: "column";
|
|
108
|
+
columnKey: string;
|
|
109
|
+
};
|
|
110
|
+
/** Every path form in prose, for `--help`, MCP descriptors, and error messages. */
|
|
111
|
+
export declare const SUBJECT_PATH_FORMS_PROSE = "\"row:<rowId>\" for one row, \"row:<rowId>#<columnKey>\" for one cell, or \"column:<columnKey>\" for one column";
|
|
112
|
+
/**
|
|
113
|
+
* Render a sub-object path: `{ kind: "row", rowId: "abc" }` -> "row:abc"; with a
|
|
114
|
+
* column -> "row:abc#email"; `{ kind: "column", columnKey: "email" }` ->
|
|
115
|
+
* "column:email".
|
|
116
|
+
*/
|
|
117
|
+
export declare function formatSubjectPath(path: CollabSubjectPath): string;
|
|
118
|
+
export declare function tryParseSubjectPath(value: unknown): CollabSubjectPath | null;
|
|
119
|
+
/** Throwing variant of {@link tryParseSubjectPath}. */
|
|
120
|
+
export declare function parseSubjectPath(value: unknown): CollabSubjectPath;
|
|
121
|
+
/**
|
|
122
|
+
* The gates a workspace can require. `launch` is the client's go/no-go before a
|
|
123
|
+
* campaign sends; `signoff` is their sign-off on the list that campaign sends
|
|
124
|
+
* to. Both are OPT-IN per subject (or per subject kind) — an unset gate leaves
|
|
125
|
+
* today's behavior untouched.
|
|
126
|
+
*/
|
|
127
|
+
export declare const COLLAB_GATE_KINDS: readonly ["launch", "signoff"];
|
|
128
|
+
export type CollabGateKind = (typeof COLLAB_GATE_KINDS)[number];
|
|
129
|
+
export declare function isCollabGateKind(value: unknown): value is CollabGateKind;
|
|
130
|
+
/**
|
|
131
|
+
* Which subject kinds each gate can be required on. Total over CollabGateKind,
|
|
132
|
+
* so a new gate cannot ship without naming the primitives that must honor it —
|
|
133
|
+
* a gate nobody enforces is worse than no gate, because the workspace believes
|
|
134
|
+
* it is protected.
|
|
135
|
+
*/
|
|
136
|
+
export declare const GATE_KIND_SUBJECTS: Record<CollabGateKind, readonly CollabSubjectKind[]>;
|
|
137
|
+
/** What each gate means, for `--help` and MCP descriptors. Total over CollabGateKind. */
|
|
138
|
+
export declare const COLLAB_GATE_PROSE: Record<CollabGateKind, string>;
|
|
139
|
+
export declare function isGateKindValidForSubject(gateKind: unknown, subjectKind: unknown): gateKind is CollabGateKind;
|
|
140
|
+
/** Every gate that can be required on a subject kind — drives `approvals gate list`. */
|
|
141
|
+
export declare function gateKindsForSubject(subjectKind: unknown): CollabGateKind[];
|
|
142
|
+
/** A thread is open until somebody resolves it; reopening flips it back. */
|
|
143
|
+
export declare const COLLAB_THREAD_STATUSES: readonly ["open", "resolved"];
|
|
144
|
+
export type CollabThreadStatus = (typeof COLLAB_THREAD_STATUSES)[number];
|
|
145
|
+
export declare function isCollabThreadStatus(value: unknown): value is CollabThreadStatus;
|
|
146
|
+
export declare const COLLAB_REQUEST_STATUSES: readonly ["pending", "approved", "changes_requested", "rejected", "cancelled", "expired"];
|
|
147
|
+
export type CollabRequestStatus = (typeof COLLAB_REQUEST_STATUSES)[number];
|
|
148
|
+
export declare function isCollabRequestStatus(value: unknown): value is CollabRequestStatus;
|
|
149
|
+
/**
|
|
150
|
+
* The whole feature hinges on this one line: ONLY `approved` opens a gate.
|
|
151
|
+
*
|
|
152
|
+
* `changes_requested` is a decision, and it ends the requester's wait, but it is
|
|
153
|
+
* not consent — the client asked for edits. Treating it as terminal-and-done is
|
|
154
|
+
* the obvious bug (a request that is no longer pending looks "handled"), so the
|
|
155
|
+
* gate check asks this function rather than testing `status !== "pending"`.
|
|
156
|
+
*/
|
|
157
|
+
export declare function requestStatusOpensGate(status: unknown): boolean;
|
|
158
|
+
/** Statuses that no longer await a decision. `pending` is the only live state. */
|
|
159
|
+
export declare const COLLAB_REQUEST_TERMINAL_STATUSES: readonly CollabRequestStatus[];
|
|
160
|
+
export declare function isTerminalRequestStatus(status: unknown): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* What an approver may do, as the CLI/MCP spells it — and the status each
|
|
163
|
+
* decision writes. Total over CollabDecision so the API, the CLI flags, and the
|
|
164
|
+
* MCP tool cannot each invent their own mapping (the failure mode being a
|
|
165
|
+
* `changes_requested` decision stored as `rejected`, which reads to the agency
|
|
166
|
+
* as "the client said no" rather than "the client wants edits").
|
|
167
|
+
*/
|
|
168
|
+
export declare const COLLAB_DECISIONS: readonly ["approve", "reject", "changes_requested"];
|
|
169
|
+
export type CollabDecision = (typeof COLLAB_DECISIONS)[number];
|
|
170
|
+
export declare function isCollabDecision(value: unknown): value is CollabDecision;
|
|
171
|
+
export declare const COLLAB_DECISION_STATUSES: Record<CollabDecision, CollabRequestStatus>;
|
|
172
|
+
/** Why a notification exists. Delivery itself is the notifier's problem. */
|
|
173
|
+
export declare const COLLAB_NOTIFICATION_KINDS: readonly ["assigned", "mentioned", "decided", "replied"];
|
|
174
|
+
export type CollabNotificationKind = (typeof COLLAB_NOTIFICATION_KINDS)[number];
|
|
175
|
+
export declare function isCollabNotificationKind(value: unknown): value is CollabNotificationKind;
|
|
176
|
+
export declare const COLLAB_NOTIFICATION_STATUSES: readonly ["pending", "sent", "failed", "skipped"];
|
|
177
|
+
export type CollabNotificationStatus = (typeof COLLAB_NOTIFICATION_STATUSES)[number];
|
|
178
|
+
export declare function isCollabNotificationStatus(value: unknown): value is CollabNotificationStatus;
|
|
179
|
+
/**
|
|
180
|
+
* Body/field caps. Shared so the API, the CLI, and the tenant column widths
|
|
181
|
+
* agree — three independently chosen limits means the CLI accepts what the API
|
|
182
|
+
* truncates.
|
|
183
|
+
*/
|
|
184
|
+
export declare const MAX_COMMENT_BODY_LENGTH = 10000;
|
|
185
|
+
export declare const MAX_THREAD_TITLE_LENGTH = 200;
|
|
186
|
+
export declare const MAX_DECISION_NOTE_LENGTH = 2000;
|
|
187
|
+
/** Bounds the notification fan-out one comment or request can trigger. */
|
|
188
|
+
export declare const MAX_MENTIONS_PER_COMMENT = 25;
|
|
189
|
+
export declare const MAX_ASSIGNEES_PER_REQUEST = 10;
|
|
190
|
+
/**
|
|
191
|
+
* Normalize one comment body: trim, reject blanks, non-strings, and anything
|
|
192
|
+
* over {@link MAX_COMMENT_BODY_LENGTH}. Returns `null` so each surface can raise
|
|
193
|
+
* its own typed error (the CLI wants an exit code, the API wants a status).
|
|
194
|
+
*
|
|
195
|
+
* Deliberately does NOT strip or rewrite the body beyond trimming — a comment is
|
|
196
|
+
* the client's words, and Markdown, quoted text, and whitespace layout are part
|
|
197
|
+
* of what they wrote.
|
|
198
|
+
*/
|
|
199
|
+
export declare function normalizeCommentBody(value: unknown): string | null;
|
|
200
|
+
/**
|
|
201
|
+
* The Oxygen-side membership role overlay (control DB
|
|
202
|
+
* `organization_memberships.oxygen_role`). NULL means no override — today's
|
|
203
|
+
* behavior for every existing member — and `client` is the restricted role an
|
|
204
|
+
* agency hands its client: read the work, comment on it, decide the approvals
|
|
205
|
+
* assigned to them, and nothing else.
|
|
206
|
+
*
|
|
207
|
+
* Deliberately not a Clerk custom role: those need dashboard configuration, and
|
|
208
|
+
* repo doctrine requires asking a human before touching Clerk. Keep this list in
|
|
209
|
+
* step with the `organization_memberships_oxygen_role_check` constraint in
|
|
210
|
+
* control migration 0095 — the CHECK is what stops a typo from creating a role
|
|
211
|
+
* nothing enforces.
|
|
212
|
+
*/
|
|
213
|
+
export declare const COLLAB_MEMBER_ROLES: readonly ["client"];
|
|
214
|
+
export type CollabMemberRole = (typeof COLLAB_MEMBER_ROLES)[number];
|
|
215
|
+
export declare function isCollabMemberRole(value: unknown): value is CollabMemberRole;
|
|
216
|
+
/**
|
|
217
|
+
* The CLERK workspace roles that carry admin authority (control DB
|
|
218
|
+
* `organization_memberships.role`). Both spellings of each: Clerk writes the
|
|
219
|
+
* `org:`-prefixed form, older rows carry the bare one.
|
|
220
|
+
*
|
|
221
|
+
* The overlay above and this list are the two halves of one question — "may this
|
|
222
|
+
* member do X" — and a Clerk admin's role OVERRIDES the overlay, which is why
|
|
223
|
+
* granting `client` to one is refused. Keeping the vocabulary here means the
|
|
224
|
+
* collaboration lib can ask without importing the billing graph, and there is
|
|
225
|
+
* one list to change if Clerk ever gains another admin-ish role.
|
|
226
|
+
*/
|
|
227
|
+
export declare const WORKSPACE_ADMIN_ROLES: readonly ["admin", "owner", "org:admin", "org:owner"];
|
|
228
|
+
export declare function isWorkspaceAdminRole(role: string): boolean;
|
|
229
|
+
export {};
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
// Collaboration vocabulary (Control-layer interaction state, NOT a sixteenth
|
|
2
|
+
// primitive). A comment thread or an approval request is state ABOUT a GTM
|
|
3
|
+
// artifact — the artifact itself still belongs to its owning primitive, and the
|
|
4
|
+
// approval gate is honored by that primitive's own route (Sequences still owns
|
|
5
|
+
// whether a sequence launches). Same precedent ADR 0013 set for the Workspace
|
|
6
|
+
// Copilot: durable interaction state may own a tenant store, GTM primitive
|
|
7
|
+
// state may not.
|
|
8
|
+
//
|
|
9
|
+
// This module is the ONE vocabulary the tenant schema (`ox_collab`), the
|
|
10
|
+
// `/api/cli/collab/*` routes, the CLI groups, and the MCP tools all read from:
|
|
11
|
+
// which kinds can carry a thread, how a subject is addressed as a string, which
|
|
12
|
+
// gates apply to which kinds, and what the statuses are. Nothing here talks to a
|
|
13
|
+
// database or a transport — it is deliberately importable from every surface.
|
|
14
|
+
//
|
|
15
|
+
// Unlike Tags (a label that fits in a `text[]` column on the row it describes),
|
|
16
|
+
// a thread is an independent entity with its own author, body, replies, and
|
|
17
|
+
// lifecycle, so it is stored separately and addressed by an explicit subject
|
|
18
|
+
// reference — `<kind>:<id>` — rather than by a column on the subject.
|
|
19
|
+
import { OxygenError } from "./cli-result.js";
|
|
20
|
+
/**
|
|
21
|
+
* Workspace objects that can carry a comment thread or an approval request.
|
|
22
|
+
*
|
|
23
|
+
* Seeded from {@link TAG_KINDS}: anything worth labelling for a campaign is
|
|
24
|
+
* worth discussing with the client who signs that campaign off. The list is
|
|
25
|
+
* RESTATED rather than aliased because it is also a stored value — existing
|
|
26
|
+
* `ox_collab` rows pin it — so widening the tag vocabulary must be a deliberate
|
|
27
|
+
* decision here, not a silent side effect. (`subject_kind` deliberately carries
|
|
28
|
+
* no enum CHECK; 0182_collab.sql explains why, so adding a kind here needs no
|
|
29
|
+
* tenant migration.) The alignment is enforced
|
|
30
|
+
* both ways: {@link EveryTagKindIsCommentable} fails the build if a taggable
|
|
31
|
+
* kind is missing, and the paired test pins today's list exactly.
|
|
32
|
+
*/
|
|
33
|
+
export const COLLAB_SUBJECT_KINDS = [
|
|
34
|
+
"knowledge_page",
|
|
35
|
+
"publishing_post",
|
|
36
|
+
"sequence",
|
|
37
|
+
"table",
|
|
38
|
+
"workflow",
|
|
39
|
+
"recipe",
|
|
40
|
+
"conversation",
|
|
41
|
+
"mailbox",
|
|
42
|
+
"sender",
|
|
43
|
+
"record",
|
|
44
|
+
"domain",
|
|
45
|
+
"project",
|
|
46
|
+
"sender_profile",
|
|
47
|
+
"voice_number",
|
|
48
|
+
];
|
|
49
|
+
export function isCollabSubjectKind(value) {
|
|
50
|
+
return typeof value === "string" && COLLAB_SUBJECT_KINDS.includes(value);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* How each subject kind is named in output. Total over CollabSubjectKind, so
|
|
54
|
+
* adding a kind is a compile error until it is labelled — the guarantee
|
|
55
|
+
* `TAG_KIND_LABELS` had to learn the hard way when three hand-maintained copies
|
|
56
|
+
* of the same map drifted apart.
|
|
57
|
+
*
|
|
58
|
+
* `many` keeps proper nouns intact ("CRM records") so an inline count reads
|
|
59
|
+
* correctly; headings run it through {@link collabSubjectHeading}, which only
|
|
60
|
+
* uppercases a leading lowercase letter.
|
|
61
|
+
*/
|
|
62
|
+
export const COLLAB_SUBJECT_LABELS = {
|
|
63
|
+
knowledge_page: { one: "knowledge page", many: "knowledge pages" },
|
|
64
|
+
publishing_post: { one: "publishing post", many: "publishing posts" },
|
|
65
|
+
sequence: { one: "sequence", many: "sequences" },
|
|
66
|
+
table: { one: "table", many: "tables" },
|
|
67
|
+
workflow: { one: "workflow", many: "workflows" },
|
|
68
|
+
recipe: { one: "recipe", many: "recipes" },
|
|
69
|
+
conversation: { one: "conversation", many: "conversations" },
|
|
70
|
+
mailbox: { one: "mailbox", many: "mailboxes" },
|
|
71
|
+
sender: { one: "sender account", many: "sender accounts" },
|
|
72
|
+
record: { one: "CRM record", many: "CRM records" },
|
|
73
|
+
domain: { one: "sending domain", many: "sending domains" },
|
|
74
|
+
project: { one: "project", many: "projects" },
|
|
75
|
+
sender_profile: { one: "sender profile", many: "sender profiles" },
|
|
76
|
+
voice_number: { one: "phone number", many: "phone numbers" },
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* What a thread on each kind is usually about, for `--help` and MCP tool
|
|
80
|
+
* descriptions. Total over CollabSubjectKind for the same reason the labels
|
|
81
|
+
* are: a blind-user eval (2026-07-21) found `tags --help` still advertising 7
|
|
82
|
+
* of 13 kinds because the prose was hand-written beside a hand-maintained
|
|
83
|
+
* marker map, so six taggable kinds were invisible from the one place a user
|
|
84
|
+
* looks. Here the help text cannot omit a kind — the compiler rejects the map
|
|
85
|
+
* until the kind is glossed, and {@link COLLAB_SUBJECT_KINDS_PROSE} is DERIVED
|
|
86
|
+
* from the labels rather than typed out a second time.
|
|
87
|
+
*/
|
|
88
|
+
export const COLLAB_SUBJECT_PROSE = {
|
|
89
|
+
knowledge_page: "a wiki page's copy before it becomes canonical",
|
|
90
|
+
publishing_post: "a post's copy before it is published",
|
|
91
|
+
sequence: "a campaign's messaging before it launches",
|
|
92
|
+
table: "a list's rows and columns, or one cell's value",
|
|
93
|
+
workflow: "an automation's graph before it runs live",
|
|
94
|
+
recipe: "an installable motion before it is installed",
|
|
95
|
+
conversation: "a reply in an inbox thread before it is sent",
|
|
96
|
+
mailbox: "a mailbox's configuration or health",
|
|
97
|
+
sender: "a sender account's caps and warmup",
|
|
98
|
+
record: "a CRM record's truth",
|
|
99
|
+
domain: "a sending domain's DNS and warmup",
|
|
100
|
+
project: "a project's scope",
|
|
101
|
+
sender_profile: "a sending identity's accounts and inboxes",
|
|
102
|
+
voice_number: "a dialing number's caps and warmup",
|
|
103
|
+
};
|
|
104
|
+
/** Oxford-comma list: ["a"] -> "a"; ["a","b"] -> "a and b"; ["a","b","c"] -> "a, b, and c". */
|
|
105
|
+
function formatProseList(items) {
|
|
106
|
+
if (items.length <= 1)
|
|
107
|
+
return items[0] ?? "";
|
|
108
|
+
if (items.length === 2)
|
|
109
|
+
return `${items[0]} and ${items[1]}`;
|
|
110
|
+
return `${items.slice(0, -1).join(", ")}, and ${items[items.length - 1]}`;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Every commentable kind in prose, for CLI `--help` and MCP tool descriptions.
|
|
114
|
+
* Derived from {@link COLLAB_SUBJECT_LABELS} on purpose: a hand-written copy is
|
|
115
|
+
* exactly what drifted in the tags help.
|
|
116
|
+
*/
|
|
117
|
+
export const COLLAB_SUBJECT_KINDS_PROSE = formatProseList(COLLAB_SUBJECT_KINDS.map((kind) => COLLAB_SUBJECT_LABELS[kind].many));
|
|
118
|
+
/** Inline label for a count: `collabSubjectLabel("sequence", 1)` -> "sequence". */
|
|
119
|
+
export function collabSubjectLabel(kind, count) {
|
|
120
|
+
const entry = isCollabSubjectKind(kind) ? COLLAB_SUBJECT_LABELS[kind] : null;
|
|
121
|
+
if (!entry)
|
|
122
|
+
return kind;
|
|
123
|
+
return count === 1 ? entry.one : entry.many;
|
|
124
|
+
}
|
|
125
|
+
/** Section heading for a kind: "Sequences", "CRM records". */
|
|
126
|
+
export function collabSubjectHeading(kind) {
|
|
127
|
+
const entry = isCollabSubjectKind(kind) ? COLLAB_SUBJECT_LABELS[kind] : null;
|
|
128
|
+
const label = entry ? entry.many : kind;
|
|
129
|
+
return label.charAt(0).toUpperCase() + label.slice(1);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Render a subject as the `<kind>:<id>` string every surface accepts
|
|
133
|
+
* (`--on sequence:9f1c...`). Throws rather than emitting an unparseable ref,
|
|
134
|
+
* because a malformed ref written into a stored row is drift nobody notices
|
|
135
|
+
* until a read fails.
|
|
136
|
+
*/
|
|
137
|
+
export function formatSubjectRef(ref) {
|
|
138
|
+
if (!isCollabSubjectKind(ref.kind)) {
|
|
139
|
+
throw invalidSubjectRef(`Unknown subject kind "${ref.kind}".`, { kind: ref.kind });
|
|
140
|
+
}
|
|
141
|
+
const id = ref.id.trim();
|
|
142
|
+
if (!id) {
|
|
143
|
+
throw invalidSubjectRef("Subject id is required.", { kind: ref.kind });
|
|
144
|
+
}
|
|
145
|
+
return `${ref.kind}:${id}`;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Parse `<kind>:<id>`. Splits on the FIRST colon only, so an id that itself
|
|
149
|
+
* contains colons survives the round trip; an input with no colon at all is
|
|
150
|
+
* rejected rather than being guessed at (there is no default kind — a bare id
|
|
151
|
+
* would silently address the wrong store).
|
|
152
|
+
*/
|
|
153
|
+
export function tryParseSubjectRef(value) {
|
|
154
|
+
if (typeof value !== "string")
|
|
155
|
+
return null;
|
|
156
|
+
const raw = value.trim();
|
|
157
|
+
const separator = raw.indexOf(":");
|
|
158
|
+
if (separator <= 0)
|
|
159
|
+
return null;
|
|
160
|
+
const kind = raw.slice(0, separator);
|
|
161
|
+
const id = raw.slice(separator + 1).trim();
|
|
162
|
+
if (!isCollabSubjectKind(kind) || !id)
|
|
163
|
+
return null;
|
|
164
|
+
return { kind, id };
|
|
165
|
+
}
|
|
166
|
+
/** Throwing variant of {@link tryParseSubjectRef}, for surfaces that want the typed error. */
|
|
167
|
+
export function parseSubjectRef(value) {
|
|
168
|
+
const parsed = tryParseSubjectRef(value);
|
|
169
|
+
if (parsed)
|
|
170
|
+
return parsed;
|
|
171
|
+
throw invalidSubjectRef(`Subject must be "<kind>:<id>" — for example "sequence:9f1c2b7e". Valid kinds: ${COLLAB_SUBJECT_KINDS.join(", ")}.`, { subject: typeof value === "string" ? value : null });
|
|
172
|
+
}
|
|
173
|
+
function invalidSubjectRef(message, details) {
|
|
174
|
+
return new OxygenError("invalid_subject_ref", message, {
|
|
175
|
+
details: { ...details, valid_kinds: [...COLLAB_SUBJECT_KINDS] },
|
|
176
|
+
exitCode: 2,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Sub-object addressing inside one subject, so commenting on a single cell does
|
|
181
|
+
* not need a thread table per kind: `row:<rowId>` for a whole row,
|
|
182
|
+
* `row:<rowId>#<columnKey>` for one cell, `column:<columnKey>` for a whole
|
|
183
|
+
* column. Unknown prefixes are still rejected rather than stored — an address no
|
|
184
|
+
* reader understands is worse than a refusal.
|
|
185
|
+
*
|
|
186
|
+
* `column:` was added in the second Collaboration pass because a column is what
|
|
187
|
+
* an agency and its client actually argue about ("why is Stage set this way?"),
|
|
188
|
+
* and it had no address at all: every path had to name a row first. It is a
|
|
189
|
+
* SIBLING of `row:`, not a variant of it, which is why the type below is a
|
|
190
|
+
* discriminated union — a column path has no row, and an optional `rowId` would
|
|
191
|
+
* let `{}` typecheck as a valid path.
|
|
192
|
+
*/
|
|
193
|
+
export const SUBJECT_PATH_ROW_PREFIX = "row:";
|
|
194
|
+
export const SUBJECT_PATH_COLUMN_PREFIX = "column:";
|
|
195
|
+
/** Every path form in prose, for `--help`, MCP descriptors, and error messages. */
|
|
196
|
+
export const SUBJECT_PATH_FORMS_PROSE = '"row:<rowId>" for one row, "row:<rowId>#<columnKey>" for one cell, or "column:<columnKey>" for one column';
|
|
197
|
+
/**
|
|
198
|
+
* Render a sub-object path: `{ kind: "row", rowId: "abc" }` -> "row:abc"; with a
|
|
199
|
+
* column -> "row:abc#email"; `{ kind: "column", columnKey: "email" }` ->
|
|
200
|
+
* "column:email".
|
|
201
|
+
*/
|
|
202
|
+
export function formatSubjectPath(path) {
|
|
203
|
+
if (path.kind === "column") {
|
|
204
|
+
const columnKey = path.columnKey.trim();
|
|
205
|
+
if (!columnKey || columnKey.includes("#")) {
|
|
206
|
+
throw invalidSubjectPath('Column key is required and cannot contain "#".', {
|
|
207
|
+
column_key: path.columnKey,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
return `${SUBJECT_PATH_COLUMN_PREFIX}${columnKey}`;
|
|
211
|
+
}
|
|
212
|
+
const rowId = path.rowId.trim();
|
|
213
|
+
if (!rowId || rowId.includes("#")) {
|
|
214
|
+
throw invalidSubjectPath('Row id is required and cannot contain "#".', { row_id: path.rowId });
|
|
215
|
+
}
|
|
216
|
+
const columnKey = path.columnKey?.trim() ?? "";
|
|
217
|
+
if (path.columnKey !== undefined && !columnKey) {
|
|
218
|
+
throw invalidSubjectPath("Column key cannot be blank.", { row_id: rowId });
|
|
219
|
+
}
|
|
220
|
+
const base = `${SUBJECT_PATH_ROW_PREFIX}${rowId}`;
|
|
221
|
+
return columnKey ? `${base}#${columnKey}` : base;
|
|
222
|
+
}
|
|
223
|
+
export function tryParseSubjectPath(value) {
|
|
224
|
+
if (typeof value !== "string")
|
|
225
|
+
return null;
|
|
226
|
+
const raw = value.trim();
|
|
227
|
+
if (raw.startsWith(SUBJECT_PATH_COLUMN_PREFIX)) {
|
|
228
|
+
const columnKey = raw.slice(SUBJECT_PATH_COLUMN_PREFIX.length).trim();
|
|
229
|
+
// No `#` inside a column path: a column addresses no row, so a hash here
|
|
230
|
+
// means the caller meant a cell and got the prefix wrong.
|
|
231
|
+
if (!columnKey || columnKey.includes("#"))
|
|
232
|
+
return null;
|
|
233
|
+
return { kind: "column", columnKey };
|
|
234
|
+
}
|
|
235
|
+
if (!raw.startsWith(SUBJECT_PATH_ROW_PREFIX))
|
|
236
|
+
return null;
|
|
237
|
+
const remainder = raw.slice(SUBJECT_PATH_ROW_PREFIX.length);
|
|
238
|
+
const hash = remainder.indexOf("#");
|
|
239
|
+
if (hash < 0) {
|
|
240
|
+
const rowId = remainder.trim();
|
|
241
|
+
return rowId ? { kind: "row", rowId } : null;
|
|
242
|
+
}
|
|
243
|
+
const rowId = remainder.slice(0, hash).trim();
|
|
244
|
+
const columnKey = remainder.slice(hash + 1).trim();
|
|
245
|
+
if (!rowId || !columnKey || columnKey.includes("#"))
|
|
246
|
+
return null;
|
|
247
|
+
return { kind: "row", rowId, columnKey };
|
|
248
|
+
}
|
|
249
|
+
/** Throwing variant of {@link tryParseSubjectPath}. */
|
|
250
|
+
export function parseSubjectPath(value) {
|
|
251
|
+
const parsed = tryParseSubjectPath(value);
|
|
252
|
+
if (parsed)
|
|
253
|
+
return parsed;
|
|
254
|
+
throw invalidSubjectPath(`Path must be ${SUBJECT_PATH_FORMS_PROSE} — for example "row:8f2c1a4d#email".`, { path: typeof value === "string" ? value : null });
|
|
255
|
+
}
|
|
256
|
+
function invalidSubjectPath(message, details) {
|
|
257
|
+
return new OxygenError("invalid_subject_path", message, { details, exitCode: 2 });
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* The gates a workspace can require. `launch` is the client's go/no-go before a
|
|
261
|
+
* campaign sends; `signoff` is their sign-off on the list that campaign sends
|
|
262
|
+
* to. Both are OPT-IN per subject (or per subject kind) — an unset gate leaves
|
|
263
|
+
* today's behavior untouched.
|
|
264
|
+
*/
|
|
265
|
+
export const COLLAB_GATE_KINDS = ["launch", "signoff"];
|
|
266
|
+
export function isCollabGateKind(value) {
|
|
267
|
+
return typeof value === "string" && COLLAB_GATE_KINDS.includes(value);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Which subject kinds each gate can be required on. Total over CollabGateKind,
|
|
271
|
+
* so a new gate cannot ship without naming the primitives that must honor it —
|
|
272
|
+
* a gate nobody enforces is worse than no gate, because the workspace believes
|
|
273
|
+
* it is protected.
|
|
274
|
+
*/
|
|
275
|
+
export const GATE_KIND_SUBJECTS = {
|
|
276
|
+
launch: ["sequence"],
|
|
277
|
+
signoff: ["table"],
|
|
278
|
+
};
|
|
279
|
+
/** What each gate means, for `--help` and MCP descriptors. Total over CollabGateKind. */
|
|
280
|
+
export const COLLAB_GATE_PROSE = {
|
|
281
|
+
launch: "approve before a sequence starts sending live",
|
|
282
|
+
signoff: "approve the table's rows before they are worked",
|
|
283
|
+
};
|
|
284
|
+
export function isGateKindValidForSubject(gateKind, subjectKind) {
|
|
285
|
+
if (!isCollabGateKind(gateKind) || !isCollabSubjectKind(subjectKind))
|
|
286
|
+
return false;
|
|
287
|
+
return GATE_KIND_SUBJECTS[gateKind].includes(subjectKind);
|
|
288
|
+
}
|
|
289
|
+
/** Every gate that can be required on a subject kind — drives `approvals gate list`. */
|
|
290
|
+
export function gateKindsForSubject(subjectKind) {
|
|
291
|
+
if (!isCollabSubjectKind(subjectKind))
|
|
292
|
+
return [];
|
|
293
|
+
return COLLAB_GATE_KINDS.filter((gate) => GATE_KIND_SUBJECTS[gate].includes(subjectKind));
|
|
294
|
+
}
|
|
295
|
+
/** A thread is open until somebody resolves it; reopening flips it back. */
|
|
296
|
+
export const COLLAB_THREAD_STATUSES = ["open", "resolved"];
|
|
297
|
+
export function isCollabThreadStatus(value) {
|
|
298
|
+
return typeof value === "string" && COLLAB_THREAD_STATUSES.includes(value);
|
|
299
|
+
}
|
|
300
|
+
export const COLLAB_REQUEST_STATUSES = [
|
|
301
|
+
"pending",
|
|
302
|
+
"approved",
|
|
303
|
+
"changes_requested",
|
|
304
|
+
"rejected",
|
|
305
|
+
"cancelled",
|
|
306
|
+
"expired",
|
|
307
|
+
];
|
|
308
|
+
export function isCollabRequestStatus(value) {
|
|
309
|
+
return typeof value === "string" && COLLAB_REQUEST_STATUSES.includes(value);
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* The whole feature hinges on this one line: ONLY `approved` opens a gate.
|
|
313
|
+
*
|
|
314
|
+
* `changes_requested` is a decision, and it ends the requester's wait, but it is
|
|
315
|
+
* not consent — the client asked for edits. Treating it as terminal-and-done is
|
|
316
|
+
* the obvious bug (a request that is no longer pending looks "handled"), so the
|
|
317
|
+
* gate check asks this function rather than testing `status !== "pending"`.
|
|
318
|
+
*/
|
|
319
|
+
export function requestStatusOpensGate(status) {
|
|
320
|
+
return status === "approved";
|
|
321
|
+
}
|
|
322
|
+
/** Statuses that no longer await a decision. `pending` is the only live state. */
|
|
323
|
+
export const COLLAB_REQUEST_TERMINAL_STATUSES = [
|
|
324
|
+
"approved",
|
|
325
|
+
"changes_requested",
|
|
326
|
+
"rejected",
|
|
327
|
+
"cancelled",
|
|
328
|
+
"expired",
|
|
329
|
+
];
|
|
330
|
+
export function isTerminalRequestStatus(status) {
|
|
331
|
+
return isCollabRequestStatus(status) && status !== "pending";
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* What an approver may do, as the CLI/MCP spells it — and the status each
|
|
335
|
+
* decision writes. Total over CollabDecision so the API, the CLI flags, and the
|
|
336
|
+
* MCP tool cannot each invent their own mapping (the failure mode being a
|
|
337
|
+
* `changes_requested` decision stored as `rejected`, which reads to the agency
|
|
338
|
+
* as "the client said no" rather than "the client wants edits").
|
|
339
|
+
*/
|
|
340
|
+
export const COLLAB_DECISIONS = ["approve", "reject", "changes_requested"];
|
|
341
|
+
export function isCollabDecision(value) {
|
|
342
|
+
return typeof value === "string" && COLLAB_DECISIONS.includes(value);
|
|
343
|
+
}
|
|
344
|
+
export const COLLAB_DECISION_STATUSES = {
|
|
345
|
+
approve: "approved",
|
|
346
|
+
reject: "rejected",
|
|
347
|
+
changes_requested: "changes_requested",
|
|
348
|
+
};
|
|
349
|
+
/** Why a notification exists. Delivery itself is the notifier's problem. */
|
|
350
|
+
export const COLLAB_NOTIFICATION_KINDS = ["assigned", "mentioned", "decided", "replied"];
|
|
351
|
+
export function isCollabNotificationKind(value) {
|
|
352
|
+
return (typeof value === "string" && COLLAB_NOTIFICATION_KINDS.includes(value));
|
|
353
|
+
}
|
|
354
|
+
export const COLLAB_NOTIFICATION_STATUSES = ["pending", "sent", "failed", "skipped"];
|
|
355
|
+
export function isCollabNotificationStatus(value) {
|
|
356
|
+
return (typeof value === "string" && COLLAB_NOTIFICATION_STATUSES.includes(value));
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Body/field caps. Shared so the API, the CLI, and the tenant column widths
|
|
360
|
+
* agree — three independently chosen limits means the CLI accepts what the API
|
|
361
|
+
* truncates.
|
|
362
|
+
*/
|
|
363
|
+
export const MAX_COMMENT_BODY_LENGTH = 10_000;
|
|
364
|
+
export const MAX_THREAD_TITLE_LENGTH = 200;
|
|
365
|
+
export const MAX_DECISION_NOTE_LENGTH = 2_000;
|
|
366
|
+
/** Bounds the notification fan-out one comment or request can trigger. */
|
|
367
|
+
export const MAX_MENTIONS_PER_COMMENT = 25;
|
|
368
|
+
export const MAX_ASSIGNEES_PER_REQUEST = 10;
|
|
369
|
+
/**
|
|
370
|
+
* Normalize one comment body: trim, reject blanks, non-strings, and anything
|
|
371
|
+
* over {@link MAX_COMMENT_BODY_LENGTH}. Returns `null` so each surface can raise
|
|
372
|
+
* its own typed error (the CLI wants an exit code, the API wants a status).
|
|
373
|
+
*
|
|
374
|
+
* Deliberately does NOT strip or rewrite the body beyond trimming — a comment is
|
|
375
|
+
* the client's words, and Markdown, quoted text, and whitespace layout are part
|
|
376
|
+
* of what they wrote.
|
|
377
|
+
*/
|
|
378
|
+
export function normalizeCommentBody(value) {
|
|
379
|
+
if (typeof value !== "string")
|
|
380
|
+
return null;
|
|
381
|
+
const normalized = value.trim();
|
|
382
|
+
if (!normalized || normalized.length > MAX_COMMENT_BODY_LENGTH)
|
|
383
|
+
return null;
|
|
384
|
+
return normalized;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* The Oxygen-side membership role overlay (control DB
|
|
388
|
+
* `organization_memberships.oxygen_role`). NULL means no override — today's
|
|
389
|
+
* behavior for every existing member — and `client` is the restricted role an
|
|
390
|
+
* agency hands its client: read the work, comment on it, decide the approvals
|
|
391
|
+
* assigned to them, and nothing else.
|
|
392
|
+
*
|
|
393
|
+
* Deliberately not a Clerk custom role: those need dashboard configuration, and
|
|
394
|
+
* repo doctrine requires asking a human before touching Clerk. Keep this list in
|
|
395
|
+
* step with the `organization_memberships_oxygen_role_check` constraint in
|
|
396
|
+
* control migration 0095 — the CHECK is what stops a typo from creating a role
|
|
397
|
+
* nothing enforces.
|
|
398
|
+
*/
|
|
399
|
+
export const COLLAB_MEMBER_ROLES = ["client"];
|
|
400
|
+
export function isCollabMemberRole(value) {
|
|
401
|
+
return typeof value === "string" && COLLAB_MEMBER_ROLES.includes(value);
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* The CLERK workspace roles that carry admin authority (control DB
|
|
405
|
+
* `organization_memberships.role`). Both spellings of each: Clerk writes the
|
|
406
|
+
* `org:`-prefixed form, older rows carry the bare one.
|
|
407
|
+
*
|
|
408
|
+
* The overlay above and this list are the two halves of one question — "may this
|
|
409
|
+
* member do X" — and a Clerk admin's role OVERRIDES the overlay, which is why
|
|
410
|
+
* granting `client` to one is refused. Keeping the vocabulary here means the
|
|
411
|
+
* collaboration lib can ask without importing the billing graph, and there is
|
|
412
|
+
* one list to change if Clerk ever gains another admin-ish role.
|
|
413
|
+
*/
|
|
414
|
+
export const WORKSPACE_ADMIN_ROLES = ["admin", "owner", "org:admin", "org:owner"];
|
|
415
|
+
export function isWorkspaceAdminRole(role) {
|
|
416
|
+
return WORKSPACE_ADMIN_ROLES.includes(role.toLowerCase());
|
|
417
|
+
}
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
*/
|
|
13
13
|
/** Data types an import can infer for a brand-new column. Dates-only by design. */
|
|
14
14
|
export type ImportColumnDataType = "text" | "timestamptz";
|
|
15
|
-
/** Data types a
|
|
16
|
-
export type RetypeableDataType = "text" | "numeric" | "boolean" | "timestamptz";
|
|
15
|
+
/** Data types a plain data column can be explicitly retyped into. */
|
|
16
|
+
export type RetypeableDataType = "text" | "numeric" | "boolean" | "jsonb" | "timestamptz";
|
|
17
17
|
export declare const RETYPEABLE_DATA_TYPES: readonly RetypeableDataType[];
|
|
18
18
|
export declare const EXCEL_SERIAL_MIN = 10000;
|
|
19
19
|
export declare const EXCEL_SERIAL_MAX = 80000;
|
|
@@ -41,7 +41,7 @@ export declare function parseDateValueToIso(value: unknown, options?: {
|
|
|
41
41
|
export declare function inferImportColumnDataType(label: string, values: Iterable<unknown>): ImportColumnDataType;
|
|
42
42
|
export type CoercionResult = {
|
|
43
43
|
ok: true;
|
|
44
|
-
value:
|
|
44
|
+
value: unknown | null;
|
|
45
45
|
} | {
|
|
46
46
|
ok: false;
|
|
47
47
|
reason: string;
|