@wraps.dev/cli 2.30.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -14
- package/dist/cli.js +16266 -17099
- package/dist/cli.js.map +1 -1
- package/dist/console/assets/index-Cv-QsoKP.css +1 -0
- package/dist/console/assets/index-D-ml23Id.js +127 -0
- package/dist/console/assets/{index-C6gZtoa3.js → index-OqgjYuh3.js} +1 -1
- package/dist/console/assets/{optimizer.worker-DZcD7Kza.js → optimizer.worker-Cjnw_FT2.js} +1 -1
- package/dist/console/assets/{webp_enc_simd-D5IXDjAy.js → webp_enc_simd-0PCv9qCn.js} +2 -2
- package/dist/console/index.html +2 -2
- package/dist/lambda/agent-enforcer/.bundled +1 -1
- package/dist/lambda/agent-enforcer/index.js +16 -3
- package/dist/lambda/event-processor/.bundled +1 -1
- package/dist/lambda/event-processor/index.js +16 -3
- package/dist/lambda/inbound-processor/.bundled +1 -1
- package/dist/lambda/inbound-processor/index.js +66 -53
- package/dist/lambda/sms-event-processor/.bundled +1 -1
- package/dist/lambda/sms-event-processor/index.js +16 -3
- package/package.json +7 -7
- package/dist/api-lambda.zip +0 -0
- package/dist/console/assets/index-BP4FpEpn.css +0 -1
- package/dist/console/assets/index-P0x5JCC4.js +0 -127
- package/dist/selfhost-migrations/0000_absent_rogue.sql +0 -203
- package/dist/selfhost-migrations/0001_polite_maverick.sql +0 -17
- package/dist/selfhost-migrations/0002_perpetual_scorpion.sql +0 -1
- package/dist/selfhost-migrations/0003_wealthy_absorbing_man.sql +0 -1
- package/dist/selfhost-migrations/0004_opposite_blur.sql +0 -1
- package/dist/selfhost-migrations/0005_clear_terror.sql +0 -4
- package/dist/selfhost-migrations/0006_soft_black_widow.sql +0 -20
- package/dist/selfhost-migrations/0007_dazzling_saracen.sql +0 -124
- package/dist/selfhost-migrations/0008_broad_hannibal_king.sql +0 -33
- package/dist/selfhost-migrations/0009_bouncy_mystique.sql +0 -73
- package/dist/selfhost-migrations/0010_cheerful_valeria_richards.sql +0 -18
- package/dist/selfhost-migrations/0011_absent_thunderbolts.sql +0 -2
- package/dist/selfhost-migrations/0012_demonic_donald_blake.sql +0 -1
- package/dist/selfhost-migrations/0013_nifty_preak.sql +0 -143
- package/dist/selfhost-migrations/0014_hesitant_beast.sql +0 -2
- package/dist/selfhost-migrations/0015_blue_giant_girl.sql +0 -1
- package/dist/selfhost-migrations/0016_cooing_overlord.sql +0 -1
- package/dist/selfhost-migrations/0017_tranquil_ender_wiggin.sql +0 -11
- package/dist/selfhost-migrations/0018_talented_groot.sql +0 -8
- package/dist/selfhost-migrations/0019_ambitious_devos.sql +0 -3
- package/dist/selfhost-migrations/0020_misty_master_mold.sql +0 -95
- package/dist/selfhost-migrations/0021_regular_harrier.sql +0 -14
- package/dist/selfhost-migrations/0022_sour_blizzard.sql +0 -10
- package/dist/selfhost-migrations/0023_flawless_psynapse.sql +0 -1
- package/dist/selfhost-migrations/0024_premium_blindfold.sql +0 -1
- package/dist/selfhost-migrations/0025_unusual_santa_claus.sql +0 -1
- package/dist/selfhost-migrations/0026_volatile_pandemic.sql +0 -2
- package/dist/selfhost-migrations/0027_workable_logan.sql +0 -4
- package/dist/selfhost-migrations/0028_familiar_prodigy.sql +0 -1
- package/dist/selfhost-migrations/0029_cute_maddog.sql +0 -13
- package/dist/selfhost-migrations/0030_adorable_scarecrow.sql +0 -1
- package/dist/selfhost-migrations/0031_material_slapstick.sql +0 -10
- package/dist/selfhost-migrations/0032_hot_dust.sql +0 -11
- package/dist/selfhost-migrations/0033_slow_deathbird.sql +0 -1
- package/dist/selfhost-migrations/0034_lush_rafael_vega.sql +0 -12
- package/dist/selfhost-migrations/0035_normal_red_hulk.sql +0 -8
- package/dist/selfhost-migrations/0036_marvelous_ezekiel.sql +0 -1
- package/dist/selfhost-migrations/0037_swift_talisman.sql +0 -8
- package/dist/selfhost-migrations/0038_first_mandroid.sql +0 -1
- package/dist/selfhost-migrations/0039_fixed_stryfe.sql +0 -1
- package/dist/selfhost-migrations/0040_add_channel_check_constraints.sql +0 -2
- package/dist/selfhost-migrations/0041_black_spencer_smythe.sql +0 -1
- package/dist/selfhost-migrations/0042_plain_marvel_zombies.sql +0 -2
- package/dist/selfhost-migrations/0043_curved_champions.sql +0 -1
- package/dist/selfhost-migrations/0044_clean_iceman.sql +0 -1
- package/dist/selfhost-migrations/0045_condemned_steel_serpent.sql +0 -1
- package/dist/selfhost-migrations/0046_steep_ultimo.sql +0 -2
- package/dist/selfhost-migrations/0047_empty_sleepwalker.sql +0 -2
- package/dist/selfhost-migrations/0048_cheerful_multiple_man.sql +0 -1
- package/dist/selfhost-migrations/0049_nostalgic_loki.sql +0 -3
- package/dist/selfhost-migrations/0050_add_engagement_metadata.sql +0 -4
- package/dist/selfhost-migrations/0051_odd_marrow.sql +0 -2
- package/dist/selfhost-migrations/0052_redundant_siren.sql +0 -5
- package/dist/selfhost-migrations/0053_soft_carnage.sql +0 -31
- package/dist/selfhost-migrations/0054_blushing_vin_gonzales.sql +0 -1
- package/dist/selfhost-migrations/0055_broadcast_resume_columns.sql +0 -12
- package/dist/selfhost-migrations/0056_broadcast_resume_dedup_cleanup.sql +0 -31
- package/dist/selfhost-migrations/0057_audit_log_actoremail_jsonb.sql +0 -5
- package/dist/selfhost-migrations/0058_email_log_sent_at_idx.sql +0 -1
- package/dist/selfhost-migrations/0059_message_send_claimed_at.sql +0 -1
- package/dist/selfhost-migrations/0060_harsh_nehzno.sql +0 -1
- package/dist/selfhost-migrations/0061_flashy_spirit.sql +0 -1
- package/dist/selfhost-migrations/0062_next_timeslip.sql +0 -2
- package/dist/selfhost-migrations/0063_greedy_legion.sql +0 -17
- package/dist/selfhost-migrations/0064_wise_brood.sql +0 -42
- package/dist/selfhost-migrations/0065_public_the_fallen.sql +0 -2
- package/dist/selfhost-migrations/0066_odd_yellow_claw.sql +0 -3
- package/dist/selfhost-migrations/0067_empty_ultimo.sql +0 -1
- package/dist/selfhost-migrations/0068_abandoned_mephisto.sql +0 -1
- package/dist/selfhost-migrations/0069_abnormal_zuras.sql +0 -1
- package/dist/selfhost-migrations/CLAUDE.md +0 -49
- package/dist/selfhost-migrations/meta/0000_snapshot.json +0 -1311
- package/dist/selfhost-migrations/meta/0001_snapshot.json +0 -1454
- package/dist/selfhost-migrations/meta/0002_snapshot.json +0 -1460
- package/dist/selfhost-migrations/meta/0003_snapshot.json +0 -1467
- package/dist/selfhost-migrations/meta/0004_snapshot.json +0 -1473
- package/dist/selfhost-migrations/meta/0005_snapshot.json +0 -1499
- package/dist/selfhost-migrations/meta/0006_snapshot.json +0 -1617
- package/dist/selfhost-migrations/meta/0007_snapshot.json +0 -2581
- package/dist/selfhost-migrations/meta/0008_snapshot.json +0 -2861
- package/dist/selfhost-migrations/meta/0009_snapshot.json +0 -3447
- package/dist/selfhost-migrations/meta/0010_snapshot.json +0 -3586
- package/dist/selfhost-migrations/meta/0011_snapshot.json +0 -3600
- package/dist/selfhost-migrations/meta/0012_snapshot.json +0 -3607
- package/dist/selfhost-migrations/meta/0013_snapshot.json +0 -4697
- package/dist/selfhost-migrations/meta/0014_snapshot.json +0 -4704
- package/dist/selfhost-migrations/meta/0015_snapshot.json +0 -4697
- package/dist/selfhost-migrations/meta/0016_snapshot.json +0 -4703
- package/dist/selfhost-migrations/meta/0017_snapshot.json +0 -4769
- package/dist/selfhost-migrations/meta/0018_snapshot.json +0 -4821
- package/dist/selfhost-migrations/meta/0019_snapshot.json +0 -4840
- package/dist/selfhost-migrations/meta/0020_snapshot.json +0 -5602
- package/dist/selfhost-migrations/meta/0021_snapshot.json +0 -5729
- package/dist/selfhost-migrations/meta/0022_snapshot.json +0 -5792
- package/dist/selfhost-migrations/meta/0023_snapshot.json +0 -5799
- package/dist/selfhost-migrations/meta/0024_snapshot.json +0 -5821
- package/dist/selfhost-migrations/meta/0025_snapshot.json +0 -5831
- package/dist/selfhost-migrations/meta/0026_snapshot.json +0 -5844
- package/dist/selfhost-migrations/meta/0027_snapshot.json +0 -5864
- package/dist/selfhost-migrations/meta/0028_snapshot.json +0 -5871
- package/dist/selfhost-migrations/meta/0029_snapshot.json +0 -5984
- package/dist/selfhost-migrations/meta/0030_snapshot.json +0 -5990
- package/dist/selfhost-migrations/meta/0031_snapshot.json +0 -5950
- package/dist/selfhost-migrations/meta/0032_snapshot.json +0 -6042
- package/dist/selfhost-migrations/meta/0033_snapshot.json +0 -6057
- package/dist/selfhost-migrations/meta/0034_snapshot.json +0 -6130
- package/dist/selfhost-migrations/meta/0035_snapshot.json +0 -6195
- package/dist/selfhost-migrations/meta/0036_snapshot.json +0 -6201
- package/dist/selfhost-migrations/meta/0037_snapshot.json +0 -6265
- package/dist/selfhost-migrations/meta/0038_snapshot.json +0 -6271
- package/dist/selfhost-migrations/meta/0039_snapshot.json +0 -6278
- package/dist/selfhost-migrations/meta/0041_snapshot.json +0 -6284
- package/dist/selfhost-migrations/meta/0042_snapshot.json +0 -6297
- package/dist/selfhost-migrations/meta/0043_snapshot.json +0 -6297
- package/dist/selfhost-migrations/meta/0044_snapshot.json +0 -6297
- package/dist/selfhost-migrations/meta/0045_snapshot.json +0 -6303
- package/dist/selfhost-migrations/meta/0046_snapshot.json +0 -6315
- package/dist/selfhost-migrations/meta/0047_snapshot.json +0 -6330
- package/dist/selfhost-migrations/meta/0048_snapshot.json +0 -6336
- package/dist/selfhost-migrations/meta/0049_snapshot.json +0 -6366
- package/dist/selfhost-migrations/meta/0050_snapshot.json +0 -6390
- package/dist/selfhost-migrations/meta/0051_snapshot.json +0 -6403
- package/dist/selfhost-migrations/meta/0052_snapshot.json +0 -6470
- package/dist/selfhost-migrations/meta/0053_snapshot.json +0 -6470
- package/dist/selfhost-migrations/meta/0054_snapshot.json +0 -6646
- package/dist/selfhost-migrations/meta/0055_snapshot.json +0 -6713
- package/dist/selfhost-migrations/meta/0056_snapshot.json +0 -6713
- package/dist/selfhost-migrations/meta/0057_snapshot.json +0 -6731
- package/dist/selfhost-migrations/meta/0059_snapshot.json +0 -6764
- package/dist/selfhost-migrations/meta/0060_snapshot.json +0 -7125
- package/dist/selfhost-migrations/meta/0061_snapshot.json +0 -7131
- package/dist/selfhost-migrations/meta/0062_snapshot.json +0 -7143
- package/dist/selfhost-migrations/meta/0063_snapshot.json +0 -7282
- package/dist/selfhost-migrations/meta/0064_snapshot.json +0 -7626
- package/dist/selfhost-migrations/meta/0065_snapshot.json +0 -7662
- package/dist/selfhost-migrations/meta/0066_snapshot.json +0 -7682
- package/dist/selfhost-migrations/meta/0067_snapshot.json +0 -7688
- package/dist/selfhost-migrations/meta/0068_snapshot.json +0 -7694
- package/dist/selfhost-migrations/meta/0069_snapshot.json +0 -7700
- package/dist/selfhost-migrations/meta/_journal.json +0 -496
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
CREATE TABLE "notification" (
|
|
2
|
-
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
-
"user_id" text NOT NULL,
|
|
4
|
-
"organization_id" text,
|
|
5
|
-
"type" text NOT NULL,
|
|
6
|
-
"title" text NOT NULL,
|
|
7
|
-
"body" text,
|
|
8
|
-
"href" text,
|
|
9
|
-
"data" jsonb,
|
|
10
|
-
"read" boolean DEFAULT false NOT NULL,
|
|
11
|
-
"created_at" timestamp DEFAULT now() NOT NULL
|
|
12
|
-
);
|
|
13
|
-
--> statement-breakpoint
|
|
14
|
-
ALTER TABLE "notification" ADD CONSTRAINT "notification_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
15
|
-
ALTER TABLE "notification" ADD CONSTRAINT "notification_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
16
|
-
CREATE INDEX "notification_org_idx" ON "notification" USING btree ("organization_id");--> statement-breakpoint
|
|
17
|
-
CREATE INDEX "notification_user_read_idx" ON "notification" USING btree ("user_id","read");
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
CREATE TYPE "public"."agent_approval_status" AS ENUM('PENDING', 'APPROVED', 'REJECTED', 'SENT', 'FAILED');--> statement-breakpoint
|
|
2
|
-
CREATE TYPE "public"."agent_status" AS ENUM('ACTIVE', 'KILLED');--> statement-breakpoint
|
|
3
|
-
CREATE TABLE "agent" (
|
|
4
|
-
"id" text PRIMARY KEY NOT NULL,
|
|
5
|
-
"organization_id" text NOT NULL,
|
|
6
|
-
"name" text NOT NULL,
|
|
7
|
-
"email_address" text NOT NULL,
|
|
8
|
-
"domain" text NOT NULL,
|
|
9
|
-
"status" "agent_status" DEFAULT 'ACTIVE' NOT NULL,
|
|
10
|
-
"policy" jsonb NOT NULL,
|
|
11
|
-
"credential_user_arn" text,
|
|
12
|
-
"enforcer_function_arn" text,
|
|
13
|
-
"aws_account_id" text,
|
|
14
|
-
"created_by" text,
|
|
15
|
-
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
16
|
-
"updated_at" timestamp DEFAULT now() NOT NULL
|
|
17
|
-
);
|
|
18
|
-
--> statement-breakpoint
|
|
19
|
-
CREATE TABLE "agent_approval_queue" (
|
|
20
|
-
"id" text PRIMARY KEY NOT NULL,
|
|
21
|
-
"organization_id" text NOT NULL,
|
|
22
|
-
"agent_id" text NOT NULL,
|
|
23
|
-
"payload" jsonb NOT NULL,
|
|
24
|
-
"reason" text,
|
|
25
|
-
"status" "agent_approval_status" DEFAULT 'PENDING' NOT NULL,
|
|
26
|
-
"decided_by" text,
|
|
27
|
-
"decided_at" timestamp,
|
|
28
|
-
"message_id" text,
|
|
29
|
-
"error_message" text,
|
|
30
|
-
"created_at" timestamp DEFAULT now() NOT NULL,
|
|
31
|
-
"updated_at" timestamp DEFAULT now() NOT NULL
|
|
32
|
-
);
|
|
33
|
-
--> statement-breakpoint
|
|
34
|
-
ALTER TABLE "agent" ADD CONSTRAINT "agent_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
35
|
-
ALTER TABLE "agent" ADD CONSTRAINT "agent_created_by_user_id_fk" FOREIGN KEY ("created_by") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
36
|
-
ALTER TABLE "agent_approval_queue" ADD CONSTRAINT "agent_approval_queue_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
37
|
-
ALTER TABLE "agent_approval_queue" ADD CONSTRAINT "agent_approval_queue_agent_id_agent_id_fk" FOREIGN KEY ("agent_id") REFERENCES "public"."agent"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
38
|
-
ALTER TABLE "agent_approval_queue" ADD CONSTRAINT "agent_approval_queue_decided_by_user_id_fk" FOREIGN KEY ("decided_by") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
|
|
39
|
-
CREATE INDEX "agent_org_idx" ON "agent" USING btree ("organization_id");--> statement-breakpoint
|
|
40
|
-
CREATE UNIQUE INDEX "agent_unique_org_name_idx" ON "agent" USING btree ("organization_id","name");--> statement-breakpoint
|
|
41
|
-
CREATE INDEX "agent_approval_queue_org_idx" ON "agent_approval_queue" USING btree ("organization_id");--> statement-breakpoint
|
|
42
|
-
CREATE INDEX "agent_approval_queue_org_status_idx" ON "agent_approval_queue" USING btree ("organization_id","status");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ALTER TABLE "ai_usage_log" ADD COLUMN "cached_input_tokens" integer;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ALTER TABLE "topic_settings" ADD COLUMN "preference_center_theme" jsonb;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ALTER TABLE "aws_account" ADD COLUMN "daily_quota_reserve" integer;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Migrations — Rules for Agents
|
|
2
|
-
|
|
3
|
-
Everything in this directory is owned by drizzle-kit. Read this before
|
|
4
|
-
editing anything here.
|
|
5
|
-
|
|
6
|
-
## Hard rules
|
|
7
|
-
|
|
8
|
-
1. **Never hand-edit or hand-create files under `meta/`** (`*_snapshot.json`,
|
|
9
|
-
`_journal.json`). They are machine-generated. Hand-edited snapshots broke
|
|
10
|
-
`db:generate` repo-wide for migrations 0055–0059 (see
|
|
11
|
-
`plans/018-repair-drizzle-snapshot-chain.md`): index `columns` were
|
|
12
|
-
encoded as strings where drizzle's v7 schema requires objects, and every
|
|
13
|
-
later migration had to be hand-written as a workaround.
|
|
14
|
-
2. **Never hand-write migration SQL plus journal entries to bypass a broken
|
|
15
|
-
`db:generate`.** Fix the generator instead (playbook below).
|
|
16
|
-
3. **Do not run formatters here.** `meta/` is excluded from Biome
|
|
17
|
-
(`biome.jsonc`); drizzle-kit's raw output is canonical. Snapshots
|
|
18
|
-
0000–0059 predate the exclusion and are Biome-styled — leave them as
|
|
19
|
-
they are.
|
|
20
|
-
4. **Snapshot gaps are normal.** 0040 and 0058 have journal+SQL but no
|
|
21
|
-
snapshot; drizzle tolerates gaps. Never backfill a missing snapshot.
|
|
22
|
-
|
|
23
|
-
## If `db:generate` fails with "data is malformed"
|
|
24
|
-
|
|
25
|
-
1. Probe (offline, read-only, no DB needed):
|
|
26
|
-
`cd packages/db && npx drizzle-kit check`
|
|
27
|
-
Healthy: `Everything's fine 🐶🔥`. Broken: one `data is malformed` line
|
|
28
|
-
per bad snapshot.
|
|
29
|
-
2. The usual cause is hand-edited snapshot JSON that fails drizzle's zod
|
|
30
|
-
schema — e.g. index `columns` entries as `"col"` strings instead of
|
|
31
|
-
`{ "expression": "col", "isExpression": false, "asc": true, "nulls": "last" }`
|
|
32
|
-
objects.
|
|
33
|
-
3. Repair the encoding in the named files — change nothing else (not `id`,
|
|
34
|
-
not `prevId`) — and re-run the probe.
|
|
35
|
-
`plans/018-repair-drizzle-snapshot-chain.md` is the worked example of a
|
|
36
|
-
full repair, including how to regenerate a tip snapshot safely.
|
|
37
|
-
|
|
38
|
-
## Manual SQL (e.g. CREATE INDEX CONCURRENTLY)
|
|
39
|
-
|
|
40
|
-
Do not bypass drizzle. Follow the out-of-band pattern in
|
|
41
|
-
`packages/db/CLAUDE.md` → "CONCURRENT Indexes": declare the index in
|
|
42
|
-
`schema/*.ts` as the source of truth, strip the statement from the generated
|
|
43
|
-
migration SQL, and create the index via a script under
|
|
44
|
-
`packages/db/scripts/`.
|
|
45
|
-
|
|
46
|
-
## Normal workflow
|
|
47
|
-
|
|
48
|
-
Edit `packages/db/src/schema/*.ts` → `pnpm --filter @wraps/db db:generate`
|
|
49
|
-
→ review the generated SQL → commit schema + SQL + meta together.
|