@shipeasy/openapi 2.4.0 → 3.0.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.
package/dist/client.d.ts CHANGED
@@ -1 +1 @@
1
- export { q as Client, s as Config, u as ConfigureOptions, T as CreateClientConfig, iU as Options, jp as RequestResult, na as ackOpsItem, nb as approveEvent, nc as client, nd as configure, ne as createAlertRule, nf as createAttribute, ng as createClient, nh as createClientConfig, ni as createConfig, nj as createConnector, nk as createEvent, nl as createExperiment, nm as createExperimentReadout, nn as createGate, no as createGateTemplate, np as createI18nDraft, nq as createI18nProfile, nr as createKey, ns as createKillswitch, nt as createMetric, nu as createOpsComment, nv as createOpsInvestigation, nw as createOpsItem, nx as createTriggerConnector, ny as createUniverse, nz as deleteAlertRule, nA as deleteAttribute, nB as deleteConfig, nC as deleteConnector, nD as deleteEvent, nE as deleteExperiment, nF as deleteGate, nG as deleteGateTemplate, nH as deleteI18nDraft, nI as deleteI18nKey, nJ as deleteI18nProfile, nK as deleteKillswitch, nL as deleteMetric, nM as deleteOpsItem, nN as deleteUniverse, nO as disableGate, nP as discardConfigDraft, nQ as enableGate, nR as fileErrorTicket, nS as fireConnector, nT as getAttribute, nU as getConfig, nV as getConnector, nW as getCurrentProject, nX as getError, nY as getErrorSeries, nZ as getEvent, n_ as getExperiment, n$ as getExperimentReadout, o0 as getExperimentResults, o1 as getExperimentTimeseries, o2 as getGate, o3 as getGateTemplate, o4 as getKillswitch, o5 as getMetric, o6 as getMetricSeries, o7 as getOpsItem, o8 as getProject, o9 as linkPrToOpsItem, oa as listAlertRules, ob as listAlerts, oc as listAttributes, od as listConfigActivity, oe as listConfigVersions, of as listConfigs, og as listConnectors, oh as listErrors, oi as listEvents, oj as listExperiments, ok as listGateActivity, ol as listGateTemplates, om as listGates, on as listI18nDraftKeys, oo as listI18nDrafts, op as listI18nKeys, oq as listI18nProfiles, or as listKeys, os as listKillswitches, ot as listMetricExperiments, ou as listMetrics, ov as listOpsAgents, ow as listOpsComments, ox as listOpsInvestigations, oy as listOpsItems, oz as listSlackChannels, oA as listUniverses, oB as notifyOps, oC as publishConfigDraft, oD as publishI18nProfile, oE as pushI18nKeys, oF as reanalyzeExperiment, oG as resolveError, oH as revokeKey, oI as saveConfigDraft, oJ as searchResources, oK as setExperimentMetrics, oL as setExperimentStatus, oM as setI18nLabel, oN as setKillswitchSwitch, oO as setKillswitchValue, oP as testConnector, oQ as unarchiveMetric, oR as unsetKillswitchSwitch, oS as updateAlert, oT as updateAlertRule, oU as updateAttribute, oV as updateConfig, oW as updateConfigSchema, oX as updateConnector, oY as updateErrorStatus, oZ as updateEvent, o_ as updateExperiment, o$ as updateGate, p0 as updateGateTemplate, p1 as updateI18nDraft, p2 as updateI18nKey, p3 as updateKillswitch, p4 as updateMetric, p5 as updateOpsItem, p6 as updateProject, p7 as updateTriggerConnector, p8 as updateUniverse, p9 as upsertI18nDraftKey, pa as upsertI18nKeys, pb as upsertProject } from './client-WGNXT4xl.js';
1
+ export { q as Client, s as Config, u as ConfigureOptions, T as CreateClientConfig, iX as Options, js as RequestResult, nj as ackOpsItem, nk as approveEvent, nl as client, nm as configure, nn as createAlertRule, no as createAttribute, np as createClient, nq as createClientConfig, nr as createConfig, ns as createConnector, nt as createEvent, nu as createExperiment, nv as createExperimentReadout, nw as createGate, nx as createGateTemplate, ny as createI18nDraft, nz as createI18nProfile, nA as createKey, nB as createKillswitch, nC as createMetric, nD as createOpsComment, nE as createOpsInvestigation, nF as createOpsItem, nG as createTriggerConnector, nH as createUniverse, nI as deleteAlertRule, nJ as deleteAttribute, nK as deleteConfig, nL as deleteConnector, nM as deleteEvent, nN as deleteExperiment, nO as deleteGate, nP as deleteGateTemplate, nQ as deleteI18nDraft, nR as deleteI18nKey, nS as deleteI18nProfile, nT as deleteKillswitch, nU as deleteMetric, nV as deleteOpsItem, nW as deleteUniverse, nX as disableGate, nY as discardConfigDraft, nZ as enableGate, n_ as fileErrorTicket, n$ as fireConnector, o0 as getAttribute, o1 as getConfig, o2 as getConnector, o3 as getCurrentProject, o4 as getError, o5 as getErrorSeries, o6 as getEvent, o7 as getExperiment, o8 as getExperimentReadout, o9 as getExperimentResults, oa as getExperimentTimeseries, ob as getGate, oc as getGateTemplate, od as getKillswitch, oe as getMetric, of as getMetricSeries, og as getOpsItem, oh as getProject, oi as linkPrToOpsItem, oj as listAlertRules, ok as listAlerts, ol as listAttributes, om as listConfigActivity, on as listConfigVersions, oo as listConfigs, op as listConnectors, oq as listErrors, or as listEvents, os as listExperiments, ot as listGateActivity, ou as listGateTemplates, ov as listGates, ow as listI18nDraftKeys, ox as listI18nDrafts, oy as listI18nKeys, oz as listI18nProfiles, oA as listKeys, oB as listKillswitches, oC as listMetricExperiments, oD as listMetrics, oE as listOpsAgents, oF as listOpsComments, oG as listOpsInvestigations, oH as listOpsItems, oI as listSlackChannels, oJ as listUniverses, oK as notifyOps, oL as publishConfigDraft, oM as publishI18nProfile, oN as pushI18nKeys, oO as reanalyzeExperiment, oP as resolveError, oQ as revokeKey, oR as saveConfigDraft, oS as searchResources, oT as setExperimentMetrics, oU as setExperimentStatus, oV as setI18nLabel, oW as setKillswitchSwitch, oX as setKillswitchValue, oY as testConnector, oZ as unarchiveMetric, o_ as unsetKillswitchSwitch, o$ as updateAlert, p0 as updateAlertRule, p1 as updateAttribute, p2 as updateConfig, p3 as updateConfigSchema, p4 as updateConnector, p5 as updateErrorStatus, p6 as updateEvent, p7 as updateExperiment, p8 as updateGate, p9 as updateGateTemplate, pa as updateI18nDraft, pb as updateI18nKey, pc as updateKillswitch, pd as updateMetric, pe as updateOpsInvestigation, pf as updateOpsItem, pg as updateProject, ph as updateTriggerConnector, pi as updateUniverse, pj as upsertI18nDraftKey, pk as upsertI18nKeys, pl as upsertProject } from './client-DzEqdN5N.js';
package/dist/client.js CHANGED
@@ -122,6 +122,7 @@ import {
122
122
  updateI18nKey,
123
123
  updateKillswitch,
124
124
  updateMetric,
125
+ updateOpsInvestigation,
125
126
  updateOpsItem,
126
127
  updateProject,
127
128
  updateTriggerConnector,
@@ -129,7 +130,7 @@ import {
129
130
  upsertI18nDraftKey,
130
131
  upsertI18nKeys,
131
132
  upsertProject
132
- } from "./chunk-4QSU744W.js";
133
+ } from "./chunk-V4ZESAIF.js";
133
134
  export {
134
135
  ackOpsItem,
135
136
  approveEvent,
@@ -254,6 +255,7 @@ export {
254
255
  updateI18nKey,
255
256
  updateKillswitch,
256
257
  updateMetric,
258
+ updateOpsInvestigation,
257
259
  updateOpsItem,
258
260
  updateProject,
259
261
  updateTriggerConnector,
package/dist/custom.d.ts CHANGED
@@ -64,11 +64,16 @@ declare const opId: (op: CustomOp) => string;
64
64
  * author a `metrics create --query "..."` string. It is intentionally
65
65
  * self-contained: the formal grammar (precise, for machine parsing), a full
66
66
  * aggregation reference (semantics + value-label rules + experiment behaviour),
67
- * the selector/filter/group-by rules, hard constraints, and glossed examples.
68
- * Keep it in sync with the parser (`cli/src/query-dsl/parse.ts`) and the IR
69
- * (`cli/src/query-dsl/ir.ts`) — they are the source of truth for semantics.
67
+ * the selector/filter/group-by/ratio rules, hard constraints, and glossed
68
+ * examples.
69
+ *
70
+ * Source of truth for semantics is the RUNTIME parser + IR that the server
71
+ * actually runs: the main repo's `packages/query-dsl` (`parse.ts` / `ir.ts`).
72
+ * The vendored `cli/src/query-dsl` copy is a lagging subset (no `ratio` yet) and
73
+ * is NOT on the create path — the CLI forwards the raw `--query` string to the
74
+ * server, which parses it. Keep this text in sync with `packages/query-dsl`.
70
75
  */
71
- declare const METRIC_GRAMMAR = "SHIPEASY METRIC QUERY DSL\n=========================\n\nA metric is ONE aggregation over ONE event stream. This DSL is the string you\npass to `metrics create --query \"...\"` (equivalently the typed `query_ir`).\nThere is no arithmetic, no formulas across events, no subqueries \u2014 one event\nselector, one aggregation, an optional group-by.\n\n\nGRAMMAR (BNF)\n-------------\n Query := AggFunc \"(\" Selector (\",\" Identifier)? \")\" GroupBy?\n AggFunc := \"count_users\" | \"count\" | \"sum\" | \"avg\" | \"min\" | \"max\"\n | \"unique\" | \"p50\" | \"p75\" | \"p90\" | \"p95\" | \"p99\" | \"p999\"\n | \"retention_\" <N> \"d\" (N = 1..90)\n Selector := Identifier (\"{\" Filter (\",\" Filter)* \",\"? \"}\")?\n Filter := Identifier MatchOp StringLiteral\n MatchOp := \"=\" | \"!=\" | \"=~\" | \"!~\"\n GroupBy := (\"by\" | \"without\") \"(\" Identifier (\",\" Identifier)* \",\"? \")\"\n StringLiteral := double-quoted; \\\" is a literal quote, \\\\ is a backslash\n Identifier := [A-Za-z_][A-Za-z0-9_]* (case-sensitive)\n\n The trailing Identifier after the selector \u2014 \"(\" Selector \",\" Identifier \")\" \u2014\n is the VALUE LABEL: the numeric event label the aggregation reduces. Whether it\n is required, optional, or forbidden depends on the aggregation (see below).\n\n\nAGGREGATIONS\n------------\n Function Value label Meaning In experiments\n -------------- ------------ ------------------------------ ---------------\n count_users forbidden distinct users who fired it exact\n count forbidden number of events (rows) exact\n sum(e, v) required \u03A3 of numeric label v exact\n avg(e, v) required mean of label v exact\n retention_Nd(e) forbidden % of users who returned exact\n within N days (N = 1..90)\n min(e, v) required minimum of label v approx \u2192 avg *\n max(e, v) required maximum of label v approx \u2192 avg *\n unique(e, v) required distinct values of label v approx \u2192 avg *\n p50 \u2026 p999(e,v) required quantile of v (50/75/90/ approx \u2192 avg *\n 95/99/99.9th percentile)\n\n * Display-only aggregations. The experiment t-test needs a per-user mean and\n variance, so min/max/unique/quantile are computed exactly on dashboards but\n collapse to a per-user `avg` when used as an experiment metric. If you need\n an exact experiment metric, pick count_users / count / sum / avg / retention.\n\n \"count\" is the DSL spelling of the internal count_events (one per matching\n row); \"count_users\" is unique-by-user. Getting these two confused is the most\n common mistake \u2014 count double-counts a user who fired the event twice.\n\n\nSELECTOR & FILTERS\n------------------\n The selector is the event name plus an optional `{ ... }` filter set that\n narrows which events count. Each filter compares an event LABEL to a quoted\n string:\n\n = equal != not equal\n =~ regex match !~ regex NOT match\n\n - Values are ALWAYS double-quoted strings, even for numeric labels \u2014 they are\n coerced on the server (`amount=~\"^1[0-9]$\"`, `status=\"200\"`).\n - Multiple filters are AND-ed: `{country=\"US\", tier!=\"free\"}`.\n - Every filter label AND the value label must be a label DECLARED on the source\n event. Undeclared labels are a validation error, not a silent no-match.\n\n\nGROUP-BY\n--------\n Splits the result into one series per label combination.\n by (a, b) one series per distinct (a, b) \u2014 keep only these labels\n without (a, b) group by all declared labels EXCEPT a, b\n\n NOTE: group-by is a DASHBOARD-only feature. In an experiment the group-by is\n ignored \u2014 a per-user reducer is applied across the whole arm instead.\n\n\nNOT SUPPORTED (will fail to parse)\n----------------------------------\n - arithmetic / ratios / formulas: `count(a) / count(b)`\n - more than one event per query\n - arbitrary quantiles (only the fixed p50/p75/p90/p95/p99/p999)\n - unquoted or numeric filter values: `{status=200}` \u2192 must be `\"200\"`\n - trailing tokens after the query\n\n\nEXAMPLES (query \u2014 what it measures)\n--------------------------------------\n count_users(checkout_completed)\n distinct users who completed checkout.\n\n count(add_to_cart{country=\"US\"})\n number of US add-to-cart events (a user can count many times).\n\n sum(purchase{country=\"US\"}, amount)\n total purchase amount from US purchase events.\n\n avg(req_dur{tier!=\"free\"}, ms) without (region)\n mean request duration for non-free tiers, one series per region-excluded\n label combination.\n\n p99(req_dur{route=~\"/api/.*\"}, ms) by (route, status)\n 99th-percentile latency of /api/* requests, split by route and status.\n\n unique(login{method=\"sso\"}, device_id)\n distinct SSO devices seen (display-only; an experiment would use per-user avg).\n\n retention_7d(session_start)\n share of users who started a new session within 7 days.\n";
76
+ declare const METRIC_GRAMMAR = "SHIPEASY METRIC QUERY DSL\n=========================\n\nA metric is an aggregation over an event stream. Almost always that is ONE\naggregation over ONE event; the single exception is the binary `ratio(...)`\nform, which divides one count-style arm by another (each arm its own event and\nfilters) in one pass. This DSL is the string you pass to\n`metrics create --query \"...\"` (equivalently the typed `query_ir`). There is\nno general arithmetic, no free-form formulas, and no subqueries \u2014 `ratio` is\nthe only division / two-event form.\n\n\nGRAMMAR (BNF)\n-------------\n Query := Agg | Ratio\n Agg := AggFunc \"(\" Selector (\",\" Identifier)? \")\" GroupBy?\n Ratio := \"ratio\" \"(\" RatioArm \",\" RatioArm \")\"\n RatioArm := (\"count_users\" | \"count\") \"(\" Selector \")\"\n AggFunc := \"count_users\" | \"count\" | \"sum\" | \"avg\" | \"min\" | \"max\"\n | \"unique\" | \"p50\" | \"p75\" | \"p90\" | \"p95\" | \"p99\" | \"p999\"\n | \"retention_\" <N> \"d\" (N = 1..90)\n Selector := Identifier (\"{\" Filter (\",\" Filter)* \",\"? \"}\")?\n Filter := Identifier MatchOp StringLiteral\n MatchOp := \"=\" | \"!=\" | \"=~\" | \"!~\"\n GroupBy := (\"by\" | \"without\") \"(\" Identifier (\",\" Identifier)* \",\"? \")\"\n StringLiteral := double-quoted; \\\" is a literal quote, \\\\ is a backslash\n Identifier := [A-Za-z_][A-Za-z0-9_]* (case-sensitive)\n\n The trailing Identifier after the selector \u2014 \"(\" Selector \",\" Identifier \")\" \u2014\n is the VALUE LABEL: the numeric event label the aggregation reduces. Whether it\n is required, optional, or forbidden depends on the aggregation (see below).\n\n\nAGGREGATIONS\n------------\n Function Value label Meaning In experiments\n -------------- ------------ ------------------------------ ---------------\n count_users forbidden distinct users who fired it exact\n count forbidden number of events (rows) exact\n sum(e, v) required \u03A3 of numeric label v exact\n avg(e, v) required mean of label v exact\n retention_Nd(e) forbidden % of users who returned exact\n within N days (N = 1..90)\n min(e, v) required minimum of label v approx \u2192 avg *\n max(e, v) required maximum of label v approx \u2192 avg *\n unique(e, v) required distinct values of label v approx \u2192 avg *\n p50 \u2026 p999(e,v) required quantile of v (50/75/90/ approx \u2192 avg *\n 95/99/99.9th percentile)\n ratio(a, b) forbidden a \u00F7 b (see RATIO below) proportion **\n\n * Display-only aggregations. The experiment t-test needs a per-user mean and\n variance, so min/max/unique/quantile are computed exactly on dashboards but\n collapse to a per-user `avg` when used as an experiment metric. If you need\n an exact experiment metric, pick count_users / count / sum / avg / retention.\n\n ** In an experiment a ratio collapses to a per-user 0/1 outcome (a proportion),\n not a ratio-of-sums \u2014 see RATIO.\n\n \"count\" is the DSL spelling of the internal count_events (one per matching\n row); \"count_users\" is unique-by-user. Getting these two confused is the most\n common mistake \u2014 count double-counts a user who fired the event twice.\n\n\nSELECTOR & FILTERS\n------------------\n The selector is the event name plus an optional `{ ... }` filter set that\n narrows which events count. Each filter compares an event LABEL to a quoted\n string:\n\n = equal != not equal\n =~ regex match !~ regex NOT match\n\n - Values are ALWAYS double-quoted strings, even for numeric labels \u2014 they are\n coerced on the server (`amount=~\"^1[0-9]$\"`, `status=\"200\"`).\n - Multiple filters are AND-ed: `{country=\"US\", tier!=\"free\"}`.\n - Every filter label AND the value label must be a label DECLARED on the source\n event. Undeclared labels are a validation error, not a silent no-match.\n\n\nGROUP-BY\n--------\n Splits the result into one series per label combination.\n by (a, b) one series per distinct (a, b) \u2014 keep only these labels\n without (a, b) group by all declared labels EXCEPT a, b\n\n NOTE: group-by is a DASHBOARD-only feature. In an experiment the group-by is\n ignored \u2014 a per-user reducer is applied across the whole arm instead. Group-by\n is NOT allowed on a `ratio` query.\n\n\nRATIO (success rate, conversion, failure %, \u2026)\n-----------------------------------------------\n `ratio(numerator, denominator)` divides one count-style arm by another. Each\n arm is an independent selector with its OWN event and filters, so the two arms\n can be different events:\n\n ratio(count(checkout_completed), count(checkout_started))\n ratio(count_users(paid), count_users(signed_up))\n ratio(count(payment{ok=\"1\"}), count(payment)) one event, filtered arm\n\n Rules:\n - Arms are limited to `count` and `count_users` \u2014 no sum/avg/quantile arm.\n - `count` arms divide event counts; `count_users` arms divide distinct-user\n counts. Pick one shape and use it on both arms unless you mean to mix them.\n - A zero denominator yields 0, not an error.\n - No `by (...)` / `without (...)`, and no retention arm, on a ratio.\n - It is a COHORT RATE over the window \u2014 numerator events \u00F7 denominator events \u2014\n NOT a per-id join. It never matches an individual attempt to its outcome by a\n correlation id; it counts each side over the window and divides. If you need a\n matched pair, resolve the outcome in your own code and emit ONE event carrying\n the result (e.g. an `ok` label), then use `ratio(count(e{ok=\"1\"}), count(e))`\n or `avg(e, ok)`.\n - In an experiment a per-user ratio is a 0/1 outcome \u2014 did the numerator happen,\n among denominator-eligible users \u2014 i.e. a proportion, not a ratio-of-sums.\n - When creating with `--event-name`, pass the NUMERATOR's event name.\n\n\nNOT SUPPORTED (will fail to parse)\n----------------------------------\n - general arithmetic / free-form formulas: `count(a) + count(b)`, `2 * sum(x)`,\n `avg(a) / avg(b)` \u2014 the ONLY division form is the fixed binary\n `ratio(arm, arm)` with count-style arms (see RATIO)\n - a ratio arm that isn't `count` / `count_users`: `ratio(sum(a, v), count(b))`\n - more than two events in one query\n - `by (...)` / `without (...)` on a ratio\n - arbitrary quantiles (only the fixed p50/p75/p90/p95/p99/p999)\n - unquoted or numeric filter values: `{status=200}` \u2192 must be `\"200\"`\n - trailing tokens after the query\n\n\nEXAMPLES (query \u2014 what it measures)\n--------------------------------------\n count_users(checkout_completed)\n distinct users who completed checkout.\n\n count(add_to_cart{country=\"US\"})\n number of US add-to-cart events (a user can count many times).\n\n sum(purchase{country=\"US\"}, amount)\n total purchase amount from US purchase events.\n\n avg(req_dur{tier!=\"free\"}, ms) without (region)\n mean request duration for non-free tiers, one series per region-excluded\n label combination.\n\n p99(req_dur{route=~\"/api/.*\"}, ms) by (route, status)\n 99th-percentile latency of /api/* requests, split by route and status.\n\n unique(login{method=\"sso\"}, device_id)\n distinct SSO devices seen (display-only; an experiment would use per-user avg).\n\n retention_7d(session_start)\n share of users who started a new session within 7 days.\n\n ratio(count(checkout_completed), count(checkout_started))\n checkout conversion rate \u2014 completions \u00F7 starts over the window.\n\n ratio(count(payment{ok=\"0\"}), count(payment))\n payment failure rate from a single event's outcome label.\n";
72
77
 
73
78
  /**
74
79
  * Every custom (non-spec) operation, in surface order. The CLI and MCP each
package/dist/custom.js CHANGED
@@ -2,15 +2,21 @@
2
2
  var METRIC_GRAMMAR = `SHIPEASY METRIC QUERY DSL
3
3
  =========================
4
4
 
5
- A metric is ONE aggregation over ONE event stream. This DSL is the string you
6
- pass to \`metrics create --query "..."\` (equivalently the typed \`query_ir\`).
7
- There is no arithmetic, no formulas across events, no subqueries \u2014 one event
8
- selector, one aggregation, an optional group-by.
5
+ A metric is an aggregation over an event stream. Almost always that is ONE
6
+ aggregation over ONE event; the single exception is the binary \`ratio(...)\`
7
+ form, which divides one count-style arm by another (each arm its own event and
8
+ filters) in one pass. This DSL is the string you pass to
9
+ \`metrics create --query "..."\` (equivalently the typed \`query_ir\`). There is
10
+ no general arithmetic, no free-form formulas, and no subqueries \u2014 \`ratio\` is
11
+ the only division / two-event form.
9
12
 
10
13
 
11
14
  GRAMMAR (BNF)
12
15
  -------------
13
- Query := AggFunc "(" Selector ("," Identifier)? ")" GroupBy?
16
+ Query := Agg | Ratio
17
+ Agg := AggFunc "(" Selector ("," Identifier)? ")" GroupBy?
18
+ Ratio := "ratio" "(" RatioArm "," RatioArm ")"
19
+ RatioArm := ("count_users" | "count") "(" Selector ")"
14
20
  AggFunc := "count_users" | "count" | "sum" | "avg" | "min" | "max"
15
21
  | "unique" | "p50" | "p75" | "p90" | "p95" | "p99" | "p999"
16
22
  | "retention_" <N> "d" (N = 1..90)
@@ -41,12 +47,16 @@ AGGREGATIONS
41
47
  unique(e, v) required distinct values of label v approx \u2192 avg *
42
48
  p50 \u2026 p999(e,v) required quantile of v (50/75/90/ approx \u2192 avg *
43
49
  95/99/99.9th percentile)
50
+ ratio(a, b) forbidden a \xF7 b (see RATIO below) proportion **
44
51
 
45
52
  * Display-only aggregations. The experiment t-test needs a per-user mean and
46
53
  variance, so min/max/unique/quantile are computed exactly on dashboards but
47
54
  collapse to a per-user \`avg\` when used as an experiment metric. If you need
48
55
  an exact experiment metric, pick count_users / count / sum / avg / retention.
49
56
 
57
+ ** In an experiment a ratio collapses to a per-user 0/1 outcome (a proportion),
58
+ not a ratio-of-sums \u2014 see RATIO.
59
+
50
60
  "count" is the DSL spelling of the internal count_events (one per matching
51
61
  row); "count_users" is unique-by-user. Getting these two confused is the most
52
62
  common mistake \u2014 count double-counts a user who fired the event twice.
@@ -75,13 +85,45 @@ GROUP-BY
75
85
  without (a, b) group by all declared labels EXCEPT a, b
76
86
 
77
87
  NOTE: group-by is a DASHBOARD-only feature. In an experiment the group-by is
78
- ignored \u2014 a per-user reducer is applied across the whole arm instead.
88
+ ignored \u2014 a per-user reducer is applied across the whole arm instead. Group-by
89
+ is NOT allowed on a \`ratio\` query.
90
+
91
+
92
+ RATIO (success rate, conversion, failure %, \u2026)
93
+ -----------------------------------------------
94
+ \`ratio(numerator, denominator)\` divides one count-style arm by another. Each
95
+ arm is an independent selector with its OWN event and filters, so the two arms
96
+ can be different events:
97
+
98
+ ratio(count(checkout_completed), count(checkout_started))
99
+ ratio(count_users(paid), count_users(signed_up))
100
+ ratio(count(payment{ok="1"}), count(payment)) one event, filtered arm
101
+
102
+ Rules:
103
+ - Arms are limited to \`count\` and \`count_users\` \u2014 no sum/avg/quantile arm.
104
+ - \`count\` arms divide event counts; \`count_users\` arms divide distinct-user
105
+ counts. Pick one shape and use it on both arms unless you mean to mix them.
106
+ - A zero denominator yields 0, not an error.
107
+ - No \`by (...)\` / \`without (...)\`, and no retention arm, on a ratio.
108
+ - It is a COHORT RATE over the window \u2014 numerator events \xF7 denominator events \u2014
109
+ NOT a per-id join. It never matches an individual attempt to its outcome by a
110
+ correlation id; it counts each side over the window and divides. If you need a
111
+ matched pair, resolve the outcome in your own code and emit ONE event carrying
112
+ the result (e.g. an \`ok\` label), then use \`ratio(count(e{ok="1"}), count(e))\`
113
+ or \`avg(e, ok)\`.
114
+ - In an experiment a per-user ratio is a 0/1 outcome \u2014 did the numerator happen,
115
+ among denominator-eligible users \u2014 i.e. a proportion, not a ratio-of-sums.
116
+ - When creating with \`--event-name\`, pass the NUMERATOR's event name.
79
117
 
80
118
 
81
119
  NOT SUPPORTED (will fail to parse)
82
120
  ----------------------------------
83
- - arithmetic / ratios / formulas: \`count(a) / count(b)\`
84
- - more than one event per query
121
+ - general arithmetic / free-form formulas: \`count(a) + count(b)\`, \`2 * sum(x)\`,
122
+ \`avg(a) / avg(b)\` \u2014 the ONLY division form is the fixed binary
123
+ \`ratio(arm, arm)\` with count-style arms (see RATIO)
124
+ - a ratio arm that isn't \`count\` / \`count_users\`: \`ratio(sum(a, v), count(b))\`
125
+ - more than two events in one query
126
+ - \`by (...)\` / \`without (...)\` on a ratio
85
127
  - arbitrary quantiles (only the fixed p50/p75/p90/p95/p99/p999)
86
128
  - unquoted or numeric filter values: \`{status=200}\` \u2192 must be \`"200"\`
87
129
  - trailing tokens after the query
@@ -110,12 +152,18 @@ EXAMPLES (query \u2014 what it measures)
110
152
 
111
153
  retention_7d(session_start)
112
154
  share of users who started a new session within 7 days.
155
+
156
+ ratio(count(checkout_completed), count(checkout_started))
157
+ checkout conversion rate \u2014 completions \xF7 starts over the window.
158
+
159
+ ratio(count(payment{ok="0"}), count(payment))
160
+ payment failure rate from a single event's outcome label.
113
161
  `;
114
162
  var grammarOp = {
115
163
  group: ["metrics"],
116
164
  name: "grammar",
117
165
  summary: "Print the metric query DSL grammar",
118
- description: "Print the full metric query DSL reference \u2014 grammar, aggregation semantics, filter/group-by rules, and glossed examples \u2014 used to author `metrics create --query`.",
166
+ description: "Print the full metric query DSL reference \u2014 grammar, aggregation semantics, filter/group-by/ratio rules, and glossed examples \u2014 used to author `metrics create --query`.",
119
167
  params: [],
120
168
  examples: [{ run: "shipeasy metrics grammar" }],
121
169
  run: () => ({ grammar: METRIC_GRAMMAR })
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/custom/grammar.ts","../src/custom/types.ts","../src/custom/docs.ts","../src/custom/index.ts"],"sourcesContent":["import type { CustomOp } from \"./types.js\";\n\n/**\n * The Shipeasy metric query DSL grammar — printed by `shipeasy metrics grammar`\n * / the `metrics_grammar` MCP tool.\n *\n * This is the one-stop reference for both humans and AI agents that need to\n * author a `metrics create --query \"...\"` string. It is intentionally\n * self-contained: the formal grammar (precise, for machine parsing), a full\n * aggregation reference (semantics + value-label rules + experiment behaviour),\n * the selector/filter/group-by rules, hard constraints, and glossed examples.\n * Keep it in sync with the parser (`cli/src/query-dsl/parse.ts`) and the IR\n * (`cli/src/query-dsl/ir.ts`) — they are the source of truth for semantics.\n */\nexport const METRIC_GRAMMAR = `SHIPEASY METRIC QUERY DSL\n=========================\n\nA metric is ONE aggregation over ONE event stream. This DSL is the string you\npass to \\`metrics create --query \"...\"\\` (equivalently the typed \\`query_ir\\`).\nThere is no arithmetic, no formulas across events, no subqueries — one event\nselector, one aggregation, an optional group-by.\n\n\nGRAMMAR (BNF)\n-------------\n Query := AggFunc \"(\" Selector (\",\" Identifier)? \")\" GroupBy?\n AggFunc := \"count_users\" | \"count\" | \"sum\" | \"avg\" | \"min\" | \"max\"\n | \"unique\" | \"p50\" | \"p75\" | \"p90\" | \"p95\" | \"p99\" | \"p999\"\n | \"retention_\" <N> \"d\" (N = 1..90)\n Selector := Identifier (\"{\" Filter (\",\" Filter)* \",\"? \"}\")?\n Filter := Identifier MatchOp StringLiteral\n MatchOp := \"=\" | \"!=\" | \"=~\" | \"!~\"\n GroupBy := (\"by\" | \"without\") \"(\" Identifier (\",\" Identifier)* \",\"? \")\"\n StringLiteral := double-quoted; \\\\\" is a literal quote, \\\\\\\\ is a backslash\n Identifier := [A-Za-z_][A-Za-z0-9_]* (case-sensitive)\n\n The trailing Identifier after the selector — \"(\" Selector \",\" Identifier \")\" —\n is the VALUE LABEL: the numeric event label the aggregation reduces. Whether it\n is required, optional, or forbidden depends on the aggregation (see below).\n\n\nAGGREGATIONS\n------------\n Function Value label Meaning In experiments\n -------------- ------------ ------------------------------ ---------------\n count_users forbidden distinct users who fired it exact\n count forbidden number of events (rows) exact\n sum(e, v) required Σ of numeric label v exact\n avg(e, v) required mean of label v exact\n retention_Nd(e) forbidden % of users who returned exact\n within N days (N = 1..90)\n min(e, v) required minimum of label v approx → avg *\n max(e, v) required maximum of label v approx → avg *\n unique(e, v) required distinct values of label v approx → avg *\n p50 … p999(e,v) required quantile of v (50/75/90/ approx → avg *\n 95/99/99.9th percentile)\n\n * Display-only aggregations. The experiment t-test needs a per-user mean and\n variance, so min/max/unique/quantile are computed exactly on dashboards but\n collapse to a per-user \\`avg\\` when used as an experiment metric. If you need\n an exact experiment metric, pick count_users / count / sum / avg / retention.\n\n \"count\" is the DSL spelling of the internal count_events (one per matching\n row); \"count_users\" is unique-by-user. Getting these two confused is the most\n common mistake — count double-counts a user who fired the event twice.\n\n\nSELECTOR & FILTERS\n------------------\n The selector is the event name plus an optional \\`{ ... }\\` filter set that\n narrows which events count. Each filter compares an event LABEL to a quoted\n string:\n\n = equal != not equal\n =~ regex match !~ regex NOT match\n\n - Values are ALWAYS double-quoted strings, even for numeric labels — they are\n coerced on the server (\\`amount=~\"^1[0-9]$\"\\`, \\`status=\"200\"\\`).\n - Multiple filters are AND-ed: \\`{country=\"US\", tier!=\"free\"}\\`.\n - Every filter label AND the value label must be a label DECLARED on the source\n event. Undeclared labels are a validation error, not a silent no-match.\n\n\nGROUP-BY\n--------\n Splits the result into one series per label combination.\n by (a, b) one series per distinct (a, b) — keep only these labels\n without (a, b) group by all declared labels EXCEPT a, b\n\n NOTE: group-by is a DASHBOARD-only feature. In an experiment the group-by is\n ignored — a per-user reducer is applied across the whole arm instead.\n\n\nNOT SUPPORTED (will fail to parse)\n----------------------------------\n - arithmetic / ratios / formulas: \\`count(a) / count(b)\\`\n - more than one event per query\n - arbitrary quantiles (only the fixed p50/p75/p90/p95/p99/p999)\n - unquoted or numeric filter values: \\`{status=200}\\` → must be \\`\"200\"\\`\n - trailing tokens after the query\n\n\nEXAMPLES (query — what it measures)\n--------------------------------------\n count_users(checkout_completed)\n distinct users who completed checkout.\n\n count(add_to_cart{country=\"US\"})\n number of US add-to-cart events (a user can count many times).\n\n sum(purchase{country=\"US\"}, amount)\n total purchase amount from US purchase events.\n\n avg(req_dur{tier!=\"free\"}, ms) without (region)\n mean request duration for non-free tiers, one series per region-excluded\n label combination.\n\n p99(req_dur{route=~\"/api/.*\"}, ms) by (route, status)\n 99th-percentile latency of /api/* requests, split by route and status.\n\n unique(login{method=\"sso\"}, device_id)\n distinct SSO devices seen (display-only; an experiment would use per-user avg).\n\n retention_7d(session_start)\n share of users who started a new session within 7 days.\n`;\n\nexport const grammarOp: CustomOp = {\n group: [\"metrics\"],\n name: \"grammar\",\n summary: \"Print the metric query DSL grammar\",\n description:\n \"Print the full metric query DSL reference — grammar, aggregation semantics, \" +\n \"filter/group-by rules, and glossed examples — used to author `metrics create --query`.\",\n params: [],\n examples: [{ run: \"shipeasy metrics grammar\" }],\n run: () => ({ grammar: METRIC_GRAMMAR }),\n};\n","/**\n * The custom-operations registry — hand-written operations that are NOT admin\n * API endpoints (so they can't be generated from the spec): the metric-DSL\n * grammar (pure) and the SDK-docs fetcher (outbound `fetch` to GitHub Pages).\n *\n * It mirrors the old operations registry in spirit, but is deliberately tiny and\n * framework-agnostic: each `CustomOp` carries its command path, params, and a\n * self-contained `run`. Both consumers project it with a thin adapter — the CLI\n * (`commands/custom.ts`) and, later, the MCP server — so the surface stays in\n * sync across them. `run` never touches the filesystem, so it's worker-safe.\n */\nexport type CustomParamType = \"string\" | \"number\" | \"boolean\";\n\nexport interface CustomParam {\n name: string;\n type: CustomParamType;\n description?: string;\n required?: boolean;\n /** Render as a positional CLI argument (vs a `--flag`). */\n positional?: boolean;\n enum?: string[];\n}\n\nexport interface CustomOp {\n /** Command path, e.g. `[\"docs\"]` → `shipeasy docs <name>`, `[\"metrics\"]` → `metrics <name>`. */\n group: string[];\n /** Verb. */\n name: string;\n summary: string;\n description?: string;\n params: CustomParam[];\n examples?: { note?: string; run: string }[];\n /** Self-contained handler. `args` are the coerced param values. */\n run: (args: Record<string, unknown>) => Promise<unknown> | unknown;\n}\n\n/**\n * Group-level help for a custom-op command group (e.g. `docs`). Mirrors what an\n * OpenAPI tag carries for the generated tree — a short `summary` (shown in the\n * parent `--help` list) and a long `description` (shown on the group's own\n * `--help`). Consumers look this up by `group` path when creating the group so a\n * custom group reads as richly as a spec-backed one, instead of the bare\n * `\"<name> commands\"` fallback.\n */\nexport interface CustomGroup {\n /** Group path, e.g. `[\"docs\"]`. */\n group: string[];\n summary: string;\n description?: string;\n aliases?: string[];\n}\n\n/** Thrown by a custom op for a user-facing error with an HTTP-ish status. */\nexport class CustomOpError extends Error {\n constructor(\n message: string,\n public status = 400,\n ) {\n super(message);\n this.name = \"CustomOpError\";\n }\n}\n\nexport const opId = (op: CustomOp): string => [...op.group, op.name].join(\".\");\n","import { type CustomOp, CustomOpError } from \"./types.js\";\n\n/**\n * SDK-docs operations — `docs list/get/skill`. A generic fetcher over each SDK\n * repo's `/docs/` folder published to plain GitHub Pages (latest only, no\n * backend, no version arg). The `run`s do outbound `fetch` (worker-safe — not\n * the fs/AST boundary) and fall back to a built-in default doc set for repos\n * that haven't adopted the doc standard yet.\n */\nconst SDK_REPOS: Record<string, { owner: string; repo: string }> = {\n typescript: { owner: \"shipeasy-ai\", repo: \"sdk-ts\" },\n javascript: { owner: \"shipeasy-ai\", repo: \"sdk-ts\" },\n node: { owner: \"shipeasy-ai\", repo: \"sdk-ts\" },\n ts: { owner: \"shipeasy-ai\", repo: \"sdk-ts\" },\n python: { owner: \"shipeasy-ai\", repo: \"sdk-python\" },\n go: { owner: \"shipeasy-ai\", repo: \"sdk-go\" },\n java: { owner: \"shipeasy-ai\", repo: \"sdk-java\" },\n kotlin: { owner: \"shipeasy-ai\", repo: \"sdk-kotlin\" },\n php: { owner: \"shipeasy-ai\", repo: \"sdk-php\" },\n swift: { owner: \"shipeasy-ai\", repo: \"sdk-swift\" },\n ruby: { owner: \"shipeasy-ai\", repo: \"sdk-ruby\" },\n};\nconst SDK_ENUM = Object.keys(SDK_REPOS);\n\ninterface DocManifest {\n schemaVersion: number;\n sdk: string;\n placeholders?: string[];\n skill?: string;\n pages?: Record<string, string>;\n snippets?: Record<string, Record<string, string>>;\n}\n\nconst DEFAULT_MANIFEST: DocManifest = {\n schemaVersion: 2,\n sdk: \"default\",\n placeholders: [\"RESOURCE_NAME\"],\n skill: \"skill/SKILL.md\",\n pages: { overview: \"pages/overview.md\", installation: \"pages/installation.md\" },\n snippets: { release: { flags: \"snippets/release/flags.md\" } },\n};\nconst DEFAULT_CONTENT: Record<string, string> = {\n \"pages/overview.md\":\n \"# Shipeasy SDK\\n\\nThis SDK has not published its `/docs/` folder yet. See https://docs.shipeasy.ai for the full reference.\",\n \"pages/installation.md\":\n \"# Installation\\n\\nInstall the Shipeasy SDK for your language, then call `shipeasy({ serverKey })` (server) or `shipeasy({ clientKey })` (browser).\",\n \"snippets/release/flags.md\": \"```\\nconst on = await client.checkGate(user, '{{RESOURCE_NAME}}');\\n```\",\n \"skill/SKILL.md\":\n \"---\\nname: shipeasy-sdk\\ndescription: Use the Shipeasy SDK for flags, experiments, configs, and i18n.\\n---\\n\\nThis SDK has not published a skill yet. See https://docs.shipeasy.ai.\",\n};\n\n/**\n * Resolve the caller-supplied `sdk`. The adapters (CLI/MCP) default it from the\n * nearest `.shipeasy` before we get here, so an empty value means neither a flag\n * nor a bound project supplied one — surface that explicitly.\n */\nfunction requireSdk(sdk: unknown): string {\n const s = typeof sdk === \"string\" ? sdk.trim() : \"\";\n if (!s)\n throw new CustomOpError(\n `No SDK given and none recorded in .shipeasy. Pass --sdk <lang> (one of: ${SDK_ENUM.join(\", \")}), ` +\n `or run \\`shipeasy detect\\` in the project to record its sdk.`,\n 400,\n );\n return s;\n}\nfunction repoFor(sdk: string): { owner: string; repo: string } {\n const r = SDK_REPOS[sdk.toLowerCase()];\n if (!r) throw new CustomOpError(`Unknown SDK '${sdk}'. One of: ${SDK_ENUM.join(\", \")}`, 400);\n return r;\n}\nfunction pagesBase(sdk: string): string {\n const { owner, repo } = repoFor(sdk);\n return `https://${owner}.github.io/${repo}`;\n}\nasync function fetchText(url: string): Promise<string | null> {\n const res = await fetch(url);\n if (!res.ok) return null;\n return res.text();\n}\nasync function loadManifest(sdk: string): Promise<{ manifest: DocManifest; fallback: boolean }> {\n const text = await fetchText(`${pagesBase(sdk)}/manifest.json`);\n if (!text) return { manifest: DEFAULT_MANIFEST, fallback: true };\n try {\n return { manifest: JSON.parse(text) as DocManifest, fallback: false };\n } catch {\n return { manifest: DEFAULT_MANIFEST, fallback: true };\n }\n}\nfunction resolvePath(manifest: DocManifest, handle: string): string {\n if (handle.endsWith(\".md\")) return handle;\n if (manifest.pages?.[handle]) return manifest.pages[handle];\n if (handle.includes(\"/\")) {\n const [group, resource] = handle.split(\"/\", 2);\n const p = manifest.snippets?.[group]?.[resource];\n if (p) return p;\n }\n throw new CustomOpError(\n `Doc '${handle}' not found. Run 'docs list --sdk <lang>' to see available pages and snippets.`,\n 404,\n );\n}\nfunction substitute(body: string, manifest: DocManifest, args: Record<string, unknown>): string {\n let out = body;\n for (const ph of manifest.placeholders ?? []) {\n const value =\n (args[ph] as string | undefined) ??\n (ph === \"RESOURCE_NAME\" ? (args.name as string | undefined) : undefined) ??\n (ph === \"FRAMEWORK\" ? (args.framework as string | undefined) : undefined);\n if (value !== undefined) out = out.replaceAll(`{{${ph}}}`, value);\n }\n return out;\n}\n\nexport const docsOps: CustomOp[] = [\n {\n group: [\"docs\"],\n name: \"list\",\n summary: \"List an SDK's documentation tree\",\n description:\n \"Fetch an SDK's `/docs/manifest.json` and return the doc tree — feature pages, nested snippet groups, and whether an installable skill exists.\",\n params: [{ name: \"sdk\", type: \"string\", description: \"SDK language. Defaults to the `sdk` recorded in the nearest `.shipeasy` when omitted.\", required: false, enum: SDK_ENUM }],\n examples: [{ run: \"shipeasy docs list --sdk python\" }],\n run: async (args) => {\n const sdk = requireSdk(args.sdk);\n const { manifest, fallback } = await loadManifest(sdk);\n return {\n sdk,\n fallback,\n pages: Object.keys(manifest.pages ?? {}),\n snippets: Object.fromEntries(\n Object.entries(manifest.snippets ?? {}).map(([g, r]) => [g, Object.keys(r)]),\n ),\n skill: Boolean(manifest.skill),\n };\n },\n },\n {\n group: [\"docs\"],\n name: \"get\",\n summary: \"Fetch one SDK doc page or snippet\",\n description:\n \"Fetch one feature page (`flags`, `experiments`, …) or nested snippet (`release/experiments`, …), substituting declared {{placeholders}} from caller args.\",\n params: [\n { name: \"sdk\", type: \"string\", description: \"SDK language. Defaults to the `sdk` recorded in the nearest `.shipeasy` when omitted.\", required: false, enum: SDK_ENUM },\n { name: \"path\", type: \"string\", description: \"Page key or snippet 'group/resource'.\", required: true, positional: true },\n { name: \"framework\", type: \"string\", description: \"Framework hint (substitutes {{FRAMEWORK}}).\" },\n { name: \"name\", type: \"string\", description: \"Resource name (substitutes {{RESOURCE_NAME}}).\" },\n ],\n examples: [\n { note: \"A feature page\", run: \"shipeasy docs get --sdk python experiments\" },\n { note: \"A nested snippet\", run: \"shipeasy docs get --sdk typescript release/flags --name checkout_v2\" },\n ],\n run: async (args) => {\n const sdk = requireSdk(args.sdk);\n const { manifest, fallback } = await loadManifest(sdk);\n const path = resolvePath(manifest, args.path as string);\n const body = fallback ? DEFAULT_CONTENT[path] : ((await fetchText(`${pagesBase(sdk)}/${path}`)) ?? undefined);\n if (body === undefined) throw new CustomOpError(`Doc '${path}' could not be fetched for '${sdk}'.`, 404);\n return { sdk, path, fallback, content: substitute(body, manifest, args) };\n },\n },\n {\n group: [\"docs\"],\n name: \"skill\",\n summary: \"Fetch an SDK's installable LLM skill\",\n description:\n \"Fetch the SDK's `skill/SKILL.md` (frontmatter intact) so an agent can install it verbatim. The CLI `--install` writes it locally (a consumer fs side-effect).\",\n params: [\n { name: \"sdk\", type: \"string\", description: \"SDK language. Defaults to the `sdk` recorded in the nearest `.shipeasy` when omitted.\", required: false, enum: SDK_ENUM },\n { name: \"install\", type: \"boolean\", description: \"CLI only: write the skill to the local agent skills dir.\" },\n ],\n examples: [{ run: \"shipeasy docs skill --sdk python\" }],\n run: async (args) => {\n const sdk = requireSdk(args.sdk);\n const { manifest, fallback } = await loadManifest(sdk);\n const skillPath = manifest.skill ?? \"skill/SKILL.md\";\n const content = fallback ? DEFAULT_CONTENT[skillPath] : ((await fetchText(`${pagesBase(sdk)}/${skillPath}`)) ?? undefined);\n if (content === undefined) throw new CustomOpError(`No skill published for '${sdk}'.`, 404);\n return { sdk, skillPath, fallback, content };\n },\n },\n];\n","import { grammarOp } from \"./grammar.js\";\nimport { docsOps } from \"./docs.js\";\nimport type { CustomOp, CustomGroup } from \"./types.js\";\n\nexport type { CustomOp, CustomGroup, CustomParam, CustomParamType } from \"./types.js\";\nexport { CustomOpError, opId } from \"./types.js\";\nexport { METRIC_GRAMMAR } from \"./grammar.js\";\n\n/**\n * Every custom (non-spec) operation, in surface order. The CLI and MCP each\n * project this with a thin adapter so the sugar commands stay in sync.\n */\nexport const customOperations: CustomOp[] = [grammarOp, ...docsOps];\n\n/**\n * Group-level help for custom-op groups that aren't backed by an OpenAPI tag.\n * `metrics` is a spec tag (its group is created — and described — by the\n * generated tree), so only `docs` needs an entry here; without it the CLI would\n * label the group the bare `\"docs commands\"`.\n */\nexport const customGroups: CustomGroup[] = [\n {\n group: [\"docs\"],\n summary:\n \"SDK docs: fetch a language SDK's published docs — its page tree, feature pages, code snippets, and installable agent skill.\",\n description:\n \"SDK docs — a read-only fetcher over each language SDK's `/docs/` folder, \" +\n \"published to plain GitHub Pages (latest only; no backend, no version arg). \" +\n \"Point it at an SDK with `--sdk <lang>` (one of: typescript, python, go, \" +\n \"java, kotlin, php, swift, ruby) or let it default to the `sdk` recorded in \" +\n \"the nearest `.shipeasy`.\\n\\n\" +\n \"**Commands.**\\n\" +\n \"- `list` — the SDK's doc tree: feature pages, nested snippet groups, and whether an installable skill exists.\\n\" +\n \"- `get <path>` — one feature page (`flags`, `experiments`, …) or nested snippet (`release/flags`), with `{{placeholders}}` substituted from `--name`/`--framework`.\\n\" +\n \"- `skill` — the SDK's installable LLM skill (`SKILL.md`); `--install` writes it into your agent's skills dir.\\n\\n\" +\n \"SDKs that haven't adopted the doc standard yet fall back to a built-in \" +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,eAA8B;AAAA,EACzC;AAAA,IACE,OAAO,CAAC,MAAM;AAAA,IACd,SACE;AAAA,IACF,aACE;AAAA,EAWJ;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/custom/grammar.ts","../src/custom/types.ts","../src/custom/docs.ts","../src/custom/index.ts"],"sourcesContent":["import type { CustomOp } from \"./types.js\";\n\n/**\n * The Shipeasy metric query DSL grammar — printed by `shipeasy metrics grammar`\n * / the `metrics_grammar` MCP tool.\n *\n * This is the one-stop reference for both humans and AI agents that need to\n * author a `metrics create --query \"...\"` string. It is intentionally\n * self-contained: the formal grammar (precise, for machine parsing), a full\n * aggregation reference (semantics + value-label rules + experiment behaviour),\n * the selector/filter/group-by/ratio rules, hard constraints, and glossed\n * examples.\n *\n * Source of truth for semantics is the RUNTIME parser + IR that the server\n * actually runs: the main repo's `packages/query-dsl` (`parse.ts` / `ir.ts`).\n * The vendored `cli/src/query-dsl` copy is a lagging subset (no `ratio` yet) and\n * is NOT on the create path — the CLI forwards the raw `--query` string to the\n * server, which parses it. Keep this text in sync with `packages/query-dsl`.\n */\nexport const METRIC_GRAMMAR = `SHIPEASY METRIC QUERY DSL\n=========================\n\nA metric is an aggregation over an event stream. Almost always that is ONE\naggregation over ONE event; the single exception is the binary \\`ratio(...)\\`\nform, which divides one count-style arm by another (each arm its own event and\nfilters) in one pass. This DSL is the string you pass to\n\\`metrics create --query \"...\"\\` (equivalently the typed \\`query_ir\\`). There is\nno general arithmetic, no free-form formulas, and no subqueries — \\`ratio\\` is\nthe only division / two-event form.\n\n\nGRAMMAR (BNF)\n-------------\n Query := Agg | Ratio\n Agg := AggFunc \"(\" Selector (\",\" Identifier)? \")\" GroupBy?\n Ratio := \"ratio\" \"(\" RatioArm \",\" RatioArm \")\"\n RatioArm := (\"count_users\" | \"count\") \"(\" Selector \")\"\n AggFunc := \"count_users\" | \"count\" | \"sum\" | \"avg\" | \"min\" | \"max\"\n | \"unique\" | \"p50\" | \"p75\" | \"p90\" | \"p95\" | \"p99\" | \"p999\"\n | \"retention_\" <N> \"d\" (N = 1..90)\n Selector := Identifier (\"{\" Filter (\",\" Filter)* \",\"? \"}\")?\n Filter := Identifier MatchOp StringLiteral\n MatchOp := \"=\" | \"!=\" | \"=~\" | \"!~\"\n GroupBy := (\"by\" | \"without\") \"(\" Identifier (\",\" Identifier)* \",\"? \")\"\n StringLiteral := double-quoted; \\\\\" is a literal quote, \\\\\\\\ is a backslash\n Identifier := [A-Za-z_][A-Za-z0-9_]* (case-sensitive)\n\n The trailing Identifier after the selector — \"(\" Selector \",\" Identifier \")\" —\n is the VALUE LABEL: the numeric event label the aggregation reduces. Whether it\n is required, optional, or forbidden depends on the aggregation (see below).\n\n\nAGGREGATIONS\n------------\n Function Value label Meaning In experiments\n -------------- ------------ ------------------------------ ---------------\n count_users forbidden distinct users who fired it exact\n count forbidden number of events (rows) exact\n sum(e, v) required Σ of numeric label v exact\n avg(e, v) required mean of label v exact\n retention_Nd(e) forbidden % of users who returned exact\n within N days (N = 1..90)\n min(e, v) required minimum of label v approx → avg *\n max(e, v) required maximum of label v approx → avg *\n unique(e, v) required distinct values of label v approx → avg *\n p50 … p999(e,v) required quantile of v (50/75/90/ approx → avg *\n 95/99/99.9th percentile)\n ratio(a, b) forbidden a ÷ b (see RATIO below) proportion **\n\n * Display-only aggregations. The experiment t-test needs a per-user mean and\n variance, so min/max/unique/quantile are computed exactly on dashboards but\n collapse to a per-user \\`avg\\` when used as an experiment metric. If you need\n an exact experiment metric, pick count_users / count / sum / avg / retention.\n\n ** In an experiment a ratio collapses to a per-user 0/1 outcome (a proportion),\n not a ratio-of-sums — see RATIO.\n\n \"count\" is the DSL spelling of the internal count_events (one per matching\n row); \"count_users\" is unique-by-user. Getting these two confused is the most\n common mistake — count double-counts a user who fired the event twice.\n\n\nSELECTOR & FILTERS\n------------------\n The selector is the event name plus an optional \\`{ ... }\\` filter set that\n narrows which events count. Each filter compares an event LABEL to a quoted\n string:\n\n = equal != not equal\n =~ regex match !~ regex NOT match\n\n - Values are ALWAYS double-quoted strings, even for numeric labels — they are\n coerced on the server (\\`amount=~\"^1[0-9]$\"\\`, \\`status=\"200\"\\`).\n - Multiple filters are AND-ed: \\`{country=\"US\", tier!=\"free\"}\\`.\n - Every filter label AND the value label must be a label DECLARED on the source\n event. Undeclared labels are a validation error, not a silent no-match.\n\n\nGROUP-BY\n--------\n Splits the result into one series per label combination.\n by (a, b) one series per distinct (a, b) — keep only these labels\n without (a, b) group by all declared labels EXCEPT a, b\n\n NOTE: group-by is a DASHBOARD-only feature. In an experiment the group-by is\n ignored — a per-user reducer is applied across the whole arm instead. Group-by\n is NOT allowed on a \\`ratio\\` query.\n\n\nRATIO (success rate, conversion, failure %, …)\n-----------------------------------------------\n \\`ratio(numerator, denominator)\\` divides one count-style arm by another. Each\n arm is an independent selector with its OWN event and filters, so the two arms\n can be different events:\n\n ratio(count(checkout_completed), count(checkout_started))\n ratio(count_users(paid), count_users(signed_up))\n ratio(count(payment{ok=\"1\"}), count(payment)) one event, filtered arm\n\n Rules:\n - Arms are limited to \\`count\\` and \\`count_users\\` — no sum/avg/quantile arm.\n - \\`count\\` arms divide event counts; \\`count_users\\` arms divide distinct-user\n counts. Pick one shape and use it on both arms unless you mean to mix them.\n - A zero denominator yields 0, not an error.\n - No \\`by (...)\\` / \\`without (...)\\`, and no retention arm, on a ratio.\n - It is a COHORT RATE over the window — numerator events ÷ denominator events —\n NOT a per-id join. It never matches an individual attempt to its outcome by a\n correlation id; it counts each side over the window and divides. If you need a\n matched pair, resolve the outcome in your own code and emit ONE event carrying\n the result (e.g. an \\`ok\\` label), then use \\`ratio(count(e{ok=\"1\"}), count(e))\\`\n or \\`avg(e, ok)\\`.\n - In an experiment a per-user ratio is a 0/1 outcome — did the numerator happen,\n among denominator-eligible users — i.e. a proportion, not a ratio-of-sums.\n - When creating with \\`--event-name\\`, pass the NUMERATOR's event name.\n\n\nNOT SUPPORTED (will fail to parse)\n----------------------------------\n - general arithmetic / free-form formulas: \\`count(a) + count(b)\\`, \\`2 * sum(x)\\`,\n \\`avg(a) / avg(b)\\` — the ONLY division form is the fixed binary\n \\`ratio(arm, arm)\\` with count-style arms (see RATIO)\n - a ratio arm that isn't \\`count\\` / \\`count_users\\`: \\`ratio(sum(a, v), count(b))\\`\n - more than two events in one query\n - \\`by (...)\\` / \\`without (...)\\` on a ratio\n - arbitrary quantiles (only the fixed p50/p75/p90/p95/p99/p999)\n - unquoted or numeric filter values: \\`{status=200}\\` → must be \\`\"200\"\\`\n - trailing tokens after the query\n\n\nEXAMPLES (query — what it measures)\n--------------------------------------\n count_users(checkout_completed)\n distinct users who completed checkout.\n\n count(add_to_cart{country=\"US\"})\n number of US add-to-cart events (a user can count many times).\n\n sum(purchase{country=\"US\"}, amount)\n total purchase amount from US purchase events.\n\n avg(req_dur{tier!=\"free\"}, ms) without (region)\n mean request duration for non-free tiers, one series per region-excluded\n label combination.\n\n p99(req_dur{route=~\"/api/.*\"}, ms) by (route, status)\n 99th-percentile latency of /api/* requests, split by route and status.\n\n unique(login{method=\"sso\"}, device_id)\n distinct SSO devices seen (display-only; an experiment would use per-user avg).\n\n retention_7d(session_start)\n share of users who started a new session within 7 days.\n\n ratio(count(checkout_completed), count(checkout_started))\n checkout conversion rate — completions ÷ starts over the window.\n\n ratio(count(payment{ok=\"0\"}), count(payment))\n payment failure rate from a single event's outcome label.\n`;\n\nexport const grammarOp: CustomOp = {\n group: [\"metrics\"],\n name: \"grammar\",\n summary: \"Print the metric query DSL grammar\",\n description:\n \"Print the full metric query DSL reference — grammar, aggregation semantics, \" +\n \"filter/group-by/ratio rules, and glossed examples — used to author `metrics create --query`.\",\n params: [],\n examples: [{ run: \"shipeasy metrics grammar\" }],\n run: () => ({ grammar: METRIC_GRAMMAR }),\n};\n","/**\n * The custom-operations registry — hand-written operations that are NOT admin\n * API endpoints (so they can't be generated from the spec): the metric-DSL\n * grammar (pure) and the SDK-docs fetcher (outbound `fetch` to GitHub Pages).\n *\n * It mirrors the old operations registry in spirit, but is deliberately tiny and\n * framework-agnostic: each `CustomOp` carries its command path, params, and a\n * self-contained `run`. Both consumers project it with a thin adapter — the CLI\n * (`commands/custom.ts`) and, later, the MCP server — so the surface stays in\n * sync across them. `run` never touches the filesystem, so it's worker-safe.\n */\nexport type CustomParamType = \"string\" | \"number\" | \"boolean\";\n\nexport interface CustomParam {\n name: string;\n type: CustomParamType;\n description?: string;\n required?: boolean;\n /** Render as a positional CLI argument (vs a `--flag`). */\n positional?: boolean;\n enum?: string[];\n}\n\nexport interface CustomOp {\n /** Command path, e.g. `[\"docs\"]` → `shipeasy docs <name>`, `[\"metrics\"]` → `metrics <name>`. */\n group: string[];\n /** Verb. */\n name: string;\n summary: string;\n description?: string;\n params: CustomParam[];\n examples?: { note?: string; run: string }[];\n /** Self-contained handler. `args` are the coerced param values. */\n run: (args: Record<string, unknown>) => Promise<unknown> | unknown;\n}\n\n/**\n * Group-level help for a custom-op command group (e.g. `docs`). Mirrors what an\n * OpenAPI tag carries for the generated tree — a short `summary` (shown in the\n * parent `--help` list) and a long `description` (shown on the group's own\n * `--help`). Consumers look this up by `group` path when creating the group so a\n * custom group reads as richly as a spec-backed one, instead of the bare\n * `\"<name> commands\"` fallback.\n */\nexport interface CustomGroup {\n /** Group path, e.g. `[\"docs\"]`. */\n group: string[];\n summary: string;\n description?: string;\n aliases?: string[];\n}\n\n/** Thrown by a custom op for a user-facing error with an HTTP-ish status. */\nexport class CustomOpError extends Error {\n constructor(\n message: string,\n public status = 400,\n ) {\n super(message);\n this.name = \"CustomOpError\";\n }\n}\n\nexport const opId = (op: CustomOp): string => [...op.group, op.name].join(\".\");\n","import { type CustomOp, CustomOpError } from \"./types.js\";\n\n/**\n * SDK-docs operations — `docs list/get/skill`. A generic fetcher over each SDK\n * repo's `/docs/` folder published to plain GitHub Pages (latest only, no\n * backend, no version arg). The `run`s do outbound `fetch` (worker-safe — not\n * the fs/AST boundary) and fall back to a built-in default doc set for repos\n * that haven't adopted the doc standard yet.\n */\nconst SDK_REPOS: Record<string, { owner: string; repo: string }> = {\n typescript: { owner: \"shipeasy-ai\", repo: \"sdk-ts\" },\n javascript: { owner: \"shipeasy-ai\", repo: \"sdk-ts\" },\n node: { owner: \"shipeasy-ai\", repo: \"sdk-ts\" },\n ts: { owner: \"shipeasy-ai\", repo: \"sdk-ts\" },\n python: { owner: \"shipeasy-ai\", repo: \"sdk-python\" },\n go: { owner: \"shipeasy-ai\", repo: \"sdk-go\" },\n java: { owner: \"shipeasy-ai\", repo: \"sdk-java\" },\n kotlin: { owner: \"shipeasy-ai\", repo: \"sdk-kotlin\" },\n php: { owner: \"shipeasy-ai\", repo: \"sdk-php\" },\n swift: { owner: \"shipeasy-ai\", repo: \"sdk-swift\" },\n ruby: { owner: \"shipeasy-ai\", repo: \"sdk-ruby\" },\n};\nconst SDK_ENUM = Object.keys(SDK_REPOS);\n\ninterface DocManifest {\n schemaVersion: number;\n sdk: string;\n placeholders?: string[];\n skill?: string;\n pages?: Record<string, string>;\n snippets?: Record<string, Record<string, string>>;\n}\n\nconst DEFAULT_MANIFEST: DocManifest = {\n schemaVersion: 2,\n sdk: \"default\",\n placeholders: [\"RESOURCE_NAME\"],\n skill: \"skill/SKILL.md\",\n pages: { overview: \"pages/overview.md\", installation: \"pages/installation.md\" },\n snippets: { release: { flags: \"snippets/release/flags.md\" } },\n};\nconst DEFAULT_CONTENT: Record<string, string> = {\n \"pages/overview.md\":\n \"# Shipeasy SDK\\n\\nThis SDK has not published its `/docs/` folder yet. See https://docs.shipeasy.ai for the full reference.\",\n \"pages/installation.md\":\n \"# Installation\\n\\nInstall the Shipeasy SDK for your language, then call `shipeasy({ serverKey })` (server) or `shipeasy({ clientKey })` (browser).\",\n \"snippets/release/flags.md\": \"```\\nconst on = await client.checkGate(user, '{{RESOURCE_NAME}}');\\n```\",\n \"skill/SKILL.md\":\n \"---\\nname: shipeasy-sdk\\ndescription: Use the Shipeasy SDK for flags, experiments, configs, and i18n.\\n---\\n\\nThis SDK has not published a skill yet. See https://docs.shipeasy.ai.\",\n};\n\n/**\n * Resolve the caller-supplied `sdk`. The adapters (CLI/MCP) default it from the\n * nearest `.shipeasy` before we get here, so an empty value means neither a flag\n * nor a bound project supplied one — surface that explicitly.\n */\nfunction requireSdk(sdk: unknown): string {\n const s = typeof sdk === \"string\" ? sdk.trim() : \"\";\n if (!s)\n throw new CustomOpError(\n `No SDK given and none recorded in .shipeasy. Pass --sdk <lang> (one of: ${SDK_ENUM.join(\", \")}), ` +\n `or run \\`shipeasy detect\\` in the project to record its sdk.`,\n 400,\n );\n return s;\n}\nfunction repoFor(sdk: string): { owner: string; repo: string } {\n const r = SDK_REPOS[sdk.toLowerCase()];\n if (!r) throw new CustomOpError(`Unknown SDK '${sdk}'. One of: ${SDK_ENUM.join(\", \")}`, 400);\n return r;\n}\nfunction pagesBase(sdk: string): string {\n const { owner, repo } = repoFor(sdk);\n return `https://${owner}.github.io/${repo}`;\n}\nasync function fetchText(url: string): Promise<string | null> {\n const res = await fetch(url);\n if (!res.ok) return null;\n return res.text();\n}\nasync function loadManifest(sdk: string): Promise<{ manifest: DocManifest; fallback: boolean }> {\n const text = await fetchText(`${pagesBase(sdk)}/manifest.json`);\n if (!text) return { manifest: DEFAULT_MANIFEST, fallback: true };\n try {\n return { manifest: JSON.parse(text) as DocManifest, fallback: false };\n } catch {\n return { manifest: DEFAULT_MANIFEST, fallback: true };\n }\n}\nfunction resolvePath(manifest: DocManifest, handle: string): string {\n if (handle.endsWith(\".md\")) return handle;\n if (manifest.pages?.[handle]) return manifest.pages[handle];\n if (handle.includes(\"/\")) {\n const [group, resource] = handle.split(\"/\", 2);\n const p = manifest.snippets?.[group]?.[resource];\n if (p) return p;\n }\n throw new CustomOpError(\n `Doc '${handle}' not found. Run 'docs list --sdk <lang>' to see available pages and snippets.`,\n 404,\n );\n}\nfunction substitute(body: string, manifest: DocManifest, args: Record<string, unknown>): string {\n let out = body;\n for (const ph of manifest.placeholders ?? []) {\n const value =\n (args[ph] as string | undefined) ??\n (ph === \"RESOURCE_NAME\" ? (args.name as string | undefined) : undefined) ??\n (ph === \"FRAMEWORK\" ? (args.framework as string | undefined) : undefined);\n if (value !== undefined) out = out.replaceAll(`{{${ph}}}`, value);\n }\n return out;\n}\n\nexport const docsOps: CustomOp[] = [\n {\n group: [\"docs\"],\n name: \"list\",\n summary: \"List an SDK's documentation tree\",\n description:\n \"Fetch an SDK's `/docs/manifest.json` and return the doc tree — feature pages, nested snippet groups, and whether an installable skill exists.\",\n params: [{ name: \"sdk\", type: \"string\", description: \"SDK language. Defaults to the `sdk` recorded in the nearest `.shipeasy` when omitted.\", required: false, enum: SDK_ENUM }],\n examples: [{ run: \"shipeasy docs list --sdk python\" }],\n run: async (args) => {\n const sdk = requireSdk(args.sdk);\n const { manifest, fallback } = await loadManifest(sdk);\n return {\n sdk,\n fallback,\n pages: Object.keys(manifest.pages ?? {}),\n snippets: Object.fromEntries(\n Object.entries(manifest.snippets ?? {}).map(([g, r]) => [g, Object.keys(r)]),\n ),\n skill: Boolean(manifest.skill),\n };\n },\n },\n {\n group: [\"docs\"],\n name: \"get\",\n summary: \"Fetch one SDK doc page or snippet\",\n description:\n \"Fetch one feature page (`flags`, `experiments`, …) or nested snippet (`release/experiments`, …), substituting declared {{placeholders}} from caller args.\",\n params: [\n { name: \"sdk\", type: \"string\", description: \"SDK language. Defaults to the `sdk` recorded in the nearest `.shipeasy` when omitted.\", required: false, enum: SDK_ENUM },\n { name: \"path\", type: \"string\", description: \"Page key or snippet 'group/resource'.\", required: true, positional: true },\n { name: \"framework\", type: \"string\", description: \"Framework hint (substitutes {{FRAMEWORK}}).\" },\n { name: \"name\", type: \"string\", description: \"Resource name (substitutes {{RESOURCE_NAME}}).\" },\n ],\n examples: [\n { note: \"A feature page\", run: \"shipeasy docs get --sdk python experiments\" },\n { note: \"A nested snippet\", run: \"shipeasy docs get --sdk typescript release/flags --name checkout_v2\" },\n ],\n run: async (args) => {\n const sdk = requireSdk(args.sdk);\n const { manifest, fallback } = await loadManifest(sdk);\n const path = resolvePath(manifest, args.path as string);\n const body = fallback ? DEFAULT_CONTENT[path] : ((await fetchText(`${pagesBase(sdk)}/${path}`)) ?? undefined);\n if (body === undefined) throw new CustomOpError(`Doc '${path}' could not be fetched for '${sdk}'.`, 404);\n return { sdk, path, fallback, content: substitute(body, manifest, args) };\n },\n },\n {\n group: [\"docs\"],\n name: \"skill\",\n summary: \"Fetch an SDK's installable LLM skill\",\n description:\n \"Fetch the SDK's `skill/SKILL.md` (frontmatter intact) so an agent can install it verbatim. The CLI `--install` writes it locally (a consumer fs side-effect).\",\n params: [\n { name: \"sdk\", type: \"string\", description: \"SDK language. Defaults to the `sdk` recorded in the nearest `.shipeasy` when omitted.\", required: false, enum: SDK_ENUM },\n { name: \"install\", type: \"boolean\", description: \"CLI only: write the skill to the local agent skills dir.\" },\n ],\n examples: [{ run: \"shipeasy docs skill --sdk python\" }],\n run: async (args) => {\n const sdk = requireSdk(args.sdk);\n const { manifest, fallback } = await loadManifest(sdk);\n const skillPath = manifest.skill ?? \"skill/SKILL.md\";\n const content = fallback ? DEFAULT_CONTENT[skillPath] : ((await fetchText(`${pagesBase(sdk)}/${skillPath}`)) ?? undefined);\n if (content === undefined) throw new CustomOpError(`No skill published for '${sdk}'.`, 404);\n return { sdk, skillPath, fallback, content };\n },\n },\n];\n","import { grammarOp } from \"./grammar.js\";\nimport { docsOps } from \"./docs.js\";\nimport type { CustomOp, CustomGroup } from \"./types.js\";\n\nexport type { CustomOp, CustomGroup, CustomParam, CustomParamType } from \"./types.js\";\nexport { CustomOpError, opId } from \"./types.js\";\nexport { METRIC_GRAMMAR } from \"./grammar.js\";\n\n/**\n * Every custom (non-spec) operation, in surface order. The CLI and MCP each\n * project this with a thin adapter so the sugar commands stay in sync.\n */\nexport const customOperations: CustomOp[] = [grammarOp, ...docsOps];\n\n/**\n * Group-level help for custom-op groups that aren't backed by an OpenAPI tag.\n * `metrics` is a spec tag (its group is created — and described — by the\n * generated tree), so only `docs` needs an entry here; without it the CLI would\n * label the group the bare `\"docs commands\"`.\n */\nexport const customGroups: CustomGroup[] = [\n {\n group: [\"docs\"],\n summary:\n \"SDK docs: fetch a language SDK's published docs — its page tree, feature pages, code snippets, and installable agent skill.\",\n description:\n \"SDK docs — a read-only fetcher over each language SDK's `/docs/` folder, \" +\n \"published to plain GitHub Pages (latest only; no backend, no version arg). \" +\n \"Point it at an SDK with `--sdk <lang>` (one of: typescript, python, go, \" +\n \"java, kotlin, php, swift, ruby) or let it default to the `sdk` recorded in \" +\n \"the nearest `.shipeasy`.\\n\\n\" +\n \"**Commands.**\\n\" +\n \"- `list` — the SDK's doc tree: feature pages, nested snippet groups, and whether an installable skill exists.\\n\" +\n \"- `get <path>` — one feature page (`flags`, `experiments`, …) or nested snippet (`release/flags`), with `{{placeholders}}` substituted from `--name`/`--framework`.\\n\" +\n \"- `skill` — the SDK's installable LLM skill (`SKILL.md`); `--install` writes it into your agent's skills dir.\\n\\n\" +\n \"SDKs that haven't adopted the doc standard yet fall back to a built-in \" +\n \"default doc set, flagged `fallback: true` in the output.\",\n },\n];\n"],"mappings":";AAmBO,IAAM,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AAW,OAAM,IAAI,cAAc,QAAQ,IAAI,+BAA+B,GAAG,MAAM,GAAG;AACvG,aAAO,EAAE,KAAK,MAAM,UAAU,SAAS,WAAW,MAAM,UAAU,IAAI,EAAE;AAAA,IAC1E;AAAA,EACF;AAAA,EACA;AAAA,IACE,OAAO,CAAC,MAAM;AAAA,IACd,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aACE;AAAA,IACF,QAAQ;AAAA,MACN,EAAE,MAAM,OAAO,MAAM,UAAU,aAAa,yFAAyF,UAAU,OAAO,MAAM,SAAS;AAAA,MACrK,EAAE,MAAM,WAAW,MAAM,WAAW,aAAa,2DAA2D;AAAA,IAC9G;AAAA,IACA,UAAU,CAAC,EAAE,KAAK,mCAAmC,CAAC;AAAA,IACtD,KAAK,OAAO,SAAS;AACnB,YAAM,MAAM,WAAW,KAAK,GAAG;AAC/B,YAAM,EAAE,UAAU,SAAS,IAAI,MAAM,aAAa,GAAG;AACrD,YAAM,YAAY,SAAS,SAAS;AACpC,YAAM,UAAU,WAAW,gBAAgB,SAAS,IAAM,MAAM,UAAU,GAAG,UAAU,GAAG,CAAC,IAAI,SAAS,EAAE,KAAM;AAChH,UAAI,YAAY,OAAW,OAAM,IAAI,cAAc,2BAA2B,GAAG,MAAM,GAAG;AAC1F,aAAO,EAAE,KAAK,WAAW,UAAU,QAAQ;AAAA,IAC7C;AAAA,EACF;AACF;;;AC1KO,IAAM,mBAA+B,CAAC,WAAW,GAAG,OAAO;AAQ3D,IAAM,eAA8B;AAAA,EACzC;AAAA,IACE,OAAO,CAAC,MAAM;AAAA,IACd,SACE;AAAA,IACF,aACE;AAAA,EAWJ;AACF;","names":[]}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { E as ErrorCode, a as Error } from './client-WGNXT4xl.js';
2
- export { A as AckOpsItemData, b as AckOpsItemError, c as AckOpsItemErrors, d as AckOpsItemRequest, e as AckOpsItemResponse, f as AckOpsItemResponse2, g as AckOpsItemResponses, h as AlertApiRow, i as ApproveEventData, j as ApproveEventError, k as ApproveEventErrors, l as ApproveEventRequest, m as ApproveEventResponse, n as ApproveEventResponse2, o as ApproveEventResponses, p as AttributeType, C as ClaudeTriggerConfig, q as Client, r as ClientOptions, s as Config, t as ConfigName, u as ConfigureOptions, v as ConnectorData, w as ConnectorEvent, x as ConnectorProvider, y as ConnectorRecord, z as CopilotTriggerConfig, B as CreateAlertRuleData, D as CreateAlertRuleError, F as CreateAlertRuleErrors, G as CreateAlertRuleRequest, H as CreateAlertRuleResponse, I as CreateAlertRuleResponse2, J as CreateAlertRuleResponses, K as CreateAttributeData, L as CreateAttributeError, M as CreateAttributeErrors, N as CreateAttributeRequest, O as CreateAttributeResponse, P as CreateAttributeResponse2, Q as CreateAttributeResponses, R as CreateBugRequest, S as CreateClaudeTriggerRequest, T as CreateClientConfig, U as CreateConfigData, V as CreateConfigError, W as CreateConfigErrors, X as CreateConfigRequest, Y as CreateConfigResponse, Z as CreateConfigResponse2, _ as CreateConfigResponses, $ as CreateConnectorData, a0 as CreateConnectorError, a1 as CreateConnectorErrors, a2 as CreateConnectorRequest, a3 as CreateConnectorResponse, a4 as CreateConnectorResponse2, a5 as CreateConnectorResponses, a6 as CreateCopilotTriggerRequest, a7 as CreateCursorTriggerRequest, a8 as CreateEventData, a9 as CreateEventError, aa as CreateEventErrors, ab as CreateEventRequest, ac as CreateEventResponse, ad as CreateEventResponse2, ae as CreateEventResponses, af as CreateExperimentData, ag as CreateExperimentError, ah as CreateExperimentErrors, ai as CreateExperimentReadoutData, aj as CreateExperimentReadoutError, ak as CreateExperimentReadoutErrors, al as CreateExperimentReadoutRequest, am as CreateExperimentReadoutResponse, an as CreateExperimentReadoutResponse2, ao as CreateExperimentReadoutResponses, ap as CreateExperimentRequest, aq as CreateExperimentResponse, ar as CreateExperimentResponse2, as as CreateExperimentResponses, at as CreateFeatureRequestRequest, au as CreateGateData, av as CreateGateError, aw as CreateGateErrors, ax as CreateGateRequest, ay as CreateGateResponse, az as CreateGateResponse2, aA as CreateGateResponses, aB as CreateGateTemplateData, aC as CreateGateTemplateError, aD as CreateGateTemplateErrors, aE as CreateGateTemplateRequest, aF as CreateGateTemplateResponse, aG as CreateGateTemplateResponse2, aH as CreateGateTemplateResponses, aI as CreateI18nDraftData, aJ as CreateI18nDraftError, aK as CreateI18nDraftErrors, aL as CreateI18nDraftRequest, aM as CreateI18nDraftResponse, aN as CreateI18nDraftResponses, aO as CreateI18nProfileData, aP as CreateI18nProfileError, aQ as CreateI18nProfileErrors, aR as CreateI18nProfileRequest, aS as CreateI18nProfileResponse, aT as CreateI18nProfileResponse2, aU as CreateI18nProfileResponses, aV as CreateJulesTriggerRequest, aW as CreateKeyData, aX as CreateKeyError, aY as CreateKeyErrors, aZ as CreateKeyRequest, a_ as CreateKeyResponse, a$ as CreateKeyResponse2, b0 as CreateKeyResponses, b1 as CreateKillswitchData, b2 as CreateKillswitchError, b3 as CreateKillswitchErrors, b4 as CreateKillswitchRequest, b5 as CreateKillswitchResponse, b6 as CreateKillswitchResponse2, b7 as CreateKillswitchResponses, b8 as CreateMetricData, b9 as CreateMetricError, ba as CreateMetricErrors, bb as CreateMetricRequest, bc as CreateMetricResponse, bd as CreateMetricResponse2, be as CreateMetricResponses, bf as CreateMetricWithQuery, bg as CreateMetricWithQueryIr, bh as CreateOAuthConnectorRequest, bi as CreateOpsCommentData, bj as CreateOpsCommentError, bk as CreateOpsCommentErrors, bl as CreateOpsCommentRequest, bm as CreateOpsCommentResponse, bn as CreateOpsCommentResponse2, bo as CreateOpsCommentResponses, bp as CreateOpsInvestigationData, bq as CreateOpsInvestigationError, br as CreateOpsInvestigationErrors, bs as CreateOpsInvestigationRequest, bt as CreateOpsInvestigationResponse, bu as CreateOpsInvestigationResponses, bv as CreateOpsItemData, bw as CreateOpsItemError, bx as CreateOpsItemErrors, by as CreateOpsItemRequest, bz as CreateOpsItemResponse, bA as CreateOpsItemResponse2, bB as CreateOpsItemResponses, bC as CreateTriggerConnectorData, bD as CreateTriggerConnectorError, bE as CreateTriggerConnectorErrors, bF as CreateTriggerConnectorRequest, bG as CreateTriggerConnectorResponse, bH as CreateTriggerConnectorResponses, bI as CreateUniverseData, bJ as CreateUniverseError, bK as CreateUniverseErrors, bL as CreateUniverseRequest, bM as CreateUniverseResponse, bN as CreateUniverseResponse2, bO as CreateUniverseResponses, bP as CursorTriggerConfig, bQ as DeleteAlertRuleData, bR as DeleteAlertRuleError, bS as DeleteAlertRuleErrors, bT as DeleteAlertRuleResponse, bU as DeleteAlertRuleResponse2, bV as DeleteAlertRuleResponses, bW as DeleteAttributeData, bX as DeleteAttributeError, bY as DeleteAttributeErrors, bZ as DeleteAttributeResponse, b_ as DeleteAttributeResponse2, b$ as DeleteAttributeResponses, c0 as DeleteConfigData, c1 as DeleteConfigError, c2 as DeleteConfigErrors, c3 as DeleteConfigResponse, c4 as DeleteConfigResponse2, c5 as DeleteConfigResponses, c6 as DeleteConnectorData, c7 as DeleteConnectorError, c8 as DeleteConnectorErrors, c9 as DeleteConnectorResponse, ca as DeleteConnectorResponse2, cb as DeleteConnectorResponses, cc as DeleteEventData, cd as DeleteEventError, ce as DeleteEventErrors, cf as DeleteEventResponse, cg as DeleteEventResponse2, ch as DeleteEventResponses, ci as DeleteExperimentData, cj as DeleteExperimentError, ck as DeleteExperimentErrors, cl as DeleteExperimentResponse, cm as DeleteExperimentResponse2, cn as DeleteExperimentResponses, co as DeleteGateData, cp as DeleteGateError, cq as DeleteGateErrors, cr as DeleteGateResponse, cs as DeleteGateResponse2, ct as DeleteGateResponses, cu as DeleteGateTemplateData, cv as DeleteGateTemplateError, cw as DeleteGateTemplateErrors, cx as DeleteGateTemplateResponse, cy as DeleteGateTemplateResponse2, cz as DeleteGateTemplateResponses, cA as DeleteI18nDraftData, cB as DeleteI18nDraftError, cC as DeleteI18nDraftErrors, cD as DeleteI18nDraftResponse, cE as DeleteI18nDraftResponses, cF as DeleteI18nKeyData, cG as DeleteI18nKeyError, cH as DeleteI18nKeyErrors, cI as DeleteI18nKeyResponse, cJ as DeleteI18nKeyResponses, cK as DeleteI18nProfileData, cL as DeleteI18nProfileError, cM as DeleteI18nProfileErrors, cN as DeleteI18nProfileResponse, cO as DeleteI18nProfileResponses, cP as DeleteKillswitchData, cQ as DeleteKillswitchError, cR as DeleteKillswitchErrors, cS as DeleteKillswitchResponse, cT as DeleteKillswitchResponse2, cU as DeleteKillswitchResponses, cV as DeleteMetricData, cW as DeleteMetricError, cX as DeleteMetricErrors, cY as DeleteMetricResponse, cZ as DeleteMetricResponse2, c_ as DeleteMetricResponses, c$ as DeleteOpsItemData, d0 as DeleteOpsItemError, d1 as DeleteOpsItemErrors, d2 as DeleteOpsItemResponse, d3 as DeleteOpsItemResponse2, d4 as DeleteOpsItemResponses, d5 as DeleteUniverseData, d6 as DeleteUniverseError, d7 as DeleteUniverseErrors, d8 as DeleteUniverseResponse, d9 as DeleteUniverseResponse2, da as DeleteUniverseResponses, db as DisableGateData, dc as DisableGateError, dd as DisableGateErrors, de as DisableGateResponse, df as DisableGateResponse2, dg as DisableGateResponses, dh as DiscardConfigDraftData, di as DiscardConfigDraftError, dj as DiscardConfigDraftErrors, dk as DiscardConfigDraftRequest, dl as DiscardConfigDraftResponse, dm as DiscardConfigDraftResponse2, dn as DiscardConfigDraftResponses, dp as Domain, dq as EnableGateData, dr as EnableGateError, ds as EnableGateErrors, dt as EnableGateResponse, du as EnableGateResponse2, dv as EnableGateResponses, dw as Env, dx as ErrorOccurrence, dy as ErrorRecord, dz as ErrorSeriesRequest, dA as ErrorSeriesResponse, dB as ExperimentApiRow, dC as ExperimentInlineMetric, dD as ExperimentReadoutApiRow, dE as ExperimentReadoutCaveat, dF as ExperimentReadoutMetric, dG as ExperimentResultRow, dH as FileErrorTicketData, dI as FileErrorTicketError, dJ as FileErrorTicketErrors, dK as FileErrorTicketResponse, dL as FileErrorTicketResponse2, dM as FileErrorTicketResponses, dN as FireConnectorData, dO as FireConnectorError, dP as FireConnectorErrors, dQ as FireConnectorRequest, dR as FireConnectorResponse, dS as FireConnectorResponse2, dT as FireConnectorResponses, dU as Folder, dV as GateApiRow, dW as GateTemplate, dX as GateTemplateRule, dY as GateTemplateRuleResponse, dZ as GetAttributeData, d_ as GetAttributeError, d$ as GetAttributeErrors, e0 as GetAttributeResponse, e1 as GetAttributeResponse2, e2 as GetAttributeResponses, e3 as GetConfigData, e4 as GetConfigError, e5 as GetConfigErrors, e6 as GetConfigResponse, e7 as GetConfigResponse2, e8 as GetConfigResponses, e9 as GetConnectorData, ea as GetConnectorError, eb as GetConnectorErrors, ec as GetConnectorResponse, ed as GetConnectorResponses, ee as GetCurrentProjectData, ef as GetCurrentProjectError, eg as GetCurrentProjectErrors, eh as GetCurrentProjectResponse, ei as GetCurrentProjectResponse2, ej as GetCurrentProjectResponses, ek as GetErrorData, el as GetErrorError, em as GetErrorErrors, en as GetErrorResponse, eo as GetErrorResponses, ep as GetErrorSeriesData, eq as GetErrorSeriesError, er as GetErrorSeriesErrors, es as GetErrorSeriesResponse, et as GetErrorSeriesResponses, eu as GetEventData, ev as GetEventError, ew as GetEventErrors, ex as GetEventResponse, ey as GetEventResponse2, ez as GetEventResponses, eA as GetExperimentData, eB as GetExperimentError, eC as GetExperimentErrors, eD as GetExperimentReadoutData, eE as GetExperimentReadoutError, eF as GetExperimentReadoutErrors, eG as GetExperimentReadoutResponse, eH as GetExperimentReadoutResponses, eI as GetExperimentResponse, eJ as GetExperimentResponses, eK as GetExperimentResultsData, eL as GetExperimentResultsError, eM as GetExperimentResultsErrors, eN as GetExperimentResultsResponse, eO as GetExperimentResultsResponse2, eP as GetExperimentResultsResponses, eQ as GetExperimentTimeseriesData, eR as GetExperimentTimeseriesError, eS as GetExperimentTimeseriesErrors, eT as GetExperimentTimeseriesResponse, eU as GetExperimentTimeseriesResponse2, eV as GetExperimentTimeseriesResponses, eW as GetGateData, eX as GetGateError, eY as GetGateErrors, eZ as GetGateResponse, e_ as GetGateResponses, e$ as GetGateTemplateData, f0 as GetGateTemplateError, f1 as GetGateTemplateErrors, f2 as GetGateTemplateResponse, f3 as GetGateTemplateResponses, f4 as GetKillswitchData, f5 as GetKillswitchError, f6 as GetKillswitchErrors, f7 as GetKillswitchResponse, f8 as GetKillswitchResponse2, f9 as GetKillswitchResponses, fa as GetMetricData, fb as GetMetricError, fc as GetMetricErrors, fd as GetMetricResponse, fe as GetMetricResponse2, ff as GetMetricResponses, fg as GetMetricSeriesData, fh as GetMetricSeriesError, fi as GetMetricSeriesErrors, fj as GetMetricSeriesRequest, fk as GetMetricSeriesResponse, fl as GetMetricSeriesResponse2, fm as GetMetricSeriesResponses, fn as GetOpsItemData, fo as GetOpsItemError, fp as GetOpsItemErrors, fq as GetOpsItemResponse, fr as GetOpsItemResponse2, fs as GetOpsItemResponses, ft as GetProjectData, fu as GetProjectError, fv as GetProjectErrors, fw as GetProjectResponse, fx as GetProjectResponses, fy as GithubConnectorData, fz as GithubPrLink, fA as I18nDraft, fB as JulesTriggerConfig, fC as KeyRecord, fD as KillswitchValue, fE as LinkPrToOpsItemData, fF as LinkPrToOpsItemError, fG as LinkPrToOpsItemErrors, fH as LinkPrToOpsItemRequest, fI as LinkPrToOpsItemResponse, fJ as LinkPrToOpsItemResponse2, fK as LinkPrToOpsItemResponses, fL as ListAlertRulesData, fM as ListAlertRulesError, fN as ListAlertRulesErrors, fO as ListAlertRulesResponse, fP as ListAlertRulesResponse2, fQ as ListAlertRulesResponses, fR as ListAlertsData, fS as ListAlertsError, fT as ListAlertsErrors, fU as ListAlertsResponse, fV as ListAlertsResponse2, fW as ListAlertsResponses, fX as ListAttributesData, fY as ListAttributesError, fZ as ListAttributesErrors, f_ as ListAttributesResponse, f$ as ListAttributesResponse2, g0 as ListAttributesResponses, g1 as ListConfigActivityData, g2 as ListConfigActivityError, g3 as ListConfigActivityErrors, g4 as ListConfigActivityResponse, g5 as ListConfigActivityResponse2, g6 as ListConfigActivityResponses, g7 as ListConfigVersionsData, g8 as ListConfigVersionsError, g9 as ListConfigVersionsErrors, ga as ListConfigVersionsResponse, gb as ListConfigVersionsResponse2, gc as ListConfigVersionsResponses, gd as ListConfigsData, ge as ListConfigsError, gf as ListConfigsErrors, gg as ListConfigsResponse, gh as ListConfigsResponse2, gi as ListConfigsResponses, gj as ListConnectorsData, gk as ListConnectorsError, gl as ListConnectorsErrors, gm as ListConnectorsResponse, gn as ListConnectorsResponse2, go as ListConnectorsResponses, gp as ListErrorsData, gq as ListErrorsError, gr as ListErrorsErrors, gs as ListErrorsResponse, gt as ListErrorsResponse2, gu as ListErrorsResponses, gv as ListEventsData, gw as ListEventsError, gx as ListEventsErrors, gy as ListEventsResponse, gz as ListEventsResponse2, gA as ListEventsResponses, gB as ListExperimentsData, gC as ListExperimentsError, gD as ListExperimentsErrors, gE as ListExperimentsResponse, gF as ListExperimentsResponse2, gG as ListExperimentsResponses, gH as ListGateActivityData, gI as ListGateActivityError, gJ as ListGateActivityErrors, gK as ListGateActivityResponse, gL as ListGateActivityResponse2, gM as ListGateActivityResponses, gN as ListGateTemplatesData, gO as ListGateTemplatesError, gP as ListGateTemplatesErrors, gQ as ListGateTemplatesResponse, gR as ListGateTemplatesResponse2, gS as ListGateTemplatesResponses, gT as ListGatesData, gU as ListGatesError, gV as ListGatesErrors, gW as ListGatesResponse, gX as ListGatesResponse2, gY as ListGatesResponses, gZ as ListI18nDraftKeysData, g_ as ListI18nDraftKeysError, g$ as ListI18nDraftKeysErrors, h0 as ListI18nDraftKeysResponse, h1 as ListI18nDraftKeysResponse2, h2 as ListI18nDraftKeysResponses, h3 as ListI18nDraftsData, h4 as ListI18nDraftsError, h5 as ListI18nDraftsErrors, h6 as ListI18nDraftsResponse, h7 as ListI18nDraftsResponse2, h8 as ListI18nDraftsResponses, h9 as ListI18nKeysData, ha as ListI18nKeysError, hb as ListI18nKeysErrors, hc as ListI18nKeysResponse, hd as ListI18nKeysResponse2, he as ListI18nKeysResponses, hf as ListI18nProfilesData, hg as ListI18nProfilesError, hh as ListI18nProfilesErrors, hi as ListI18nProfilesResponse, hj as ListI18nProfilesResponse2, hk as ListI18nProfilesResponses, hl as ListKeysData, hm as ListKeysError, hn as ListKeysErrors, ho as ListKeysResponse, hp as ListKeysResponse2, hq as ListKeysResponses, hr as ListKillswitchesData, hs as ListKillswitchesError, ht as ListKillswitchesErrors, hu as ListKillswitchesResponse, hv as ListKillswitchesResponse2, hw as ListKillswitchesResponses, hx as ListMetricExperimentsData, hy as ListMetricExperimentsError, hz as ListMetricExperimentsErrors, hA as ListMetricExperimentsResponse, hB as ListMetricExperimentsResponse2, hC as ListMetricExperimentsResponses, hD as ListMetricsData, hE as ListMetricsError, hF as ListMetricsErrors, hG as ListMetricsResponse, hH as ListMetricsResponse2, hI as ListMetricsResponses, hJ as ListOpsAgentsData, hK as ListOpsAgentsError, hL as ListOpsAgentsErrors, hM as ListOpsAgentsResponse, hN as ListOpsAgentsResponse2, hO as ListOpsAgentsResponses, hP as ListOpsCommentsData, hQ as ListOpsCommentsError, hR as ListOpsCommentsErrors, hS as ListOpsCommentsResponse, hT as ListOpsCommentsResponse2, hU as ListOpsCommentsResponses, hV as ListOpsInvestigationsData, hW as ListOpsInvestigationsError, hX as ListOpsInvestigationsErrors, hY as ListOpsInvestigationsResponse, hZ as ListOpsInvestigationsResponse2, h_ as ListOpsInvestigationsResponses, h$ as ListOpsItemsData, i0 as ListOpsItemsError, i1 as ListOpsItemsErrors, i2 as ListOpsItemsResponse, i3 as ListOpsItemsResponse2, i4 as ListOpsItemsResponses, i5 as ListSlackChannelsData, i6 as ListSlackChannelsError, i7 as ListSlackChannelsErrors, i8 as ListSlackChannelsResponse, i9 as ListSlackChannelsResponse2, ia as ListSlackChannelsResponses, ib as ListUniversesData, ic as ListUniversesError, id as ListUniversesErrors, ie as ListUniversesResponse, ig as ListUniversesResponse2, ih as ListUniversesResponses, ii as MeasurePlanResource, ij as MeasurePlanStep, ik as MetricDefaultMinEffectOfInterest, il as MetricDirection, im as MetricEventName, io as MetricName, ip as MetricQueryDsl, iq as MetricWinsorizePct, ir as NotificationTarget, is as NotifyOpsData, it as NotifyOpsError, iu as NotifyOpsErrors, iv as NotifyOpsRequest, iw as NotifyOpsResponse, ix as NotifyOpsResponse2, iy as NotifyOpsResponses, iz as OkResponse, iA as OpsAgentProfile, iB as OpsAlertContext, iC as OpsAlertMetricSummary, iD as OpsAlertRuleSummary, iE as OpsBrowserContext, iF as OpsComment, iG as OpsCommentAuthorType, iH as OpsErrorContext, iI as OpsInvestigation, iJ as OpsInvestigationState, iK as OpsItemAttachment, iL as OpsItemContext, iM as OpsItemNotifyOrNull, iN as OpsItemOwner, iO as OpsItemPriority, iP as OpsItemPriorityOrNull, iQ as OpsItemRelated, iR as OpsItemStatus, iS as OpsMeasurePlanContext, iT as OpsRun, iU as Options, iV as PaginationCursor, iW as PaginationLimit, iX as ProjectId, iY as PublishConfigDraftData, iZ as PublishConfigDraftError, i_ as PublishConfigDraftErrors, i$ as PublishConfigDraftRequest, j0 as PublishConfigDraftResponse, j1 as PublishConfigDraftResponse2, j2 as PublishConfigDraftResponses, j3 as PublishI18nProfileData, j4 as PublishI18nProfileError, j5 as PublishI18nProfileErrors, j6 as PublishI18nProfileRequest, j7 as PublishI18nProfileResponse, j8 as PublishI18nProfileResponse2, j9 as PublishI18nProfileResponses, ja as PushI18nKeysData, jb as PushI18nKeysError, jc as PushI18nKeysErrors, jd as PushI18nKeysRequest, je as PushI18nKeysResponse, jf as PushI18nKeysResponse2, jg as PushI18nKeysResponses, jh as Q, ji as QueryIr, jj as ReanalyzeExperimentData, jk as ReanalyzeExperimentError, jl as ReanalyzeExperimentErrors, jm as ReanalyzeExperimentResponse, jn as ReanalyzeExperimentResponse2, jo as ReanalyzeExperimentResponses, jp as RequestResult, jq as ResolveErrorData, jr as ResolveErrorError, js as ResolveErrorErrors, jt as ResolveErrorResponse, ju as ResolveErrorResponses, jv as ResourceId, jw as RevokeKeyData, jx as RevokeKeyError, jy as RevokeKeyErrors, jz as RevokeKeyResponse, jA as RevokeKeyResponse2, jB as RevokeKeyResponses, jC as SaveConfigDraftData, jD as SaveConfigDraftError, jE as SaveConfigDraftErrors, jF as SaveConfigDraftRequest, jG as SaveConfigDraftResponse, jH as SaveConfigDraftResponse2, jI as SaveConfigDraftResponses, jJ as SearchHit, jK as SearchResourcesData, jL as SearchResourcesError, jM as SearchResourcesErrors, jN as SearchResourcesResponse, jO as SearchResourcesResponses, jP as SearchResponse, jQ as SetExperimentMetricsData, jR as SetExperimentMetricsError, jS as SetExperimentMetricsErrors, jT as SetExperimentMetricsRequest, jU as SetExperimentMetricsResponse, jV as SetExperimentMetricsResponse2, jW as SetExperimentMetricsResponses, jX as SetExperimentStatusData, jY as SetExperimentStatusError, jZ as SetExperimentStatusErrors, j_ as SetExperimentStatusRequest, j$ as SetExperimentStatusResponse, k0 as SetExperimentStatusResponse2, k1 as SetExperimentStatusResponses, k2 as SetI18nLabelData, k3 as SetI18nLabelError, k4 as SetI18nLabelErrors, k5 as SetI18nLabelRequest, k6 as SetI18nLabelResponse, k7 as SetI18nLabelResponse2, k8 as SetI18nLabelResponses, k9 as SetKillswitchSwitchData, ka as SetKillswitchSwitchError, kb as SetKillswitchSwitchErrors, kc as SetKillswitchSwitchRequest, kd as SetKillswitchSwitchResponse, ke as SetKillswitchSwitchResponse2, kf as SetKillswitchSwitchResponses, kg as SetKillswitchValueData, kh as SetKillswitchValueError, ki as SetKillswitchValueErrors, kj as SetKillswitchValueRequest, kk as SetKillswitchValueResponse, kl as SetKillswitchValueResponse2, km as SetKillswitchValueResponses, kn as SlackConnectorData, ko as TestConnectorData, kp as TestConnectorError, kq as TestConnectorErrors, kr as TestConnectorResponse, ks as TestConnectorResponse2, kt as TestConnectorResponses, ku as UnarchiveMetricData, kv as UnarchiveMetricError, kw as UnarchiveMetricErrors, kx as UnarchiveMetricResponse, ky as UnarchiveMetricResponse2, kz as UnarchiveMetricResponses, kA as UniverseParam, kB as UniverseParamSchema, kC as UnsetKillswitchSwitchData, kD as UnsetKillswitchSwitchError, kE as UnsetKillswitchSwitchErrors, kF as UnsetKillswitchSwitchRequest, kG as UnsetKillswitchSwitchResponse, kH as UnsetKillswitchSwitchResponse2, kI as UnsetKillswitchSwitchResponses, kJ as UpdateAlertData, kK as UpdateAlertError, kL as UpdateAlertErrors, kM as UpdateAlertRequest, kN as UpdateAlertResponse, kO as UpdateAlertResponses, kP as UpdateAlertRuleData, kQ as UpdateAlertRuleError, kR as UpdateAlertRuleErrors, kS as UpdateAlertRuleRequest, kT as UpdateAlertRuleResponse, kU as UpdateAlertRuleResponse2, kV as UpdateAlertRuleResponses, kW as UpdateAttributeData, kX as UpdateAttributeError, kY as UpdateAttributeErrors, kZ as UpdateAttributeRequest, k_ as UpdateAttributeResponse, k$ as UpdateAttributeResponse2, l0 as UpdateAttributeResponses, l1 as UpdateBugRequest, l2 as UpdateClaudeTriggerRequest, l3 as UpdateConfigData, l4 as UpdateConfigError, l5 as UpdateConfigErrors, l6 as UpdateConfigRequest, l7 as UpdateConfigResponse, l8 as UpdateConfigResponse2, l9 as UpdateConfigResponses, la as UpdateConfigSchemaData, lb as UpdateConfigSchemaError, lc as UpdateConfigSchemaErrors, ld as UpdateConfigSchemaRequest, le as UpdateConfigSchemaResponse, lf as UpdateConfigSchemaResponse2, lg as UpdateConfigSchemaResponses, lh as UpdateConnectorData, li as UpdateConnectorError, lj as UpdateConnectorErrors, lk as UpdateConnectorRequest, ll as UpdateConnectorResponse, lm as UpdateConnectorResponse2, ln as UpdateConnectorResponses, lo as UpdateCopilotTriggerRequest, lp as UpdateCursorTriggerRequest, lq as UpdateErrorStatusData, lr as UpdateErrorStatusError, ls as UpdateErrorStatusErrors, lt as UpdateErrorStatusRequest, lu as UpdateErrorStatusResponse, lv as UpdateErrorStatusResponses, lw as UpdateEventData, lx as UpdateEventError, ly as UpdateEventErrors, lz as UpdateEventRequest, lA as UpdateEventResponse, lB as UpdateEventResponse2, lC as UpdateEventResponses, lD as UpdateExperimentData, lE as UpdateExperimentError, lF as UpdateExperimentErrors, lG as UpdateExperimentRequest, lH as UpdateExperimentResponse, lI as UpdateExperimentResponse2, lJ as UpdateExperimentResponses, lK as UpdateFeatureRequestRequest, lL as UpdateGateData, lM as UpdateGateError, lN as UpdateGateErrors, lO as UpdateGateRequest, lP as UpdateGateResponse, lQ as UpdateGateResponse2, lR as UpdateGateResponses, lS as UpdateGateTemplateData, lT as UpdateGateTemplateError, lU as UpdateGateTemplateErrors, lV as UpdateGateTemplateRequest, lW as UpdateGateTemplateResponse, lX as UpdateGateTemplateResponse2, lY as UpdateGateTemplateResponses, lZ as UpdateI18nDraftData, l_ as UpdateI18nDraftError, l$ as UpdateI18nDraftErrors, m0 as UpdateI18nDraftRequest, m1 as UpdateI18nDraftResponse, m2 as UpdateI18nDraftResponses, m3 as UpdateI18nKeyData, m4 as UpdateI18nKeyError, m5 as UpdateI18nKeyErrors, m6 as UpdateI18nKeyRequest, m7 as UpdateI18nKeyResponse, m8 as UpdateI18nKeyResponse2, m9 as UpdateI18nKeyResponses, ma as UpdateJulesTriggerRequest, mb as UpdateKillswitchData, mc as UpdateKillswitchError, md as UpdateKillswitchErrors, me as UpdateKillswitchRequest, mf as UpdateKillswitchResponse, mg as UpdateKillswitchResponse2, mh as UpdateKillswitchResponses, mi as UpdateMetricData, mj as UpdateMetricError, mk as UpdateMetricErrors, ml as UpdateMetricFields, mm as UpdateMetricRequest, mn as UpdateMetricResponse, mo as UpdateMetricResponses, mp as UpdateMetricWithQuery, mq as UpdateMetricWithQueryIr, mr as UpdateOpsItemData, ms as UpdateOpsItemError, mt as UpdateOpsItemErrors, mu as UpdateOpsItemRequest, mv as UpdateOpsItemResponse, mw as UpdateOpsItemResponse2, mx as UpdateOpsItemResponses, my as UpdateOpsItemStatusRequest, mz as UpdateProjectData, mA as UpdateProjectError, mB as UpdateProjectErrors, mC as UpdateProjectRequest, mD as UpdateProjectResponse, mE as UpdateProjectResponses, mF as UpdateTriggerConnectorData, mG as UpdateTriggerConnectorError, mH as UpdateTriggerConnectorErrors, mI as UpdateTriggerConnectorRequest, mJ as UpdateTriggerConnectorResponse, mK as UpdateTriggerConnectorResponses, mL as UpdateUniverseData, mM as UpdateUniverseError, mN as UpdateUniverseErrors, mO as UpdateUniverseRequest, mP as UpdateUniverseResponse, mQ as UpdateUniverseResponse2, mR as UpdateUniverseResponses, mS as UpsertI18nDraftKeyData, mT as UpsertI18nDraftKeyError, mU as UpsertI18nDraftKeyErrors, mV as UpsertI18nDraftKeyRequest, mW as UpsertI18nDraftKeyResponse, mX as UpsertI18nDraftKeyResponses, mY as UpsertI18nKeysData, mZ as UpsertI18nKeysError, m_ as UpsertI18nKeysErrors, m$ as UpsertI18nKeysRequest, n0 as UpsertI18nKeysResponse, n1 as UpsertI18nKeysResponse2, n2 as UpsertI18nKeysResponses, n3 as UpsertProjectData, n4 as UpsertProjectError, n5 as UpsertProjectErrors, n6 as UpsertProjectRequest, n7 as UpsertProjectResponse, n8 as UpsertProjectResponse2, n9 as UpsertProjectResponses, na as ackOpsItem, nb as approveEvent, nc as client, nd as configure, ne as createAlertRule, nf as createAttribute, ng as createClient, nh as createClientConfig, ni as createConfig, nj as createConnector, nk as createEvent, nl as createExperiment, nm as createExperimentReadout, nn as createGate, no as createGateTemplate, np as createI18nDraft, nq as createI18nProfile, nr as createKey, ns as createKillswitch, nt as createMetric, nu as createOpsComment, nv as createOpsInvestigation, nw as createOpsItem, nx as createTriggerConnector, ny as createUniverse, nz as deleteAlertRule, nA as deleteAttribute, nB as deleteConfig, nC as deleteConnector, nD as deleteEvent, nE as deleteExperiment, nF as deleteGate, nG as deleteGateTemplate, nH as deleteI18nDraft, nI as deleteI18nKey, nJ as deleteI18nProfile, nK as deleteKillswitch, nL as deleteMetric, nM as deleteOpsItem, nN as deleteUniverse, nO as disableGate, nP as discardConfigDraft, nQ as enableGate, nR as fileErrorTicket, nS as fireConnector, nT as getAttribute, nU as getConfig, nV as getConnector, nW as getCurrentProject, nX as getError, nY as getErrorSeries, nZ as getEvent, n_ as getExperiment, n$ as getExperimentReadout, o0 as getExperimentResults, o1 as getExperimentTimeseries, o2 as getGate, o3 as getGateTemplate, o4 as getKillswitch, o5 as getMetric, o6 as getMetricSeries, o7 as getOpsItem, o8 as getProject, o9 as linkPrToOpsItem, oa as listAlertRules, ob as listAlerts, oc as listAttributes, od as listConfigActivity, oe as listConfigVersions, of as listConfigs, og as listConnectors, oh as listErrors, oi as listEvents, oj as listExperiments, ok as listGateActivity, ol as listGateTemplates, om as listGates, on as listI18nDraftKeys, oo as listI18nDrafts, op as listI18nKeys, oq as listI18nProfiles, or as listKeys, os as listKillswitches, ot as listMetricExperiments, ou as listMetrics, ov as listOpsAgents, ow as listOpsComments, ox as listOpsInvestigations, oy as listOpsItems, oz as listSlackChannels, oA as listUniverses, oB as notifyOps, oC as publishConfigDraft, oD as publishI18nProfile, oE as pushI18nKeys, oF as reanalyzeExperiment, oG as resolveError, oH as revokeKey, oI as saveConfigDraft, oJ as searchResources, oK as setExperimentMetrics, oL as setExperimentStatus, oM as setI18nLabel, oN as setKillswitchSwitch, oO as setKillswitchValue, oP as testConnector, oQ as unarchiveMetric, oR as unsetKillswitchSwitch, oS as updateAlert, oT as updateAlertRule, oU as updateAttribute, oV as updateConfig, oW as updateConfigSchema, oX as updateConnector, oY as updateErrorStatus, oZ as updateEvent, o_ as updateExperiment, o$ as updateGate, p0 as updateGateTemplate, p1 as updateI18nDraft, p2 as updateI18nKey, p3 as updateKillswitch, p4 as updateMetric, p5 as updateOpsItem, p6 as updateProject, p7 as updateTriggerConnector, p8 as updateUniverse, p9 as upsertI18nDraftKey, pa as upsertI18nKeys, pb as upsertProject } from './client-WGNXT4xl.js';
1
+ import { E as ErrorCode, a as Error } from './client-DzEqdN5N.js';
2
+ export { A as AckOpsItemData, b as AckOpsItemError, c as AckOpsItemErrors, d as AckOpsItemRequest, e as AckOpsItemResponse, f as AckOpsItemResponse2, g as AckOpsItemResponses, h as AlertApiRow, i as ApproveEventData, j as ApproveEventError, k as ApproveEventErrors, l as ApproveEventRequest, m as ApproveEventResponse, n as ApproveEventResponse2, o as ApproveEventResponses, p as AttributeType, C as ClaudeTriggerConfig, q as Client, r as ClientOptions, s as Config, t as ConfigName, u as ConfigureOptions, v as ConnectorData, w as ConnectorEvent, x as ConnectorProvider, y as ConnectorRecord, z as CopilotTriggerConfig, B as CreateAlertRuleData, D as CreateAlertRuleError, F as CreateAlertRuleErrors, G as CreateAlertRuleRequest, H as CreateAlertRuleResponse, I as CreateAlertRuleResponse2, J as CreateAlertRuleResponses, K as CreateAttributeData, L as CreateAttributeError, M as CreateAttributeErrors, N as CreateAttributeRequest, O as CreateAttributeResponse, P as CreateAttributeResponse2, Q as CreateAttributeResponses, R as CreateBugRequest, S as CreateClaudeTriggerRequest, T as CreateClientConfig, U as CreateConfigData, V as CreateConfigError, W as CreateConfigErrors, X as CreateConfigRequest, Y as CreateConfigResponse, Z as CreateConfigResponse2, _ as CreateConfigResponses, $ as CreateConnectorData, a0 as CreateConnectorError, a1 as CreateConnectorErrors, a2 as CreateConnectorRequest, a3 as CreateConnectorResponse, a4 as CreateConnectorResponse2, a5 as CreateConnectorResponses, a6 as CreateCopilotTriggerRequest, a7 as CreateCursorTriggerRequest, a8 as CreateEventData, a9 as CreateEventError, aa as CreateEventErrors, ab as CreateEventRequest, ac as CreateEventResponse, ad as CreateEventResponse2, ae as CreateEventResponses, af as CreateExperimentData, ag as CreateExperimentError, ah as CreateExperimentErrors, ai as CreateExperimentReadoutData, aj as CreateExperimentReadoutError, ak as CreateExperimentReadoutErrors, al as CreateExperimentReadoutRequest, am as CreateExperimentReadoutResponse, an as CreateExperimentReadoutResponse2, ao as CreateExperimentReadoutResponses, ap as CreateExperimentRequest, aq as CreateExperimentResponse, ar as CreateExperimentResponse2, as as CreateExperimentResponses, at as CreateFeatureRequestRequest, au as CreateGateData, av as CreateGateError, aw as CreateGateErrors, ax as CreateGateRequest, ay as CreateGateResponse, az as CreateGateResponse2, aA as CreateGateResponses, aB as CreateGateTemplateData, aC as CreateGateTemplateError, aD as CreateGateTemplateErrors, aE as CreateGateTemplateRequest, aF as CreateGateTemplateResponse, aG as CreateGateTemplateResponse2, aH as CreateGateTemplateResponses, aI as CreateI18nDraftData, aJ as CreateI18nDraftError, aK as CreateI18nDraftErrors, aL as CreateI18nDraftRequest, aM as CreateI18nDraftResponse, aN as CreateI18nDraftResponses, aO as CreateI18nProfileData, aP as CreateI18nProfileError, aQ as CreateI18nProfileErrors, aR as CreateI18nProfileRequest, aS as CreateI18nProfileResponse, aT as CreateI18nProfileResponse2, aU as CreateI18nProfileResponses, aV as CreateJulesTriggerRequest, aW as CreateKeyData, aX as CreateKeyError, aY as CreateKeyErrors, aZ as CreateKeyRequest, a_ as CreateKeyResponse, a$ as CreateKeyResponse2, b0 as CreateKeyResponses, b1 as CreateKillswitchData, b2 as CreateKillswitchError, b3 as CreateKillswitchErrors, b4 as CreateKillswitchRequest, b5 as CreateKillswitchResponse, b6 as CreateKillswitchResponse2, b7 as CreateKillswitchResponses, b8 as CreateMetricData, b9 as CreateMetricError, ba as CreateMetricErrors, bb as CreateMetricRequest, bc as CreateMetricResponse, bd as CreateMetricResponse2, be as CreateMetricResponses, bf as CreateMetricWithQuery, bg as CreateMetricWithQueryIr, bh as CreateOAuthConnectorRequest, bi as CreateOpsCommentData, bj as CreateOpsCommentError, bk as CreateOpsCommentErrors, bl as CreateOpsCommentRequest, bm as CreateOpsCommentResponse, bn as CreateOpsCommentResponse2, bo as CreateOpsCommentResponses, bp as CreateOpsInvestigationData, bq as CreateOpsInvestigationError, br as CreateOpsInvestigationErrors, bs as CreateOpsInvestigationRequest, bt as CreateOpsInvestigationResponse, bu as CreateOpsInvestigationResponses, bv as CreateOpsItemData, bw as CreateOpsItemError, bx as CreateOpsItemErrors, by as CreateOpsItemRequest, bz as CreateOpsItemResponse, bA as CreateOpsItemResponse2, bB as CreateOpsItemResponses, bC as CreateTriggerConnectorData, bD as CreateTriggerConnectorError, bE as CreateTriggerConnectorErrors, bF as CreateTriggerConnectorRequest, bG as CreateTriggerConnectorResponse, bH as CreateTriggerConnectorResponses, bI as CreateUniverseData, bJ as CreateUniverseError, bK as CreateUniverseErrors, bL as CreateUniverseRequest, bM as CreateUniverseResponse, bN as CreateUniverseResponse2, bO as CreateUniverseResponses, bP as CursorTriggerConfig, bQ as DeleteAlertRuleData, bR as DeleteAlertRuleError, bS as DeleteAlertRuleErrors, bT as DeleteAlertRuleResponse, bU as DeleteAlertRuleResponse2, bV as DeleteAlertRuleResponses, bW as DeleteAttributeData, bX as DeleteAttributeError, bY as DeleteAttributeErrors, bZ as DeleteAttributeResponse, b_ as DeleteAttributeResponse2, b$ as DeleteAttributeResponses, c0 as DeleteConfigData, c1 as DeleteConfigError, c2 as DeleteConfigErrors, c3 as DeleteConfigResponse, c4 as DeleteConfigResponse2, c5 as DeleteConfigResponses, c6 as DeleteConnectorData, c7 as DeleteConnectorError, c8 as DeleteConnectorErrors, c9 as DeleteConnectorResponse, ca as DeleteConnectorResponse2, cb as DeleteConnectorResponses, cc as DeleteEventData, cd as DeleteEventError, ce as DeleteEventErrors, cf as DeleteEventResponse, cg as DeleteEventResponse2, ch as DeleteEventResponses, ci as DeleteExperimentData, cj as DeleteExperimentError, ck as DeleteExperimentErrors, cl as DeleteExperimentResponse, cm as DeleteExperimentResponse2, cn as DeleteExperimentResponses, co as DeleteGateData, cp as DeleteGateError, cq as DeleteGateErrors, cr as DeleteGateResponse, cs as DeleteGateResponse2, ct as DeleteGateResponses, cu as DeleteGateTemplateData, cv as DeleteGateTemplateError, cw as DeleteGateTemplateErrors, cx as DeleteGateTemplateResponse, cy as DeleteGateTemplateResponse2, cz as DeleteGateTemplateResponses, cA as DeleteI18nDraftData, cB as DeleteI18nDraftError, cC as DeleteI18nDraftErrors, cD as DeleteI18nDraftResponse, cE as DeleteI18nDraftResponses, cF as DeleteI18nKeyData, cG as DeleteI18nKeyError, cH as DeleteI18nKeyErrors, cI as DeleteI18nKeyResponse, cJ as DeleteI18nKeyResponses, cK as DeleteI18nProfileData, cL as DeleteI18nProfileError, cM as DeleteI18nProfileErrors, cN as DeleteI18nProfileResponse, cO as DeleteI18nProfileResponses, cP as DeleteKillswitchData, cQ as DeleteKillswitchError, cR as DeleteKillswitchErrors, cS as DeleteKillswitchResponse, cT as DeleteKillswitchResponse2, cU as DeleteKillswitchResponses, cV as DeleteMetricData, cW as DeleteMetricError, cX as DeleteMetricErrors, cY as DeleteMetricResponse, cZ as DeleteMetricResponse2, c_ as DeleteMetricResponses, c$ as DeleteOpsItemData, d0 as DeleteOpsItemError, d1 as DeleteOpsItemErrors, d2 as DeleteOpsItemResponse, d3 as DeleteOpsItemResponse2, d4 as DeleteOpsItemResponses, d5 as DeleteUniverseData, d6 as DeleteUniverseError, d7 as DeleteUniverseErrors, d8 as DeleteUniverseResponse, d9 as DeleteUniverseResponse2, da as DeleteUniverseResponses, db as DisableGateData, dc as DisableGateError, dd as DisableGateErrors, de as DisableGateResponse, df as DisableGateResponse2, dg as DisableGateResponses, dh as DiscardConfigDraftData, di as DiscardConfigDraftError, dj as DiscardConfigDraftErrors, dk as DiscardConfigDraftRequest, dl as DiscardConfigDraftResponse, dm as DiscardConfigDraftResponse2, dn as DiscardConfigDraftResponses, dp as Domain, dq as EnableGateData, dr as EnableGateError, ds as EnableGateErrors, dt as EnableGateResponse, du as EnableGateResponse2, dv as EnableGateResponses, dw as Env, dx as ErrorOccurrence, dy as ErrorRecord, dz as ErrorSeriesRequest, dA as ErrorSeriesResponse, dB as ExperimentApiRow, dC as ExperimentInlineMetric, dD as ExperimentReadoutApiRow, dE as ExperimentReadoutCaveat, dF as ExperimentReadoutMetric, dG as ExperimentResultRow, dH as FileErrorTicketData, dI as FileErrorTicketError, dJ as FileErrorTicketErrors, dK as FileErrorTicketResponse, dL as FileErrorTicketResponse2, dM as FileErrorTicketResponses, dN as FireConnectorData, dO as FireConnectorError, dP as FireConnectorErrors, dQ as FireConnectorRequest, dR as FireConnectorResponse, dS as FireConnectorResponse2, dT as FireConnectorResponses, dU as Folder, dV as GateApiRow, dW as GateTemplate, dX as GateTemplateRule, dY as GateTemplateRuleResponse, dZ as GetAttributeData, d_ as GetAttributeError, d$ as GetAttributeErrors, e0 as GetAttributeResponse, e1 as GetAttributeResponse2, e2 as GetAttributeResponses, e3 as GetConfigData, e4 as GetConfigError, e5 as GetConfigErrors, e6 as GetConfigResponse, e7 as GetConfigResponse2, e8 as GetConfigResponses, e9 as GetConnectorData, ea as GetConnectorError, eb as GetConnectorErrors, ec as GetConnectorResponse, ed as GetConnectorResponses, ee as GetCurrentProjectData, ef as GetCurrentProjectError, eg as GetCurrentProjectErrors, eh as GetCurrentProjectResponse, ei as GetCurrentProjectResponse2, ej as GetCurrentProjectResponses, ek as GetErrorData, el as GetErrorError, em as GetErrorErrors, en as GetErrorResponse, eo as GetErrorResponses, ep as GetErrorSeriesData, eq as GetErrorSeriesError, er as GetErrorSeriesErrors, es as GetErrorSeriesResponse, et as GetErrorSeriesResponses, eu as GetEventData, ev as GetEventError, ew as GetEventErrors, ex as GetEventResponse, ey as GetEventResponse2, ez as GetEventResponses, eA as GetExperimentData, eB as GetExperimentError, eC as GetExperimentErrors, eD as GetExperimentReadoutData, eE as GetExperimentReadoutError, eF as GetExperimentReadoutErrors, eG as GetExperimentReadoutResponse, eH as GetExperimentReadoutResponses, eI as GetExperimentResponse, eJ as GetExperimentResponses, eK as GetExperimentResultsData, eL as GetExperimentResultsError, eM as GetExperimentResultsErrors, eN as GetExperimentResultsResponse, eO as GetExperimentResultsResponse2, eP as GetExperimentResultsResponses, eQ as GetExperimentTimeseriesData, eR as GetExperimentTimeseriesError, eS as GetExperimentTimeseriesErrors, eT as GetExperimentTimeseriesResponse, eU as GetExperimentTimeseriesResponse2, eV as GetExperimentTimeseriesResponses, eW as GetGateData, eX as GetGateError, eY as GetGateErrors, eZ as GetGateResponse, e_ as GetGateResponses, e$ as GetGateTemplateData, f0 as GetGateTemplateError, f1 as GetGateTemplateErrors, f2 as GetGateTemplateResponse, f3 as GetGateTemplateResponses, f4 as GetKillswitchData, f5 as GetKillswitchError, f6 as GetKillswitchErrors, f7 as GetKillswitchResponse, f8 as GetKillswitchResponse2, f9 as GetKillswitchResponses, fa as GetMetricData, fb as GetMetricError, fc as GetMetricErrors, fd as GetMetricResponse, fe as GetMetricResponse2, ff as GetMetricResponses, fg as GetMetricSeriesData, fh as GetMetricSeriesError, fi as GetMetricSeriesErrors, fj as GetMetricSeriesRequest, fk as GetMetricSeriesResponse, fl as GetMetricSeriesResponse2, fm as GetMetricSeriesResponses, fn as GetOpsItemData, fo as GetOpsItemError, fp as GetOpsItemErrors, fq as GetOpsItemResponse, fr as GetOpsItemResponse2, fs as GetOpsItemResponses, ft as GetProjectData, fu as GetProjectError, fv as GetProjectErrors, fw as GetProjectResponse, fx as GetProjectResponses, fy as GithubConnectorData, fz as GithubPrLink, fA as I18nDraft, fB as JulesTriggerConfig, fC as KeyRecord, fD as KillswitchValue, fE as LinkPrToOpsItemData, fF as LinkPrToOpsItemError, fG as LinkPrToOpsItemErrors, fH as LinkPrToOpsItemRequest, fI as LinkPrToOpsItemResponse, fJ as LinkPrToOpsItemResponse2, fK as LinkPrToOpsItemResponses, fL as ListAlertRulesData, fM as ListAlertRulesError, fN as ListAlertRulesErrors, fO as ListAlertRulesResponse, fP as ListAlertRulesResponse2, fQ as ListAlertRulesResponses, fR as ListAlertsData, fS as ListAlertsError, fT as ListAlertsErrors, fU as ListAlertsResponse, fV as ListAlertsResponse2, fW as ListAlertsResponses, fX as ListAttributesData, fY as ListAttributesError, fZ as ListAttributesErrors, f_ as ListAttributesResponse, f$ as ListAttributesResponse2, g0 as ListAttributesResponses, g1 as ListConfigActivityData, g2 as ListConfigActivityError, g3 as ListConfigActivityErrors, g4 as ListConfigActivityResponse, g5 as ListConfigActivityResponse2, g6 as ListConfigActivityResponses, g7 as ListConfigVersionsData, g8 as ListConfigVersionsError, g9 as ListConfigVersionsErrors, ga as ListConfigVersionsResponse, gb as ListConfigVersionsResponse2, gc as ListConfigVersionsResponses, gd as ListConfigsData, ge as ListConfigsError, gf as ListConfigsErrors, gg as ListConfigsResponse, gh as ListConfigsResponse2, gi as ListConfigsResponses, gj as ListConnectorsData, gk as ListConnectorsError, gl as ListConnectorsErrors, gm as ListConnectorsResponse, gn as ListConnectorsResponse2, go as ListConnectorsResponses, gp as ListErrorsData, gq as ListErrorsError, gr as ListErrorsErrors, gs as ListErrorsResponse, gt as ListErrorsResponse2, gu as ListErrorsResponses, gv as ListEventsData, gw as ListEventsError, gx as ListEventsErrors, gy as ListEventsResponse, gz as ListEventsResponse2, gA as ListEventsResponses, gB as ListExperimentsData, gC as ListExperimentsError, gD as ListExperimentsErrors, gE as ListExperimentsResponse, gF as ListExperimentsResponse2, gG as ListExperimentsResponses, gH as ListGateActivityData, gI as ListGateActivityError, gJ as ListGateActivityErrors, gK as ListGateActivityResponse, gL as ListGateActivityResponse2, gM as ListGateActivityResponses, gN as ListGateTemplatesData, gO as ListGateTemplatesError, gP as ListGateTemplatesErrors, gQ as ListGateTemplatesResponse, gR as ListGateTemplatesResponse2, gS as ListGateTemplatesResponses, gT as ListGatesData, gU as ListGatesError, gV as ListGatesErrors, gW as ListGatesResponse, gX as ListGatesResponse2, gY as ListGatesResponses, gZ as ListI18nDraftKeysData, g_ as ListI18nDraftKeysError, g$ as ListI18nDraftKeysErrors, h0 as ListI18nDraftKeysResponse, h1 as ListI18nDraftKeysResponse2, h2 as ListI18nDraftKeysResponses, h3 as ListI18nDraftsData, h4 as ListI18nDraftsError, h5 as ListI18nDraftsErrors, h6 as ListI18nDraftsResponse, h7 as ListI18nDraftsResponse2, h8 as ListI18nDraftsResponses, h9 as ListI18nKeysData, ha as ListI18nKeysError, hb as ListI18nKeysErrors, hc as ListI18nKeysResponse, hd as ListI18nKeysResponse2, he as ListI18nKeysResponses, hf as ListI18nProfilesData, hg as ListI18nProfilesError, hh as ListI18nProfilesErrors, hi as ListI18nProfilesResponse, hj as ListI18nProfilesResponse2, hk as ListI18nProfilesResponses, hl as ListKeysData, hm as ListKeysError, hn as ListKeysErrors, ho as ListKeysResponse, hp as ListKeysResponse2, hq as ListKeysResponses, hr as ListKillswitchesData, hs as ListKillswitchesError, ht as ListKillswitchesErrors, hu as ListKillswitchesResponse, hv as ListKillswitchesResponse2, hw as ListKillswitchesResponses, hx as ListMetricExperimentsData, hy as ListMetricExperimentsError, hz as ListMetricExperimentsErrors, hA as ListMetricExperimentsResponse, hB as ListMetricExperimentsResponse2, hC as ListMetricExperimentsResponses, hD as ListMetricsData, hE as ListMetricsError, hF as ListMetricsErrors, hG as ListMetricsResponse, hH as ListMetricsResponse2, hI as ListMetricsResponses, hJ as ListOpsAgentsData, hK as ListOpsAgentsError, hL as ListOpsAgentsErrors, hM as ListOpsAgentsResponse, hN as ListOpsAgentsResponse2, hO as ListOpsAgentsResponses, hP as ListOpsCommentsData, hQ as ListOpsCommentsError, hR as ListOpsCommentsErrors, hS as ListOpsCommentsResponse, hT as ListOpsCommentsResponse2, hU as ListOpsCommentsResponses, hV as ListOpsInvestigationsData, hW as ListOpsInvestigationsError, hX as ListOpsInvestigationsErrors, hY as ListOpsInvestigationsResponse, hZ as ListOpsInvestigationsResponse2, h_ as ListOpsInvestigationsResponses, h$ as ListOpsItemsData, i0 as ListOpsItemsError, i1 as ListOpsItemsErrors, i2 as ListOpsItemsResponse, i3 as ListOpsItemsResponse2, i4 as ListOpsItemsResponses, i5 as ListSlackChannelsData, i6 as ListSlackChannelsError, i7 as ListSlackChannelsErrors, i8 as ListSlackChannelsResponse, i9 as ListSlackChannelsResponse2, ia as ListSlackChannelsResponses, ib as ListUniversesData, ic as ListUniversesError, id as ListUniversesErrors, ie as ListUniversesResponse, ig as ListUniversesResponse2, ih as ListUniversesResponses, ii as MeasurePlanResource, ij as MeasurePlanStep, ik as MetricDefaultMinEffectOfInterest, il as MetricDirection, im as MetricDisplayUnit, io as MetricEventName, ip as MetricName, iq as MetricQueryDsl, ir as MetricWinsorizePct, is as NotificationTarget, it as NotifyOpsData, iu as NotifyOpsError, iv as NotifyOpsErrors, iw as NotifyOpsRequest, ix as NotifyOpsResponse, iy as NotifyOpsResponse2, iz as NotifyOpsResponses, iA as OkResponse, iB as OpsAgentProfile, iC as OpsAlertContext, iD as OpsAlertMetricSummary, iE as OpsAlertRuleSummary, iF as OpsBrowserContext, iG as OpsComment, iH as OpsCommentAuthorType, iI as OpsErrorContext, iJ as OpsInvestigation, iK as OpsInvestigationState, iL as OpsItemAttachment, iM as OpsItemContext, iN as OpsItemNotifyOrNull, iO as OpsItemOwner, iP as OpsItemPriority, iQ as OpsItemPriorityOrNull, iR as OpsItemRelated, iS as OpsItemStatus, iT as OpsMeasurePlanContext, iU as OpsRun, iV as OpsRunAction, iW as OpsRunActionOrNull, iX as Options, iY as PaginationCursor, iZ as PaginationLimit, i_ as ProjectId, i$ as PublishConfigDraftData, j0 as PublishConfigDraftError, j1 as PublishConfigDraftErrors, j2 as PublishConfigDraftRequest, j3 as PublishConfigDraftResponse, j4 as PublishConfigDraftResponse2, j5 as PublishConfigDraftResponses, j6 as PublishI18nProfileData, j7 as PublishI18nProfileError, j8 as PublishI18nProfileErrors, j9 as PublishI18nProfileRequest, ja as PublishI18nProfileResponse, jb as PublishI18nProfileResponse2, jc as PublishI18nProfileResponses, jd as PushI18nKeysData, je as PushI18nKeysError, jf as PushI18nKeysErrors, jg as PushI18nKeysRequest, jh as PushI18nKeysResponse, ji as PushI18nKeysResponse2, jj as PushI18nKeysResponses, jk as Q, jl as QueryIr, jm as ReanalyzeExperimentData, jn as ReanalyzeExperimentError, jo as ReanalyzeExperimentErrors, jp as ReanalyzeExperimentResponse, jq as ReanalyzeExperimentResponse2, jr as ReanalyzeExperimentResponses, js as RequestResult, jt as ResolveErrorData, ju as ResolveErrorError, jv as ResolveErrorErrors, jw as ResolveErrorResponse, jx as ResolveErrorResponses, jy as ResourceId, jz as RevokeKeyData, jA as RevokeKeyError, jB as RevokeKeyErrors, jC as RevokeKeyResponse, jD as RevokeKeyResponse2, jE as RevokeKeyResponses, jF as SaveConfigDraftData, jG as SaveConfigDraftError, jH as SaveConfigDraftErrors, jI as SaveConfigDraftRequest, jJ as SaveConfigDraftResponse, jK as SaveConfigDraftResponse2, jL as SaveConfigDraftResponses, jM as SearchHit, jN as SearchResourcesData, jO as SearchResourcesError, jP as SearchResourcesErrors, jQ as SearchResourcesResponse, jR as SearchResourcesResponses, jS as SearchResponse, jT as SetExperimentMetricsData, jU as SetExperimentMetricsError, jV as SetExperimentMetricsErrors, jW as SetExperimentMetricsRequest, jX as SetExperimentMetricsResponse, jY as SetExperimentMetricsResponse2, jZ as SetExperimentMetricsResponses, j_ as SetExperimentStatusData, j$ as SetExperimentStatusError, k0 as SetExperimentStatusErrors, k1 as SetExperimentStatusRequest, k2 as SetExperimentStatusResponse, k3 as SetExperimentStatusResponse2, k4 as SetExperimentStatusResponses, k5 as SetI18nLabelData, k6 as SetI18nLabelError, k7 as SetI18nLabelErrors, k8 as SetI18nLabelRequest, k9 as SetI18nLabelResponse, ka as SetI18nLabelResponse2, kb as SetI18nLabelResponses, kc as SetKillswitchSwitchData, kd as SetKillswitchSwitchError, ke as SetKillswitchSwitchErrors, kf as SetKillswitchSwitchRequest, kg as SetKillswitchSwitchResponse, kh as SetKillswitchSwitchResponse2, ki as SetKillswitchSwitchResponses, kj as SetKillswitchValueData, kk as SetKillswitchValueError, kl as SetKillswitchValueErrors, km as SetKillswitchValueRequest, kn as SetKillswitchValueResponse, ko as SetKillswitchValueResponse2, kp as SetKillswitchValueResponses, kq as SlackConnectorData, kr as TestConnectorData, ks as TestConnectorError, kt as TestConnectorErrors, ku as TestConnectorResponse, kv as TestConnectorResponse2, kw as TestConnectorResponses, kx as UnarchiveMetricData, ky as UnarchiveMetricError, kz as UnarchiveMetricErrors, kA as UnarchiveMetricResponse, kB as UnarchiveMetricResponse2, kC as UnarchiveMetricResponses, kD as UniverseParam, kE as UniverseParamSchema, kF as UnsetKillswitchSwitchData, kG as UnsetKillswitchSwitchError, kH as UnsetKillswitchSwitchErrors, kI as UnsetKillswitchSwitchRequest, kJ as UnsetKillswitchSwitchResponse, kK as UnsetKillswitchSwitchResponse2, kL as UnsetKillswitchSwitchResponses, kM as UpdateAlertData, kN as UpdateAlertError, kO as UpdateAlertErrors, kP as UpdateAlertRequest, kQ as UpdateAlertResponse, kR as UpdateAlertResponses, kS as UpdateAlertRuleData, kT as UpdateAlertRuleError, kU as UpdateAlertRuleErrors, kV as UpdateAlertRuleRequest, kW as UpdateAlertRuleResponse, kX as UpdateAlertRuleResponse2, kY as UpdateAlertRuleResponses, kZ as UpdateAttributeData, k_ as UpdateAttributeError, k$ as UpdateAttributeErrors, l0 as UpdateAttributeRequest, l1 as UpdateAttributeResponse, l2 as UpdateAttributeResponse2, l3 as UpdateAttributeResponses, l4 as UpdateBugRequest, l5 as UpdateClaudeTriggerRequest, l6 as UpdateConfigData, l7 as UpdateConfigError, l8 as UpdateConfigErrors, l9 as UpdateConfigRequest, la as UpdateConfigResponse, lb as UpdateConfigResponse2, lc as UpdateConfigResponses, ld as UpdateConfigSchemaData, le as UpdateConfigSchemaError, lf as UpdateConfigSchemaErrors, lg as UpdateConfigSchemaRequest, lh as UpdateConfigSchemaResponse, li as UpdateConfigSchemaResponse2, lj as UpdateConfigSchemaResponses, lk as UpdateConnectorData, ll as UpdateConnectorError, lm as UpdateConnectorErrors, ln as UpdateConnectorRequest, lo as UpdateConnectorResponse, lp as UpdateConnectorResponse2, lq as UpdateConnectorResponses, lr as UpdateCopilotTriggerRequest, ls as UpdateCursorTriggerRequest, lt as UpdateErrorStatusData, lu as UpdateErrorStatusError, lv as UpdateErrorStatusErrors, lw as UpdateErrorStatusRequest, lx as UpdateErrorStatusResponse, ly as UpdateErrorStatusResponses, lz as UpdateEventData, lA as UpdateEventError, lB as UpdateEventErrors, lC as UpdateEventRequest, lD as UpdateEventResponse, lE as UpdateEventResponse2, lF as UpdateEventResponses, lG as UpdateExperimentData, lH as UpdateExperimentError, lI as UpdateExperimentErrors, lJ as UpdateExperimentRequest, lK as UpdateExperimentResponse, lL as UpdateExperimentResponse2, lM as UpdateExperimentResponses, lN as UpdateFeatureRequestRequest, lO as UpdateGateData, lP as UpdateGateError, lQ as UpdateGateErrors, lR as UpdateGateRequest, lS as UpdateGateResponse, lT as UpdateGateResponse2, lU as UpdateGateResponses, lV as UpdateGateTemplateData, lW as UpdateGateTemplateError, lX as UpdateGateTemplateErrors, lY as UpdateGateTemplateRequest, lZ as UpdateGateTemplateResponse, l_ as UpdateGateTemplateResponse2, l$ as UpdateGateTemplateResponses, m0 as UpdateI18nDraftData, m1 as UpdateI18nDraftError, m2 as UpdateI18nDraftErrors, m3 as UpdateI18nDraftRequest, m4 as UpdateI18nDraftResponse, m5 as UpdateI18nDraftResponses, m6 as UpdateI18nKeyData, m7 as UpdateI18nKeyError, m8 as UpdateI18nKeyErrors, m9 as UpdateI18nKeyRequest, ma as UpdateI18nKeyResponse, mb as UpdateI18nKeyResponse2, mc as UpdateI18nKeyResponses, md as UpdateJulesTriggerRequest, me as UpdateKillswitchData, mf as UpdateKillswitchError, mg as UpdateKillswitchErrors, mh as UpdateKillswitchRequest, mi as UpdateKillswitchResponse, mj as UpdateKillswitchResponse2, mk as UpdateKillswitchResponses, ml as UpdateMetricData, mm as UpdateMetricError, mn as UpdateMetricErrors, mo as UpdateMetricFields, mp as UpdateMetricRequest, mq as UpdateMetricResponse, mr as UpdateMetricResponses, ms as UpdateMetricWithQuery, mt as UpdateMetricWithQueryIr, mu as UpdateOpsInvestigationData, mv as UpdateOpsInvestigationError, mw as UpdateOpsInvestigationErrors, mx as UpdateOpsInvestigationRequest, my as UpdateOpsInvestigationResponse, mz as UpdateOpsInvestigationResponses, mA as UpdateOpsItemData, mB as UpdateOpsItemError, mC as UpdateOpsItemErrors, mD as UpdateOpsItemRequest, mE as UpdateOpsItemResponse, mF as UpdateOpsItemResponse2, mG as UpdateOpsItemResponses, mH as UpdateOpsItemStatusRequest, mI as UpdateProjectData, mJ as UpdateProjectError, mK as UpdateProjectErrors, mL as UpdateProjectRequest, mM as UpdateProjectResponse, mN as UpdateProjectResponses, mO as UpdateTriggerConnectorData, mP as UpdateTriggerConnectorError, mQ as UpdateTriggerConnectorErrors, mR as UpdateTriggerConnectorRequest, mS as UpdateTriggerConnectorResponse, mT as UpdateTriggerConnectorResponses, mU as UpdateUniverseData, mV as UpdateUniverseError, mW as UpdateUniverseErrors, mX as UpdateUniverseRequest, mY as UpdateUniverseResponse, mZ as UpdateUniverseResponse2, m_ as UpdateUniverseResponses, m$ as UpsertI18nDraftKeyData, n0 as UpsertI18nDraftKeyError, n1 as UpsertI18nDraftKeyErrors, n2 as UpsertI18nDraftKeyRequest, n3 as UpsertI18nDraftKeyResponse, n4 as UpsertI18nDraftKeyResponses, n5 as UpsertI18nKeysData, n6 as UpsertI18nKeysError, n7 as UpsertI18nKeysErrors, n8 as UpsertI18nKeysRequest, n9 as UpsertI18nKeysResponse, na as UpsertI18nKeysResponse2, nb as UpsertI18nKeysResponses, nc as UpsertProjectData, nd as UpsertProjectError, ne as UpsertProjectErrors, nf as UpsertProjectRequest, ng as UpsertProjectResponse, nh as UpsertProjectResponse2, ni as UpsertProjectResponses, nj as ackOpsItem, nk as approveEvent, nl as client, nm as configure, nn as createAlertRule, no as createAttribute, np as createClient, nq as createClientConfig, nr as createConfig, ns as createConnector, nt as createEvent, nu as createExperiment, nv as createExperimentReadout, nw as createGate, nx as createGateTemplate, ny as createI18nDraft, nz as createI18nProfile, nA as createKey, nB as createKillswitch, nC as createMetric, nD as createOpsComment, nE as createOpsInvestigation, nF as createOpsItem, nG as createTriggerConnector, nH as createUniverse, nI as deleteAlertRule, nJ as deleteAttribute, nK as deleteConfig, nL as deleteConnector, nM as deleteEvent, nN as deleteExperiment, nO as deleteGate, nP as deleteGateTemplate, nQ as deleteI18nDraft, nR as deleteI18nKey, nS as deleteI18nProfile, nT as deleteKillswitch, nU as deleteMetric, nV as deleteOpsItem, nW as deleteUniverse, nX as disableGate, nY as discardConfigDraft, nZ as enableGate, n_ as fileErrorTicket, n$ as fireConnector, o0 as getAttribute, o1 as getConfig, o2 as getConnector, o3 as getCurrentProject, o4 as getError, o5 as getErrorSeries, o6 as getEvent, o7 as getExperiment, o8 as getExperimentReadout, o9 as getExperimentResults, oa as getExperimentTimeseries, ob as getGate, oc as getGateTemplate, od as getKillswitch, oe as getMetric, of as getMetricSeries, og as getOpsItem, oh as getProject, oi as linkPrToOpsItem, oj as listAlertRules, ok as listAlerts, ol as listAttributes, om as listConfigActivity, on as listConfigVersions, oo as listConfigs, op as listConnectors, oq as listErrors, or as listEvents, os as listExperiments, ot as listGateActivity, ou as listGateTemplates, ov as listGates, ow as listI18nDraftKeys, ox as listI18nDrafts, oy as listI18nKeys, oz as listI18nProfiles, oA as listKeys, oB as listKillswitches, oC as listMetricExperiments, oD as listMetrics, oE as listOpsAgents, oF as listOpsComments, oG as listOpsInvestigations, oH as listOpsItems, oI as listSlackChannels, oJ as listUniverses, oK as notifyOps, oL as publishConfigDraft, oM as publishI18nProfile, oN as pushI18nKeys, oO as reanalyzeExperiment, oP as resolveError, oQ as revokeKey, oR as saveConfigDraft, oS as searchResources, oT as setExperimentMetrics, oU as setExperimentStatus, oV as setI18nLabel, oW as setKillswitchSwitch, oX as setKillswitchValue, oY as testConnector, oZ as unarchiveMetric, o_ as unsetKillswitchSwitch, o$ as updateAlert, p0 as updateAlertRule, p1 as updateAttribute, p2 as updateConfig, p3 as updateConfigSchema, p4 as updateConnector, p5 as updateErrorStatus, p6 as updateEvent, p7 as updateExperiment, p8 as updateGate, p9 as updateGateTemplate, pa as updateI18nDraft, pb as updateI18nKey, pc as updateKillswitch, pd as updateMetric, pe as updateOpsInvestigation, pf as updateOpsItem, pg as updateProject, ph as updateTriggerConnector, pi as updateUniverse, pj as upsertI18nDraftKey, pk as upsertI18nKeys, pl as upsertProject } from './client-DzEqdN5N.js';
3
3
 
