@autohq/cli 0.1.378 → 0.1.380
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/agent-bridge.js +294 -5
- package/dist/index.js +295 -6
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -23492,7 +23492,7 @@ Object.assign(lookup, {
|
|
|
23492
23492
|
// package.json
|
|
23493
23493
|
var package_default = {
|
|
23494
23494
|
name: "@autohq/cli",
|
|
23495
|
-
version: "0.1.
|
|
23495
|
+
version: "0.1.380",
|
|
23496
23496
|
license: "SEE LICENSE IN README.md",
|
|
23497
23497
|
publishConfig: {
|
|
23498
23498
|
access: "public"
|
|
@@ -28123,6 +28123,10 @@ var CreditEventTypeSchema = external_exports.enum(CREDIT_EVENT_TYPES);
|
|
|
28123
28123
|
var UsdAmountSchema = external_exports.number().finite();
|
|
28124
28124
|
var NonNegativeUsdSchema = external_exports.number().finite().nonnegative();
|
|
28125
28125
|
var PositiveUsdSchema = external_exports.number().finite().positive();
|
|
28126
|
+
var MIN_CREDIT_PURCHASE_USD = 5;
|
|
28127
|
+
var MAX_CREDIT_PURCHASE_USD = 1e4;
|
|
28128
|
+
var wholeCents = (value2) => Math.abs(value2 * 100 - Math.round(value2 * 100)) < 1e-6;
|
|
28129
|
+
var ChargeableUsdSchema = PositiveUsdSchema.min(MIN_CREDIT_PURCHASE_USD).max(MAX_CREDIT_PURCHASE_USD).refine(wholeCents, "amount must be a whole number of cents");
|
|
28126
28130
|
var CreditEventSchema = external_exports.object({
|
|
28127
28131
|
organizationId: OrganizationIdSchema,
|
|
28128
28132
|
type: CreditEventTypeSchema,
|
|
@@ -28130,7 +28134,11 @@ var CreditEventSchema = external_exports.object({
|
|
|
28130
28134
|
description: external_exports.string().trim().min(1).nullable().default(null),
|
|
28131
28135
|
// The acting user for manual purchases/adjustments; null for system-issued
|
|
28132
28136
|
// rows (signup grants, auto-top-ups).
|
|
28133
|
-
createdByUserId: external_exports.string().trim().min(1).nullable().default(null)
|
|
28137
|
+
createdByUserId: external_exports.string().trim().min(1).nullable().default(null),
|
|
28138
|
+
// External payment reference (e.g. a Stripe payment intent id). Unique in
|
|
28139
|
+
// the ledger, so payment-driven mints are idempotent: a webhook retry or a
|
|
28140
|
+
// sync-plus-webhook race inserts once and no-ops after.
|
|
28141
|
+
externalRef: external_exports.string().trim().min(1).nullable().default(null)
|
|
28134
28142
|
}).refine(
|
|
28135
28143
|
(event) => event.type === "adjustment" || event.amountUsd > 0,
|
|
28136
28144
|
"Only adjustment credit events may carry a non-positive amount"
|
|
@@ -28142,6 +28150,7 @@ var CreditEventRecordSchema = external_exports.object({
|
|
|
28142
28150
|
amountUsd: UsdAmountSchema,
|
|
28143
28151
|
description: external_exports.string().trim().min(1).nullable(),
|
|
28144
28152
|
createdByUserId: external_exports.string().trim().min(1).nullable(),
|
|
28153
|
+
externalRef: external_exports.string().trim().min(1).nullable(),
|
|
28145
28154
|
createdAt: external_exports.string().datetime()
|
|
28146
28155
|
});
|
|
28147
28156
|
var SPENDING_LIMIT_WINDOWS = ["day", "month"];
|
|
@@ -28159,14 +28168,24 @@ var OrganizationBillingSettingsSchema = external_exports.object({
|
|
|
28159
28168
|
// Balance at or below the threshold triggers a top-up of the configured
|
|
28160
28169
|
// amount. Both must be set for auto-top-up to arm.
|
|
28161
28170
|
autoTopUpThresholdUsd: NonNegativeUsdSchema.nullable(),
|
|
28162
|
-
autoTopUpAmountUsd: PositiveUsdSchema.nullable()
|
|
28171
|
+
autoTopUpAmountUsd: PositiveUsdSchema.nullable(),
|
|
28172
|
+
// Stripe linkage, set by the payment flow (never by the settings PATCH):
|
|
28173
|
+
// the org's Stripe customer, and the saved card auto-top-up charges
|
|
28174
|
+
// off-session. A non-null payment method is what "card on file" means.
|
|
28175
|
+
stripeCustomerId: external_exports.string().trim().min(1).nullable(),
|
|
28176
|
+
stripeDefaultPaymentMethodId: external_exports.string().trim().min(1).nullable()
|
|
28163
28177
|
});
|
|
28164
28178
|
var UpdateOrganizationBillingSettingsRequestSchema = external_exports.object({
|
|
28165
28179
|
spendLimitDayUsd: PositiveUsdSchema.nullable().optional(),
|
|
28166
28180
|
spendLimitMonthUsd: PositiveUsdSchema.nullable().optional(),
|
|
28167
28181
|
autoTopUpEnabled: external_exports.boolean().optional(),
|
|
28168
28182
|
autoTopUpThresholdUsd: NonNegativeUsdSchema.nullable().optional(),
|
|
28169
|
-
|
|
28183
|
+
// The top-up amount is charged to a real card, so it carries the same
|
|
28184
|
+
// bounds as a purchase: whole cents (Stripe charges integer cents; a
|
|
28185
|
+
// fractional-cent amount would make the charge and the mint disagree
|
|
28186
|
+
// forever) and the purchase floor/cap (Stripe rejects sub-$0.50 charges,
|
|
28187
|
+
// which would otherwise disarm auto-top-up on first trigger).
|
|
28188
|
+
autoTopUpAmountUsd: ChargeableUsdSchema.nullable().optional()
|
|
28170
28189
|
}).strict();
|
|
28171
28190
|
var OrganizationCreditsResponseSchema = external_exports.object({
|
|
28172
28191
|
organizationId: OrganizationIdSchema,
|
|
@@ -28179,6 +28198,14 @@ var AddOrganizationCreditsRequestSchema = external_exports.object({
|
|
|
28179
28198
|
amountUsd: PositiveUsdSchema.max(1e4),
|
|
28180
28199
|
description: external_exports.string().trim().min(1).max(500).optional()
|
|
28181
28200
|
}).strict();
|
|
28201
|
+
var ReturnPathSchema = external_exports.string().trim().min(1).max(2e3).regex(/^\/(?!\/)/, "returnPath must be an absolute in-app path");
|
|
28202
|
+
var CreateCreditPurchaseRequestSchema = external_exports.object({
|
|
28203
|
+
amountUsd: ChargeableUsdSchema,
|
|
28204
|
+
returnPath: ReturnPathSchema
|
|
28205
|
+
}).strict();
|
|
28206
|
+
var CreateBillingPortalSessionRequestSchema = external_exports.object({
|
|
28207
|
+
returnPath: ReturnPathSchema
|
|
28208
|
+
}).strict();
|
|
28182
28209
|
|
|
28183
28210
|
// ../../packages/schemas/src/pricing.ts
|
|
28184
28211
|
var RATE_CARD_2026_06_23 = {
|
|
@@ -31868,6 +31895,268 @@ triggers:
|
|
|
31868
31895
|
content: "harness: claude-code\nenvironment:\n name: agent-runtime\n image:\n kind: preset\n name: node24\n resources:\n memoryMB: 8192\n"
|
|
31869
31896
|
}
|
|
31870
31897
|
]
|
|
31898
|
+
},
|
|
31899
|
+
{
|
|
31900
|
+
version: "1.3.0",
|
|
31901
|
+
files: [
|
|
31902
|
+
{
|
|
31903
|
+
path: "agents/incident-response-slack.yaml",
|
|
31904
|
+
content: `imports:
|
|
31905
|
+
- ./incident-response.yaml
|
|
31906
|
+
systemPrompt: |
|
|
31907
|
+
You are the incident response agent for {{ $repoFullName }}. When an alert
|
|
31908
|
+
arrives, your job is fast, evidence-based triage \u2014 not heroics.
|
|
31909
|
+
|
|
31910
|
+
Investigation protocol:
|
|
31911
|
+
- Read the alert payload carefully; identify the affected service and
|
|
31912
|
+
the symptom.
|
|
31913
|
+
- Correlate with recent change: inspect the last day of commits on main
|
|
31914
|
+
in the mounted checkout (git log) and look for changes touching the
|
|
31915
|
+
affected area.
|
|
31916
|
+
- When an observability tool is available, pull the relevant logs,
|
|
31917
|
+
monitors, or metrics for the alert window before speculating.
|
|
31918
|
+
- Form a hypothesis with explicit confidence: likely cause, supporting
|
|
31919
|
+
evidence, and what would confirm or refute it.
|
|
31920
|
+
|
|
31921
|
+
Reporting protocol (Slack {{ $slackChannel }}):
|
|
31922
|
+
- Slack renders mrkdwn links: <https://url|text>.
|
|
31923
|
+
- Post one top-level message: severity, service, one-line symptom, and
|
|
31924
|
+
the alert link.
|
|
31925
|
+
- Thread the full triage under it: timeline, suspected cause with
|
|
31926
|
+
evidence, suggested next steps, and what you ruled out.
|
|
31927
|
+
- After your first reply, call auto.chat.subscribe for the thread so
|
|
31928
|
+
responder questions route back to you. Answer follow-ups in the same
|
|
31929
|
+
thread with the same evidence discipline.
|
|
31930
|
+
|
|
31931
|
+
Fix protocol (serve the fix on a platter):
|
|
31932
|
+
- When the evidence points at a specific code change with a clear,
|
|
31933
|
+
contained fix \u2014 a bad commit to revert, a config value to correct, a
|
|
31934
|
+
small patch \u2014 prepare it: create a focused branch from main in the
|
|
31935
|
+
mounted checkout, implement the minimal fix, push the branch, and open
|
|
31936
|
+
a draft pull request with create_pull_request.
|
|
31937
|
+
- The PR body states the hypothesis the fix encodes with its evidence
|
|
31938
|
+
and says how to verify it. Post the PR link in the incident thread.
|
|
31939
|
+
- Keep the fix minimal and reversible; run the repo's relevant checks
|
|
31940
|
+
when the environment allows and report what you ran. Never force a fix:
|
|
31941
|
+
when the cause is uncertain or the change would sprawl, the triage with
|
|
31942
|
+
suggested next steps is a complete deliverable on its own.
|
|
31943
|
+
|
|
31944
|
+
Hard limits: your only writes are the incident thread and the draft fix
|
|
31945
|
+
PR. Do not merge the PR, push to main, restart services, mutate
|
|
31946
|
+
infrastructure, or declare an incident resolved \u2014 humans review the fix
|
|
31947
|
+
and decide that. If the evidence is thin, say so plainly rather than
|
|
31948
|
+
manufacturing a conclusion.
|
|
31949
|
+
initialPrompt: |
|
|
31950
|
+
A production alert arrived.
|
|
31951
|
+
|
|
31952
|
+
Alert:
|
|
31953
|
+
- Title: {{title}}
|
|
31954
|
+
- Severity: {{severity}}
|
|
31955
|
+
- Service: {{service}}
|
|
31956
|
+
- Description: {{description}}
|
|
31957
|
+
- Link: {{link}}
|
|
31958
|
+
|
|
31959
|
+
Investigate following your responder instructions, then post the triage
|
|
31960
|
+
to Slack {{ $slackChannel }} and subscribe to the thread for follow-ups.
|
|
31961
|
+
If the evidence points at a clear, contained code fix, also open a draft
|
|
31962
|
+
fix PR and post the link in the thread.
|
|
31963
|
+
# The Slack variant triages in the channel, not on a GitHub issue: narrow the
|
|
31964
|
+
# base's GitHub tooling to the pull-request surface and drop the issue grant.
|
|
31965
|
+
tools:
|
|
31966
|
+
chat:
|
|
31967
|
+
kind: local
|
|
31968
|
+
implementation: chat
|
|
31969
|
+
auth:
|
|
31970
|
+
kind: connection
|
|
31971
|
+
provider: slack
|
|
31972
|
+
connection: "{{ $slackConnection }}"
|
|
31973
|
+
github:
|
|
31974
|
+
kind: github
|
|
31975
|
+
tools:
|
|
31976
|
+
- pull_request_read
|
|
31977
|
+
- create_pull_request
|
|
31978
|
+
- update_pull_request
|
|
31979
|
+
mounts:
|
|
31980
|
+
- kind: git
|
|
31981
|
+
repository: "{{ $repoFullName }}"
|
|
31982
|
+
mountPath: /workspace/repo
|
|
31983
|
+
ref: main
|
|
31984
|
+
depth: 100
|
|
31985
|
+
auth:
|
|
31986
|
+
kind: githubApp
|
|
31987
|
+
capabilities:
|
|
31988
|
+
contents: write
|
|
31989
|
+
pullRequests: write
|
|
31990
|
+
issues: none
|
|
31991
|
+
checks: read
|
|
31992
|
+
actions: read
|
|
31993
|
+
triggers:
|
|
31994
|
+
- name: mention
|
|
31995
|
+
event: chat.message.mentioned
|
|
31996
|
+
connection: "{{ $slackConnection }}"
|
|
31997
|
+
where:
|
|
31998
|
+
$.chat.provider: slack
|
|
31999
|
+
$.auto.authored: false
|
|
32000
|
+
$.auto.attributions:
|
|
32001
|
+
exists: false
|
|
32002
|
+
message: |
|
|
32003
|
+
{{message.author.userName}} mentioned you on Slack:
|
|
32004
|
+
|
|
32005
|
+
{{message.text}}
|
|
32006
|
+
|
|
32007
|
+
Channel: {{chat.channelId}}
|
|
32008
|
+
Thread: {{chat.threadId}}
|
|
32009
|
+
|
|
32010
|
+
Reply in that thread with chat.send. If the user provides alert details
|
|
32011
|
+
or clearly asks for an incident investigation, handle it. If required
|
|
32012
|
+
context is missing, ask for the alert details. Otherwise, briefly explain
|
|
32013
|
+
that you investigate production alerts, post triage to {{ $slackChannel }},
|
|
32014
|
+
open a draft fix PR when the cause is clear, and answer follow-up
|
|
32015
|
+
questions in the incident thread.
|
|
32016
|
+
routing:
|
|
32017
|
+
kind: spawn
|
|
32018
|
+
- name: thread-reply
|
|
32019
|
+
events:
|
|
32020
|
+
- chat.message.mentioned
|
|
32021
|
+
- chat.message.subscribed
|
|
32022
|
+
connection: "{{ $slackConnection }}"
|
|
32023
|
+
where:
|
|
32024
|
+
$.chat.provider: slack
|
|
32025
|
+
$.auto.authored: false
|
|
32026
|
+
$.auto.attributions:
|
|
32027
|
+
exists: true
|
|
32028
|
+
message: |
|
|
32029
|
+
{{message.author.userName}} replied in your incident thread:
|
|
32030
|
+
|
|
32031
|
+
{{message.text}}
|
|
32032
|
+
|
|
32033
|
+
Channel: {{chat.channelId}}
|
|
32034
|
+
Thread: {{chat.threadId}}
|
|
32035
|
+
|
|
32036
|
+
Answer in that thread with chat.send, keeping the evidence discipline
|
|
32037
|
+
from your instructions.
|
|
32038
|
+
routing:
|
|
32039
|
+
kind: deliver
|
|
32040
|
+
routeBy:
|
|
32041
|
+
kind: attributedSessions
|
|
32042
|
+
onUnmatched: drop
|
|
32043
|
+
`
|
|
32044
|
+
},
|
|
32045
|
+
{
|
|
32046
|
+
path: "agents/incident-response.yaml",
|
|
32047
|
+
content: `name: incident-response
|
|
32048
|
+
model:
|
|
32049
|
+
provider: anthropic
|
|
32050
|
+
id: claude-opus-4-8
|
|
32051
|
+
identity:
|
|
32052
|
+
displayName: Incident Response
|
|
32053
|
+
username: incident-response
|
|
32054
|
+
avatar:
|
|
32055
|
+
asset: .auto/assets/sentinel.png
|
|
32056
|
+
sha256: 8b8c15db5c65b19fcd81a856cc6b4c56cb64a2b6b473eedcf7159ee0e07f55ec
|
|
32057
|
+
description: First responder for production alerts - posts an evidence-based triage issue and drafts a fix PR when the cause is clear.
|
|
32058
|
+
imports:
|
|
32059
|
+
- ../fragments/environments/agent-runtime.yaml
|
|
32060
|
+
systemPrompt: |
|
|
32061
|
+
You are the incident response agent for {{ $repoFullName }}. When an alert
|
|
32062
|
+
arrives, your job is fast, evidence-based triage \u2014 not heroics.
|
|
32063
|
+
|
|
32064
|
+
Investigation protocol:
|
|
32065
|
+
- Read the alert payload carefully; identify the affected service and
|
|
32066
|
+
the symptom.
|
|
32067
|
+
- Correlate with recent change: inspect the last day of commits on main
|
|
32068
|
+
in the mounted checkout (git log) and look for changes touching the
|
|
32069
|
+
affected area.
|
|
32070
|
+
- When an observability tool is available, pull the relevant logs,
|
|
32071
|
+
monitors, or metrics for the alert window before speculating.
|
|
32072
|
+
- Form a hypothesis with explicit confidence: likely cause, supporting
|
|
32073
|
+
evidence, and what would confirm or refute it.
|
|
32074
|
+
|
|
32075
|
+
Reporting protocol (GitHub issues):
|
|
32076
|
+
- Create one GitHub issue for the incident with the issue_write tool:
|
|
32077
|
+
the title is "[severity] service: one-line symptom", and the body
|
|
32078
|
+
opens with the alert link, then the full triage \u2014 timeline, suspected
|
|
32079
|
+
cause with evidence, suggested next steps, and what you ruled out.
|
|
32080
|
+
- If material findings arrive after the issue exists, add them with
|
|
32081
|
+
add_issue_comment rather than rewriting the body, so the record stays
|
|
32082
|
+
chronological.
|
|
32083
|
+
|
|
32084
|
+
Fix protocol (serve the fix on a platter):
|
|
32085
|
+
- When the evidence points at a specific code change with a clear,
|
|
32086
|
+
contained fix \u2014 a bad commit to revert, a config value to correct, a
|
|
32087
|
+
small patch \u2014 prepare it: create a focused branch from main in the
|
|
32088
|
+
mounted checkout, implement the minimal fix, push the branch, and open
|
|
32089
|
+
a draft pull request with create_pull_request.
|
|
32090
|
+
- The PR body links the incident issue, states the hypothesis the fix
|
|
32091
|
+
encodes with its evidence, and says how to verify it. Link the PR from
|
|
32092
|
+
the incident issue with add_issue_comment.
|
|
32093
|
+
- Keep the fix minimal and reversible; run the repo's relevant checks
|
|
32094
|
+
when the environment allows and report what you ran. Never force a fix:
|
|
32095
|
+
when the cause is uncertain or the change would sprawl, the triage with
|
|
32096
|
+
suggested next steps is a complete deliverable on its own.
|
|
32097
|
+
|
|
32098
|
+
Hard limits: your only writes are the incident issue and the draft fix
|
|
32099
|
+
PR. Do not merge the PR, push to main, restart services, mutate
|
|
32100
|
+
infrastructure, or declare an incident resolved \u2014 humans review the fix
|
|
32101
|
+
and decide that. If the evidence is thin, say so plainly rather than
|
|
32102
|
+
manufacturing a conclusion.
|
|
32103
|
+
initialPrompt: |
|
|
32104
|
+
A production alert arrived.
|
|
32105
|
+
|
|
32106
|
+
Alert:
|
|
32107
|
+
- Title: {{title}}
|
|
32108
|
+
- Severity: {{severity}}
|
|
32109
|
+
- Service: {{service}}
|
|
32110
|
+
- Description: {{description}}
|
|
32111
|
+
- Link: {{link}}
|
|
32112
|
+
|
|
32113
|
+
Investigate following your responder instructions, then create the GitHub
|
|
32114
|
+
incident issue with your triage. If the evidence points at a clear,
|
|
32115
|
+
contained code fix, also open a draft fix PR and link it from the issue.
|
|
32116
|
+
mounts:
|
|
32117
|
+
- kind: git
|
|
32118
|
+
repository: "{{ $repoFullName }}"
|
|
32119
|
+
mountPath: /workspace/repo
|
|
32120
|
+
ref: main
|
|
32121
|
+
depth: 100
|
|
32122
|
+
auth:
|
|
32123
|
+
kind: githubApp
|
|
32124
|
+
capabilities:
|
|
32125
|
+
contents: write
|
|
32126
|
+
pullRequests: write
|
|
32127
|
+
issues: write
|
|
32128
|
+
checks: read
|
|
32129
|
+
actions: read
|
|
32130
|
+
workingDirectory: /workspace/repo
|
|
32131
|
+
tools:
|
|
32132
|
+
auto:
|
|
32133
|
+
kind: local
|
|
32134
|
+
implementation: auto
|
|
32135
|
+
github:
|
|
32136
|
+
kind: github
|
|
32137
|
+
tools:
|
|
32138
|
+
- issue_read
|
|
32139
|
+
- issue_write
|
|
32140
|
+
- add_issue_comment
|
|
32141
|
+
- pull_request_read
|
|
32142
|
+
- create_pull_request
|
|
32143
|
+
- update_pull_request
|
|
32144
|
+
triggers:
|
|
32145
|
+
- name: incident-webhook
|
|
32146
|
+
event: webhook.incident.opened
|
|
32147
|
+
endpoint: incident-webhook
|
|
32148
|
+
auth:
|
|
32149
|
+
kind: bearer_token
|
|
32150
|
+
secretRef: incident-webhook-secret
|
|
32151
|
+
routing:
|
|
32152
|
+
kind: spawn
|
|
32153
|
+
`
|
|
32154
|
+
},
|
|
32155
|
+
{
|
|
32156
|
+
path: "fragments/environments/agent-runtime.yaml",
|
|
32157
|
+
content: "harness: claude-code\nenvironment:\n name: agent-runtime\n image:\n kind: preset\n name: node24\n resources:\n memoryMB: 8192\n"
|
|
32158
|
+
}
|
|
32159
|
+
]
|
|
31871
32160
|
}
|
|
31872
32161
|
],
|
|
31873
32162
|
"@auto/issue-triage": [
|
|
@@ -37433,7 +37722,7 @@ var TEMPLATE_DESCRIPTIONS = {
|
|
|
37433
37722
|
"@auto/code-review": "A pull-request reviewer that posts one severity-ranked review comment and reports a check; a -slack entrypoint adds Slack verdicts.",
|
|
37434
37723
|
"@auto/daily-digest": "A scheduled read-only analyst that posts a daily shipped-code digest to a tracking issue; a -slack entrypoint posts to Slack instead.",
|
|
37435
37724
|
"@auto/handoff": "A handoff coder that takes ownership of delegated PRs or coding tasks and reports back when ready.",
|
|
37436
|
-
"@auto/incident-response": "A first responder for production alerts: investigates, posts a triage issue, and
|
|
37725
|
+
"@auto/incident-response": "A first responder for production alerts: investigates, posts a triage issue, and opens a draft fix PR when the cause is clear; -slack entrypoint for channel triage.",
|
|
37437
37726
|
"@auto/issue-triage": "Linear issue triage plus an implementation coder: label-driven triage handoffs that become focused PRs.",
|
|
37438
37727
|
"@auto/lead-engine": "An inbound-lead researcher that scores fit and drafts outreach for human approval; -slack entrypoint for a sales-channel flow.",
|
|
37439
37728
|
"@auto/onboarding": "Auto's house onboarding guidance, importable as a managed template.",
|
package/dist/index.js
CHANGED
|
@@ -19729,7 +19729,7 @@ var init_organization_settings = __esm({
|
|
|
19729
19729
|
});
|
|
19730
19730
|
|
|
19731
19731
|
// ../../packages/schemas/src/billing.ts
|
|
19732
|
-
var FEE_CARD_2026_07_06, BILLING_FEE_CARDS, CURRENT_BILLING_FEE_VERSION, CREDIT_EVENT_TYPES, CreditEventTypeSchema, UsdAmountSchema, NonNegativeUsdSchema, PositiveUsdSchema, CreditEventSchema, CreditEventRecordSchema, SPENDING_LIMIT_WINDOWS, SpendingLimitWindowSchema, BilledSpendWindowsSchema, OrganizationBillingSettingsSchema, UpdateOrganizationBillingSettingsRequestSchema, OrganizationCreditsResponseSchema, AddOrganizationCreditsRequestSchema;
|
|
19732
|
+
var FEE_CARD_2026_07_06, BILLING_FEE_CARDS, CURRENT_BILLING_FEE_VERSION, CREDIT_EVENT_TYPES, CreditEventTypeSchema, UsdAmountSchema, NonNegativeUsdSchema, PositiveUsdSchema, MIN_CREDIT_PURCHASE_USD, MAX_CREDIT_PURCHASE_USD, wholeCents, ChargeableUsdSchema, CreditEventSchema, CreditEventRecordSchema, SPENDING_LIMIT_WINDOWS, SpendingLimitWindowSchema, BilledSpendWindowsSchema, OrganizationBillingSettingsSchema, UpdateOrganizationBillingSettingsRequestSchema, OrganizationCreditsResponseSchema, AddOrganizationCreditsRequestSchema, ReturnPathSchema, CreateCreditPurchaseRequestSchema, CreateBillingPortalSessionRequestSchema;
|
|
19733
19733
|
var init_billing = __esm({
|
|
19734
19734
|
"../../packages/schemas/src/billing.ts"() {
|
|
19735
19735
|
"use strict";
|
|
@@ -19754,6 +19754,10 @@ var init_billing = __esm({
|
|
|
19754
19754
|
UsdAmountSchema = external_exports.number().finite();
|
|
19755
19755
|
NonNegativeUsdSchema = external_exports.number().finite().nonnegative();
|
|
19756
19756
|
PositiveUsdSchema = external_exports.number().finite().positive();
|
|
19757
|
+
MIN_CREDIT_PURCHASE_USD = 5;
|
|
19758
|
+
MAX_CREDIT_PURCHASE_USD = 1e4;
|
|
19759
|
+
wholeCents = (value) => Math.abs(value * 100 - Math.round(value * 100)) < 1e-6;
|
|
19760
|
+
ChargeableUsdSchema = PositiveUsdSchema.min(MIN_CREDIT_PURCHASE_USD).max(MAX_CREDIT_PURCHASE_USD).refine(wholeCents, "amount must be a whole number of cents");
|
|
19757
19761
|
CreditEventSchema = external_exports.object({
|
|
19758
19762
|
organizationId: OrganizationIdSchema,
|
|
19759
19763
|
type: CreditEventTypeSchema,
|
|
@@ -19761,7 +19765,11 @@ var init_billing = __esm({
|
|
|
19761
19765
|
description: external_exports.string().trim().min(1).nullable().default(null),
|
|
19762
19766
|
// The acting user for manual purchases/adjustments; null for system-issued
|
|
19763
19767
|
// rows (signup grants, auto-top-ups).
|
|
19764
|
-
createdByUserId: external_exports.string().trim().min(1).nullable().default(null)
|
|
19768
|
+
createdByUserId: external_exports.string().trim().min(1).nullable().default(null),
|
|
19769
|
+
// External payment reference (e.g. a Stripe payment intent id). Unique in
|
|
19770
|
+
// the ledger, so payment-driven mints are idempotent: a webhook retry or a
|
|
19771
|
+
// sync-plus-webhook race inserts once and no-ops after.
|
|
19772
|
+
externalRef: external_exports.string().trim().min(1).nullable().default(null)
|
|
19765
19773
|
}).refine(
|
|
19766
19774
|
(event) => event.type === "adjustment" || event.amountUsd > 0,
|
|
19767
19775
|
"Only adjustment credit events may carry a non-positive amount"
|
|
@@ -19773,6 +19781,7 @@ var init_billing = __esm({
|
|
|
19773
19781
|
amountUsd: UsdAmountSchema,
|
|
19774
19782
|
description: external_exports.string().trim().min(1).nullable(),
|
|
19775
19783
|
createdByUserId: external_exports.string().trim().min(1).nullable(),
|
|
19784
|
+
externalRef: external_exports.string().trim().min(1).nullable(),
|
|
19776
19785
|
createdAt: external_exports.string().datetime()
|
|
19777
19786
|
});
|
|
19778
19787
|
SPENDING_LIMIT_WINDOWS = ["day", "month"];
|
|
@@ -19790,14 +19799,24 @@ var init_billing = __esm({
|
|
|
19790
19799
|
// Balance at or below the threshold triggers a top-up of the configured
|
|
19791
19800
|
// amount. Both must be set for auto-top-up to arm.
|
|
19792
19801
|
autoTopUpThresholdUsd: NonNegativeUsdSchema.nullable(),
|
|
19793
|
-
autoTopUpAmountUsd: PositiveUsdSchema.nullable()
|
|
19802
|
+
autoTopUpAmountUsd: PositiveUsdSchema.nullable(),
|
|
19803
|
+
// Stripe linkage, set by the payment flow (never by the settings PATCH):
|
|
19804
|
+
// the org's Stripe customer, and the saved card auto-top-up charges
|
|
19805
|
+
// off-session. A non-null payment method is what "card on file" means.
|
|
19806
|
+
stripeCustomerId: external_exports.string().trim().min(1).nullable(),
|
|
19807
|
+
stripeDefaultPaymentMethodId: external_exports.string().trim().min(1).nullable()
|
|
19794
19808
|
});
|
|
19795
19809
|
UpdateOrganizationBillingSettingsRequestSchema = external_exports.object({
|
|
19796
19810
|
spendLimitDayUsd: PositiveUsdSchema.nullable().optional(),
|
|
19797
19811
|
spendLimitMonthUsd: PositiveUsdSchema.nullable().optional(),
|
|
19798
19812
|
autoTopUpEnabled: external_exports.boolean().optional(),
|
|
19799
19813
|
autoTopUpThresholdUsd: NonNegativeUsdSchema.nullable().optional(),
|
|
19800
|
-
|
|
19814
|
+
// The top-up amount is charged to a real card, so it carries the same
|
|
19815
|
+
// bounds as a purchase: whole cents (Stripe charges integer cents; a
|
|
19816
|
+
// fractional-cent amount would make the charge and the mint disagree
|
|
19817
|
+
// forever) and the purchase floor/cap (Stripe rejects sub-$0.50 charges,
|
|
19818
|
+
// which would otherwise disarm auto-top-up on first trigger).
|
|
19819
|
+
autoTopUpAmountUsd: ChargeableUsdSchema.nullable().optional()
|
|
19801
19820
|
}).strict();
|
|
19802
19821
|
OrganizationCreditsResponseSchema = external_exports.object({
|
|
19803
19822
|
organizationId: OrganizationIdSchema,
|
|
@@ -19810,6 +19829,14 @@ var init_billing = __esm({
|
|
|
19810
19829
|
amountUsd: PositiveUsdSchema.max(1e4),
|
|
19811
19830
|
description: external_exports.string().trim().min(1).max(500).optional()
|
|
19812
19831
|
}).strict();
|
|
19832
|
+
ReturnPathSchema = external_exports.string().trim().min(1).max(2e3).regex(/^\/(?!\/)/, "returnPath must be an absolute in-app path");
|
|
19833
|
+
CreateCreditPurchaseRequestSchema = external_exports.object({
|
|
19834
|
+
amountUsd: ChargeableUsdSchema,
|
|
19835
|
+
returnPath: ReturnPathSchema
|
|
19836
|
+
}).strict();
|
|
19837
|
+
CreateBillingPortalSessionRequestSchema = external_exports.object({
|
|
19838
|
+
returnPath: ReturnPathSchema
|
|
19839
|
+
}).strict();
|
|
19813
19840
|
}
|
|
19814
19841
|
});
|
|
19815
19842
|
|
|
@@ -23680,6 +23707,268 @@ triggers:
|
|
|
23680
23707
|
content: "harness: claude-code\nenvironment:\n name: agent-runtime\n image:\n kind: preset\n name: node24\n resources:\n memoryMB: 8192\n"
|
|
23681
23708
|
}
|
|
23682
23709
|
]
|
|
23710
|
+
},
|
|
23711
|
+
{
|
|
23712
|
+
version: "1.3.0",
|
|
23713
|
+
files: [
|
|
23714
|
+
{
|
|
23715
|
+
path: "agents/incident-response-slack.yaml",
|
|
23716
|
+
content: `imports:
|
|
23717
|
+
- ./incident-response.yaml
|
|
23718
|
+
systemPrompt: |
|
|
23719
|
+
You are the incident response agent for {{ $repoFullName }}. When an alert
|
|
23720
|
+
arrives, your job is fast, evidence-based triage \u2014 not heroics.
|
|
23721
|
+
|
|
23722
|
+
Investigation protocol:
|
|
23723
|
+
- Read the alert payload carefully; identify the affected service and
|
|
23724
|
+
the symptom.
|
|
23725
|
+
- Correlate with recent change: inspect the last day of commits on main
|
|
23726
|
+
in the mounted checkout (git log) and look for changes touching the
|
|
23727
|
+
affected area.
|
|
23728
|
+
- When an observability tool is available, pull the relevant logs,
|
|
23729
|
+
monitors, or metrics for the alert window before speculating.
|
|
23730
|
+
- Form a hypothesis with explicit confidence: likely cause, supporting
|
|
23731
|
+
evidence, and what would confirm or refute it.
|
|
23732
|
+
|
|
23733
|
+
Reporting protocol (Slack {{ $slackChannel }}):
|
|
23734
|
+
- Slack renders mrkdwn links: <https://url|text>.
|
|
23735
|
+
- Post one top-level message: severity, service, one-line symptom, and
|
|
23736
|
+
the alert link.
|
|
23737
|
+
- Thread the full triage under it: timeline, suspected cause with
|
|
23738
|
+
evidence, suggested next steps, and what you ruled out.
|
|
23739
|
+
- After your first reply, call auto.chat.subscribe for the thread so
|
|
23740
|
+
responder questions route back to you. Answer follow-ups in the same
|
|
23741
|
+
thread with the same evidence discipline.
|
|
23742
|
+
|
|
23743
|
+
Fix protocol (serve the fix on a platter):
|
|
23744
|
+
- When the evidence points at a specific code change with a clear,
|
|
23745
|
+
contained fix \u2014 a bad commit to revert, a config value to correct, a
|
|
23746
|
+
small patch \u2014 prepare it: create a focused branch from main in the
|
|
23747
|
+
mounted checkout, implement the minimal fix, push the branch, and open
|
|
23748
|
+
a draft pull request with create_pull_request.
|
|
23749
|
+
- The PR body states the hypothesis the fix encodes with its evidence
|
|
23750
|
+
and says how to verify it. Post the PR link in the incident thread.
|
|
23751
|
+
- Keep the fix minimal and reversible; run the repo's relevant checks
|
|
23752
|
+
when the environment allows and report what you ran. Never force a fix:
|
|
23753
|
+
when the cause is uncertain or the change would sprawl, the triage with
|
|
23754
|
+
suggested next steps is a complete deliverable on its own.
|
|
23755
|
+
|
|
23756
|
+
Hard limits: your only writes are the incident thread and the draft fix
|
|
23757
|
+
PR. Do not merge the PR, push to main, restart services, mutate
|
|
23758
|
+
infrastructure, or declare an incident resolved \u2014 humans review the fix
|
|
23759
|
+
and decide that. If the evidence is thin, say so plainly rather than
|
|
23760
|
+
manufacturing a conclusion.
|
|
23761
|
+
initialPrompt: |
|
|
23762
|
+
A production alert arrived.
|
|
23763
|
+
|
|
23764
|
+
Alert:
|
|
23765
|
+
- Title: {{title}}
|
|
23766
|
+
- Severity: {{severity}}
|
|
23767
|
+
- Service: {{service}}
|
|
23768
|
+
- Description: {{description}}
|
|
23769
|
+
- Link: {{link}}
|
|
23770
|
+
|
|
23771
|
+
Investigate following your responder instructions, then post the triage
|
|
23772
|
+
to Slack {{ $slackChannel }} and subscribe to the thread for follow-ups.
|
|
23773
|
+
If the evidence points at a clear, contained code fix, also open a draft
|
|
23774
|
+
fix PR and post the link in the thread.
|
|
23775
|
+
# The Slack variant triages in the channel, not on a GitHub issue: narrow the
|
|
23776
|
+
# base's GitHub tooling to the pull-request surface and drop the issue grant.
|
|
23777
|
+
tools:
|
|
23778
|
+
chat:
|
|
23779
|
+
kind: local
|
|
23780
|
+
implementation: chat
|
|
23781
|
+
auth:
|
|
23782
|
+
kind: connection
|
|
23783
|
+
provider: slack
|
|
23784
|
+
connection: "{{ $slackConnection }}"
|
|
23785
|
+
github:
|
|
23786
|
+
kind: github
|
|
23787
|
+
tools:
|
|
23788
|
+
- pull_request_read
|
|
23789
|
+
- create_pull_request
|
|
23790
|
+
- update_pull_request
|
|
23791
|
+
mounts:
|
|
23792
|
+
- kind: git
|
|
23793
|
+
repository: "{{ $repoFullName }}"
|
|
23794
|
+
mountPath: /workspace/repo
|
|
23795
|
+
ref: main
|
|
23796
|
+
depth: 100
|
|
23797
|
+
auth:
|
|
23798
|
+
kind: githubApp
|
|
23799
|
+
capabilities:
|
|
23800
|
+
contents: write
|
|
23801
|
+
pullRequests: write
|
|
23802
|
+
issues: none
|
|
23803
|
+
checks: read
|
|
23804
|
+
actions: read
|
|
23805
|
+
triggers:
|
|
23806
|
+
- name: mention
|
|
23807
|
+
event: chat.message.mentioned
|
|
23808
|
+
connection: "{{ $slackConnection }}"
|
|
23809
|
+
where:
|
|
23810
|
+
$.chat.provider: slack
|
|
23811
|
+
$.auto.authored: false
|
|
23812
|
+
$.auto.attributions:
|
|
23813
|
+
exists: false
|
|
23814
|
+
message: |
|
|
23815
|
+
{{message.author.userName}} mentioned you on Slack:
|
|
23816
|
+
|
|
23817
|
+
{{message.text}}
|
|
23818
|
+
|
|
23819
|
+
Channel: {{chat.channelId}}
|
|
23820
|
+
Thread: {{chat.threadId}}
|
|
23821
|
+
|
|
23822
|
+
Reply in that thread with chat.send. If the user provides alert details
|
|
23823
|
+
or clearly asks for an incident investigation, handle it. If required
|
|
23824
|
+
context is missing, ask for the alert details. Otherwise, briefly explain
|
|
23825
|
+
that you investigate production alerts, post triage to {{ $slackChannel }},
|
|
23826
|
+
open a draft fix PR when the cause is clear, and answer follow-up
|
|
23827
|
+
questions in the incident thread.
|
|
23828
|
+
routing:
|
|
23829
|
+
kind: spawn
|
|
23830
|
+
- name: thread-reply
|
|
23831
|
+
events:
|
|
23832
|
+
- chat.message.mentioned
|
|
23833
|
+
- chat.message.subscribed
|
|
23834
|
+
connection: "{{ $slackConnection }}"
|
|
23835
|
+
where:
|
|
23836
|
+
$.chat.provider: slack
|
|
23837
|
+
$.auto.authored: false
|
|
23838
|
+
$.auto.attributions:
|
|
23839
|
+
exists: true
|
|
23840
|
+
message: |
|
|
23841
|
+
{{message.author.userName}} replied in your incident thread:
|
|
23842
|
+
|
|
23843
|
+
{{message.text}}
|
|
23844
|
+
|
|
23845
|
+
Channel: {{chat.channelId}}
|
|
23846
|
+
Thread: {{chat.threadId}}
|
|
23847
|
+
|
|
23848
|
+
Answer in that thread with chat.send, keeping the evidence discipline
|
|
23849
|
+
from your instructions.
|
|
23850
|
+
routing:
|
|
23851
|
+
kind: deliver
|
|
23852
|
+
routeBy:
|
|
23853
|
+
kind: attributedSessions
|
|
23854
|
+
onUnmatched: drop
|
|
23855
|
+
`
|
|
23856
|
+
},
|
|
23857
|
+
{
|
|
23858
|
+
path: "agents/incident-response.yaml",
|
|
23859
|
+
content: `name: incident-response
|
|
23860
|
+
model:
|
|
23861
|
+
provider: anthropic
|
|
23862
|
+
id: claude-opus-4-8
|
|
23863
|
+
identity:
|
|
23864
|
+
displayName: Incident Response
|
|
23865
|
+
username: incident-response
|
|
23866
|
+
avatar:
|
|
23867
|
+
asset: .auto/assets/sentinel.png
|
|
23868
|
+
sha256: 8b8c15db5c65b19fcd81a856cc6b4c56cb64a2b6b473eedcf7159ee0e07f55ec
|
|
23869
|
+
description: First responder for production alerts - posts an evidence-based triage issue and drafts a fix PR when the cause is clear.
|
|
23870
|
+
imports:
|
|
23871
|
+
- ../fragments/environments/agent-runtime.yaml
|
|
23872
|
+
systemPrompt: |
|
|
23873
|
+
You are the incident response agent for {{ $repoFullName }}. When an alert
|
|
23874
|
+
arrives, your job is fast, evidence-based triage \u2014 not heroics.
|
|
23875
|
+
|
|
23876
|
+
Investigation protocol:
|
|
23877
|
+
- Read the alert payload carefully; identify the affected service and
|
|
23878
|
+
the symptom.
|
|
23879
|
+
- Correlate with recent change: inspect the last day of commits on main
|
|
23880
|
+
in the mounted checkout (git log) and look for changes touching the
|
|
23881
|
+
affected area.
|
|
23882
|
+
- When an observability tool is available, pull the relevant logs,
|
|
23883
|
+
monitors, or metrics for the alert window before speculating.
|
|
23884
|
+
- Form a hypothesis with explicit confidence: likely cause, supporting
|
|
23885
|
+
evidence, and what would confirm or refute it.
|
|
23886
|
+
|
|
23887
|
+
Reporting protocol (GitHub issues):
|
|
23888
|
+
- Create one GitHub issue for the incident with the issue_write tool:
|
|
23889
|
+
the title is "[severity] service: one-line symptom", and the body
|
|
23890
|
+
opens with the alert link, then the full triage \u2014 timeline, suspected
|
|
23891
|
+
cause with evidence, suggested next steps, and what you ruled out.
|
|
23892
|
+
- If material findings arrive after the issue exists, add them with
|
|
23893
|
+
add_issue_comment rather than rewriting the body, so the record stays
|
|
23894
|
+
chronological.
|
|
23895
|
+
|
|
23896
|
+
Fix protocol (serve the fix on a platter):
|
|
23897
|
+
- When the evidence points at a specific code change with a clear,
|
|
23898
|
+
contained fix \u2014 a bad commit to revert, a config value to correct, a
|
|
23899
|
+
small patch \u2014 prepare it: create a focused branch from main in the
|
|
23900
|
+
mounted checkout, implement the minimal fix, push the branch, and open
|
|
23901
|
+
a draft pull request with create_pull_request.
|
|
23902
|
+
- The PR body links the incident issue, states the hypothesis the fix
|
|
23903
|
+
encodes with its evidence, and says how to verify it. Link the PR from
|
|
23904
|
+
the incident issue with add_issue_comment.
|
|
23905
|
+
- Keep the fix minimal and reversible; run the repo's relevant checks
|
|
23906
|
+
when the environment allows and report what you ran. Never force a fix:
|
|
23907
|
+
when the cause is uncertain or the change would sprawl, the triage with
|
|
23908
|
+
suggested next steps is a complete deliverable on its own.
|
|
23909
|
+
|
|
23910
|
+
Hard limits: your only writes are the incident issue and the draft fix
|
|
23911
|
+
PR. Do not merge the PR, push to main, restart services, mutate
|
|
23912
|
+
infrastructure, or declare an incident resolved \u2014 humans review the fix
|
|
23913
|
+
and decide that. If the evidence is thin, say so plainly rather than
|
|
23914
|
+
manufacturing a conclusion.
|
|
23915
|
+
initialPrompt: |
|
|
23916
|
+
A production alert arrived.
|
|
23917
|
+
|
|
23918
|
+
Alert:
|
|
23919
|
+
- Title: {{title}}
|
|
23920
|
+
- Severity: {{severity}}
|
|
23921
|
+
- Service: {{service}}
|
|
23922
|
+
- Description: {{description}}
|
|
23923
|
+
- Link: {{link}}
|
|
23924
|
+
|
|
23925
|
+
Investigate following your responder instructions, then create the GitHub
|
|
23926
|
+
incident issue with your triage. If the evidence points at a clear,
|
|
23927
|
+
contained code fix, also open a draft fix PR and link it from the issue.
|
|
23928
|
+
mounts:
|
|
23929
|
+
- kind: git
|
|
23930
|
+
repository: "{{ $repoFullName }}"
|
|
23931
|
+
mountPath: /workspace/repo
|
|
23932
|
+
ref: main
|
|
23933
|
+
depth: 100
|
|
23934
|
+
auth:
|
|
23935
|
+
kind: githubApp
|
|
23936
|
+
capabilities:
|
|
23937
|
+
contents: write
|
|
23938
|
+
pullRequests: write
|
|
23939
|
+
issues: write
|
|
23940
|
+
checks: read
|
|
23941
|
+
actions: read
|
|
23942
|
+
workingDirectory: /workspace/repo
|
|
23943
|
+
tools:
|
|
23944
|
+
auto:
|
|
23945
|
+
kind: local
|
|
23946
|
+
implementation: auto
|
|
23947
|
+
github:
|
|
23948
|
+
kind: github
|
|
23949
|
+
tools:
|
|
23950
|
+
- issue_read
|
|
23951
|
+
- issue_write
|
|
23952
|
+
- add_issue_comment
|
|
23953
|
+
- pull_request_read
|
|
23954
|
+
- create_pull_request
|
|
23955
|
+
- update_pull_request
|
|
23956
|
+
triggers:
|
|
23957
|
+
- name: incident-webhook
|
|
23958
|
+
event: webhook.incident.opened
|
|
23959
|
+
endpoint: incident-webhook
|
|
23960
|
+
auth:
|
|
23961
|
+
kind: bearer_token
|
|
23962
|
+
secretRef: incident-webhook-secret
|
|
23963
|
+
routing:
|
|
23964
|
+
kind: spawn
|
|
23965
|
+
`
|
|
23966
|
+
},
|
|
23967
|
+
{
|
|
23968
|
+
path: "fragments/environments/agent-runtime.yaml",
|
|
23969
|
+
content: "harness: claude-code\nenvironment:\n name: agent-runtime\n image:\n kind: preset\n name: node24\n resources:\n memoryMB: 8192\n"
|
|
23970
|
+
}
|
|
23971
|
+
]
|
|
23683
23972
|
}
|
|
23684
23973
|
],
|
|
23685
23974
|
"@auto/issue-triage": [
|
|
@@ -29276,7 +29565,7 @@ var init_hardcoded = __esm({
|
|
|
29276
29565
|
"@auto/code-review": "A pull-request reviewer that posts one severity-ranked review comment and reports a check; a -slack entrypoint adds Slack verdicts.",
|
|
29277
29566
|
"@auto/daily-digest": "A scheduled read-only analyst that posts a daily shipped-code digest to a tracking issue; a -slack entrypoint posts to Slack instead.",
|
|
29278
29567
|
"@auto/handoff": "A handoff coder that takes ownership of delegated PRs or coding tasks and reports back when ready.",
|
|
29279
|
-
"@auto/incident-response": "A first responder for production alerts: investigates, posts a triage issue, and
|
|
29568
|
+
"@auto/incident-response": "A first responder for production alerts: investigates, posts a triage issue, and opens a draft fix PR when the cause is clear; -slack entrypoint for channel triage.",
|
|
29280
29569
|
"@auto/issue-triage": "Linear issue triage plus an implementation coder: label-driven triage handoffs that become focused PRs.",
|
|
29281
29570
|
"@auto/lead-engine": "An inbound-lead researcher that scores fit and drafts outreach for human approval; -slack entrypoint for a sales-channel flow.",
|
|
29282
29571
|
"@auto/onboarding": "Auto's house onboarding guidance, importable as a managed template.",
|
|
@@ -32356,7 +32645,7 @@ var init_package = __esm({
|
|
|
32356
32645
|
"package.json"() {
|
|
32357
32646
|
package_default = {
|
|
32358
32647
|
name: "@autohq/cli",
|
|
32359
|
-
version: "0.1.
|
|
32648
|
+
version: "0.1.380",
|
|
32360
32649
|
license: "SEE LICENSE IN README.md",
|
|
32361
32650
|
publishConfig: {
|
|
32362
32651
|
access: "public"
|