@oxygen-agent/cli 1.717.11 → 1.739.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/command-manifest.js +27 -12
  3. package/dist/index.js +243 -72
  4. package/dist/skills.js +2 -2
  5. package/node_modules/@oxygen/shared/dist/axiom-field-budget.d.ts +99 -0
  6. package/node_modules/@oxygen/shared/dist/axiom-field-budget.js +112 -17
  7. package/node_modules/@oxygen/shared/dist/cli-result.js +2 -0
  8. package/node_modules/@oxygen/shared/dist/crm-activity-events.d.ts +20 -0
  9. package/node_modules/@oxygen/shared/dist/crm-activity-events.js +5 -0
  10. package/node_modules/@oxygen/shared/dist/future-signup-events.d.ts +27 -0
  11. package/node_modules/@oxygen/shared/dist/future-signup-events.js +90 -0
  12. package/node_modules/@oxygen/shared/dist/future-signup-lifecycle-projection.d.ts +320 -0
  13. package/node_modules/@oxygen/shared/dist/future-signup-lifecycle-projection.js +1233 -0
  14. package/node_modules/@oxygen/shared/dist/index.d.ts +7 -1
  15. package/node_modules/@oxygen/shared/dist/index.js +14 -1
  16. package/node_modules/@oxygen/shared/dist/notetaker-events.d.ts +4 -0
  17. package/node_modules/@oxygen/shared/dist/notetaker-events.js +23 -0
  18. package/node_modules/@oxygen/shared/dist/plain-support-events.d.ts +40 -0
  19. package/node_modules/@oxygen/shared/dist/plain-support-events.js +43 -0
  20. package/node_modules/@oxygen/shared/dist/redaction.js +6 -1
  21. package/node_modules/@oxygen/shared/dist/user-capability-routing.d.ts +2 -0
  22. package/node_modules/@oxygen/shared/dist/user-capability-routing.js +23 -0
  23. package/node_modules/@oxygen/shared/dist/version.d.ts +1 -1
  24. package/node_modules/@oxygen/shared/dist/version.js +1 -1
  25. package/node_modules/@oxygen/shared/dist/webhook-headers.d.ts +10 -0
  26. package/node_modules/@oxygen/shared/dist/webhook-headers.js +48 -0
  27. package/node_modules/@oxygen/shared/dist/workspace-event-catalog.d.ts +31 -1
  28. package/node_modules/@oxygen/shared/dist/workspace-event-catalog.js +112 -1
  29. package/node_modules/@oxygen/workflows/dist/graph/expression.js +7 -5
  30. package/node_modules/@oxygen/workflows/dist/graph/lint.d.ts +9 -0
  31. package/node_modules/@oxygen/workflows/dist/graph/lint.js +409 -7
  32. package/node_modules/@oxygen/workflows/dist/graph/manifest-schema.d.ts +513 -0
  33. package/node_modules/@oxygen/workflows/dist/graph/manifest-schema.js +104 -1
  34. package/node_modules/@oxygen/workflows/dist/graph/params.d.ts +2 -0
  35. package/node_modules/@oxygen/workflows/dist/graph/params.js +15 -0
  36. package/node_modules/@oxygen/workflows/dist/graph/remap.js +12 -3
  37. package/node_modules/@oxygen/workflows/dist/graph/topology.d.ts +9 -0
  38. package/node_modules/@oxygen/workflows/dist/graph/topology.js +33 -1
  39. package/node_modules/@oxygen/workflows/dist/graph/types.d.ts +123 -16
  40. package/node_modules/@oxygen/workflows/dist/graph/types.js +45 -0
  41. package/node_modules/@oxygen/workflows/dist/index.d.ts +94 -2
  42. package/node_modules/@oxygen/workflows/dist/index.js +169 -26
  43. package/node_modules/@oxygen/workflows/dist/portable.js +3 -1
  44. package/package.json +1 -1
