bazilion 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +607 -96
- package/dist/cli.js.map +1 -1
- package/dist/daemon.js +3225 -739
- package/dist/daemon.js.map +1 -1
- package/dist/migrations/0001_init.sql +142 -3
- package/dist/web/client/assets/{ChatPane-CAYS_fIQ.js → ChatPane-DCyGcqdh.js} +1 -1
- package/dist/web/client/assets/ConfirmDialog-C908TxS5.js +1 -0
- package/dist/web/client/assets/{FieldRow-W_54rw5c.js → FieldRow-CELqI-1V.js} +1 -1
- package/dist/web/client/assets/{ProductionTeamPolicyEditor-DNXVX8Lz.js → ProductionTeamPolicyEditor-DnTcWhG8.js} +1 -1
- package/dist/web/client/assets/{ProfileCommunicationEditor-DN0fOzqn.js → ProfileCommunicationEditor-BVIEaW3s.js} +1 -1
- package/dist/web/client/assets/{ResultSourceConversation-DoU4tOWc.js → ResultSourceConversation-4gbZCh_s.js} +1 -1
- package/dist/web/client/assets/{TeamTabs-BmTZRI4T.js → TeamTabs-V17b45X5.js} +1 -1
- package/dist/web/client/assets/{TemplatesTabs-Bs_OXKwx.js → TemplatesTabs-BMK3Qok_.js} +1 -1
- package/dist/web/client/assets/{UnsavedChangesGuard-CPRtFReU.js → UnsavedChangesGuard-BaE-UzyS.js} +1 -1
- package/dist/web/client/assets/{_id-Dbmei5tg.js → _id-BU1l9gP7.js} +1 -1
- package/dist/web/client/assets/{_id-DL4tJFQB.js → _id-BVANQm00.js} +1 -1
- package/dist/web/client/assets/{_id-DR9eFC17.js → _id-Bvh5LyUv.js} +1 -1
- package/dist/web/client/assets/{_id-ybF-pqmr.js → _id-CArZR-IO.js} +1 -1
- package/dist/web/client/assets/{_id-CxAB4TDr.js → _id-tUkSe5li.js} +1 -1
- package/dist/web/client/assets/{activity-oUyy77jD.js → activity-CWCnqjqj.js} +1 -1
- package/dist/web/client/assets/{agents-DkjJp7JP.js → agents-CX4STmGK.js} +1 -1
- package/dist/web/client/assets/{agents-D_TrEqAg.js → agents-CdCnhH06.js} +1 -1
- package/dist/web/client/assets/{approvals-DhOerWdt.js → approvals-CnNpwG78.js} +1 -1
- package/dist/web/client/assets/{attention-DGwiF-Jy.js → attention-CEE-wWrx.js} +1 -1
- package/dist/web/client/assets/chevron-right-CvCEwfSl.js +1 -0
- package/dist/web/client/assets/{config-BJ2ZzHPR.js → config-CSEtI-dq.js} +1 -1
- package/dist/web/client/assets/{inbox-BUElnGep.js → inbox-MYnBtPdF.js} +1 -1
- package/dist/web/client/assets/index-Ct31TjS-.js +52 -0
- package/dist/web/client/assets/{learning-BiTHNwB3.js → learning-BIR5FTgQ.js} +1 -1
- package/dist/web/client/assets/{login-BmcZvAH2.js → login-DIeceuOs.js} +1 -1
- package/dist/web/client/assets/{mcp-Cwk9V82W.js → mcp-CX3kJpGu.js} +1 -1
- package/dist/web/client/assets/{members-CHDNabFh.js → members-DlhSjye1.js} +1 -1
- package/dist/web/client/assets/{memory-Cx_Fpd4e.js → memory-CsDd6b2l.js} +1 -1
- package/dist/web/client/assets/{policy-C0nMdwcG.js → policy-DkWDhG0x.js} +1 -1
- package/dist/web/client/assets/{results-Bz3jASs-.js → results-BHdhNHJJ.js} +1 -1
- package/dist/web/client/assets/review-Dyw47eM1.js +1 -0
- package/dist/web/client/assets/{routes-DsMY_6oy.js → routes-DtYD4WJL.js} +1 -1
- package/dist/web/client/assets/{services-DItA6fJ7.js → services-WUlW7oEo.js} +1 -1
- package/dist/web/client/assets/{skills-DbNV2vgL.js → skills-jNoUfUSZ.js} +1 -1
- package/dist/web/client/assets/styles-DCX6QTqJ.css +2 -0
- package/dist/web/client/assets/{teams-D83scDxw.js → teams-C1kYRrtP.js} +1 -1
- package/dist/web/client/assets/{teams-DAny1ypN.js → teams-D3FaSKE7.js} +1 -1
- package/dist/web/client/assets/{telegram-BOmf9vUh.js → telegram-D86AO6V9.js} +1 -1
- package/dist/web/client/assets/{tokens-DBGH6Bw5.js → tokens-B42KDisP.js} +1 -1
- package/dist/web/client/assets/{triggers-D1_pseI3.js → triggers-yEfWnQ_K.js} +1 -1
- package/dist/web/client/assets/{verifications-CBTo-FyV.js → verifications-DrHQEQFx.js} +2 -2
- package/dist/web/client/assets/{welcome-DAfPOm15.js → welcome-D8IbF_P0.js} +1 -1
- package/dist/web/client/assets/{x-CWY-gUaM.js → x-CXKABZ7C.js} +1 -1
- package/dist/web/server/assets/{_id--zoh1vv7.js → _id-D2bDA1iV.js} +1 -1
- package/dist/web/server/assets/{_id-6p-mDmI8.js → _id-DL-SnSnK.js} +1 -1
- package/dist/web/server/assets/{_id-dUnXL-My2.js → _id-Dab2CVtO2.js} +1 -1
- package/dist/web/server/assets/{_id-DptBl3X8.js → _id-bVispdh-.js} +1 -1
- package/dist/web/server/assets/{_tanstack-start-manifest_v-B3M-dfRO.js → _tanstack-start-manifest_v-BcTOb0oj.js} +84 -85
- package/dist/web/server/assets/{activity-C5jpoEQI.js → activity-CLDAy6rk.js} +1 -1
- package/dist/web/server/assets/{agents-RE6aYOb-.js → agents-CdB2kuNN.js} +1 -1
- package/dist/web/server/assets/{agents-nAOx_H7s.js → agents-DfHcb2H2.js} +1 -1
- package/dist/web/server/assets/{approvals-DhHxIDrL.js → approvals-Bq846WaP.js} +1 -1
- package/dist/web/server/assets/{attention-CBWzWRni.js → attention-Sm-U7s_0.js} +1 -1
- package/dist/web/server/assets/{auth-tB3i6cFd.js → auth-PB5dVyvX.js} +1 -1
- package/dist/web/server/assets/{config-D1k_tTAw.js → config-BNGTBu80.js} +1 -1
- package/dist/web/server/assets/{daemon-client-C7qjQ2iO.js → daemon-client-CWQvck6B.js} +35 -0
- package/dist/web/server/assets/{git-review-Bf5ABFJg.js → git-review-C_h_tezf.js} +1 -1
- package/dist/web/server/assets/{inbox-Dw4pTevh.js → inbox-DJoU-bla.js} +1 -1
- package/dist/web/server/assets/{learning-CF8ZzFVD.js → learning-DVb0I_3Z.js} +1 -1
- package/dist/web/server/assets/{mcp-D5dmBT82.js → mcp-CeZqOiDG.js} +1 -1
- package/dist/web/server/assets/{members-CvwEN9pm.js → members-CcYjuqxB.js} +1 -1
- package/dist/web/server/assets/{memory-CcPK7um7.js → memory-CH2yNT89.js} +1 -1
- package/dist/web/server/assets/{policy-Dh6wd2wN.js → policy-DrRKinMr.js} +1 -1
- package/dist/web/server/assets/{results-BWnu3gXP.js → results-fT2zyiJx.js} +1 -1
- package/dist/web/server/assets/review-CvUPk4HA.js +38 -0
- package/dist/web/server/assets/review-DYcYdUTv.js +859 -0
- package/dist/web/server/assets/review-packets-e36PsTSX.js +172 -0
- package/dist/web/server/assets/{router-Deq94UJQ.js → router-NYhuYQCd.js} +4 -4
- package/dist/web/server/assets/{routes-CVKkvFVv.js → routes-RdppWPiW.js} +1 -1
- package/dist/web/server/assets/{services-CEr61xb5.js → services-Dgu7dcTC.js} +1 -1
- package/dist/web/server/assets/{skills-BImC3LTO.js → skills-DL7UIWa8.js} +1 -1
- package/dist/web/server/assets/{teams-8zEIo08E.js → teams-Cmn7mdx9.js} +1 -1
- package/dist/web/server/assets/{teams-D-yaAWLV.js → teams-DiC-MBg4.js} +1 -1
- package/dist/web/server/assets/{telegram-CGl_LFtJ.js → telegram-CLOFnLjF.js} +1 -1
- package/dist/web/server/assets/{tokens-cB-uf7qm.js → tokens-BVva7GHu.js} +1 -1
- package/dist/web/server/assets/{triggers-CtSj79L0.js → triggers-D4orksJq.js} +1 -1
- package/dist/web/server/assets/{verification-B5QjcpIo.js → verification-C1SHMTX8.js} +1 -1
- package/dist/web/server/assets/{verifications-CUq_6ZqL.js → verifications-C_ycXrPK.js} +1 -1
- package/dist/web/server/assets/{verifications-BfQsfwSE.js → verifications-Ci49n2Km.js} +14 -1
- package/dist/web/server/server.js +75 -39
- package/dist/worker.js +528 -111
- package/dist/worker.js.map +1 -1
- package/package.json +3 -3
- package/dist/web/client/assets/ConfirmDialog-BzIiABOP.js +0 -1
- package/dist/web/client/assets/chevron-right-DSa4xPTs.js +0 -1
- package/dist/web/client/assets/createServerFn-Dzfjt7mA.js +0 -3
- package/dist/web/client/assets/index-Bi-HxcPG.js +0 -50
- package/dist/web/client/assets/review-AK9WGmpv.js +0 -1
- package/dist/web/client/assets/styles-C6br2xxl.css +0 -2
- package/dist/web/server/assets/review-DUe3vHPU.js +0 -393
- package/dist/web/server/assets/review-c_-cFi7H.js +0 -14
|
@@ -530,8 +530,14 @@ CREATE TABLE agent_results (
|
|
|
530
530
|
id TEXT PRIMARY KEY,
|
|
531
531
|
team_id TEXT NOT NULL REFERENCES teams(id) ON DELETE CASCADE,
|
|
532
532
|
agent_id TEXT NOT NULL,
|
|
533
|
-
|
|
534
|
-
|
|
533
|
+
-- BAZ-043 widened provenance: a result is either a turn's deliver_file call, or an artifact an
|
|
534
|
+
-- operator/system surface produced from a review packet. Never both, and never neither — the source is
|
|
535
|
+
-- what the access rules and the backup verifier reason about.
|
|
536
|
+
source_kind TEXT NOT NULL CHECK (source_kind IN ('session_tool', 'review_packet')),
|
|
537
|
+
session_id TEXT,
|
|
538
|
+
tool_call_id TEXT,
|
|
539
|
+
review_packet_id TEXT REFERENCES review_packets(id) ON DELETE CASCADE,
|
|
540
|
+
review_revision TEXT,
|
|
535
541
|
name TEXT NOT NULL,
|
|
536
542
|
mime_type TEXT NOT NULL,
|
|
537
543
|
byte_length INTEGER NOT NULL CHECK (byte_length BETWEEN 0 AND 26214400),
|
|
@@ -540,10 +546,16 @@ CREATE TABLE agent_results (
|
|
|
540
546
|
released_at INTEGER,
|
|
541
547
|
deleted_at INTEGER,
|
|
542
548
|
bytes BLOB,
|
|
543
|
-
|
|
549
|
+
CHECK ((source_kind = 'session_tool') = (session_id IS NOT NULL AND tool_call_id IS NOT NULL)),
|
|
550
|
+
CHECK ((source_kind = 'review_packet') = (review_packet_id IS NOT NULL AND review_revision IS NOT NULL)),
|
|
544
551
|
CHECK ((deleted_at IS NULL AND bytes IS NOT NULL AND length(bytes) = byte_length)
|
|
545
552
|
OR (deleted_at IS NOT NULL AND bytes IS NULL))
|
|
546
553
|
);
|
|
554
|
+
-- Retry idempotency is per source: a turn's tool call, or one export of one revision of one packet.
|
|
555
|
+
CREATE UNIQUE INDEX agent_results_session_source
|
|
556
|
+
ON agent_results(agent_id, session_id, tool_call_id) WHERE source_kind = 'session_tool';
|
|
557
|
+
CREATE UNIQUE INDEX agent_results_packet_source
|
|
558
|
+
ON agent_results(agent_id, review_packet_id, review_revision) WHERE source_kind = 'review_packet';
|
|
547
559
|
CREATE INDEX agent_results_team_time ON agent_results(team_id, created_at DESC, id DESC);
|
|
548
560
|
|
|
549
561
|
CREATE TRIGGER validate_team_policy_baseline_update
|
|
@@ -807,6 +819,129 @@ CREATE TABLE source_snapshots (
|
|
|
807
819
|
CREATE INDEX source_snapshots_retention ON source_snapshots(expires_at, snapshot_id);
|
|
808
820
|
CREATE INDEX source_snapshots_team_time ON source_snapshots(team_id, created_at, snapshot_id);
|
|
809
821
|
|
|
822
|
+
-- BAZ-043: revision-bound review and handoff.
|
|
823
|
+
--
|
|
824
|
+
-- One packet binds exactly one immutable change (a BAZ-042 snapshot) to a bounded set of findings and
|
|
825
|
+
-- one review conclusion, plus an optional reviewer Agent. It is a record of *review*, not a workflow:
|
|
826
|
+
-- no stages, no approver assignment, and no automatic commit, push, PR, merge or deploy.
|
|
827
|
+
CREATE TABLE review_packets (
|
|
828
|
+
id TEXT PRIMARY KEY,
|
|
829
|
+
team_id TEXT NOT NULL REFERENCES teams(id) ON DELETE CASCADE,
|
|
830
|
+
requester_kind TEXT NOT NULL CHECK (requester_kind IN ('agent', 'operator')),
|
|
831
|
+
requester_agent_id TEXT,
|
|
832
|
+
-- Null means an operator-only packet: nothing was delegated, so no reviewer turn is dispatched.
|
|
833
|
+
reviewer_agent_id TEXT REFERENCES agents(id) ON DELETE SET NULL,
|
|
834
|
+
-- BAZ-042 evidence identity. Not a foreign key, deliberately: a snapshot has its own seven-day
|
|
835
|
+
-- window, and a packet whose evidence is gone must report that rather than resolve to another tree.
|
|
836
|
+
snapshot_id TEXT NOT NULL,
|
|
837
|
+
snapshot_complete INTEGER NOT NULL CHECK (snapshot_complete IN (0, 1)),
|
|
838
|
+
head TEXT,
|
|
839
|
+
base_oid TEXT NOT NULL,
|
|
840
|
+
-- What the change is for: the requester's statement of the problem, kept as commentary.
|
|
841
|
+
summary TEXT CHECK (summary IS NULL OR length(CAST(summary AS BLOB)) <= 2000),
|
|
842
|
+
state TEXT NOT NULL CHECK (state IN (
|
|
843
|
+
'open', 'awaiting_approval', 'blocked', 'reviewing', 'reviewed', 'cancelled'
|
|
844
|
+
)),
|
|
845
|
+
-- Recorded only when an export was actually produced, and only for the revision it exported.
|
|
846
|
+
exported_at INTEGER,
|
|
847
|
+
export_revision TEXT,
|
|
848
|
+
-- Operator-reported external states (committed / pushed / pull request / merged / deployed /
|
|
849
|
+
-- production accepted), each a reference the operator supplied. Never inferred, never verified: a
|
|
850
|
+
-- reported state is what the operator says, and this story has no code-host integration to check it.
|
|
851
|
+
reported_json TEXT CHECK (reported_json IS NULL OR json_valid(reported_json)),
|
|
852
|
+
created_at INTEGER NOT NULL,
|
|
853
|
+
expires_at INTEGER NOT NULL,
|
|
854
|
+
CHECK (expires_at > created_at),
|
|
855
|
+
CHECK ((requester_kind = 'agent') = (requester_agent_id IS NOT NULL)),
|
|
856
|
+
-- A reviewer never reviews its own packet.
|
|
857
|
+
CHECK (requester_agent_id IS NULL OR reviewer_agent_id IS NULL OR requester_agent_id != reviewer_agent_id),
|
|
858
|
+
-- An export names the revision it was made from, or it is not an export.
|
|
859
|
+
CHECK ((exported_at IS NULL) = (export_revision IS NULL))
|
|
860
|
+
);
|
|
861
|
+
CREATE INDEX review_packets_team_time ON review_packets(team_id, created_at DESC, id);
|
|
862
|
+
CREATE INDEX review_packets_reviewer_dispatch
|
|
863
|
+
ON review_packets(reviewer_agent_id, state, created_at);
|
|
864
|
+
CREATE INDEX review_packets_retention ON review_packets(expires_at, id);
|
|
865
|
+
|
|
866
|
+
-- Findings, append-only. A finding is about one path in one captured revision; the line range is
|
|
867
|
+
-- context, never identity, because lines move while the issue stays the same.
|
|
868
|
+
CREATE TABLE review_findings (
|
|
869
|
+
id TEXT PRIMARY KEY,
|
|
870
|
+
packet_id TEXT NOT NULL REFERENCES review_packets(id) ON DELETE CASCADE,
|
|
871
|
+
author_kind TEXT NOT NULL CHECK (author_kind IN ('agent', 'operator')),
|
|
872
|
+
author_agent_id TEXT,
|
|
873
|
+
-- Repository-relative. Validated at write time to be inside the reviewed scope.
|
|
874
|
+
path TEXT NOT NULL CHECK (length(CAST(path AS BLOB)) BETWEEN 1 AND 1000),
|
|
875
|
+
line_start INTEGER CHECK (line_start IS NULL OR line_start >= 1),
|
|
876
|
+
line_end INTEGER CHECK (line_end IS NULL OR line_end >= 1),
|
|
877
|
+
severity TEXT NOT NULL CHECK (severity IN ('blocker', 'major', 'minor', 'info')),
|
|
878
|
+
note TEXT NOT NULL CHECK (length(CAST(note AS BLOB)) BETWEEN 1 AND 4000),
|
|
879
|
+
-- The revision the finding was made against. A finding of an older revision stays visible and is
|
|
880
|
+
-- reported as stale for the current code, rather than being silently attached to new lines.
|
|
881
|
+
snapshot_id TEXT NOT NULL,
|
|
882
|
+
state TEXT NOT NULL CHECK (state IN ('open', 'unverified', 'resolved')),
|
|
883
|
+
-- Proof of resolution. A line number alone never proves an issue was fixed, so the only ways out of
|
|
884
|
+
-- `open` are an explicit decision or a later revision that is named.
|
|
885
|
+
resolution_kind TEXT CHECK (resolution_kind IN ('explicit', 'linked_revision')),
|
|
886
|
+
resolution_note TEXT CHECK (resolution_note IS NULL OR length(CAST(resolution_note AS BLOB)) <= 2000),
|
|
887
|
+
resolved_at INTEGER,
|
|
888
|
+
resolved_by_kind TEXT CHECK (resolved_by_kind IN ('agent', 'operator')),
|
|
889
|
+
resolved_by_agent_id TEXT,
|
|
890
|
+
created_at INTEGER NOT NULL,
|
|
891
|
+
CHECK ((line_end IS NULL) OR (line_start IS NOT NULL AND line_end >= line_start)),
|
|
892
|
+
CHECK ((author_kind = 'agent') = (author_agent_id IS NOT NULL)),
|
|
893
|
+
-- Resolution facts travel together, and only a resolved finding has them.
|
|
894
|
+
CHECK (
|
|
895
|
+
(state = 'resolved') = (
|
|
896
|
+
resolution_kind IS NOT NULL AND resolved_at IS NOT NULL
|
|
897
|
+
AND resolved_by_kind IS NOT NULL AND resolution_note IS NOT NULL
|
|
898
|
+
)
|
|
899
|
+
),
|
|
900
|
+
CHECK ((resolved_by_kind = 'agent') = (resolved_by_agent_id IS NOT NULL))
|
|
901
|
+
);
|
|
902
|
+
CREATE INDEX review_findings_packet ON review_findings(packet_id, created_at, id);
|
|
903
|
+
CREATE INDEX review_findings_unresolved ON review_findings(packet_id, state, severity);
|
|
904
|
+
|
|
905
|
+
-- One conclusion per reviewer per packet: changes_requested, commented or recommended. Operator
|
|
906
|
+
-- acceptance is a separate fact recorded elsewhere; a conclusion never implies it.
|
|
907
|
+
CREATE TABLE review_conclusions (
|
|
908
|
+
id TEXT PRIMARY KEY,
|
|
909
|
+
packet_id TEXT NOT NULL REFERENCES review_packets(id) ON DELETE CASCADE,
|
|
910
|
+
reviewer_kind TEXT NOT NULL CHECK (reviewer_kind IN ('agent', 'operator')),
|
|
911
|
+
reviewer_agent_id TEXT,
|
|
912
|
+
conclusion TEXT NOT NULL CHECK (conclusion IN ('changes_requested', 'commented', 'recommended')),
|
|
913
|
+
note TEXT CHECK (note IS NULL OR length(CAST(note AS BLOB)) <= 4000),
|
|
914
|
+
-- The revision the conclusion is about, so a later revision cannot inherit it.
|
|
915
|
+
snapshot_id TEXT NOT NULL,
|
|
916
|
+
created_at INTEGER NOT NULL,
|
|
917
|
+
UNIQUE (packet_id, reviewer_kind, reviewer_agent_id),
|
|
918
|
+
CHECK ((reviewer_kind = 'agent') = (reviewer_agent_id IS NOT NULL))
|
|
919
|
+
);
|
|
920
|
+
CREATE INDEX review_conclusions_packet ON review_conclusions(packet_id, created_at, id);
|
|
921
|
+
|
|
922
|
+
-- Reviewer dispatch attempts. Claiming is transactional and leased so exactly one owner reviews a
|
|
923
|
+
-- packet; a claim left by an interrupted process becomes uncertain and is never replayed.
|
|
924
|
+
CREATE TABLE review_attempts (
|
|
925
|
+
id TEXT PRIMARY KEY,
|
|
926
|
+
packet_id TEXT NOT NULL REFERENCES review_packets(id) ON DELETE CASCADE,
|
|
927
|
+
attempt_number INTEGER NOT NULL CHECK (attempt_number >= 1),
|
|
928
|
+
supersedes_attempt_id TEXT REFERENCES review_attempts(id) ON DELETE SET NULL,
|
|
929
|
+
state TEXT NOT NULL CHECK (state IN ('claimed', 'running', 'completed', 'failed', 'cancelled', 'uncertain')),
|
|
930
|
+
lease_owner TEXT,
|
|
931
|
+
lease_expires_at INTEGER,
|
|
932
|
+
started_at INTEGER,
|
|
933
|
+
finished_at INTEGER,
|
|
934
|
+
error TEXT CHECK (error IS NULL OR length(CAST(error AS BLOB)) <= 2000),
|
|
935
|
+
created_at INTEGER NOT NULL,
|
|
936
|
+
CHECK ((state IN ('claimed', 'running')) = (finished_at IS NULL)),
|
|
937
|
+
CHECK ((state IN ('claimed', 'running')) = (lease_owner IS NOT NULL)),
|
|
938
|
+
CHECK (state != 'claimed' OR started_at IS NULL),
|
|
939
|
+
UNIQUE (packet_id, attempt_number)
|
|
940
|
+
);
|
|
941
|
+
CREATE UNIQUE INDEX review_attempts_one_open_per_packet
|
|
942
|
+
ON review_attempts(packet_id) WHERE finished_at IS NULL;
|
|
943
|
+
CREATE INDEX review_attempts_lease ON review_attempts(state, lease_expires_at);
|
|
944
|
+
|
|
810
945
|
-- BAZ-044: specialist verification of a captured code change.
|
|
811
946
|
--
|
|
812
947
|
-- One typed request binds exactly one immutable change (a BAZ-042 snapshot) to a finite set of
|
|
@@ -879,6 +1014,10 @@ CREATE TABLE verification_attempts (
|
|
|
879
1014
|
started_at INTEGER,
|
|
880
1015
|
finished_at INTEGER,
|
|
881
1016
|
error TEXT CHECK (error IS NULL OR length(CAST(error AS BLOB)) <= 2000),
|
|
1017
|
+
-- BAZ-044: where the tree moved relative to the capture, after the checks ran. Written once at
|
|
1018
|
+
-- settle, never rewritten; NULL means it was not established (still running, or nothing executed),
|
|
1019
|
+
-- which is deliberately distinct from an empty observation.
|
|
1020
|
+
observed_writes_json TEXT,
|
|
882
1021
|
created_at INTEGER NOT NULL,
|
|
883
1022
|
CHECK ((state IN ('claimed', 'running')) = (finished_at IS NULL)),
|
|
884
1023
|
CHECK ((state IN ('claimed', 'running')) = (lease_owner IS NOT NULL)),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{h as r}from"./index-
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{h as r}from"./index-Ct31TjS-.js";import{t as i}from"./Button-ByiV6fpd.js";import{n as a,t as o}from"./git-review-presentation-CzHQulDk.js";import{t as s}from"./ResultCard-Cps_lXVN.js";function c(e){let t=e.split(`
|
|
2
2
|
`).map(e=>e.trim()).find(e=>/^(?:[A-Za-z]*Error(?: \[[A-Z_]+\])?:|ERR_[A-Z_]+\b)/.test(e));return t?t.length>240?`${t.slice(0,237)}…`:t:null}function l(e){let t=e.split(`
|
|
3
3
|
`).find(e=>e.startsWith(`--- from `));if(!t)return`Teammate update received`;let n=/^--- from (.+?) \(message [0-9a-f-]+(?:, reply to [0-9a-f-]+)?\) ---$/.exec(t);if(!n)return`Teammate update received`;let r=n[1]?.replace(/ \([0-9a-f-]{36}\)$/,``).trim();return!r||/^[0-9a-f-]{36}$/.test(r)?`Teammate update received`:`Update from ${r.slice(0,100)}`}var u=e(n(),1),d=65536;async function f(e,t=fetch){let n=`/api/teams/${encodeURIComponent(e.teamId)}/coding-commands/${encodeURIComponent(e.commandId)}/log`;try{let e=await t(`${n}?limit=${d}`,{headers:{accept:`application/json`}});if(e.status===403)return{status:`not-shared`};if(e.status===404)return{status:`missing`};if(!e.ok)return{status:`unavailable`,message:`Request failed (${e.status}).`};let r=await e.json(),i=p(r);if(!i)return{status:`unavailable`,message:`Unexpected response from the daemon.`};if(h(r,`page`)===null)return{status:`not-shared`};let a=m(h(r,`page`));return a?{status:`available`,page:a,view:i}:{status:`unavailable`,message:`Unexpected response from the daemon.`}}catch{return{status:`unavailable`,message:`The daemon could not be reached.`}}}function p(e){let t=h(e,`view`);return!g(t)||typeof t.commandId!=`string`||typeof t.availability!=`string`||typeof t.byteLength!=`number`?null:t}function m(e){return!g(e)||typeof e.text!=`string`||typeof e.availability!=`string`||typeof e.offset!=`number`||typeof e.hasMore!=`boolean`||typeof e.byteLength!=`number`?null:e}function h(e,t){return g(e)?e[t]:void 0}function g(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var _=t();function v({name:e,body:t,pending:n=!1,log:r}){if(!n&&t===`Coding context or command evidence retained privately. Captured transport output follows its communication approval; ask the Agent for the relevant result.`)return(0,_.jsxs)(`details`,{className:`py-1 text-xs font-sans`,"aria-label":`Private command details`,children:[(0,_.jsx)(`summary`,{className:`cursor-pointer`,children:`Detailed output isn’t included in this history view`}),(0,_.jsx)(`p`,{className:`mt-1`,children:`The Agent’s summary is shown in the conversation. Ask the Agent to summarize its retained command result if you need more detail.`}),r&&(0,_.jsx)(b,{reference:r})]});let i;try{i=JSON.parse(t)}catch{return(0,_.jsx)(`span`,{children:t})}if(!i||typeof i!=`object`)return(0,_.jsx)(`span`,{children:t});if(n){let t=i;return(0,_.jsxs)(`p`,{className:`py-1 break-words`,children:[e===`coding_command`?`Running`:`Inspecting`,`:`,` `,typeof t.command==`string`?t.command:typeof t.target==`string`?t.target:`command evidence`]})}if(e===`repository_context`){let e=i;return Array.isArray(e.instructions?.files)?(0,_.jsxs)(`details`,{className:`py-1`,children:[(0,_.jsxs)(`summary`,{className:`cursor-pointer`,children:[`Repository: `,e.target,` ·`,` `,e.instructions.state===`complete`?`${e.instructions.files.length} instruction files`:`instructions unavailable`]}),e.instructions.files.map(e=>(0,_.jsx)(`p`,{children:e.path},e.path)),(0,_.jsxs)(`p`,{children:[e.commands?.candidates?.length??0,` suggested commands ·`,` `,e.git?.state===`available`?e.git.branch:`Git unavailable`]}),(0,_.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words`,children:t})]}):(0,_.jsx)(`span`,{children:t})}if(e===`coding_log`){let e=i;return typeof e.text!=`string`||typeof e.availability!=`string`?(0,_.jsx)(`span`,{children:t}):(0,_.jsxs)(`details`,{className:`py-1`,"aria-label":`Retained command output`,children:[(0,_.jsxs)(`summary`,{className:`cursor-pointer`,children:[`Retained output: `,e.availability,e.hasMore?` · more available`:``]}),(0,_.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words`,children:e.text}),(0,_.jsxs)(`p`,{className:`text-xs`,children:[`bytes `,typeof e.offset==`number`?e.offset:0,`–`,(typeof e.offset==`number`?e.offset:0)+e.text.length,` of`,` `,typeof e.byteLength==`number`?e.byteLength:0]})]})}if(e===`coding_environment`){let e=i;return typeof e.posture==`string`?(0,_.jsxs)(`details`,{className:`py-1`,children:[(0,_.jsxs)(`summary`,{className:`cursor-pointer`,children:[`Environment: `,e.posture,` · `,e.cwd]}),(0,_.jsx)(`p`,{className:`break-all`,children:e.imageId??`Host runtime`}),Array.isArray(e.restrictions)&&e.restrictions.filter(e=>typeof e==`string`).map(e=>(0,_.jsx)(`p`,{children:e},e))]}):(0,_.jsx)(`span`,{children:t})}let a=i,o=e===`coding_receipt`?a.receipt:i;if(!o||typeof o.state!=`string`||typeof o.input?.command!=`string`||typeof o.input?.cwd!=`string`)return(0,_.jsx)(`span`,{children:t});let s=o.state===`failed`&&typeof o.diagnostic==`string`?c(o.diagnostic):null;return(0,_.jsxs)(`div`,{className:`py-2`,"aria-label":`Coding command result`,children:[(0,_.jsxs)(`p`,{className:`font-sans`,children:[(0,_.jsx)(`strong`,{className:o.state===`succeeded`?`text-sapphire-deep`:`text-mocha`,children:o.state.replaceAll(`_`,` `)}),` `,`· `,o.input.purpose,typeof o.exitCode==`number`?` · exit ${o.exitCode}`:``,e===`coding_receipt`?` · ${a.applicability}`:``]}),(0,_.jsx)(`p`,{className:`whitespace-pre-wrap break-words`,children:o.input.command}),(0,_.jsxs)(`p`,{className:`text-xs`,children:[o.input.cwd,` · `,o.environment?.posture,` · result at execution time`]}),s&&(0,_.jsx)(`p`,{className:`mt-1 font-sans text-rose-baziu`,"aria-label":`Command failure summary`,children:s}),typeof o.reason==`string`&&(0,_.jsx)(`p`,{children:o.reason}),(0,_.jsxs)(`details`,{children:[(0,_.jsx)(`summary`,{className:`cursor-pointer`,children:`Output and evidence`}),(0,_.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words`,children:o.diagnostic}),o.truncated&&(0,_.jsx)(`p`,{children:`Output truncated.`}),(0,_.jsxs)(`p`,{className:`break-all`,children:[`coding-receipt:`,o.id]}),(0,_.jsx)(y,{teamId:o.teamId,after:o.sourceAfter??null,before:o.sourceBefore??null}),o.environment?.imageId&&(0,_.jsx)(`p`,{className:`break-all`,children:o.environment.imageId})]})]})}function y({teamId:e,after:t,before:n}){let[s,c]=(0,u.useState)(null),[l,d]=(0,u.useState)(!1);async function f(){if(t){d(!0);try{c(await r({data:{teamId:e,snapshotId:t.id}}))}finally{d(!1)}}}let p=s?.status===`ok`?s:null,m=o(p);return(0,_.jsxs)(`p`,{className:a(p)?`text-rose-baziu`:void 0,children:[m,t?(0,_.jsxs)(_.Fragment,{children:[` · tested version `,(0,_.jsx)(`span`,{className:`break-all font-mono`,children:t.id.slice(0,12)}),t.complete?``:` (incomplete)`,p===null&&(0,_.jsxs)(_.Fragment,{children:[` `,(0,_.jsx)(i,{variant:`ghost`,disabled:l,onClick:()=>void f(),children:l?`Checking…`:`Check applicability`})]}),s?.status===`unavailable`&&(0,_.jsxs)(`span`,{children:[` · `,s.message]})]}):` · no source snapshot was captured for this result`,n&&(0,_.jsxs)(_.Fragment,{children:[` · started from `,(0,_.jsx)(`span`,{className:`break-all font-mono`,children:n.id.slice(0,12)})]})]})}function b({reference:e}){let[t,n]=(0,u.useState)(null),[r,a]=(0,u.useState)(!1);async function o(){a(!0);try{n(await f(e))}finally{a(!1)}}return t===null?(0,_.jsx)(`p`,{className:`mt-2`,children:(0,_.jsx)(i,{variant:`ghost`,disabled:r,onClick:()=>void o(),children:r?`Loading…`:`Show retained output`})}):t.status===`not-shared`?(0,_.jsx)(`p`,{className:`mt-2`,children:`This command’s output hasn’t been shared with the conversation yet.`}):t.status===`missing`?(0,_.jsx)(`p`,{className:`mt-2`,children:`This retained output is no longer available.`}):t.status===`unavailable`?(0,_.jsx)(`p`,{className:`mt-2`,role:`alert`,children:t.message}):(0,_.jsxs)(`div`,{className:`mt-2`,children:[(0,_.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-sm bg-[rgba(42,31,22,0.04)] p-2`,children:t.page.text}),(0,_.jsxs)(`p`,{children:[`Retained output: `,t.page.availability,t.page.hasMore?` · earlier output omitted`:``,` · bytes `,t.page.offset,`–`,t.page.offset+t.page.text.length,` of `,t.page.byteLength]})]})}function x(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function S(e){if(Array.isArray(e))return e}function C(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function w(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(e,t){return S(e)||C(e,t)||E(e,t)||w()}function E(e,t){if(e){if(typeof e==`string`)return x(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}var D=Object.entries,O=Object.setPrototypeOf,k=Object.isFrozen,ee=Object.getPrototypeOf,te=Object.getOwnPropertyDescriptor,A=Object.freeze,j=Object.seal,M=Object.create,N=typeof Reflect<`u`&&Reflect,ne=N.apply,re=N.construct;A||=function(e){return e},j||=function(e){return e},ne||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},re||=function(e){return new e(...[...arguments].slice(1))};var ie=z(Array.prototype.forEach),ae=z(Array.prototype.lastIndexOf),oe=z(Array.prototype.pop),se=z(Array.prototype.push),ce=z(Array.prototype.splice),P=Array.isArray,le=z(String.prototype.toLowerCase),ue=z(String.prototype.toString),de=z(String.prototype.match),fe=z(String.prototype.replace),pe=z(String.prototype.indexOf),me=z(String.prototype.trim),F=z(Number.prototype.toString),he=z(Boolean.prototype.toString),I=typeof BigInt>`u`?null:z(BigInt.prototype.toString),ge=typeof Symbol>`u`?null:z(Symbol.prototype.toString),L=z(Object.prototype.hasOwnProperty),_e=z(Object.prototype.toString),R=z(RegExp.prototype.test),ve=ye(TypeError);function z(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return ne(e,t,n)}}function ye(e){return function(){return re(e,[...arguments])}}function B(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:le;if(O&&O(e,null),!P(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(k(t)||(t[r]=e),i=e)}e[i]=!0}return e}function V(e){for(let t=0;t<e.length;t++)L(e,t)||(e[t]=null);return e}function H(e){let t=M(null);for(let r of D(e)){var n=T(r,2);let i=n[0],a=n[1];L(e,i)&&(P(a)?t[i]=V(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=H(a):t[i]=a)}return t}function be(e){switch(typeof e){case`string`:return e;case`number`:return F(e);case`boolean`:return he(e);case`bigint`:return I?I(e):`0`;case`symbol`:return ge?ge(e):`Symbol()`;case`undefined`:return _e(e);case`function`:case`object`:{if(e===null)return _e(e);let t=e,n=U(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:_e(e)}return _e(e)}default:return _e(e)}}function U(e,t){for(;e!==null;){let n=te(e,t);if(n){if(n.get)return z(n.get);if(typeof n.value==`function`)return z(n.value)}e=ee(e)}function n(){return null}return n}function xe(e){try{return R(e,``),!0}catch{return!1}}var Se=A(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ce=A(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),we=A([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Te=A([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ee=A(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),De=A([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Oe=A([`#text`]),ke=A(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Ae=A(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),je=A(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Me=A([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Ne=j(/{{[\w\W]*|^[\w\W]*}}/g),Pe=j(/<%[\w\W]*|^[\w\W]*%>/g),Fe=j(/\${[\w\W]*/g),Ie=j(/^data-[\-\w.\u00B7-\uFFFF]+$/),Le=j(/^aria-[\-\w]+$/),Re=j(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ze=j(/^(?:\w+script|data):/i),Be=j(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ve=j(/^html$/i),He=j(/^[a-z][.\w]*(-[.\w]+)+$/i),Ue=j(/<[/\w!]/g),We=j(/<[/\w]/g),Ge=j(/<\/no(script|embed|frames)/i),Ke=j(/\/>/i),qe={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Je=function(){return typeof window>`u`?null:window},Ye=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Xe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ze=function(e,t,n,r){return L(e,t)&&P(e[t])?B(r.base?H(r.base):{},e[t],r.transform):n};function Qe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Je(),t=e=>Qe(e);if(t.version=`3.4.11`,t.removed=[],!e||!e.document||e.document.nodeType!==qe.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=U(d,`cloneNode`),p=U(d,`remove`),m=U(d,`nextSibling`),h=U(d,`childNodes`),g=U(d,`parentNode`),_=U(d,`shadowRoot`),v=U(d,`attributes`),y=o&&o.prototype?U(o.prototype,`nodeType`):null,b=o&&o.prototype?U(o.prototype,`nodeName`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let x,S=``,C,w=!1,T=0,E=function(){if(T>0)throw ve(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},O=function(e){E(),T++;try{return x.createHTML(e)}finally{T--}},k=function(e){E(),T++;try{return x.createScriptURL(e)}finally{T--}},ee=function(){return w||=(C=Ye(u,i),!0),C},te=n,N=te.implementation,ne=te.createNodeIterator,re=te.createDocumentFragment,F=te.getElementsByTagName,he=r.importNode,I=Xe();t.isSupported=typeof D==`function`&&typeof g==`function`&&N&&N.createHTMLDocument!==void 0;let ge=Ne,_e=Pe,z=Fe,ye=Ie,V=Le,$e=ze,et=Be,tt=He,nt=Re,W=null,rt=B({},[...Se,...Ce,...we,...Ee,...Oe]),G=null,it=B({},[...ke,...Ae,...je,...Me]),K=Object.seal(M(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),at=null,ot=null,st=Object.seal(M(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ct=!0,lt=!0,ut=!1,dt=!0,ft=!1,pt=!0,mt=!1,ht=!1,gt=null,_t=null,vt=!1,yt=!1,bt=!1,xt=!1,St=!0,Ct=!1,wt=`user-content-`,Tt=!0,Et=!1,Dt={},q=null,Ot=B({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),kt=null,At=B({},[`audio`,`video`,`img`,`source`,`image`,`track`]),jt=null,Mt=B({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Nt=`http://www.w3.org/1998/Math/MathML`,Pt=`http://www.w3.org/2000/svg`,Ft=`http://www.w3.org/1999/xhtml`,It=Ft,Lt=!1,Rt=null,zt=B({},[Nt,Pt,Ft],ue),Bt=A([`mi`,`mo`,`mn`,`ms`,`mtext`]),Vt=B({},Bt),Ht=A([`annotation-xml`]),Ut=B({},Ht),Wt=B({},[`title`,`style`,`font`,`a`,`script`]),Gt=null,Kt=[`application/xhtml+xml`,`text/html`],J=null,qt=null,Jt=n.createElement(`form`),Yt=function(e){return e instanceof RegExp||e instanceof Function},Xt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(qt&&qt===e)return;(!e||typeof e!=`object`)&&(e={}),e=H(e),Gt=Kt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,J=Gt===`application/xhtml+xml`?ue:le,W=Ze(e,`ALLOWED_TAGS`,rt,{transform:J}),G=Ze(e,`ALLOWED_ATTR`,it,{transform:J}),Rt=Ze(e,`ALLOWED_NAMESPACES`,zt,{transform:ue}),jt=Ze(e,`ADD_URI_SAFE_ATTR`,Mt,{transform:J,base:Mt}),kt=Ze(e,`ADD_DATA_URI_TAGS`,At,{transform:J,base:At}),q=Ze(e,`FORBID_CONTENTS`,Ot,{transform:J}),at=Ze(e,`FORBID_TAGS`,H({}),{transform:J}),ot=Ze(e,`FORBID_ATTR`,H({}),{transform:J}),Dt=L(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?H(e.USE_PROFILES):e.USE_PROFILES:!1,ct=e.ALLOW_ARIA_ATTR!==!1,lt=e.ALLOW_DATA_ATTR!==!1,ut=e.ALLOW_UNKNOWN_PROTOCOLS||!1,dt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ft=e.SAFE_FOR_TEMPLATES||!1,pt=e.SAFE_FOR_XML!==!1,mt=e.WHOLE_DOCUMENT||!1,yt=e.RETURN_DOM||!1,bt=e.RETURN_DOM_FRAGMENT||!1,xt=e.RETURN_TRUSTED_TYPE||!1,vt=e.FORCE_BODY||!1,St=e.SANITIZE_DOM!==!1,Ct=e.SANITIZE_NAMED_PROPS||!1,Tt=e.KEEP_CONTENT!==!1,Et=e.IN_PLACE||!1,nt=xe(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Re,It=typeof e.NAMESPACE==`string`?e.NAMESPACE:Ft,Vt=L(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?H(e.MATHML_TEXT_INTEGRATION_POINTS):B({},Bt),Ut=L(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?H(e.HTML_INTEGRATION_POINTS):B({},Ht);let t=L(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?H(e.CUSTOM_ELEMENT_HANDLING):M(null);if(K=M(null),L(t,`tagNameCheck`)&&Yt(t.tagNameCheck)&&(K.tagNameCheck=t.tagNameCheck),L(t,`attributeNameCheck`)&&Yt(t.attributeNameCheck)&&(K.attributeNameCheck=t.attributeNameCheck),L(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(K.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),j(K),ft&&(lt=!1),bt&&(yt=!0),Dt&&(W=B({},Oe),G=M(null),Dt.html===!0&&(B(W,Se),B(G,ke)),Dt.svg===!0&&(B(W,Ce),B(G,Ae),B(G,Me)),Dt.svgFilters===!0&&(B(W,we),B(G,Ae),B(G,Me)),Dt.mathMl===!0&&(B(W,Ee),B(G,je),B(G,Me))),st.tagCheck=null,st.attributeCheck=null,L(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?st.tagCheck=e.ADD_TAGS:P(e.ADD_TAGS)&&(W===rt&&(W=H(W)),B(W,e.ADD_TAGS,J))),L(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?st.attributeCheck=e.ADD_ATTR:P(e.ADD_ATTR)&&(G===it&&(G=H(G)),B(G,e.ADD_ATTR,J))),L(e,`ADD_URI_SAFE_ATTR`)&&P(e.ADD_URI_SAFE_ATTR)&&B(jt,e.ADD_URI_SAFE_ATTR,J),L(e,`FORBID_CONTENTS`)&&P(e.FORBID_CONTENTS)&&(q===Ot&&(q=H(q)),B(q,e.FORBID_CONTENTS,J)),L(e,`ADD_FORBID_CONTENTS`)&&P(e.ADD_FORBID_CONTENTS)&&(q===Ot&&(q=H(q)),B(q,e.ADD_FORBID_CONTENTS,J)),Tt&&(W[`#text`]=!0),mt&&B(W,[`html`,`head`,`body`]),W.table&&(B(W,[`tbody`]),delete at.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ve(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ve(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=x;x=e.TRUSTED_TYPES_POLICY;try{S=O(``)}catch(e){throw x=t,e}}else e.TRUSTED_TYPES_POLICY===null?(x=void 0,S=``):(x===void 0&&(x=ee()),x&&typeof S==`string`&&(S=O(``)));A&&A(e),qt=e},Zt=B({},[...Ce,...we,...Te]),Qt=B({},[...Ee,...De]),$t=function(e,t,n){return t.namespaceURI===Ft?e===`svg`:t.namespaceURI===Nt?e===`svg`&&(n===`annotation-xml`||Vt[n]):!!Zt[e]},en=function(e,t,n){return t.namespaceURI===Ft?e===`math`:t.namespaceURI===Pt?e===`math`&&Ut[n]:!!Qt[e]},tn=function(e,t,n){return t.namespaceURI===Pt&&!Ut[n]||t.namespaceURI===Nt&&!Vt[n]?!1:!Qt[e]&&(Wt[e]||!Zt[e])},nn=function(e){let t=g(e);(!t||!t.tagName)&&(t={namespaceURI:It,tagName:`template`});let n=le(e.tagName),r=le(t.tagName);return Rt[e.namespaceURI]?e.namespaceURI===Pt?$t(n,t,r):e.namespaceURI===Nt?en(n,t,r):e.namespaceURI===Ft?tn(n,t,r):!!(Gt===`application/xhtml+xml`&&Rt[e.namespaceURI]):!1},rn=function(e){se(t.removed,{element:e});try{g(e).removeChild(e)}catch{if(p(e),!g(e))throw ve(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},an=function(e){let t=h(e);if(t){let e=[];ie(t,t=>{se(e,t)}),ie(e,e=>{try{p(e)}catch{}})}let n=v(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},on=function(e,n){try{se(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{se(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(yt||bt)try{rn(n)}catch{}else try{n.setAttribute(e,``)}catch{}},sn=function(e){let t=v(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||G[J(i)]))try{e.removeAttribute(i)}catch{}}},cn=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(y?y(e):e.nodeType)===qe.element&&sn(e);let n=h(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},ln=function(e){let t=null,r=null;if(vt)e=`<remove></remove>`+e;else{let t=de(e,/^[\r\n\t ]+/);r=t&&t[0]}Gt===`application/xhtml+xml`&&It===Ft&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=x?O(e):e;if(It===Ft)try{t=new l().parseFromString(i,Gt)}catch{}if(!t||!t.documentElement){t=N.createDocument(It,`template`,null);try{t.documentElement.innerHTML=Lt?S:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),It===Ft?F.call(t,mt?`html`:`body`)[0]:mt?t.documentElement:a},un=function(e){return ne.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Y=function(e){return e=fe(e,ge,` `),e=fe(e,_e,` `),e=fe(e,z,` `),e},dn=function(e){e.normalize();let t=ne.call(e.ownerDocument||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;)n.data=Y(n.data),n=t.nextNode();let r=e.querySelectorAll?.call(e,`template`);r&&ie(r,e=>{X(e.content)&&dn(e.content)})},fn=function(e){let t=b?b(e):null;return typeof t!=`string`||J(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==v(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==y(e)||e.childNodes!==h(e)},X=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return y(e)===qe.documentFragment}catch{return!1}},pn=function(e){if(!y||typeof e!=`object`||!e)return!1;try{return typeof y(e)==`number`}catch{return!1}};function mn(e,n,r){e.length!==0&&ie(e,e=>{e.call(t,n,r,qt)})}let hn=function(e,t){return!!(pt&&e.hasChildNodes()&&!pn(e.firstElementChild)&&R(Ue,e.textContent)&&R(Ue,e.innerHTML)||pt&&e.namespaceURI===Ft&&t===`style`&&pn(e.firstElementChild)||e.nodeType===qe.processingInstruction||pt&&e.nodeType===qe.comment&&R(We,e.data))},gn=function(e,t){if(!at[t]&&yn(t)&&(K.tagNameCheck instanceof RegExp&&R(K.tagNameCheck,t)||K.tagNameCheck instanceof Function&&K.tagNameCheck(t)))return!1;if(Tt&&!q[t]){let t=g(e),n=h(e);if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=Et?n[i]:f(n[i],!0);t.insertBefore(r,m(e))}}}return rn(e),!0},_n=function(e){if(mn(I.beforeSanitizeElements,e,null),fn(e))return rn(e),!0;let n=J(b?b(e):e.nodeName);if(mn(I.uponSanitizeElement,e,{tagName:n,allowedTags:W}),hn(e,n))return rn(e),!0;if(at[n]||!(st.tagCheck instanceof Function&&st.tagCheck(n))&&!W[n])return gn(e,n);if((y?y(e):e.nodeType)===qe.element&&!nn(e)||(n===`noscript`||n===`noembed`||n===`noframes`)&&R(Ge,e.innerHTML))return rn(e),!0;if(ft&&e.nodeType===qe.text){let n=Y(e.textContent);e.textContent!==n&&(se(t.removed,{element:e.cloneNode()}),e.textContent=n)}return mn(I.afterSanitizeElements,e,null),!1},vn=function(e,t,r){if(ot[t]||St&&(t===`id`||t===`name`)&&(r in n||r in Jt))return!1;let i=G[t]||st.attributeCheck instanceof Function&&st.attributeCheck(t,e);if(!(lt&&R(ye,t))&&!(ct&&R(V,t))){if(!i){if(!(yn(e)&&(K.tagNameCheck instanceof RegExp&&R(K.tagNameCheck,e)||K.tagNameCheck instanceof Function&&K.tagNameCheck(e))&&(K.attributeNameCheck instanceof RegExp&&R(K.attributeNameCheck,t)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(t,e))||t===`is`&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&R(K.tagNameCheck,r)||K.tagNameCheck instanceof Function&&K.tagNameCheck(r))))return!1}else if(!jt[t]&&!R(nt,fe(r,et,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&pe(r,`data:`)===0&&kt[e])&&!(ut&&!R($e,fe(r,et,``)))&&r)return!1}return!0},Z=B({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),yn=function(e){return!Z[le(e)]&&R(tt,e)},bn=function(e,t,n,r){if(x&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return O(r);case`TrustedScriptURL`:return k(r)}return r},Q=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),fn(e)?rn(e):oe(t.removed)}catch{on(n,e)}},xn=function(e){mn(I.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||fn(e))return;let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:G,forceKeepAttr:void 0},r=t.length,i=J(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=J(o),u=c,d=o===`value`?u:me(u);if(n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,mn(I.uponSanitizeAttribute,e,n),d=n.attrValue,Ct&&(l===`id`||l===`name`)&&pe(d,wt)!==0&&(on(o,e),d=wt+d),pt&&R(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){on(o,e);continue}if(l===`attributename`&&de(d,`href`)){on(o,e);continue}if(!n.forceKeepAttr){if(!n.keepAttr){on(o,e);continue}if(!dt&&R(Ke,d)){on(o,e);continue}if(ft&&(d=Y(d)),!vn(i,l,d)){on(o,e);continue}d=bn(i,l,s,d),d!==u&&Q(e,o,s,d)}}mn(I.afterSanitizeAttributes,e,null)},Sn=function(e){let t=null,n=un(e);for(mn(I.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(mn(I.uponSanitizeShadowNode,t,null),_n(t),xn(t),X(t.content)&&Sn(t.content),(y?y(t):t.nodeType)===qe.element){let e=_(t);X(e)&&($(e),Sn(e))}mn(I.afterSanitizeShadowDOM,e,null)},$=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Sn(e.shadow);continue}let n=e.node,r=(y?y(n):n.nodeType)===qe.element,i=h(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=b?b(n):null;if(typeof e==`string`&&J(e)===`template`){let e=n.content;X(e)&&t.push({node:e,shadow:null})}}if(r){let e=_(n);X(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Lt=!e,Lt&&(e=`<!-->`),typeof e!=`string`&&!pn(e)&&(e=be(e),typeof e!=`string`))throw ve(`dirty is not a string, aborting`);if(!t.isSupported)return e;ht?(W=gt,G=_t):Xt(n),(I.uponSanitizeElement.length>0||I.uponSanitizeAttribute.length>0)&&(W=H(W)),I.uponSanitizeAttribute.length>0&&(G=H(G)),t.removed=[];let c=Et&&typeof e!=`string`&&pn(e);if(c){let t=b?b(e):e.nodeName;if(typeof t==`string`){let e=J(t);if(!W[e]||at[e])throw ve(`root node is forbidden and cannot be sanitized in-place`)}if(fn(e))throw ve(`root node is clobbered and cannot be sanitized in-place`);try{$(e)}catch(t){throw an(e),t}}else if(pn(e))i=ln(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===qe.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),$(a);else{if(!yt&&!ft&&!mt&&e.indexOf(`<`)===-1)return x&&xt?O(e):e;if(i=ln(e),!i)return yt?null:xt?S:``}i&&vt&&rn(i.firstChild);let l=un(c?e:i);try{for(;o=l.nextNode();)_n(o),xn(o),X(o.content)&&Sn(o.content)}catch(t){throw c&&an(e),t}if(c)return ie(t.removed,e=>{e.element&&cn(e.element)}),ft&&dn(e),e;if(yt){if(ft&&dn(i),bt)for(s=re.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(G.shadowroot||G.shadowrootmode)&&(s=he.call(r,s,!0)),s}let u=mt?i.outerHTML:i.innerHTML;return mt&&W[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&R(Ve,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{$ as r,Q as i,X as a,Z as o,at as s,ct as c,dt as l,et as u,it as d,nt as f,ot as p,rt as m,st as h,tt as g,ut as _}from"./index-Ct31TjS-.js";import{t as v}from"./Button-ByiV6fpd.js";var y=e(n(),1),b=t(),x=`Dialog`,[S,C]=h(x),[w,T]=S(x),E=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,c=y.useRef(null),l=y.useRef(null),[u,d]=s({prop:r,defaultProp:i??!1,onChange:a,caller:x});return(0,b.jsx)(w,{scope:t,triggerRef:c,contentRef:l,contentId:m(),titleId:m(),descriptionId:m(),open:u,onOpenChange:d,onOpenToggle:y.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};E.displayName=x;var D=`DialogTrigger`,O=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(D,n),a=l(t,i.triggerRef);return(0,b.jsx)(c.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":J(i.open),...r,ref:a,onClick:p(e.onClick,i.onOpenToggle)})});O.displayName=D;var k=`DialogPortal`,[A,j]=S(k,{forceMount:void 0}),M=e=>{let{__scopeDialog:t,forceMount:n,children:i,container:a}=e,o=T(k,t);return(0,b.jsx)(A,{scope:t,forceMount:n,children:y.Children.map(i,e=>(0,b.jsx)(d,{present:n||o.open,children:(0,b.jsx)(r,{asChild:!0,container:a,children:e})}))})};M.displayName=k;var N=`DialogOverlay`,P=y.forwardRef((e,t)=>{let n=j(N,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=T(N,e.__scopeDialog);return a.modal?(0,b.jsx)(d,{present:r||a.open,children:(0,b.jsx)(I,{...i,ref:t})}):null});P.displayName=N;var F=_(`DialogOverlay.RemoveScroll`),I=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(N,n),a=l(t,f());return(0,b.jsx)(o,{as:F,allowPinchZoom:!0,shards:[i.contentRef],children:(0,b.jsx)(c.div,{"data-state":J(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),L=`DialogContent`,R=y.forwardRef((e,t)=>{let n=j(L,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=T(L,e.__scopeDialog);return(0,b.jsx)(d,{present:r||a.open,children:a.modal?(0,b.jsx)(z,{...i,ref:t}):(0,b.jsx)(B,{...i,ref:t})})});R.displayName=L;var z=y.forwardRef((e,t)=>{let n=T(L,e.__scopeDialog),r=y.useRef(null),i=l(t,n.contentRef,r);return y.useEffect(()=>{let e=r.current;if(e)return a(e)},[]),(0,b.jsx)(V,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:p(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:p(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:p(e.onFocusOutside,e=>e.preventDefault())})}),B=y.forwardRef((e,t)=>{let n=T(L,e.__scopeDialog),r=y.useRef(!1),i=y.useRef(!1);return(0,b.jsx)(V,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),V=y.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...s}=e,c=T(L,n);return i(),(0,b.jsx)(b.Fragment,{children:(0,b.jsx)(u,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,b.jsx)(g,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":J(c.open),...s,ref:t,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})}),H=`DialogTitle`,U=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(H,n);return(0,b.jsx)(c.h2,{id:i.titleId,...r,ref:t})});U.displayName=H;var W=`DialogDescription`,G=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(W,n);return(0,b.jsx)(c.p,{id:i.descriptionId,...r,ref:t})});G.displayName=W;var K=`DialogClose`,q=y.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=T(K,n);return(0,b.jsx)(c.button,{type:`button`,...r,ref:t,onClick:p(e.onClick,()=>i.onOpenChange(!1))})});q.displayName=K;function J(e){return e?`open`:`closed`}var Y=typeof document>`u`?y.useEffect:y.useLayoutEffect;function X(e){let t=e.activeElement;return!t||t===e.body||t===e.documentElement||!(`focus`in t)||typeof t.focus!=`function`?null:t}function Z(e,t){!e||!e.isConnected||e.ownerDocument!==t||e.focus({preventScroll:!0})}function Q({open:e,title:t,description:n,confirmLabel:r,confirmVariant:i=`danger`,onConfirm:a,onOpenChange:o}){let[s,c]=(0,y.useState)(!1),[l,u]=(0,y.useState)(null),d=(0,y.useRef)(null),f=(0,y.useRef)(!1);Y(()=>{e&&!f.current&&(d.current=X(document)),f.current=e},[e]),(0,y.useEffect)(()=>{e||(c(!1),u(null))},[e]);async function p(){c(!0),u(null);try{await a(),o(!1)}catch(e){u(e instanceof Error?e.message:String(e)),c(!1)}}return(0,b.jsx)(E,{open:e,onOpenChange:e=>{!e&&!s&&o(!1)},children:(0,b.jsxs)(M,{children:[(0,b.jsx)(P,{className:`fixed inset-0 z-50 bg-chocolate/35 backdrop-blur-[2px] data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`}),(0,b.jsxs)(R,{className:`fixed left-1/2 top-1/2 z-50 grid w-[calc(100%-2rem)] max-w-md -translate-x-1/2 -translate-y-1/2 gap-4 rounded-[16px] border border-frost bg-snow p-5 text-chocolate shadow-baziu-lg outline-none data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,onCloseAutoFocus:e=>{e.preventDefault();let t=d.current;d.current=null,Z(t,document)},onEscapeKeyDown:e=>{s&&e.preventDefault()},onPointerDownOutside:e=>{s&&e.preventDefault()},children:[(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(U,{className:`font-serif text-xl text-chocolate`,children:t}),(0,b.jsx)(G,{asChild:!0,children:(0,b.jsx)(`div`,{className:`text-sm leading-6 text-mocha`,children:n})})]}),l&&(0,b.jsx)(`p`,{role:`alert`,className:`rounded-md bg-danger/10 px-3 py-2 text-sm text-danger`,children:l}),(0,b.jsxs)(`div`,{className:`flex flex-col-reverse gap-2 border-t border-frost pt-4 sm:flex-row sm:justify-end`,children:[(0,b.jsx)(v,{variant:`ghost`,disabled:s,onClick:()=>o(!1),children:`cancel`}),(0,b.jsx)(v,{variant:i,disabled:s,onClick:()=>void p(),children:s?`working…`:r})]})]})]})})}export{G as a,U as c,R as i,E as n,P as o,q as r,M as s,Q as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-bztXdkDj.js";import{t as i}from"./ConfirmDialog-
|
|
1
|
+
import{r as e,t}from"./jsx-runtime-DGeXAQPT.js";import{t as n}from"./react-3W8R1pOO.js";import{d as r}from"./preload-helper-bztXdkDj.js";import{t as i}from"./ConfirmDialog-C908TxS5.js";import{t as a}from"./Button-ByiV6fpd.js";var o=e(n(),1),s=t();function c({field:e}){let t=r(),n=(0,o.useId)(),c=`${n}-description`,[l,u]=(0,o.useState)(e.kind===`config`?e.value??``:``),[d,f]=(0,o.useState)(!1),[p,m]=(0,o.useState)(null),[h,g]=(0,o.useState)(null),[_,v]=(0,o.useState)(!1),y=e.kind===`secret`&&l.trim().length===0;async function b(n){if(n.preventDefault(),y){m(e.set?`Paste a replacement value, or use remove credential to explicitly clear the stored secret.`:`A secret value is required.`);return}f(!0),m(null);try{let n=await fetch(`/api/config/fields/${encodeURIComponent(e.envVar)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({value:l})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`${n.status} ${n.statusText}`)}g(Date.now()),e.kind===`secret`&&u(``),await t.invalidate()}catch(e){m(e.message)}finally{f(!1)}}async function x(){let n=await fetch(`/api/config/fields/${encodeURIComponent(e.envVar)}`,{method:`DELETE`});if(!n.ok&&n.status!==204){let e=await n.json().catch(()=>null);throw Error(e?.error??`${n.status} ${n.statusText}`)}u(``),m(null),g(Date.now()),await t.invalidate()}return(0,s.jsxs)(`form`,{onSubmit:b,className:`grid grid-cols-1 gap-2 border-b py-3 last:border-0 md:grid-cols-[12rem_minmax(0,1fr)_auto_auto] md:items-center`,children:[(0,s.jsxs)(`div`,{className:`min-w-0`,children:[(0,s.jsx)(`label`,{htmlFor:n,className:`text-sm font-medium text-foreground`,children:e.label}),e.description&&(0,s.jsx)(`div`,{id:c,className:`text-xs text-muted-foreground mt-0.5`,children:e.description}),(0,s.jsxs)(`details`,{className:`mt-1 text-xs text-muted-foreground`,children:[(0,s.jsx)(`summary`,{className:`cursor-pointer`,children:`Advanced identifier`}),(0,s.jsx)(`code`,{className:`mt-1 inline-block break-all font-mono`,children:e.envVar})]})]}),(0,s.jsx)(`div`,{className:`min-w-0`,children:e.kind===`config`?(0,s.jsx)(`input`,{id:n,type:`text`,"aria-describedby":e.description?c:void 0,value:l,onChange:e=>u(e.target.value),placeholder:e.placeholder??``,className:`w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30`}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(`input`,{id:n,type:`password`,"aria-describedby":e.description?c:void 0,value:l,onChange:e=>u(e.target.value),placeholder:e.set?`(paste to replace stored value)`:e.placeholder??`paste key…`,autoComplete:`off`,className:`w-full rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:ring-2 focus:ring-ring/30`}),e.set&&(0,s.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Blank keeps the current credential. Removal is a separate explicit action.`})]})}),(0,s.jsxs)(`span`,{className:`text-xs`,children:[e.kind===`secret`&&e.set&&(0,s.jsx)(`span`,{className:`rounded-full bg-success/10 text-success px-1.5 py-0.5`,title:`preview: ${e.preview??``}`,children:`set`}),h&&Date.now()-h<2e3&&(0,s.jsx)(`span`,{role:`status`,className:`text-success ml-2`,children:`saved ✓`})]}),(0,s.jsxs)(`div`,{className:`flex flex-wrap gap-2 md:justify-self-end`,children:[(0,s.jsx)(a,{variant:`ghost`,type:`submit`,disabled:d||y,className:`text-xs`,children:`save`}),e.kind===`secret`&&e.set&&(0,s.jsx)(a,{variant:`danger`,className:`text-xs`,onClick:()=>v(!0),children:`remove`})]}),p&&(0,s.jsx)(`p`,{role:`alert`,className:`text-xs text-danger md:col-span-4`,children:p}),(0,s.jsx)(i,{open:_,title:`Remove ${e.label}?`,description:(0,s.jsxs)(`p`,{children:[`This permanently deletes the stored `,(0,s.jsx)(`code`,{className:`font-mono`,children:e.envVar}),` `,`credential. Features that use it will fail until you save a replacement.`]}),confirmLabel:`remove stored credential`,onConfirm:x,onOpenChange:v})]})}export{c as t};
|