@debugbundle/cli 1.5.0 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.cjs +489 -116
  2. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -15350,6 +15350,29 @@ var ImprovementSettingsUpdateSchema = external_exports.object({
15350
15350
  message: "At least one improvement settings field must be provided."
15351
15351
  });
15352
15352
 
15353
+ // ../../packages/shared-types/src/project-color-tags.ts
15354
+ var PROJECT_COLOR_TAG_VALUES = [
15355
+ "red",
15356
+ "orange",
15357
+ "amber",
15358
+ "yellow",
15359
+ "lime",
15360
+ "green",
15361
+ "emerald",
15362
+ "teal",
15363
+ "cyan",
15364
+ "sky",
15365
+ "blue",
15366
+ "indigo",
15367
+ "violet",
15368
+ "purple",
15369
+ "fuchsia",
15370
+ "pink",
15371
+ "rose",
15372
+ "slate"
15373
+ ];
15374
+ var ProjectColorTagSchema = external_exports.enum(PROJECT_COLOR_TAG_VALUES);
15375
+
15353
15376
  // ../../packages/shared-types/src/index.ts
15354
15377
  function createUuidV4() {
15355
15378
  const cryptoSource = globalThis.crypto;
@@ -15944,8 +15967,10 @@ function buildSkill() {
15944
15967
  "name: debugbundle",
15945
15968
  "description: >-",
15946
15969
  " Investigate runtime incidents, inspect debug bundles, generate reproductions,",
15947
- " and run improvement analysis using the DebugBundle CLI and local project scaffold.",
15948
- " Use when the user reports a bug, runtime failure, or asks about production incidents.",
15970
+ " run improvement analysis, and inspect operational controls using the DebugBundle",
15971
+ " CLI and local project scaffold. Use when the user reports a bug, runtime",
15972
+ " failure, production incident, endpoint downtime, health-check issue, missing",
15973
+ " notification, webhook delivery failure, probe request, or noisy incident.",
15949
15974
  "metadata:",
15950
15975
  " author: debugbundle",
15951
15976
  ' version: "1.0"',
@@ -15983,6 +16008,24 @@ function buildSkill() {
15983
16008
  "4. Apply the narrowest fix, then validate it with the repository test workflow from `.debugbundle/profile.json`.",
15984
16009
  "5. When the fix is confirmed, or when the incident was intentionally generated for smoke, verification, or dogfooding, resolve it with `debugbundle resolve <incident-id> [incident-id ...]` or MCP `resolve_incident` / `resolve_incidents` so the open queue stays actionable.",
15985
16010
  "",
16011
+ "## Investigation Controls",
16012
+ "",
16013
+ "Use these controls when the user's issue is about observability behavior, notification delivery, targeted evidence gathering, or event noise rather than only application code.",
16014
+ "",
16015
+ "- Availability checks: use hosted health checks for endpoint downtime, public reachability, or project Health tab issues. These are DebugBundle-run external `GET`/`HEAD` checks, not SDK events from the customer app.",
16016
+ "- Probes: inspect active probes with `debugbundle probe list <project-id> --json` or MCP `list_active_probes` before activating more probes. Activate probes only when targeted runtime evidence is needed and the user has asked for investigation.",
16017
+ "- Capture policy and rules: inspect policy/rules before suppressing noisy incidents. Prefer `debugbundle capture-rule suggest <incident-id> --json` and narrow capture-policy path rules over broad drops or demotions.",
16018
+ "- Alerts and webhooks: when the user reports missing, duplicate, or failed notifications, inspect alert config, webhook config, and webhook delivery history before changing application code.",
16019
+ "",
16020
+ "## Availability Checks",
16021
+ "",
16022
+ "- Start with `debugbundle health checks list --project-id <id> --json` or MCP `list_health_checks` to inspect saved checks and plan limits.",
16023
+ "- For a failing check, inspect `debugbundle health checks results <check-id> --project-id <id> --json` and `debugbundle health checks daily-rollups <check-id> --project-id <id> --json` before changing code.",
16024
+ "- Use `debugbundle health checks test --project-id <id> --url <url> --json` or MCP `test_health_check` before creating or updating a saved check. Tests are side-effect-free: no incidents, retained history rows, or counters.",
16025
+ "- Create, update, delete, enable, or disable checks only when the user explicitly asks to change monitoring.",
16026
+ "- Availability incidents reuse the normal incident lifecycle. If a check opened an incident, fetch the incident context, bundle, and reproduction before proposing a fix, then resolve only after the endpoint recovers or the intentional verification incident has served its purpose.",
16027
+ "- Do not configure private, localhost, metadata-service, credentialed, or state-mutating targets. V1 health-check targets must be external `http`/`https` URLs on safe ports.",
16028
+ "",
15986
16029
  "## Incident Hygiene",
15987
16030
  "",
15988
16031
  "- Treat `open` as actionable work, not historical record.",
@@ -15999,6 +16042,25 @@ function buildSkill() {
15999
16042
  "- Scope frontend noise by structured evidence such as service, environment, `browser_event_kind`, `browser_event_opaque`, `client_kind`, `bot_family`, and message fields. Do not broadly demote generic `Unhandled promise rejection` incidents without bot-scoped or otherwise narrow evidence.",
16000
16043
  "- For expected or intentionally promoted 4xx responses on known routes, use capture-policy client-error path rules instead of promoting all client errors: `debugbundle capture-policy set --client-error-path-rule <status=/path/*@GET>`.",
16001
16044
  "",
16045
+ "## Notification Delivery",
16046
+ "",
16047
+ "When notification or automation delivery is the reported failure, inspect configuration and delivery records before changing incident logic.",
16048
+ "",
16049
+ "- Alerts route incident notifications to configured channels. Start with `debugbundle alert list --project-id <id> --json` and confirm condition, severity, service, cooldown, channel, and enabled state.",
16050
+ "- Webhooks deliver signed lifecycle events to external systems. Start with `debugbundle webhook list --project-id <id> --json`, then inspect `debugbundle webhook deliveries <webhook-id> --project-id <id> --json` before retrying or testing.",
16051
+ "- Webhook tests and retries are side-effecting delivery actions. Use them only when validating a destination or replaying an explicit failed delivery.",
16052
+ "",
16053
+ "## Full Documentation",
16054
+ "",
16055
+ "- CLI: `https://debugbundle.com/docs/cli`",
16056
+ "- MCP tools: `https://debugbundle.com/docs/mcp/tools`",
16057
+ "- Availability checks: `https://debugbundle.com/docs/availability-checks`",
16058
+ "- Probes: `https://debugbundle.com/docs/probes`",
16059
+ "- Capture policy and rules: `https://debugbundle.com/docs/capture-policy`",
16060
+ "- Alerts: `https://debugbundle.com/docs/alerts` and `https://debugbundle.com/docs/cli/alerts`",
16061
+ "- Webhooks: `https://debugbundle.com/docs/webhooks` and `https://debugbundle.com/docs/cli/webhooks`",
16062
+ "- API ingestion: `https://debugbundle.com/docs/api/ingestion`",
16063
+ "",
16002
16064
  "## Profile Validation",
16003
16065
  "",
16004
16066
  "Use this task after setup or whenever architecture changes make the static profile stale.",
@@ -16076,6 +16138,56 @@ function buildCliReference() {
16076
16138
  "",
16077
16139
  "Use capture-rule suggestions for repeated operational noise after inspecting an incident bundle. Use capture-policy client-error path rules for route-scoped 4xx incidents instead of promoting all client errors.",
16078
16140
  "",
16141
+ "## Probes",
16142
+ "",
16143
+ "- `debugbundle probe activate <project-id> --label-pattern <pattern> [--service <name>] [--environment <name>] [--ttl-seconds <n>] [--trigger-ttl-seconds <n>] [--auth-file <path>] [--json]`",
16144
+ "- `debugbundle probe list <project-id> [--auth-file <path>] [--json]`",
16145
+ "- `debugbundle probe deactivate <project-id> <activation-id> [--auth-file <path>] [--json]`",
16146
+ "",
16147
+ "Use probes for targeted evidence gathering when bundle context is insufficient. Prefer narrow label patterns, scoped service/environment values, and explicit TTLs.",
16148
+ "",
16149
+ "## Notifications",
16150
+ "",
16151
+ "- `debugbundle alert list --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
16152
+ "- `debugbundle alert create --project-id <id> --channel <channel> --condition <condition> [--service-id <id>] [--severity-min <level>] [--cooldown <seconds>] --config-json <json> [--is-enabled <true|false>] [--auth-file <path>] [--json]`",
16153
+ "- `debugbundle alert update <alert-id> --project-id <id> [--service-id <id|null>] [--channel <channel>] [--condition <condition>] [--severity-min <level|null>] [--cooldown <seconds>] [--config-json <json|null>] [--is-enabled <true|false>] [--auth-file <path>] [--json]`",
16154
+ "- `debugbundle alert delete <alert-id> --project-id <id> [--auth-file <path>] [--json]`",
16155
+ "- `debugbundle webhook list --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
16156
+ "- `debugbundle webhook create --project-id <id> --url <url> --event <event[,event]> [--environment <env[,env]>] [--service <svc[,svc]>] [--severity-min <level>] [--bundle-type <type[,type]>] [--verification <true|false>] [--is-enabled <true|false>] [--auth-file <path>] [--json]`",
16157
+ "- `debugbundle webhook update <webhook-id> --project-id <id> [--url <url>] [--event <event[,event]>] [--environment <env[,env]>] [--service <svc[,svc]>] [--severity-min <level>] [--bundle-type <type[,type]>] [--verification <true|false>] [--is-enabled <true|false>] [--auth-file <path>] [--json]`",
16158
+ "- `debugbundle webhook delete <webhook-id> --project-id <id> [--auth-file <path>] [--json]`",
16159
+ "- `debugbundle webhook test <webhook-id> --project-id <id> [--event <verification.passed|verification.failed>] [--auth-file <path>] [--json]`",
16160
+ "- `debugbundle webhook deliveries <webhook-id> --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
16161
+ "- `debugbundle webhook retry <webhook-id> <delivery-id> --project-id <id> [--auth-file <path>] [--json]`",
16162
+ "",
16163
+ "Use alert commands for notification routing and webhook commands for signed event delivery, delivery history, synthetic tests, and manual retries.",
16164
+ "",
16165
+ "## Availability Checks",
16166
+ "",
16167
+ "- `debugbundle health checks list --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
16168
+ "- `debugbundle health checks get <check-id> --project-id <id> [--auth-file <path>] [--json]`",
16169
+ "- `debugbundle health checks create --project-id <id> --name <name> --url <url> --interval-seconds <n> [--method <GET|HEAD>] [--expected-status-min <code>] [--expected-status-max <code>] [--timeout-ms <n>] [--failure-threshold <n>] [--recovery-threshold <n>] [--environment <name>] [--service <name|null>] [--enabled <true|false>] [--auth-file <path>] [--json]`",
16170
+ "- `debugbundle health checks update <check-id> --project-id <id> [--name <name>] [--url <url>] [--method <GET|HEAD>] [--expected-status-min <code>] [--expected-status-max <code>] [--timeout-ms <n>] [--interval-seconds <n>] [--failure-threshold <n>] [--recovery-threshold <n>] [--environment <name>] [--service <name|null>] [--enabled <true|false>] [--auth-file <path>] [--json]`",
16171
+ "- `debugbundle health checks delete <check-id> --project-id <id> [--auth-file <path>] [--json]`",
16172
+ "- `debugbundle health checks test --project-id <id> --url <url> [--method <GET|HEAD>] [--expected-status-min <code>] [--expected-status-max <code>] [--timeout-ms <n>] [--auth-file <path>] [--json]`",
16173
+ "- `debugbundle health checks results <check-id> --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
16174
+ "- `debugbundle health checks daily-rollups <check-id> --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
16175
+ "",
16176
+ "Use availability-check commands for hosted endpoint reachability. Prefer `test` before saving a new target. `test` is side-effect-free and does not create incidents or retained history. Saved checks remain visible after downgrade, but checks beyond current count or interval limits pause until the project becomes eligible again.",
16177
+ "",
16178
+ "## Documentation URLs",
16179
+ "",
16180
+ "- CLI overview: `https://debugbundle.com/docs/cli`",
16181
+ "- Cloud workflow: `https://debugbundle.com/docs/cli/cloud-workflow`",
16182
+ "- API overview: `https://debugbundle.com/docs/api`",
16183
+ "- API ingestion: `https://debugbundle.com/docs/api/ingestion`",
16184
+ "- Alerts: `https://debugbundle.com/docs/alerts` and `https://debugbundle.com/docs/cli/alerts`",
16185
+ "- Webhooks: `https://debugbundle.com/docs/webhooks`, `https://debugbundle.com/docs/cli/webhooks`, and `https://debugbundle.com/docs/api/webhooks`",
16186
+ "- Probes: `https://debugbundle.com/docs/probes` and `https://debugbundle.com/docs/api/probes`",
16187
+ "- Capture policy and rules: `https://debugbundle.com/docs/capture-policy`",
16188
+ "- Availability checks: `https://debugbundle.com/docs/availability-checks`",
16189
+ "- MCP tool catalog: `https://debugbundle.com/docs/mcp/tools`",
16190
+ "",
16079
16191
  "## Operational Paths",
16080
16192
  "",
16081
16193
  "- `.debugbundle/profile.json` \u2014 committed project map and agent validation state",
@@ -16097,7 +16209,7 @@ function buildCliReference() {
16097
16209
  "",
16098
16210
  "```bash",
16099
16211
  "debugbundle incidents --status open --json",
16100
- "debugbundle resolve <incident-id>",
16212
+ "debugbundle resolve <incident-id> [incident-id ...]",
16101
16213
  "debugbundle incidents --status open --json",
16102
16214
  "```",
16103
16215
  "",
@@ -16142,6 +16254,45 @@ function buildMcpReference() {
16142
16254
  "",
16143
16255
  "Use these tools for repeated low-value operational noise only after inspecting incident evidence. Keep frontend suppression scoped by structured browser and client signals, and use path-scoped capture policy for known 4xx routes.",
16144
16256
  "",
16257
+ "## Probe Tools",
16258
+ "",
16259
+ "- `activate_probe` \u2014 activate a remote probe pattern with optional service/environment scope and TTL.",
16260
+ "- `list_active_probes` \u2014 list active probe activations for a project.",
16261
+ "- `deactivate_probe` \u2014 deactivate one active probe.",
16262
+ "",
16263
+ "Use probes for targeted evidence gathering when incident bundles do not contain enough runtime context.",
16264
+ "",
16265
+ "## Notification Tools",
16266
+ "",
16267
+ "- `list_alerts`, `create_alert`, `update_alert`, `delete_alert` \u2014 manage incident alert rules.",
16268
+ "- `list_webhooks`, `create_webhook`, `update_webhook`, `delete_webhook` \u2014 manage signed webhook destinations.",
16269
+ "- `test_webhook`, `list_webhook_deliveries` \u2014 validate webhook delivery and inspect delivery history.",
16270
+ "",
16271
+ "Use these tools when the reported problem is missing, duplicate, delayed, disabled, or failed notification delivery.",
16272
+ "",
16273
+ "## Availability Check Tools",
16274
+ "",
16275
+ "- `list_health_checks` \u2014 list hosted health checks and plan limits for a project.",
16276
+ "- `get_health_check` \u2014 fetch one hosted health check by id.",
16277
+ "- `test_health_check` \u2014 run a side-effect-free target test without opening incidents or writing retained history.",
16278
+ "- `create_health_check`, `update_health_check`, `delete_health_check` \u2014 manage saved hosted health checks when the user explicitly asks to change monitoring.",
16279
+ "- `list_health_check_results` \u2014 inspect recent raw executions for one check.",
16280
+ "- `list_health_check_daily_rollups` \u2014 inspect retained per-day status history for one check.",
16281
+ "",
16282
+ "Use these tools for endpoint downtime, public reachability, and project Health tab issues. Start with list/results/rollups, use `test_health_check` before saving target changes, and inspect the linked normal incident bundle when failures crossed the configured threshold.",
16283
+ "",
16284
+ "## Documentation URLs",
16285
+ "",
16286
+ "- MCP overview: `https://debugbundle.com/docs/mcp`",
16287
+ "- MCP workflows: `https://debugbundle.com/docs/mcp/workflows`",
16288
+ "- MCP tools: `https://debugbundle.com/docs/mcp/tools`",
16289
+ "- Availability checks: `https://debugbundle.com/docs/availability-checks`",
16290
+ "- Probes: `https://debugbundle.com/docs/probes`",
16291
+ "- Capture policy and rules: `https://debugbundle.com/docs/capture-policy`",
16292
+ "- Alerts: `https://debugbundle.com/docs/alerts`",
16293
+ "- Webhooks: `https://debugbundle.com/docs/webhooks`",
16294
+ "- API ingestion: `https://debugbundle.com/docs/api/ingestion`",
16295
+ "",
16145
16296
  "## Smoke-Test Cleanup Recipe",
16146
16297
  "",
16147
16298
  '1. Call `list_incidents` with `status: "open"`.',
@@ -16276,6 +16427,15 @@ function buildSkillEvals() {
16276
16427
  "Use capture-policy path rules for known route-scoped 4xx incidents."
16277
16428
  ]
16278
16429
  },
16430
+ {
16431
+ name: "operational_controls_guidance",
16432
+ prompt: "The user reports missing webhook deliveries and asks whether probes or alerts are available. Confirm the skill points the agent to the relevant operational controls and docs.",
16433
+ expected_behavior: [
16434
+ "Inspect alert and webhook configuration plus webhook delivery history before changing application code.",
16435
+ "Use probes for targeted evidence gathering with narrow scope and TTL.",
16436
+ "Point to the full CLI, MCP, alerts, webhooks, probes, capture policy, availability checks, and ingestion documentation URLs."
16437
+ ]
16438
+ },
16279
16439
  {
16280
16440
  name: "artifact_path_discovery",
16281
16441
  prompt: "The user reports an unknown local runtime error. Confirm the skill tells the agent which DebugBundle paths and commands to inspect first.",
@@ -16701,6 +16861,20 @@ var import_promises3 = require("node:fs/promises");
16701
16861
  var import_node_path4 = require("node:path");
16702
16862
 
16703
16863
  // ../../packages/retrieval-client/src/index.ts
16864
+ var ProjectColorTagResponseSchema = external_exports.unknown().transform((value, context) => {
16865
+ if (value === void 0 || value === null) {
16866
+ return null;
16867
+ }
16868
+ const parsed = ProjectColorTagSchema.safeParse(value);
16869
+ if (!parsed.success) {
16870
+ context.addIssue({
16871
+ code: external_exports.ZodIssueCode.custom,
16872
+ message: "Invalid project color tag"
16873
+ });
16874
+ return external_exports.NEVER;
16875
+ }
16876
+ return parsed.data;
16877
+ });
16704
16878
  var IncidentReasonSchema = external_exports.object({
16705
16879
  kind: external_exports.enum(["backend_exception", "frontend_exception", "request_failure", "error_log"]),
16706
16880
  description: external_exports.string(),
@@ -16712,6 +16886,7 @@ var IncidentSchema = external_exports.object({
16712
16886
  incident_id: external_exports.string(),
16713
16887
  project_id: external_exports.string(),
16714
16888
  project_name: external_exports.string(),
16889
+ project_color_tag: ProjectColorTagResponseSchema,
16715
16890
  service_id: external_exports.string().nullable(),
16716
16891
  service_name: external_exports.string().nullable(),
16717
16892
  latest_deployment_id: external_exports.string().nullable(),
@@ -16734,6 +16909,7 @@ var ImprovementSchema = external_exports.object({
16734
16909
  improvement_id: external_exports.string(),
16735
16910
  project_id: external_exports.string(),
16736
16911
  project_name: external_exports.string(),
16912
+ project_color_tag: ProjectColorTagResponseSchema,
16737
16913
  project_slug: external_exports.string(),
16738
16914
  service_id: external_exports.string().nullable(),
16739
16915
  service_name: external_exports.string(),
@@ -16919,6 +17095,24 @@ async function expectServices(responsePromise) {
16919
17095
  const parsed = await expectParsed(responsePromise, ServicesResponseSchema);
16920
17096
  return parsed.services;
16921
17097
  }
17098
+ function normalizeIncidentRecord(incident) {
17099
+ return {
17100
+ ...incident,
17101
+ project_color_tag: incident.project_color_tag
17102
+ };
17103
+ }
17104
+ function normalizeIncidentContext(context) {
17105
+ return {
17106
+ ...context,
17107
+ incident: normalizeIncidentRecord(context.incident)
17108
+ };
17109
+ }
17110
+ function normalizeImprovementRecord(improvement) {
17111
+ return {
17112
+ ...improvement,
17113
+ project_color_tag: improvement.project_color_tag
17114
+ };
17115
+ }
16922
17116
  function createRetrievalApi(client) {
16923
17117
  return {
16924
17118
  async listIncidents(input2) {
@@ -16957,7 +17151,7 @@ function createRetrievalApi(client) {
16957
17151
  IncidentsResponseSchema
16958
17152
  );
16959
17153
  return {
16960
- incidents: parsed.incidents,
17154
+ incidents: parsed.incidents.map(normalizeIncidentRecord),
16961
17155
  next_cursor: parsed.next_cursor ?? null
16962
17156
  };
16963
17157
  },
@@ -16970,10 +17164,10 @@ function createRetrievalApi(client) {
16970
17164
  }),
16971
17165
  IncidentResponseSchema
16972
17166
  );
16973
- return parsed.incident;
17167
+ return normalizeIncidentRecord(parsed.incident);
16974
17168
  },
16975
17169
  async getIncidentContext(input2) {
16976
- return await expectParsed(
17170
+ const parsed = await expectParsed(
16977
17171
  client.request({
16978
17172
  method: "GET",
16979
17173
  path: `/v1/incidents/${input2.incidentId}/context`,
@@ -16981,6 +17175,7 @@ function createRetrievalApi(client) {
16981
17175
  }),
16982
17176
  IncidentContextSchema
16983
17177
  );
17178
+ return normalizeIncidentContext(parsed);
16984
17179
  },
16985
17180
  async resolveIncident(input2) {
16986
17181
  const parsed = await expectParsed(
@@ -16991,7 +17186,7 @@ function createRetrievalApi(client) {
16991
17186
  }),
16992
17187
  IncidentResponseSchema
16993
17188
  );
16994
- return parsed.incident;
17189
+ return normalizeIncidentRecord(parsed.incident);
16995
17190
  },
16996
17191
  async resolveIncidents(input2) {
16997
17192
  const parsed = await expectParsed(
@@ -17005,7 +17200,7 @@ function createRetrievalApi(client) {
17005
17200
  }),
17006
17201
  BulkIncidentResponseSchema
17007
17202
  );
17008
- return parsed.incidents;
17203
+ return parsed.incidents.map(normalizeIncidentRecord);
17009
17204
  },
17010
17205
  async reopenIncident(input2) {
17011
17206
  const parsed = await expectParsed(
@@ -17016,7 +17211,7 @@ function createRetrievalApi(client) {
17016
17211
  }),
17017
17212
  IncidentResponseSchema
17018
17213
  );
17019
- return parsed.incident;
17214
+ return normalizeIncidentRecord(parsed.incident);
17020
17215
  },
17021
17216
  async reopenIncidents(input2) {
17022
17217
  const parsed = await expectParsed(
@@ -17030,7 +17225,7 @@ function createRetrievalApi(client) {
17030
17225
  }),
17031
17226
  BulkIncidentResponseSchema
17032
17227
  );
17033
- return parsed.incidents;
17228
+ return parsed.incidents.map(normalizeIncidentRecord);
17034
17229
  },
17035
17230
  async getBundle(input2) {
17036
17231
  const bundle = await expectParsed(
@@ -17127,7 +17322,7 @@ function createRetrievalApi(client) {
17127
17322
  ImprovementsResponseSchema
17128
17323
  );
17129
17324
  return {
17130
- improvements: parsed.improvements,
17325
+ improvements: parsed.improvements.map(normalizeImprovementRecord),
17131
17326
  next_cursor: parsed.next_cursor ?? null
17132
17327
  };
17133
17328
  },
@@ -17140,7 +17335,7 @@ function createRetrievalApi(client) {
17140
17335
  }),
17141
17336
  ImprovementResponseSchema
17142
17337
  );
17143
- return parsed.improvement;
17338
+ return normalizeImprovementRecord(parsed.improvement);
17144
17339
  },
17145
17340
  async resolveImprovement(input2) {
17146
17341
  const parsed = await expectParsed(
@@ -17151,7 +17346,7 @@ function createRetrievalApi(client) {
17151
17346
  }),
17152
17347
  ImprovementResponseSchema
17153
17348
  );
17154
- return parsed.improvement;
17349
+ return normalizeImprovementRecord(parsed.improvement);
17155
17350
  },
17156
17351
  async reopenImprovement(input2) {
17157
17352
  const parsed = await expectParsed(
@@ -17162,7 +17357,7 @@ function createRetrievalApi(client) {
17162
17357
  }),
17163
17358
  ImprovementResponseSchema
17164
17359
  );
17165
- return parsed.improvement;
17360
+ return normalizeImprovementRecord(parsed.improvement);
17166
17361
  },
17167
17362
  async snoozeImprovement(input2) {
17168
17363
  const parsed = await expectParsed(
@@ -17174,7 +17369,7 @@ function createRetrievalApi(client) {
17174
17369
  }),
17175
17370
  ImprovementResponseSchema
17176
17371
  );
17177
- return parsed.improvement;
17372
+ return normalizeImprovementRecord(parsed.improvement);
17178
17373
  },
17179
17374
  async getImprovementBundle(input2) {
17180
17375
  return await expectParsed(
@@ -18212,6 +18407,136 @@ var AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS = [
18212
18407
  `
18213
18408
  ];
18214
18409
 
18410
+ // ../../packages/storage/src/storage-bootstrap-account-analytics-statements.ts
18411
+ var STORAGE_BOOTSTRAP_ACCOUNT_ANALYTICS_STATEMENTS = [
18412
+ `
18413
+ CREATE TABLE account_analytics_accounts (
18414
+ analytics_account_id uuid PRIMARY KEY,
18415
+ organization_id uuid UNIQUE,
18416
+ organization_id_hash text NOT NULL UNIQUE,
18417
+ created_at timestamptz NOT NULL,
18418
+ first_seen_at timestamptz NOT NULL,
18419
+ metrics_collection_started_at timestamptz NOT NULL,
18420
+ backfilled_from_retained_rows_at timestamptz,
18421
+ deleted_at timestamptz,
18422
+ initial_plan text,
18423
+ latest_known_plan text,
18424
+ latest_capacity_units integer,
18425
+ account_deleted boolean NOT NULL DEFAULT false,
18426
+ metrics_schema_version integer NOT NULL DEFAULT 1,
18427
+ updated_at timestamptz NOT NULL DEFAULT now()
18428
+ )
18429
+ `,
18430
+ `
18431
+ CREATE TABLE account_metric_periods (
18432
+ analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
18433
+ period_grain text NOT NULL CHECK (period_grain IN ('day', 'month', 'year', 'lifetime')),
18434
+ period_starts_at timestamptz NOT NULL,
18435
+ metric_key text NOT NULL,
18436
+ metric_value bigint NOT NULL DEFAULT 0,
18437
+ updated_at timestamptz NOT NULL DEFAULT now(),
18438
+ PRIMARY KEY (analytics_account_id, period_grain, period_starts_at, metric_key)
18439
+ )
18440
+ `,
18441
+ `
18442
+ CREATE INDEX account_metric_periods_grain_period_metric_idx
18443
+ ON account_metric_periods (period_grain, period_starts_at, metric_key)
18444
+ `,
18445
+ `
18446
+ CREATE INDEX account_metric_periods_account_grain_period_idx
18447
+ ON account_metric_periods (analytics_account_id, period_grain, period_starts_at)
18448
+ `,
18449
+ `
18450
+ CREATE TABLE account_metric_events (
18451
+ dedupe_key_hash text PRIMARY KEY,
18452
+ analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
18453
+ metric_source text NOT NULL,
18454
+ occurred_at timestamptz NOT NULL,
18455
+ recorded_at timestamptz NOT NULL DEFAULT now(),
18456
+ metric_deltas jsonb NOT NULL
18457
+ )
18458
+ `,
18459
+ `
18460
+ CREATE TABLE ingestion_rejection_diagnostic_periods (
18461
+ analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
18462
+ period_starts_at timestamptz NOT NULL,
18463
+ rejection_reason text NOT NULL,
18464
+ project_id_text text NOT NULL DEFAULT '',
18465
+ service_name text NOT NULL DEFAULT '',
18466
+ service_environment text NOT NULL DEFAULT '',
18467
+ service_runtime text NOT NULL DEFAULT '',
18468
+ sdk_name text NOT NULL DEFAULT '',
18469
+ sdk_version text NOT NULL DEFAULT '',
18470
+ event_type text NOT NULL DEFAULT '',
18471
+ validation_code text NOT NULL DEFAULT '',
18472
+ validation_path text NOT NULL DEFAULT '',
18473
+ occurrences bigint NOT NULL DEFAULT 0,
18474
+ first_seen_at timestamptz NOT NULL,
18475
+ last_seen_at timestamptz NOT NULL,
18476
+ updated_at timestamptz NOT NULL DEFAULT now(),
18477
+ PRIMARY KEY (
18478
+ analytics_account_id,
18479
+ period_starts_at,
18480
+ rejection_reason,
18481
+ project_id_text,
18482
+ service_name,
18483
+ service_environment,
18484
+ service_runtime,
18485
+ sdk_name,
18486
+ sdk_version,
18487
+ event_type,
18488
+ validation_code,
18489
+ validation_path
18490
+ )
18491
+ )
18492
+ `,
18493
+ `
18494
+ CREATE INDEX ingestion_rejection_diagnostic_periods_reason_period_idx
18495
+ ON ingestion_rejection_diagnostic_periods (rejection_reason, period_starts_at, last_seen_at DESC)
18496
+ `,
18497
+ `
18498
+ CREATE TABLE account_payment_retention_records (
18499
+ id uuid PRIMARY KEY,
18500
+ analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
18501
+ organization_id_hash text NOT NULL,
18502
+ provider text NOT NULL,
18503
+ plan text,
18504
+ billing_state text,
18505
+ stripe_customer_id text,
18506
+ stripe_subscription_id text,
18507
+ billing_period_starts_at timestamptz,
18508
+ billing_period_ends_at timestamptz,
18509
+ additional_capacity_units integer,
18510
+ last_billing_event_id text,
18511
+ account_deleted_at timestamptz NOT NULL,
18512
+ recorded_at timestamptz NOT NULL DEFAULT now(),
18513
+ updated_at timestamptz NOT NULL DEFAULT now(),
18514
+ UNIQUE (analytics_account_id, provider)
18515
+ )
18516
+ `,
18517
+ `
18518
+ CREATE INDEX account_payment_retention_records_provider_idx
18519
+ ON account_payment_retention_records (provider, account_deleted_at DESC)
18520
+ `,
18521
+ `
18522
+ CREATE TABLE account_payment_provider_events (
18523
+ provider_event_key text PRIMARY KEY,
18524
+ analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
18525
+ organization_id_hash text NOT NULL,
18526
+ provider text NOT NULL,
18527
+ provider_event_id text NOT NULL,
18528
+ provider_event_type text NOT NULL,
18529
+ processed_at timestamptz NOT NULL,
18530
+ account_deleted_at timestamptz NOT NULL,
18531
+ recorded_at timestamptz NOT NULL DEFAULT now()
18532
+ )
18533
+ `,
18534
+ `
18535
+ CREATE UNIQUE INDEX account_payment_provider_events_provider_event_key
18536
+ ON account_payment_provider_events (provider, provider_event_id)
18537
+ `
18538
+ ];
18539
+
18215
18540
  // ../../packages/storage/src/storage-bootstrap-statements.ts
18216
18541
  var STORAGE_BOOTSTRAP_STATEMENTS = [
18217
18542
  `
@@ -18275,6 +18600,8 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
18275
18600
  name text NOT NULL,
18276
18601
  slug text NOT NULL,
18277
18602
  environment_default text NOT NULL DEFAULT 'production',
18603
+ color_tag text
18604
+ CHECK (color_tag IN ('red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose', 'slate') OR color_tag IS NULL),
18278
18605
  automated_improvement_bundles_enabled boolean NOT NULL DEFAULT true,
18279
18606
  improvement_bundle_sensitivity text NOT NULL DEFAULT 'high_confidence'
18280
18607
  CHECK (improvement_bundle_sensitivity IN ('high_confidence', 'balanced', 'verbose')),
@@ -19151,94 +19478,7 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
19151
19478
  PRIMARY KEY (project_id, period_starts_at)
19152
19479
  )
19153
19480
  `,
19154
- `
19155
- CREATE TABLE account_analytics_accounts (
19156
- analytics_account_id uuid PRIMARY KEY,
19157
- organization_id uuid UNIQUE,
19158
- organization_id_hash text NOT NULL UNIQUE,
19159
- created_at timestamptz NOT NULL,
19160
- first_seen_at timestamptz NOT NULL,
19161
- metrics_collection_started_at timestamptz NOT NULL,
19162
- backfilled_from_retained_rows_at timestamptz,
19163
- deleted_at timestamptz,
19164
- initial_plan text,
19165
- latest_known_plan text,
19166
- latest_capacity_units integer,
19167
- account_deleted boolean NOT NULL DEFAULT false,
19168
- metrics_schema_version integer NOT NULL DEFAULT 1,
19169
- updated_at timestamptz NOT NULL DEFAULT now()
19170
- )
19171
- `,
19172
- `
19173
- CREATE TABLE account_metric_periods (
19174
- analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
19175
- period_grain text NOT NULL CHECK (period_grain IN ('day', 'month', 'year', 'lifetime')),
19176
- period_starts_at timestamptz NOT NULL,
19177
- metric_key text NOT NULL,
19178
- metric_value bigint NOT NULL DEFAULT 0,
19179
- updated_at timestamptz NOT NULL DEFAULT now(),
19180
- PRIMARY KEY (analytics_account_id, period_grain, period_starts_at, metric_key)
19181
- )
19182
- `,
19183
- `
19184
- CREATE INDEX account_metric_periods_grain_period_metric_idx
19185
- ON account_metric_periods (period_grain, period_starts_at, metric_key)
19186
- `,
19187
- `
19188
- CREATE INDEX account_metric_periods_account_grain_period_idx
19189
- ON account_metric_periods (analytics_account_id, period_grain, period_starts_at)
19190
- `,
19191
- `
19192
- CREATE TABLE account_metric_events (
19193
- dedupe_key_hash text PRIMARY KEY,
19194
- analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
19195
- metric_source text NOT NULL,
19196
- occurred_at timestamptz NOT NULL,
19197
- recorded_at timestamptz NOT NULL DEFAULT now(),
19198
- metric_deltas jsonb NOT NULL
19199
- )
19200
- `,
19201
- `
19202
- CREATE TABLE account_payment_retention_records (
19203
- id uuid PRIMARY KEY,
19204
- analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
19205
- organization_id_hash text NOT NULL,
19206
- provider text NOT NULL,
19207
- plan text,
19208
- billing_state text,
19209
- stripe_customer_id text,
19210
- stripe_subscription_id text,
19211
- billing_period_starts_at timestamptz,
19212
- billing_period_ends_at timestamptz,
19213
- additional_capacity_units integer,
19214
- last_billing_event_id text,
19215
- account_deleted_at timestamptz NOT NULL,
19216
- recorded_at timestamptz NOT NULL DEFAULT now(),
19217
- updated_at timestamptz NOT NULL DEFAULT now(),
19218
- UNIQUE (analytics_account_id, provider)
19219
- )
19220
- `,
19221
- `
19222
- CREATE INDEX account_payment_retention_records_provider_idx
19223
- ON account_payment_retention_records (provider, account_deleted_at DESC)
19224
- `,
19225
- `
19226
- CREATE TABLE account_payment_provider_events (
19227
- provider_event_key text PRIMARY KEY,
19228
- analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
19229
- organization_id_hash text NOT NULL,
19230
- provider text NOT NULL,
19231
- provider_event_id text NOT NULL,
19232
- provider_event_type text NOT NULL,
19233
- processed_at timestamptz NOT NULL,
19234
- account_deleted_at timestamptz NOT NULL,
19235
- recorded_at timestamptz NOT NULL DEFAULT now()
19236
- )
19237
- `,
19238
- `
19239
- CREATE UNIQUE INDEX account_payment_provider_events_provider_event_key
19240
- ON account_payment_provider_events (provider, provider_event_id)
19241
- `,
19481
+ ...STORAGE_BOOTSTRAP_ACCOUNT_ANALYTICS_STATEMENTS,
19242
19482
  `
19243
19483
  CREATE TABLE operational_email_deliveries (
19244
19484
  id uuid PRIMARY KEY,
@@ -20413,6 +20653,70 @@ var STORAGE_SCHEMA_MIGRATIONS = [
20413
20653
  AND expires_at <= now()
20414
20654
  `
20415
20655
  ]
20656
+ }),
20657
+ defineStorageSchemaMigration({
20658
+ id: "202606140001_add_ingestion_rejection_diagnostics",
20659
+ description: "Track sanitized ingestion rejection diagnostics for operator breakdowns.",
20660
+ statements: [
20661
+ `
20662
+ CREATE TABLE IF NOT EXISTS ingestion_rejection_diagnostic_periods (
20663
+ analytics_account_id uuid NOT NULL REFERENCES account_analytics_accounts(analytics_account_id),
20664
+ period_starts_at timestamptz NOT NULL,
20665
+ rejection_reason text NOT NULL,
20666
+ project_id_text text NOT NULL DEFAULT '',
20667
+ service_name text NOT NULL DEFAULT '',
20668
+ service_environment text NOT NULL DEFAULT '',
20669
+ service_runtime text NOT NULL DEFAULT '',
20670
+ sdk_name text NOT NULL DEFAULT '',
20671
+ sdk_version text NOT NULL DEFAULT '',
20672
+ event_type text NOT NULL DEFAULT '',
20673
+ validation_code text NOT NULL DEFAULT '',
20674
+ validation_path text NOT NULL DEFAULT '',
20675
+ occurrences bigint NOT NULL DEFAULT 0,
20676
+ first_seen_at timestamptz NOT NULL,
20677
+ last_seen_at timestamptz NOT NULL,
20678
+ updated_at timestamptz NOT NULL DEFAULT now(),
20679
+ PRIMARY KEY (
20680
+ analytics_account_id,
20681
+ period_starts_at,
20682
+ rejection_reason,
20683
+ project_id_text,
20684
+ service_name,
20685
+ service_environment,
20686
+ service_runtime,
20687
+ sdk_name,
20688
+ sdk_version,
20689
+ event_type,
20690
+ validation_code,
20691
+ validation_path
20692
+ )
20693
+ )
20694
+ `,
20695
+ `
20696
+ CREATE INDEX IF NOT EXISTS ingestion_rejection_diagnostic_periods_reason_period_idx
20697
+ ON ingestion_rejection_diagnostic_periods (
20698
+ rejection_reason,
20699
+ period_starts_at,
20700
+ last_seen_at DESC
20701
+ )
20702
+ `
20703
+ ]
20704
+ }),
20705
+ defineStorageSchemaMigration({
20706
+ id: "202606170001_add_project_color_tags",
20707
+ description: "Add optional project color tags for project metadata and retrieval surfaces.",
20708
+ statements: [
20709
+ "ALTER TABLE projects ADD COLUMN IF NOT EXISTS color_tag text",
20710
+ "ALTER TABLE projects DROP CONSTRAINT IF EXISTS projects_color_tag_check",
20711
+ `
20712
+ ALTER TABLE projects
20713
+ ADD CONSTRAINT projects_color_tag_check
20714
+ CHECK (
20715
+ color_tag IN ('red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose', 'slate')
20716
+ OR color_tag IS NULL
20717
+ )
20718
+ `
20719
+ ]
20416
20720
  })
20417
20721
  ];
20418
20722
 
@@ -20420,7 +20724,7 @@ var STORAGE_SCHEMA_MIGRATIONS = [
20420
20724
  var STORAGE_SCHEMA_MIGRATIONS2 = [
20421
20725
  ...STORAGE_SCHEMA_MIGRATIONS,
20422
20726
  ...AVAILABILITY_CHECK_STORAGE_SCHEMA_MIGRATIONS
20423
- ];
20727
+ ].sort((left, right) => left.id.localeCompare(right.id));
20424
20728
 
20425
20729
  // src/local-retrieval-store.ts
20426
20730
  var CONNECTION_FILE_PATH2 = ".debugbundle/local/connection.json";
@@ -21165,6 +21469,20 @@ var import_promises8 = require("node:fs/promises");
21165
21469
  var import_node_path9 = require("node:path");
21166
21470
 
21167
21471
  // ../../packages/project-management-client/src/index.ts
21472
+ var ProjectColorTagResponseSchema2 = external_exports.unknown().transform((value, context) => {
21473
+ if (value === void 0 || value === null) {
21474
+ return null;
21475
+ }
21476
+ const parsed = ProjectColorTagSchema.safeParse(value);
21477
+ if (!parsed.success) {
21478
+ context.addIssue({
21479
+ code: external_exports.ZodIssueCode.custom,
21480
+ message: "Invalid project color tag"
21481
+ });
21482
+ return external_exports.NEVER;
21483
+ }
21484
+ return parsed.data;
21485
+ });
21168
21486
  var ProjectMetricsSchema = external_exports.object({
21169
21487
  open_incidents: external_exports.number().int().nonnegative().default(0),
21170
21488
  regressed_incidents: external_exports.number().int().nonnegative().default(0),
@@ -21187,6 +21505,7 @@ var ProjectRecordSchema = external_exports.object({
21187
21505
  name: external_exports.string(),
21188
21506
  slug: external_exports.string(),
21189
21507
  environment_default: external_exports.string(),
21508
+ color_tag: ProjectColorTagResponseSchema2,
21190
21509
  organization_plan: external_exports.enum(["free", "solo", "team"]),
21191
21510
  metrics: ProjectMetricsSchema,
21192
21511
  created_at: external_exports.string(),
@@ -21210,6 +21529,7 @@ var DeletedProjectRecordSchema = external_exports.object({
21210
21529
  name: external_exports.string(),
21211
21530
  slug: external_exports.string(),
21212
21531
  environment_default: external_exports.string(),
21532
+ color_tag: ProjectColorTagResponseSchema2,
21213
21533
  organization_plan: external_exports.enum(["free", "solo", "team"]),
21214
21534
  created_at: external_exports.string(),
21215
21535
  updated_at: external_exports.string()
@@ -21236,6 +21556,18 @@ function parseApiError2(status, body) {
21236
21556
  }
21237
21557
  throw new ProjectManagementApiError(status, parsed.data.error);
21238
21558
  }
21559
+ function normalizeProjectRecord(project) {
21560
+ return {
21561
+ ...project,
21562
+ color_tag: project.color_tag
21563
+ };
21564
+ }
21565
+ function normalizeDeletedProjectRecord(project) {
21566
+ return {
21567
+ ...project,
21568
+ color_tag: project.color_tag
21569
+ };
21570
+ }
21239
21571
  async function expectProjects(responsePromise) {
21240
21572
  const response = await responsePromise;
21241
21573
  if (response.status < 200 || response.status >= 300) {
@@ -21245,7 +21577,7 @@ async function expectProjects(responsePromise) {
21245
21577
  if (!parsed.success) {
21246
21578
  throw new ProjectManagementApiError(response.status, "invalid_response_shape");
21247
21579
  }
21248
- return parsed.data.projects;
21580
+ return parsed.data.projects.map(normalizeProjectRecord);
21249
21581
  }
21250
21582
  async function expectProject(responsePromise) {
21251
21583
  const response = await responsePromise;
@@ -21256,7 +21588,7 @@ async function expectProject(responsePromise) {
21256
21588
  if (!parsed.success) {
21257
21589
  throw new ProjectManagementApiError(response.status, "invalid_response_shape");
21258
21590
  }
21259
- return parsed.data.project;
21591
+ return normalizeProjectRecord(parsed.data.project);
21260
21592
  }
21261
21593
  async function expectDeletedProject(responsePromise) {
21262
21594
  const response = await responsePromise;
@@ -21267,7 +21599,7 @@ async function expectDeletedProject(responsePromise) {
21267
21599
  if (!parsed.success) {
21268
21600
  throw new ProjectManagementApiError(response.status, "invalid_response_shape");
21269
21601
  }
21270
- return parsed.data.project;
21602
+ return normalizeDeletedProjectRecord(parsed.data.project);
21271
21603
  }
21272
21604
  function createProjectManagementApi(client) {
21273
21605
  return {
@@ -21290,7 +21622,8 @@ function createProjectManagementApi(client) {
21290
21622
  body: {
21291
21623
  name: input2.name,
21292
21624
  slug: input2.slug,
21293
- ...input2.environmentDefault === void 0 ? {} : { environment_default: input2.environmentDefault }
21625
+ ...input2.environmentDefault === void 0 ? {} : { environment_default: input2.environmentDefault },
21626
+ ...input2.colorTag === void 0 ? {} : { color_tag: input2.colorTag }
21294
21627
  }
21295
21628
  })
21296
21629
  );
@@ -21306,6 +21639,9 @@ function createProjectManagementApi(client) {
21306
21639
  if (input2.environmentDefault !== void 0) {
21307
21640
  body["environment_default"] = input2.environmentDefault;
21308
21641
  }
21642
+ if (input2.colorTag !== void 0) {
21643
+ body["color_tag"] = input2.colorTag;
21644
+ }
21309
21645
  return expectProject(
21310
21646
  client.request({
21311
21647
  method: "PATCH",
@@ -27622,7 +27958,7 @@ function buildManagedAgentsSection() {
27622
27958
  "- Read `.agents/skills/debugbundle/SKILL.md` for the full debugging workflow.",
27623
27959
  "- Use `debugbundle inspect <incident-id>` or MCP `get_bundle` when a user reports an issue.",
27624
27960
  "- Run reproduction artifacts from `.debugbundle/bundles/local/reproductions/` before proposing a fix.",
27625
- "- After a fix is verified, or after an intentional smoke or dogfood incident has served its purpose, resolve it with `debugbundle resolve <incident-id>` or MCP `resolve_incident` so open incidents remain actionable.",
27961
+ "- After a fix is verified, or after an intentional smoke or dogfood incident has served its purpose, resolve it with `debugbundle resolve <incident-id> [incident-id ...]` or MCP `resolve_incident` / `resolve_incidents` so open incidents remain actionable.",
27626
27962
  "- Use `debugbundle doctor` to validate local DebugBundle setup or connectivity issues.",
27627
27963
  MANAGED_AGENTS_END
27628
27964
  ].join("\n");
@@ -30104,8 +30440,8 @@ var CLI_USAGE_LINES = [
30104
30440
  " debugbundle github deliveries --project-id <id> [--status <status>] [--limit <n>] [--auth-file <path>] [--json]",
30105
30441
  " debugbundle github deliveries retry <delivery-id> --project-id <id> [--auth-file <path>] [--json]",
30106
30442
  " debugbundle project list [--limit <n>] [--auth-file <path>] [--json]",
30107
- " debugbundle project create --name <name> --slug <slug> [--environment-default <env>] [--auth-file <path>] [--json]",
30108
- " debugbundle project update <project-id> [--name <name>] [--slug <slug>] [--environment-default <env>] [--auth-file <path>] [--json]",
30443
+ " debugbundle project create --name <name> --slug <slug> [--environment-default <env>] [--color-tag <tag>] [--auth-file <path>] [--json]",
30444
+ " debugbundle project update <project-id> [--name <name>] [--slug <slug>] [--environment-default <env>] [--color-tag <tag> | --clear-color-tag] [--auth-file <path>] [--json]",
30109
30445
  " debugbundle project delete <project-id> [--auth-file <path>] [--json]",
30110
30446
  " debugbundle token project list <project-id> [--limit <n>] [--auth-file <path>] [--json]",
30111
30447
  " debugbundle token project create <project-id> --label <label> [--allowed-origin <origin> ...] [--auth-file <path>] [--json]",
@@ -30469,7 +30805,7 @@ function parseArgv(argv) {
30469
30805
  positionals.push(token);
30470
30806
  continue;
30471
30807
  }
30472
- if (token === "--fix" || token === "--json" || token === "--check-relay" || token === "--privacy" || token === "--help" || token === "--version" || token === "--non-interactive" || token === "--local" || token === "--cloud" || token === "--events" || token === "--bundles" || token === "--all" || token === "--trigger-5xx" || token === "--expect-app-event" || token === "--github" || token === "--github-cli" || token === "--github-device") {
30808
+ if (token === "--fix" || token === "--json" || token === "--check-relay" || token === "--privacy" || token === "--help" || token === "--version" || token === "--non-interactive" || token === "--local" || token === "--cloud" || token === "--events" || token === "--bundles" || token === "--all" || token === "--trigger-5xx" || token === "--expect-app-event" || token === "--github" || token === "--github-cli" || token === "--github-device" || token === "--clear-color-tag") {
30473
30809
  options.set(token.slice(2), true);
30474
30810
  continue;
30475
30811
  }
@@ -32357,6 +32693,9 @@ async function createProjectCommand(input2, api) {
32357
32693
  if (input2.environmentDefault !== void 0) {
32358
32694
  requestInput.environmentDefault = input2.environmentDefault;
32359
32695
  }
32696
+ if (input2.colorTag !== void 0) {
32697
+ requestInput.colorTag = input2.colorTag;
32698
+ }
32360
32699
  const project = await api.createProject(requestInput);
32361
32700
  return {
32362
32701
  exitCode: 0,
@@ -32381,6 +32720,9 @@ async function updateProjectCommand(input2, api) {
32381
32720
  if (input2.environmentDefault !== void 0) {
32382
32721
  requestInput.environmentDefault = input2.environmentDefault;
32383
32722
  }
32723
+ if (input2.colorTag !== void 0) {
32724
+ requestInput.colorTag = input2.colorTag;
32725
+ }
32384
32726
  const project = await api.updateProject(requestInput);
32385
32727
  return {
32386
32728
  exitCode: 0,
@@ -32437,6 +32779,9 @@ async function createProjectWithAuthCommand(input2, dependencies) {
32437
32779
  if (input2.environmentDefault !== void 0) {
32438
32780
  commandInput.environmentDefault = input2.environmentDefault;
32439
32781
  }
32782
+ if (input2.colorTag !== void 0) {
32783
+ commandInput.colorTag = input2.colorTag;
32784
+ }
32440
32785
  if (input2.json !== void 0) {
32441
32786
  commandInput.json = input2.json;
32442
32787
  }
@@ -32464,6 +32809,9 @@ async function updateProjectWithAuthCommand(input2, dependencies) {
32464
32809
  if (input2.environmentDefault !== void 0) {
32465
32810
  commandInput.environmentDefault = input2.environmentDefault;
32466
32811
  }
32812
+ if (input2.colorTag !== void 0) {
32813
+ commandInput.colorTag = input2.colorTag;
32814
+ }
32467
32815
  if (input2.json !== void 0) {
32468
32816
  commandInput.json = input2.json;
32469
32817
  }
@@ -32766,6 +33114,16 @@ async function revokeMemberTokenWithAuthCommand(input2, dependencies) {
32766
33114
  }
32767
33115
 
32768
33116
  // src/management-billing-project-token-command-handlers.ts
33117
+ function readProjectColorTagOption(parsedArgv) {
33118
+ const colorTag = readStringOption(parsedArgv, "color-tag");
33119
+ if (colorTag === void 0) {
33120
+ return void 0;
33121
+ }
33122
+ if (PROJECT_COLOR_TAG_VALUES.includes(colorTag)) {
33123
+ return colorTag;
33124
+ }
33125
+ throw new CliInputError("Invalid value for --color-tag.");
33126
+ }
32769
33127
  async function handleBillingCommand(parsedArgv, dependencies) {
32770
33128
  const action = requirePositional(parsedArgv, 1, "action");
32771
33129
  if (action === "get") {
@@ -32919,7 +33277,7 @@ async function handleProjectCommand(parsedArgv, dependencies) {
32919
33277
  return await (dependencies.listProjectsCommand ?? listProjectsWithAuthCommand)(input2);
32920
33278
  }
32921
33279
  if (action === "create") {
32922
- expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "name", "slug", "environment-default"]);
33280
+ expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "name", "slug", "environment-default", "color-tag"]);
32923
33281
  ensureNoExtraPositionals(parsedArgv, 2);
32924
33282
  const name = readStringOption(parsedArgv, "name");
32925
33283
  if (name === void 0) {
@@ -32934,10 +33292,14 @@ async function handleProjectCommand(parsedArgv, dependencies) {
32934
33292
  if (environmentDefault !== void 0) {
32935
33293
  input2.environmentDefault = environmentDefault;
32936
33294
  }
33295
+ const colorTag = readProjectColorTagOption(parsedArgv);
33296
+ if (colorTag !== void 0) {
33297
+ input2.colorTag = colorTag;
33298
+ }
32937
33299
  return await (dependencies.createProjectCommand ?? createProjectWithAuthCommand)(input2);
32938
33300
  }
32939
33301
  if (action === "update") {
32940
- expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "name", "slug", "environment-default"]);
33302
+ expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "name", "slug", "environment-default", "color-tag", "clear-color-tag"]);
32941
33303
  ensureNoExtraPositionals(parsedArgv, 3);
32942
33304
  const input2 = appendCommonAuthOptions(parsedArgv, {
32943
33305
  projectId: requirePositional(parsedArgv, 2, "project-id")
@@ -32954,7 +33316,18 @@ async function handleProjectCommand(parsedArgv, dependencies) {
32954
33316
  if (environmentDefault !== void 0) {
32955
33317
  input2.environmentDefault = environmentDefault;
32956
33318
  }
32957
- if (input2.name === void 0 && input2.slug === void 0 && input2.environmentDefault === void 0) {
33319
+ if (readBooleanOption(parsedArgv, "clear-color-tag") === true) {
33320
+ if (readStringOption(parsedArgv, "color-tag") !== void 0) {
33321
+ throw new CliInputError("Use either --color-tag or --clear-color-tag.");
33322
+ }
33323
+ input2.colorTag = null;
33324
+ } else {
33325
+ const colorTag = readProjectColorTagOption(parsedArgv);
33326
+ if (colorTag !== void 0) {
33327
+ input2.colorTag = colorTag;
33328
+ }
33329
+ }
33330
+ if (input2.name === void 0 && input2.slug === void 0 && input2.environmentDefault === void 0 && input2.colorTag === void 0) {
32958
33331
  throw new CliInputError("At least one project field must be provided.");
32959
33332
  }
32960
33333
  return await (dependencies.updateProjectCommand ?? updateProjectWithAuthCommand)(input2);
@@ -36537,7 +36910,7 @@ async function handleCaptureRuleCommand2(parsedArgv, dependencies) {
36537
36910
  // package.json
36538
36911
  var package_default = {
36539
36912
  name: "@debugbundle/cli",
36540
- version: "1.5.0",
36913
+ version: "1.5.2",
36541
36914
  private: false,
36542
36915
  description: "Command-line interface for DebugBundle",
36543
36916
  license: "AGPL-3.0-only",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debugbundle/cli",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "private": false,
5
5
  "description": "Command-line interface for DebugBundle",
6
6
  "license": "AGPL-3.0-only",