@@ -0,0 +1,320 @@
1
+ import { FUTURE_SIGNUP_LIFECYCLE_CONTRACT_VERSION, FUTURE_SIGNUP_LIFECYCLE_PROJECTION_CONTRACT_VERSION } from "./future-signup-events.js";
2
+ /** Fixed destination-head authority. Contract upgrades cannot reset this stream. */
3
+ export declare const FUTURE_SIGNUP_LIFECYCLE_PROJECTION_AUTHORITY: "oxygen_product_lifecycle";
4
+ export declare const FUTURE_SIGNUP_LIFECYCLE_PROJECTION_FACT_TYPES: readonly ["trial_started", "paid", "lost", "subscription_ended", "workspace_deleted", "projection_refreshed"];
5
+ export declare const FUTURE_SIGNUP_LIFECYCLE_PROJECTION_BILLING_STAGES: readonly ["free_trial", "paid", "lost"];
6
+ export declare const FUTURE_SIGNUP_LIFECYCLE_PROJECTION_PREBILLING_STAGES: readonly ["lead", "interested", "demo_booked"];
7
+ export declare const FUTURE_SIGNUP_LIFECYCLE_PROJECTION_SEMANTIC_STAGES: readonly ["lead", "interested", "demo_booked", "free_trial", "paid", "lost"];
8
+ export declare const FUTURE_SIGNUP_LIFECYCLE_PROJECTION_ALIAS_TYPES: readonly ["clerk_organization", "clerk_user", "domain", "email", "stripe_customer"];
9
+ export declare const FUTURE_SIGNUP_LIFECYCLE_PROJECTION_ACTIVITY_TYPES: readonly ["trial_started", "plan_paid", "customer_lost", "workspace_deleted"];
10
+ export type FutureSignupLifecycleProjectionFactType = (typeof FUTURE_SIGNUP_LIFECYCLE_PROJECTION_FACT_TYPES)[number];
11
+ export type FutureSignupLifecycleProjectionBillingStage = (typeof FUTURE_SIGNUP_LIFECYCLE_PROJECTION_BILLING_STAGES)[number];
12
+ export type FutureSignupLifecycleProjectionPrebillingStage = (typeof FUTURE_SIGNUP_LIFECYCLE_PROJECTION_PREBILLING_STAGES)[number];
13
+ export type FutureSignupLifecycleProjectionSemanticStage = (typeof FUTURE_SIGNUP_LIFECYCLE_PROJECTION_SEMANTIC_STAGES)[number];
14
+ export type FutureSignupLifecycleProjectionAliasType = (typeof FUTURE_SIGNUP_LIFECYCLE_PROJECTION_ALIAS_TYPES)[number];
15
+ export type FutureSignupLifecycleProjectionActivityType = (typeof FUTURE_SIGNUP_LIFECYCLE_PROJECTION_ACTIVITY_TYPES)[number];
16
+ export type FutureSignupLifecycleProjectionSubjectKind = "company" | "person";
17
+ export type FutureSignupLifecycleProjectionAction = "upsert" | "neutralize";
18
+ export type FutureSignupLifecycleProjectionLossKind = "paid_churn" | "trial_non_conversion";
19
+ export type FutureSignupLifecycleProjectionTerminationKind = "replaced" | "duplicate" | "unqualified";
20
+ export type FutureSignupLifecycleProjectionMembershipRemovalReason = "member_removed" | "user_deleted" | "workspace_deleted";
21
+ export type FutureSignupLifecycleProjectionMembershipContributor = {
22
+ clerk_membership_id: string;
23
+ clerk_org_id: string;
24
+ role: string;
25
+ is_creator: boolean;
26
+ active: boolean;
27
+ removed_reason: FutureSignupLifecycleProjectionMembershipRemovalReason | null;
28
+ };
29
+ /** Exact subject shape already emitted by the shipped v1 control builder. */
30
+ export type FutureSignupLifecycleProjectionSubject = {
31
+ kind: FutureSignupLifecycleProjectionSubjectKind;
32
+ key: string;
33
+ billing_stage: FutureSignupLifecycleProjectionBillingStage | null;
34
+ stage_since: string | null;
35
+ aggregate_revision: number;
36
+ aggregate_fingerprint: string;
37
+ winning_clerk_org_id: string | null;
38
+ winning_fact_id: string | null;
39
+ winning_fact_revision: number | null;
40
+ source_state_revision: number;
41
+ membership_set_revision: number;
42
+ members_complete: true;
43
+ projection_action: FutureSignupLifecycleProjectionAction;
44
+ replacement_company_key: string | null;
45
+ departed_clerk_org_ids: string[];
46
+ oxygen_product_lifecycle: {
47
+ revision: number;
48
+ fingerprint: string;
49
+ };
50
+ external_identities: Array<{
51
+ provider: "clerk";
52
+ object: "user" | "organization";
53
+ id: string;
54
+ }>;
55
+ natural_identity: {
56
+ email: string | null;
57
+ domain: string | null;
58
+ };
59
+ display: {
60
+ first_name: string | null;
61
+ last_name: string | null;
62
+ company_name: string | null;
63
+ };
64
+ represented_clerk_org_ids: string[];
65
+ represented_company_keys: string[];
66
+ membership_ids: string[];
67
+ membership_contributors: FutureSignupLifecycleProjectionMembershipContributor[];
68
+ };
69
+ export type FutureSignupLifecycleProjectionOrganizationState = {
70
+ clerk_org_id: string;
71
+ company_key: string;
72
+ company_key_history: string[];
73
+ normalized_domain: string | null;
74
+ billing_stage: FutureSignupLifecycleProjectionBillingStage | null;
75
+ stage_since: string | null;
76
+ loss_kind: FutureSignupLifecycleProjectionLossKind | null;
77
+ winning_fact_id: string | null;
78
+ winning_fact_revision: number | null;
79
+ organization_revision: number;
80
+ billing_revision: number;
81
+ state_revision: number;
82
+ membership_set_revision: number;
83
+ members_complete: boolean;
84
+ state_fingerprint: string;
85
+ membership_set_fingerprint: string;
86
+ workspace_deleted_at: string | null;
87
+ workspace_deleted_fact_id: string | null;
88
+ workspace_deleted_fact_revision: number | null;
89
+ };
90
+ export type FutureSignupLifecycleProjectionMembershipState = {
91
+ clerk_membership_id: string;
92
+ journey_id: string | null;
93
+ clerk_user_id: string;
94
+ clerk_org_id: string;
95
+ role: string;
96
+ is_creator: boolean;
97
+ contributes_to_lifecycle: boolean;
98
+ membership_created_at: string;
99
+ membership_revision: number;
100
+ state_fingerprint: string;
101
+ removed_at: string | null;
102
+ removed_reason: FutureSignupLifecycleProjectionMembershipRemovalReason | null;
103
+ };
104
+ export type FutureSignupLifecycleProjectionSourceFact = {
105
+ fact_id: string;
106
+ fact_revision: number;
107
+ contract_version: typeof FUTURE_SIGNUP_LIFECYCLE_CONTRACT_VERSION;
108
+ fact_type: FutureSignupLifecycleProjectionFactType;
109
+ clerk_org_id: string;
110
+ occurred_at: string;
111
+ source: "clerk" | "clerk_org_deletion" | "stripe";
112
+ source_event_id: string;
113
+ source_revision: number;
114
+ stripe_customer_id: string | null;
115
+ stripe_subscription_id: string | null;
116
+ stripe_invoice_id: string | null;
117
+ stripe_period_start: string | null;
118
+ stripe_period_end: string | null;
119
+ amount_paid_cents: number | null;
120
+ currency: string | null;
121
+ loss_kind: FutureSignupLifecycleProjectionLossKind | null;
122
+ termination_kind: FutureSignupLifecycleProjectionTerminationKind | null;
123
+ };
124
+ export type FutureSignupLifecycleProjectionSnapshot = {
125
+ complete: true;
126
+ causal_clerk_org_id: string;
127
+ organization_states: FutureSignupLifecycleProjectionOrganizationState[];
128
+ membership_states: FutureSignupLifecycleProjectionMembershipState[];
129
+ subjects: FutureSignupLifecycleProjectionSubject[];
130
+ subject_set_fingerprint: string;
131
+ snapshot_fingerprint: string;
132
+ };
133
+ export type FutureSignupLifecycleProjectionActivity = {
134
+ type: FutureSignupLifecycleProjectionActivityType | "note";
135
+ source_provider: typeof FUTURE_SIGNUP_LIFECYCLE_PROJECTION_AUTHORITY;
136
+ provider_event_id: string;
137
+ occurred_at: string;
138
+ summary: string;
139
+ subject_keys: string[];
140
+ metadata: {
141
+ source_fact_id: string;
142
+ source_fact_revision: number;
143
+ causal_clerk_org_id: string;
144
+ loss_kind: FutureSignupLifecycleProjectionLossKind | null;
145
+ termination_kind: FutureSignupLifecycleProjectionTerminationKind | null;
146
+ };
147
+ };
148
+ /** Exact plaintext envelope already emitted by the shipped v1 control builder. */
149
+ export type FutureSignupLifecycleProjectionEnvelope = {
150
+ contract_version: typeof FUTURE_SIGNUP_LIFECYCLE_PROJECTION_CONTRACT_VERSION;
151
+ event_id: string;
152
+ event_type: "lifecycle_projection";
153
+ fact_id: string;
154
+ fact_revision: number;
155
+ occurred_at: string;
156
+ provider: "oxygen";
157
+ provider_event_id: string;
158
+ upstream: {
159
+ provider: FutureSignupLifecycleProjectionSourceFact["source"];
160
+ provider_event_id: string;
161
+ source_revision: number;
162
+ };
163
+ source_fact: FutureSignupLifecycleProjectionSourceFact;
164
+ snapshot: FutureSignupLifecycleProjectionSnapshot;
165
+ activity: FutureSignupLifecycleProjectionActivity;
166
+ producer: {
167
+ environment: "dev" | "production";
168
+ version: string;
169
+ commitSha: string;
170
+ };
171
+ validation: {
172
+ synthetic: false;
173
+ no_send: true;
174
+ };
175
+ };
176
+ export type FutureSignupLifecycleProjectionAlias = {
177
+ type: FutureSignupLifecycleProjectionAliasType;
178
+ value: string;
179
+ };
180
+ export type FutureSignupLifecycleProjectionLookupIdentity = {
181
+ type: "domain";
182
+ value: string;
183
+ };
184
+ export type FutureSignupLifecycleProjectionPrebillingCandidate = {
185
+ stage: FutureSignupLifecycleProjectionPrebillingStage;
186
+ occurred_at: string;
187
+ source_event_id: string;
188
+ };
189
+ /** Closed destination view derived from, but not confused with, the shipped v1. */
190
+ export type FutureSignupLifecycleProjectionNormalizedSubject = {
191
+ kind: FutureSignupLifecycleProjectionSubjectKind;
192
+ key: string;
193
+ /** Identities the apply layer may assert or attach to the destination record. */
194
+ aliases: FutureSignupLifecycleProjectionAlias[];
195
+ /** Lookup-only identity for a historical tombstone; never asserted or moved. */
196
+ lookup_identities: FutureSignupLifecycleProjectionLookupIdentity[];
197
+ display: FutureSignupLifecycleProjectionSubject["display"];
198
+ aggregate_revision: number;
199
+ aggregate_fingerprint: string;
200
+ source_state_revision: number;
201
+ membership_set_revision: number;
202
+ members_complete: true;
203
+ projection_action: FutureSignupLifecycleProjectionAction;
204
+ replacement_company_key: string | null;
205
+ departed_clerk_org_ids: string[];
206
+ billing_stage: FutureSignupLifecycleProjectionBillingStage | null;
207
+ stage_since: string | null;
208
+ loss_kind: FutureSignupLifecycleProjectionLossKind | null;
209
+ winning_clerk_org_id: string | null;
210
+ winning_fact_id: string | null;
211
+ winning_fact_revision: number | null;
212
+ /** v1 carries no prebilling evidence, so normalization never invents one. */
213
+ prebilling_candidate: FutureSignupLifecycleProjectionPrebillingCandidate | null;
214
+ membership_contributors: FutureSignupLifecycleProjectionMembershipContributor[];
215
+ };
216
+ export type FutureSignupLifecycleProjectionParticipant = {
217
+ kind: FutureSignupLifecycleProjectionSubjectKind;
218
+ key: string;
219
+ role: "primary" | "related";
220
+ };
221
+ export type FutureSignupLifecycleProjectionNormalizedActivity = {
222
+ emit: true;
223
+ type: FutureSignupLifecycleProjectionActivityType;
224
+ source_provider: typeof FUTURE_SIGNUP_LIFECYCLE_PROJECTION_AUTHORITY;
225
+ provider_event_id: string;
226
+ occurred_at: string;
227
+ summary: string;
228
+ participants: FutureSignupLifecycleProjectionParticipant[];
229
+ } | {
230
+ emit: false;
231
+ type: null;
232
+ source_provider: null;
233
+ provider_event_id: null;
234
+ occurred_at: null;
235
+ summary: null;
236
+ participants: [];
237
+ };
238
+ export type FutureSignupLifecycleProjectionFingerprintSet = {
239
+ source_fact_fingerprint: string;
240
+ subject_set_fingerprint: string;
241
+ snapshot_fingerprint: string;
242
+ projection_fingerprint: string;
243
+ };
244
+ export type FutureSignupLifecycleProjectionIdempotencyKeys = {
245
+ delivery_receipt: string;
246
+ activity: string | null;
247
+ subjects: Array<{
248
+ kind: FutureSignupLifecycleProjectionSubjectKind;
249
+ key: string;
250
+ idempotency_key: string;
251
+ }>;
252
+ };
253
+ export type FutureSignupLifecycleProjectionNormalizedProjection = {
254
+ contract_version: typeof FUTURE_SIGNUP_LIFECYCLE_PROJECTION_CONTRACT_VERSION;
255
+ authority: typeof FUTURE_SIGNUP_LIFECYCLE_PROJECTION_AUTHORITY;
256
+ event_id: string;
257
+ occurred_at: string;
258
+ source_fact: FutureSignupLifecycleProjectionSourceFact;
259
+ snapshot: {
260
+ complete: true;
261
+ causal_clerk_org_id: string;
262
+ subjects: FutureSignupLifecycleProjectionNormalizedSubject[];
263
+ };
264
+ activity: FutureSignupLifecycleProjectionNormalizedActivity;
265
+ validation: {
266
+ synthetic: false;
267
+ no_send: true;
268
+ };
269
+ };
270
+ export type NormalizedFutureSignupLifecycleProjectionEnvelope = {
271
+ /** Canonical clone of the exact shipped v1 plaintext. */
272
+ envelope: FutureSignupLifecycleProjectionEnvelope;
273
+ /** Closed destination-facing projection derived from that plaintext. */
274
+ projection: FutureSignupLifecycleProjectionNormalizedProjection;
275
+ fingerprints: FutureSignupLifecycleProjectionFingerprintSet;
276
+ idempotency_keys: FutureSignupLifecycleProjectionIdempotencyKeys;
277
+ };
278
+ export type FutureSignupLifecycleProjectionStageMapping = Record<FutureSignupLifecycleProjectionSemanticStage, string>;
279
+ export type FutureSignupLifecycleProjectionDestinationApplyOptions = {
280
+ objects: {
281
+ people: "people";
282
+ companies: "companies";
283
+ };
284
+ stage_tokens: {
285
+ people: FutureSignupLifecycleProjectionStageMapping;
286
+ companies: FutureSignupLifecycleProjectionStageMapping;
287
+ };
288
+ /** Destination-only exact member identity. Never appears in the control envelope. */
289
+ owner_if_blank: {
290
+ workspace_user_id: string;
291
+ } | null;
292
+ activity_policy: {
293
+ customer_lifecycle_facts: "emit_envelope_activity";
294
+ projection_refreshed: "suppress";
295
+ subscription_ended: "suppress";
296
+ participants: "envelope_subjects_only";
297
+ idempotency: "event_id";
298
+ };
299
+ };
300
+ export type NormalizedFutureSignupLifecycleProjectionDestinationApplyOptions = {
301
+ apply_options: FutureSignupLifecycleProjectionDestinationApplyOptions;
302
+ apply_options_fingerprint: string;
303
+ };
304
+ /** Typed, PII-free parse failure. Raw values are intentionally never reflected. */
305
+ export declare class FutureSignupLifecycleProjectionContractError extends TypeError {
306
+ readonly path: string;
307
+ readonly rule: string;
308
+ readonly code = "future_signup_lifecycle_projection_invalid";
309
+ constructor(path: string, rule: string);
310
+ }
311
+ /** Exact fingerprint algorithm used by the shipped v1 control builder. */
312
+ export declare function futureSignupLifecycleProjectionFingerprints(input: {
313
+ eventId: string;
314
+ sourceFact: FutureSignupLifecycleProjectionSourceFact;
315
+ snapshot: Omit<FutureSignupLifecycleProjectionSnapshot, "subject_set_fingerprint" | "snapshot_fingerprint">;
316
+ }): FutureSignupLifecycleProjectionFingerprintSet;
317
+ export declare function parseFutureSignupLifecycleProjectionJson(body: string): NormalizedFutureSignupLifecycleProjectionEnvelope;
318
+ /** Validate shipped v1 and derive the closed destination view. No writes or sends. */
319
+ export declare function normalizeFutureSignupLifecycleProjectionEnvelope(value: unknown): NormalizedFutureSignupLifecycleProjectionEnvelope;
320
+ export declare function normalizeFutureSignupLifecycleProjectionDestinationApplyOptions(value: unknown): NormalizedFutureSignupLifecycleProjectionDestinationApplyOptions;