4
4
  /**
5
5
  * The canonical `ErrorCode` catalogue as a runtime array — derived from the
package/dist/index.js CHANGED
@@ -122,6 +122,7 @@ import {
122
122
  updateI18nKey,
123
123
  updateKillswitch,
124
124
  updateMetric,
125
+ updateOpsInvestigation,
125
126
  updateOpsItem,
126
127
  updateProject,
127
128
  updateTriggerConnector,
@@ -129,10 +130,10 @@ import {
129
130
  upsertI18nDraftKey,
130
131
  upsertI18nKeys,
131
132
  upsertProject
132
- } from "./chunk-4QSU744W.js";
133
+ } from "./chunk-V4ZESAIF.js";
133
134
  import {
134
135
  zErrorCode
135
- } from "./chunk-ZPKHTUVV.js";
136
+ } from "./chunk-7T77D5YO.js";
136
137
 
137
138
  // src/errors.ts
138
139
  var ERROR_CODES = zErrorCode.options;
@@ -301,6 +302,7 @@ export {
301
302
  updateI18nKey,
302
303
  updateKillswitch,
303
304
  updateMetric,
305
+ updateOpsInvestigation,
304
306
  updateOpsItem,
305
307
  updateProject,
306
308
  updateTriggerConnector,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import { zErrorCode } from \"./generated/zod.gen.js\";\nimport type { Error as ApiErrorBody, ErrorCode } from \"./generated/types.gen.js\";\n\nexport type { ErrorCode };\nexport type { ApiErrorBody };\n\n/**\n * The canonical `ErrorCode` catalogue as a runtime array — derived from the\n * generated Zod enum so it can never drift from the spec. Mirrors\n * `@shipeasy/core`'s `ErrorCode`; the parity test (`scripts/check-drift.mjs`)\n * asserts every `x-error-codes` entry in the spec is one of these.\n */\nexport const ERROR_CODES = zErrorCode.options as readonly ErrorCode[];\n\n/** Type guard for the uniform `{ error, code?, detail? }` error envelope. */\nexport function isApiErrorBody(value: unknown): value is ApiErrorBody {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"error\" in value &&\n typeof (value as { error: unknown }).error === \"string\"\n );\n}\n\n/** Narrow an error body to a known `ErrorCode`, or `undefined` if uncatalogued. */\nexport function errorCodeOf(value: unknown): ErrorCode | undefined {\n if (!isApiErrorBody(value)) return undefined;\n const code = value.code;\n return code && (ERROR_CODES as readonly string[]).includes(code) ? code : undefined;\n}\n\n/** Which binary is reporting the failure — determines which command to tell the caller to run. */\nexport type AuthSurface = \"cli\" | \"mcp\";\n\nconst REAUTH_COMMAND: Record<AuthSurface, string> = {\n cli: \"shipeasy login --force\",\n mcp: \"shipeasy-mcp install --force\",\n};\n\n/**\n * Structured, agent-parseable remediation text for an admin-API auth failure\n * (401/403) — shared by the CLI's and MCP's error printers so every command\n * and every tool call reports auth failures the same way. The leading\n * `AUTH_REQUIRED:` / `AUTH_FORBIDDEN:` token is a stable marker a calling\n * agent can grep for; everything after it is human-readable remediation.\n *\n * Returns `undefined` for non-auth statuses so callers fall back to their\n * normal error formatting.\n */\nexport function formatAuthFailure(\n surface: AuthSurface,\n status: number,\n message: string,\n): string | undefined {\n const reauth = REAUTH_COMMAND[surface];\n if (status === 401) {\n return [\n `AUTH_REQUIRED: ${message} (401)`,\n ``,\n `Cause: the request's Shipeasy credentials are missing, invalid, or expired.`,\n `Fix:`,\n ` 1. Run: ${reauth}`,\n ` 2. Retry the command that failed.`,\n ].join(\"\\n\");\n }\n if (status === 403) {\n return [\n `AUTH_FORBIDDEN: ${message} (403)`,\n ``,\n `Cause: the credentials are valid but don't have access to this project or resource.`,\n `Fix:`,\n ` 1. Confirm the bound project is correct (check the .shipeasy file, or run: shipeasy root --json).`,\n ` 2. If it's the wrong project, run: shipeasy bind <project_id>.`,\n ` 3. If it's the right project, ask a workspace admin to grant access — retrying will not help.`,\n ].join(\"\\n\");\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,IAAM,cAAc,WAAW;AAG/B,SAAS,eAAe,OAAuC;AACpE,SACE,OAAO,UAAU,YACjB,UAAU,QACV,WAAW,SACX,OAAQ,MAA6B,UAAU;AAEnD;AAGO,SAAS,YAAY,OAAuC;AACjE,MAAI,CAAC,eAAe,KAAK,EAAG,QAAO;AACnC,QAAM,OAAO,MAAM;AACnB,SAAO,QAAS,YAAkC,SAAS,IAAI,IAAI,OAAO;AAC5E;AAKA,IAAM,iBAA8C;AAAA,EAClD,KAAK;AAAA,EACL,KAAK;AACP;AAYO,SAAS,kBACd,SACA,QACA,SACoB;AACpB,QAAM,SAAS,eAAe,OAAO;AACrC,MAAI,WAAW,KAAK;AAClB,WAAO;AAAA,MACL,kBAAkB,OAAO;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,MAAM;AAAA,MACnB;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACA,MAAI,WAAW,KAAK;AAClB,WAAO;AAAA,MACL,mBAAmB,OAAO;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import { zErrorCode } from \"./generated/zod.gen.js\";\nimport type { Error as ApiErrorBody, ErrorCode } from \"./generated/types.gen.js\";\n\nexport type { ErrorCode };\nexport type { ApiErrorBody };\n\n/**\n * The canonical `ErrorCode` catalogue as a runtime array — derived from the\n * generated Zod enum so it can never drift from the spec. Mirrors\n * `@shipeasy/core`'s `ErrorCode`; the parity test (`scripts/check-drift.mjs`)\n * asserts every `x-error-codes` entry in the spec is one of these.\n */\nexport const ERROR_CODES = zErrorCode.options as readonly ErrorCode[];\n\n/** Type guard for the uniform `{ error, code?, detail? }` error envelope. */\nexport function isApiErrorBody(value: unknown): value is ApiErrorBody {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"error\" in value &&\n typeof (value as { error: unknown }).error === \"string\"\n );\n}\n\n/** Narrow an error body to a known `ErrorCode`, or `undefined` if uncatalogued. */\nexport function errorCodeOf(value: unknown): ErrorCode | undefined {\n if (!isApiErrorBody(value)) return undefined;\n const code = value.code;\n return code && (ERROR_CODES as readonly string[]).includes(code) ? code : undefined;\n}\n\n/** Which binary is reporting the failure — determines which command to tell the caller to run. */\nexport type AuthSurface = \"cli\" | \"mcp\";\n\nconst REAUTH_COMMAND: Record<AuthSurface, string> = {\n cli: \"shipeasy login --force\",\n mcp: \"shipeasy-mcp install --force\",\n};\n\n/**\n * Structured, agent-parseable remediation text for an admin-API auth failure\n * (401/403) — shared by the CLI's and MCP's error printers so every command\n * and every tool call reports auth failures the same way. The leading\n * `AUTH_REQUIRED:` / `AUTH_FORBIDDEN:` token is a stable marker a calling\n * agent can grep for; everything after it is human-readable remediation.\n *\n * Returns `undefined` for non-auth statuses so callers fall back to their\n * normal error formatting.\n */\nexport function formatAuthFailure(\n surface: AuthSurface,\n status: number,\n message: string,\n): string | undefined {\n const reauth = REAUTH_COMMAND[surface];\n if (status === 401) {\n return [\n `AUTH_REQUIRED: ${message} (401)`,\n ``,\n `Cause: the request's Shipeasy credentials are missing, invalid, or expired.`,\n `Fix:`,\n ` 1. Run: ${reauth}`,\n ` 2. Retry the command that failed.`,\n ].join(\"\\n\");\n }\n if (status === 403) {\n return [\n `AUTH_FORBIDDEN: ${message} (403)`,\n ``,\n `Cause: the credentials are valid but don't have access to this project or resource.`,\n `Fix:`,\n ` 1. Confirm the bound project is correct (check the .shipeasy file, or run: shipeasy root --json).`,\n ` 2. If it's the wrong project, run: shipeasy bind <project_id>.`,\n ` 3. If it's the right project, ask a workspace admin to grant access — retrying will not help.`,\n ].join(\"\\n\");\n }\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYO,IAAM,cAAc,WAAW;AAG/B,SAAS,eAAe,OAAuC;AACpE,SACE,OAAO,UAAU,YACjB,UAAU,QACV,WAAW,SACX,OAAQ,MAA6B,UAAU;AAEnD;AAGO,SAAS,YAAY,OAAuC;AACjE,MAAI,CAAC,eAAe,KAAK,EAAG,QAAO;AACnC,QAAM,OAAO,MAAM;AACnB,SAAO,QAAS,YAAkC,SAAS,IAAI,IAAI,OAAO;AAC5E;AAKA,IAAM,iBAA8C;AAAA,EAClD,KAAK;AAAA,EACL,KAAK;AACP;AAYO,SAAS,kBACd,SACA,QACA,SACoB;AACpB,QAAM,SAAS,eAAe,OAAO;AACrC,MAAI,WAAW,KAAK;AAClB,WAAO;AAAA,MACL,kBAAkB,OAAO;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,MAAM;AAAA,MACnB;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACA,MAAI,WAAW,KAAK;AAClB,WAAO;AAAA,MACL,mBAAmB,OAAO;AAAA,MAC1B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE,KAAK,IAAI;AAAA,EACb;AACA,SAAO;AACT;","names":[]}