@sentry/junior 0.318.0 → 0.319.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/{context-BKF_5zzI.js → adapter-8_S6Birm.js} +537 -537
- package/dist/{admin-UOHix_5P.js → admin-EsbUON1j.js} +1 -1
- package/dist/{agent-runner-DeYymwh2.js → agent-CtzMl32d.js} +18608 -5452
- package/dist/{agent-status-BA5x3Xtp.js → agent-status-Bq_AIpyp.js} +105 -1
- package/dist/{agent-update-delivery-DH8bx7jU.js → agent-update-delivery-pAvsbuGL.js} +4 -5
- package/dist/api/schema.d.ts +43 -23
- package/dist/api/schema.js +4 -4
- package/dist/api.js +70 -80
- package/dist/{app-DKAOuaoC.d.ts → app-tACXxJPI.d.ts} +4 -4
- package/dist/app.d.ts +2 -2
- package/dist/app.js +213 -91
- package/dist/{change-record-BzJgLsv7.d.ts → change-record-K-KsqNhT.d.ts} +9 -5
- package/dist/{channel-access-A0de5lRv.js → channel-access-DET5hzZM.js} +1 -1
- package/dist/{chat-core-engine-D3Wd7f5n.js → chat-core-engine-DpM3tMVi.js} +5 -5
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +23 -23
- package/dist/cli/check.js +5 -5
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.d.ts +1 -1
- package/dist/cli/plugins.js +8 -8
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -4
- package/dist/{continue-in-slack-YxwMQVeR.js → continue-in-slack-CFzDyxkH.js} +3 -3
- package/dist/{conversation-feed-Cj7IuBtM.js → conversation-feed-DEUdD7mb.js} +2 -106
- package/dist/{conversation-privacy-Cr_dNW1p.js → conversation-privacy-C2vYK55O.js} +1 -1
- package/dist/{create-Btl1y1rq.js → create-Ta3SEIB5.js} +115 -5
- package/dist/{credential-sync-DTarZ63K.js → credential-sync-DyRqDmY4.js} +15 -18
- package/dist/{db-of6e3sGt.js → db-BCaNWl9p.js} +4579 -717
- package/dist/{deployment-C0qXa0FD.js → deployment-CfOew1Tm.js} +3 -3
- package/dist/{engine-context-C_QL_bMQ.js → engine-context-CiExoy1B.js} +144 -149
- package/dist/{html-9_pS9SjY.js → html-Bb2Si1bR.js} +6 -8
- package/dist/instrumentation.js +7 -23
- package/dist/list-wwDcROh9.js +5007 -0
- package/dist/{logging-BnOG0qz2.js → logging-BRPTXAdf.js} +8 -33
- package/dist/{mailbox-turn-Byrry9o1.js → markers-9QoqW5ov.js} +1675 -1255
- package/dist/nitro.d.ts +2 -2
- package/dist/nitro.js +6 -7
- package/dist/{oauth-callback-server-CjnnUr4o.js → oauth-callback-server-vhL9b-PZ.js} +2 -2
- package/dist/{oauth-relay-BvHFH0fV.js → oauth-relay-CH2v7WiB.js} +1 -1
- package/dist/{plugins-fBrz8PCV.d.ts → plugins-DhGXZjlu.d.ts} +1 -0
- package/dist/{profile-iHw1uu32.js → profile-D9LdwmZi.js} +16 -18
- package/dist/{prompt-DEkStuxG.js → prompt-3TqxEOtc.js} +1 -1
- package/dist/{reports-C1d9azyV.js → reports-K-tbtEyx.js} +2 -2
- package/dist/{resolve-DC6zBuDV.js → resolve-BBV2qf8A.js} +5 -5
- package/dist/{result-DxewDuXb.js → result-5IdGJP4M.js} +20 -9
- package/dist/{runner-99YxVN_r.js → runner-BK_joPlM.js} +7 -8
- package/dist/{sandbox-egress-signals-CgoX5CTI.js → sandbox-egress-signals-DXgWXXmm.js} +1 -1
- package/dist/{schema-BTojNBr5.js → schema-zWGG6VC1.js} +13 -7
- package/dist/{service-account-YDCPSByj.js → service-account-CateFyhw.js} +4 -5
- package/dist/{skills-CleC0Hze.js → skills-Ccjw8h2P.js} +9 -9
- package/dist/{slack-conversation-unfurl-BNQLC12R.js → slack-conversation-unfurl-ZC_TSpc4.js} +7 -7
- package/dist/storage-C9U7R5rM.js +273 -0
- package/dist/{system-prompt-table-Ci6Ck4gk.js → system-prompt-table-YBTHIFlP.js} +26 -84
- package/dist/topic-B2EWKKBT.js +6 -0
- package/dist/{package-discovery-DD9vencX.js → topics-DxuKurCX.js} +21 -1
- package/dist/{types-DCzTAA63.js → types-BNHkJrOP.js} +25 -11
- package/dist/{users-Cb9c1k9q.js → users-CCRAqYb_.js} +1 -1
- package/dist/{validation-BiUmWPhy.js → validation-BCUpJa8K.js} +4 -4
- package/dist/{version-VEXiEcZu.js → version-BNm0JYj3.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{worker-ChWYQdhm.js → worker-BhgpZ7_b.js} +4 -4
- package/migrations/20261127052408_space_name_nullable/migration.sql +5 -0
- package/migrations/20261127052408_space_name_nullable/snapshot.json +29 -0
- package/migrations/20261127060000_annotation_object_id_index/migration.sql +1 -0
- package/migrations/20261127060000_annotation_object_id_index/snapshot.json +69 -0
- package/migrations/20261127060001_annotation_subjects/migration.sql +78 -0
- package/migrations/20261127060001_annotation_subjects/snapshot.json +104 -0
- package/migrations/20261127060002_annotation_subject_index/migration.sql +1 -0
- package/migrations/20261127060002_annotation_subject_index/snapshot.json +70 -0
- package/migrations/20261127060003_annotation_title_url/migration.sql +84 -0
- package/migrations/20261127060003_annotation_title_url/snapshot.json +73 -0
- package/package.json +9 -7
- package/dist/auth-pause-state-f9hJM_zO.js +0 -113
- package/dist/catalog-runtime-BfdAnztW.js +0 -6
- package/dist/child-message-peFWLcCZ.js +0 -15
- package/dist/conversation-turn-Bru4w_FD.js +0 -1250
- package/dist/job-runner-B2XEvpif.js +0 -1505
- package/dist/lineage-nh4z9iQN.js +0 -36
- package/dist/list-HRP3TIRl.js +0 -12631
- package/dist/markers-CTTtJqYn.js +0 -342
- package/dist/message-BRUuLgrY.js +0 -153
- package/dist/model-input-CFC62mf-.js +0 -82
- package/dist/registry-Cl7Labpe.js +0 -3279
- package/dist/run-conversation-Cz2ubZK-.js +0 -337
- package/dist/sender-actors-77zTQbSG.js +0 -84
- package/dist/spawn-DuZfodPa.js +0 -45
- package/dist/task-runner-BJ9Up3bG.js +0 -1529
- package/dist/topic-CRYYBYp-.js +0 -7
- package/dist/topics-BoCkoPJJ.js +0 -21
- package/dist/turn-membership-VT7XZh-L.js +0 -856
- package/dist/turn-wake-C7HeLHAM.js +0 -151
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "diff",
|
|
3
|
+
"version": "10",
|
|
4
|
+
"dialect": "postgres",
|
|
5
|
+
"id": "770bb17f-6db0-4c09-b900-5a19bce14b7e",
|
|
6
|
+
"prevIds": ["811305d1-7881-43e6-9f0c-280f35526253"],
|
|
7
|
+
"footprints": [
|
|
8
|
+
{
|
|
9
|
+
"statementType": "alter_column",
|
|
10
|
+
"statementTarget": ["column", "public", "junior_spaces", "name"],
|
|
11
|
+
"writes": ["s|colprop|public.junior_spaces.name.notNull"],
|
|
12
|
+
"reads": [
|
|
13
|
+
"n|tbl|public.junior_spaces",
|
|
14
|
+
"n|sch|public",
|
|
15
|
+
"n|col|public.junior_spaces.name"
|
|
16
|
+
],
|
|
17
|
+
"sqlHash": "729e3a210f86c713"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"deltas": [
|
|
21
|
+
{
|
|
22
|
+
"op": "alter",
|
|
23
|
+
"key": "columns\u0000[\"public\",\"junior_spaces\",\"name\"]",
|
|
24
|
+
"set": {
|
|
25
|
+
"notNull": false
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE INDEX CONCURRENTLY IF NOT EXISTS "junior_conversation_annotations_object_id_idx" ON "junior_conversation_annotations" ("plugin",("annotation_json" ->> 'objectId'),"created_at") WHERE "kind" = 'object' and ("annotation_json" ->> 'objectId') is not null;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "diff",
|
|
3
|
+
"version": "10",
|
|
4
|
+
"dialect": "postgres",
|
|
5
|
+
"id": "798b04e0-3f09-46d8-8a21-aefeaa9921f9",
|
|
6
|
+
"prevIds": ["770bb17f-6db0-4c09-b900-5a19bce14b7e"],
|
|
7
|
+
"footprints": [
|
|
8
|
+
{
|
|
9
|
+
"statementType": "create_index",
|
|
10
|
+
"statementTarget": [
|
|
11
|
+
"index",
|
|
12
|
+
"public",
|
|
13
|
+
"junior_conversation_annotations",
|
|
14
|
+
"junior_conversation_annotations_object_id_idx"
|
|
15
|
+
],
|
|
16
|
+
"writes": [
|
|
17
|
+
"s|idx|public.junior_conversation_annotations_object_id_idx",
|
|
18
|
+
"n|idx|public.junior_conversation_annotations_object_id_idx",
|
|
19
|
+
"e|idx|public.junior_conversation_annotations_object_id_idx",
|
|
20
|
+
"n|rel|public.junior_conversation_annotations_object_id_idx"
|
|
21
|
+
],
|
|
22
|
+
"reads": [
|
|
23
|
+
"n|tbl|public.junior_conversation_annotations",
|
|
24
|
+
"n|sch|public",
|
|
25
|
+
"n|col|public.junior_conversation_annotations.plugin",
|
|
26
|
+
"n|col|public.junior_conversation_annotations.created_at"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"deltas": [
|
|
31
|
+
{
|
|
32
|
+
"op": "create",
|
|
33
|
+
"row": {
|
|
34
|
+
"schema": "public",
|
|
35
|
+
"table": "junior_conversation_annotations",
|
|
36
|
+
"name": "junior_conversation_annotations_object_id_idx",
|
|
37
|
+
"nameExplicit": true,
|
|
38
|
+
"columns": [
|
|
39
|
+
{
|
|
40
|
+
"value": "plugin",
|
|
41
|
+
"isExpression": false,
|
|
42
|
+
"asc": true,
|
|
43
|
+
"nullsFirst": false,
|
|
44
|
+
"opclass": null
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"value": "(\"annotation_json\" ->> 'objectId')",
|
|
48
|
+
"isExpression": true,
|
|
49
|
+
"asc": true,
|
|
50
|
+
"nullsFirst": false,
|
|
51
|
+
"opclass": null
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"value": "created_at",
|
|
55
|
+
"isExpression": false,
|
|
56
|
+
"asc": true,
|
|
57
|
+
"nullsFirst": false,
|
|
58
|
+
"opclass": null
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"isUnique": false,
|
|
62
|
+
"where": "\"kind\" = 'object' and (\"annotation_json\" ->> 'objectId') is not null",
|
|
63
|
+
"with": "",
|
|
64
|
+
"method": "btree",
|
|
65
|
+
"entityType": "indexes"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
ALTER TABLE "junior_conversation_annotations" ADD COLUMN "subject_kind" text;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "junior_conversation_annotations" ADD COLUMN "subject_id" text;--> statement-breakpoint
|
|
3
|
+
ALTER TABLE "junior_conversation_annotations" ADD COLUMN "action" text;--> statement-breakpoint
|
|
4
|
+
-- Each Annotation names its object by a subject, as an Inbox item does, and
|
|
5
|
+
-- says what the Conversation did to it. New code writes both. Old workers
|
|
6
|
+
-- still write rows without them while this release rolls out, and new code
|
|
7
|
+
-- writes none for an object whose provider id it does not know, so a
|
|
8
|
+
-- trigger fills them from the saved JSON. The backfill below fires the same
|
|
9
|
+
-- trigger.
|
|
10
|
+
--
|
|
11
|
+
-- The subject of a saved object, by its plugin and type:
|
|
12
|
+
-- - An Automation card of core (`junior`) is the core `automation` kind,
|
|
13
|
+
-- with the Automation id.
|
|
14
|
+
-- - A GitHub pull request is `github:pull_request`, with GitHub's id of it,
|
|
15
|
+
-- read from the code change records by the repository and number in the
|
|
16
|
+
-- key. A GitHub issue is `github:issue`, with the `objectId` that new
|
|
17
|
+
-- issue cards saved.
|
|
18
|
+
-- - A Calendar event, a Vercel deployment, and a Linear Ticket keep their
|
|
19
|
+
-- key, which is the provider id (a Ticket's is its identifier).
|
|
20
|
+
-- - Any other object, such as an attached link or a GitHub object whose id
|
|
21
|
+
-- is not known, is the core `link` kind, with its link.
|
|
22
|
+
-- Every saved object was changed: the old JSON does not say which
|
|
23
|
+
-- Conversation created it.
|
|
24
|
+
CREATE OR REPLACE FUNCTION "junior_conversation_annotations_legacy_subject"()
|
|
25
|
+
RETURNS trigger
|
|
26
|
+
LANGUAGE plpgsql
|
|
27
|
+
AS $function$
|
|
28
|
+
DECLARE
|
|
29
|
+
object_type text := NEW."annotation_json"->>'objectType';
|
|
30
|
+
url text := NEW."annotation_json"->>'url';
|
|
31
|
+
github_ref text := CASE
|
|
32
|
+
WHEN NEW."plugin" = 'github' AND NEW."key" ~ '^[^#]+#[0-9]+$' THEN NEW."key"
|
|
33
|
+
END;
|
|
34
|
+
github_pull_request boolean := github_ref IS NOT NULL AND (
|
|
35
|
+
object_type = 'code_change'
|
|
36
|
+
OR (object_type IS NULL AND url ~ '^https://github\.com/[^/]+/[^/]+/pull/[0-9]+')
|
|
37
|
+
);
|
|
38
|
+
kind text;
|
|
39
|
+
id text;
|
|
40
|
+
BEGIN
|
|
41
|
+
IF NEW."plugin" = 'junior' AND object_type = 'automation' THEN
|
|
42
|
+
kind := 'automation';
|
|
43
|
+
id := NEW."key";
|
|
44
|
+
ELSIF github_pull_request THEN
|
|
45
|
+
SELECT c."provider_id" INTO id
|
|
46
|
+
FROM "junior_code_changes" c
|
|
47
|
+
JOIN "junior_code_repositories" r ON r."id" = c."repository_id"
|
|
48
|
+
WHERE c."provider" = 'github'
|
|
49
|
+
AND lower(r."name") = lower(split_part(github_ref, '#', 1))
|
|
50
|
+
AND c."number" = split_part(github_ref, '#', 2)::integer
|
|
51
|
+
LIMIT 1;
|
|
52
|
+
kind := CASE WHEN id IS NOT NULL THEN 'github:pull_request' END;
|
|
53
|
+
ELSIF github_ref IS NOT NULL THEN
|
|
54
|
+
id := NEW."annotation_json"->>'objectId';
|
|
55
|
+
kind := CASE WHEN id IS NOT NULL THEN 'github:issue' END;
|
|
56
|
+
ELSIF NEW."plugin" = 'google' AND object_type = 'calendar_event' THEN
|
|
57
|
+
kind := 'google:calendar_event';
|
|
58
|
+
id := NEW."key";
|
|
59
|
+
ELSIF NEW."plugin" = 'vercel' AND object_type = 'deployment' THEN
|
|
60
|
+
kind := 'vercel:deployment';
|
|
61
|
+
id := NEW."key";
|
|
62
|
+
ELSIF NEW."plugin" = 'linear' AND object_type = 'task' THEN
|
|
63
|
+
kind := 'linear:issue';
|
|
64
|
+
id := NEW."key";
|
|
65
|
+
END IF;
|
|
66
|
+
IF NEW."subject_kind" IS NULL THEN
|
|
67
|
+
NEW."subject_kind" := coalesce(kind, 'link');
|
|
68
|
+
NEW."subject_id" := CASE WHEN kind IS NOT NULL THEN id ELSE coalesce(url, NEW."key") END;
|
|
69
|
+
END IF;
|
|
70
|
+
IF NEW."action" IS NULL THEN
|
|
71
|
+
NEW."action" := 'changed';
|
|
72
|
+
END IF;
|
|
73
|
+
RETURN NEW;
|
|
74
|
+
END;
|
|
75
|
+
$function$;--> statement-breakpoint
|
|
76
|
+
CREATE TRIGGER "junior_conversation_annotations_legacy_subject" BEFORE INSERT OR UPDATE ON "junior_conversation_annotations" FOR EACH ROW WHEN (NEW."subject_kind" IS NULL OR NEW."action" IS NULL) EXECUTE FUNCTION "junior_conversation_annotations_legacy_subject"();--> statement-breakpoint
|
|
77
|
+
-- junior:bounded-backfill: every saved Annotation needs its subject before search and the new primary key use it, so the update runs once over the Annotation table. Each Conversation has only the few objects that it created or changed, and the update writes each row once.
|
|
78
|
+
UPDATE "junior_conversation_annotations" SET "subject_kind" = NULL;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "diff",
|
|
3
|
+
"version": "10",
|
|
4
|
+
"dialect": "postgres",
|
|
5
|
+
"id": "66414dd3-69b3-4341-aa2e-e40525f1a6ea",
|
|
6
|
+
"prevIds": ["798b04e0-3f09-46d8-8a21-aefeaa9921f9"],
|
|
7
|
+
"footprints": [
|
|
8
|
+
{
|
|
9
|
+
"statementType": "add_column",
|
|
10
|
+
"statementTarget": [
|
|
11
|
+
"column",
|
|
12
|
+
"public",
|
|
13
|
+
"junior_conversation_annotations",
|
|
14
|
+
"subject_kind"
|
|
15
|
+
],
|
|
16
|
+
"writes": [
|
|
17
|
+
"s|col|public.junior_conversation_annotations.subject_kind",
|
|
18
|
+
"n|col|public.junior_conversation_annotations.subject_kind",
|
|
19
|
+
"e|col|public.junior_conversation_annotations.subject_kind"
|
|
20
|
+
],
|
|
21
|
+
"reads": ["n|tbl|public.junior_conversation_annotations", "n|sch|public"]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"statementType": "add_column",
|
|
25
|
+
"statementTarget": [
|
|
26
|
+
"column",
|
|
27
|
+
"public",
|
|
28
|
+
"junior_conversation_annotations",
|
|
29
|
+
"subject_id"
|
|
30
|
+
],
|
|
31
|
+
"writes": [
|
|
32
|
+
"s|col|public.junior_conversation_annotations.subject_id",
|
|
33
|
+
"n|col|public.junior_conversation_annotations.subject_id",
|
|
34
|
+
"e|col|public.junior_conversation_annotations.subject_id"
|
|
35
|
+
],
|
|
36
|
+
"reads": ["n|tbl|public.junior_conversation_annotations", "n|sch|public"]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"statementType": "add_column",
|
|
40
|
+
"statementTarget": [
|
|
41
|
+
"column",
|
|
42
|
+
"public",
|
|
43
|
+
"junior_conversation_annotations",
|
|
44
|
+
"action"
|
|
45
|
+
],
|
|
46
|
+
"writes": [
|
|
47
|
+
"s|col|public.junior_conversation_annotations.action",
|
|
48
|
+
"n|col|public.junior_conversation_annotations.action",
|
|
49
|
+
"e|col|public.junior_conversation_annotations.action"
|
|
50
|
+
],
|
|
51
|
+
"reads": ["n|tbl|public.junior_conversation_annotations", "n|sch|public"]
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"deltas": [
|
|
55
|
+
{
|
|
56
|
+
"op": "create",
|
|
57
|
+
"row": {
|
|
58
|
+
"schema": "public",
|
|
59
|
+
"table": "junior_conversation_annotations",
|
|
60
|
+
"name": "subject_kind",
|
|
61
|
+
"type": "text",
|
|
62
|
+
"typeSchema": null,
|
|
63
|
+
"notNull": false,
|
|
64
|
+
"dimensions": 0,
|
|
65
|
+
"default": null,
|
|
66
|
+
"generated": null,
|
|
67
|
+
"identity": null,
|
|
68
|
+
"entityType": "columns"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"op": "create",
|
|
73
|
+
"row": {
|
|
74
|
+
"schema": "public",
|
|
75
|
+
"table": "junior_conversation_annotations",
|
|
76
|
+
"name": "subject_id",
|
|
77
|
+
"type": "text",
|
|
78
|
+
"typeSchema": null,
|
|
79
|
+
"notNull": false,
|
|
80
|
+
"dimensions": 0,
|
|
81
|
+
"default": null,
|
|
82
|
+
"generated": null,
|
|
83
|
+
"identity": null,
|
|
84
|
+
"entityType": "columns"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"op": "create",
|
|
89
|
+
"row": {
|
|
90
|
+
"schema": "public",
|
|
91
|
+
"table": "junior_conversation_annotations",
|
|
92
|
+
"name": "action",
|
|
93
|
+
"type": "text",
|
|
94
|
+
"typeSchema": null,
|
|
95
|
+
"notNull": false,
|
|
96
|
+
"dimensions": 0,
|
|
97
|
+
"default": null,
|
|
98
|
+
"generated": null,
|
|
99
|
+
"identity": null,
|
|
100
|
+
"entityType": "columns"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
CREATE INDEX CONCURRENTLY IF NOT EXISTS "junior_conversation_annotations_subject_idx" ON "junior_conversation_annotations" ("subject_kind","subject_id","created_at") WHERE "subject_kind" is not null;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "diff",
|
|
3
|
+
"version": "10",
|
|
4
|
+
"dialect": "postgres",
|
|
5
|
+
"id": "89760bcd-1994-47e8-84ba-0c99d5b9f3b4",
|
|
6
|
+
"prevIds": ["66414dd3-69b3-4341-aa2e-e40525f1a6ea"],
|
|
7
|
+
"footprints": [
|
|
8
|
+
{
|
|
9
|
+
"statementType": "create_index",
|
|
10
|
+
"statementTarget": [
|
|
11
|
+
"index",
|
|
12
|
+
"public",
|
|
13
|
+
"junior_conversation_annotations",
|
|
14
|
+
"junior_conversation_annotations_subject_idx"
|
|
15
|
+
],
|
|
16
|
+
"writes": [
|
|
17
|
+
"s|idx|public.junior_conversation_annotations_subject_idx",
|
|
18
|
+
"n|idx|public.junior_conversation_annotations_subject_idx",
|
|
19
|
+
"e|idx|public.junior_conversation_annotations_subject_idx",
|
|
20
|
+
"n|rel|public.junior_conversation_annotations_subject_idx"
|
|
21
|
+
],
|
|
22
|
+
"reads": [
|
|
23
|
+
"n|tbl|public.junior_conversation_annotations",
|
|
24
|
+
"n|sch|public",
|
|
25
|
+
"n|col|public.junior_conversation_annotations.subject_kind",
|
|
26
|
+
"n|col|public.junior_conversation_annotations.subject_id",
|
|
27
|
+
"n|col|public.junior_conversation_annotations.created_at"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"deltas": [
|
|
32
|
+
{
|
|
33
|
+
"op": "create",
|
|
34
|
+
"row": {
|
|
35
|
+
"schema": "public",
|
|
36
|
+
"table": "junior_conversation_annotations",
|
|
37
|
+
"name": "junior_conversation_annotations_subject_idx",
|
|
38
|
+
"nameExplicit": true,
|
|
39
|
+
"columns": [
|
|
40
|
+
{
|
|
41
|
+
"value": "subject_kind",
|
|
42
|
+
"isExpression": false,
|
|
43
|
+
"asc": true,
|
|
44
|
+
"nullsFirst": false,
|
|
45
|
+
"opclass": null
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"value": "subject_id",
|
|
49
|
+
"isExpression": false,
|
|
50
|
+
"asc": true,
|
|
51
|
+
"nullsFirst": false,
|
|
52
|
+
"opclass": null
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"value": "created_at",
|
|
56
|
+
"isExpression": false,
|
|
57
|
+
"asc": true,
|
|
58
|
+
"nullsFirst": false,
|
|
59
|
+
"opclass": null
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"isUnique": false,
|
|
63
|
+
"where": "\"subject_kind\" is not null",
|
|
64
|
+
"with": "",
|
|
65
|
+
"method": "btree",
|
|
66
|
+
"entityType": "indexes"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
ALTER TABLE "junior_conversation_annotations" ADD COLUMN "title" text;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE "junior_conversation_annotations" ADD COLUMN "url" text;--> statement-breakpoint
|
|
3
|
+
-- New code writes no link in the JSON, so the subject of an object without
|
|
4
|
+
-- a provider id comes from the `url` column. An old worker's row still has
|
|
5
|
+
-- the link only in its JSON.
|
|
6
|
+
CREATE OR REPLACE FUNCTION "junior_conversation_annotations_legacy_subject"()
|
|
7
|
+
RETURNS trigger
|
|
8
|
+
LANGUAGE plpgsql
|
|
9
|
+
AS $function$
|
|
10
|
+
DECLARE
|
|
11
|
+
object_type text := NEW."annotation_json"->>'objectType';
|
|
12
|
+
url text := coalesce(NEW."url", NEW."annotation_json"->>'url');
|
|
13
|
+
github_ref text := CASE
|
|
14
|
+
WHEN NEW."plugin" = 'github' AND NEW."key" ~ '^[^#]+#[0-9]+$' THEN NEW."key"
|
|
15
|
+
END;
|
|
16
|
+
github_pull_request boolean := github_ref IS NOT NULL AND (
|
|
17
|
+
object_type = 'code_change'
|
|
18
|
+
OR (object_type IS NULL AND url ~ '^https://github\.com/[^/]+/[^/]+/pull/[0-9]+')
|
|
19
|
+
);
|
|
20
|
+
kind text;
|
|
21
|
+
id text;
|
|
22
|
+
BEGIN
|
|
23
|
+
IF NEW."plugin" = 'junior' AND object_type = 'automation' THEN
|
|
24
|
+
kind := 'automation';
|
|
25
|
+
id := NEW."key";
|
|
26
|
+
ELSIF github_pull_request THEN
|
|
27
|
+
SELECT c."provider_id" INTO id
|
|
28
|
+
FROM "junior_code_changes" c
|
|
29
|
+
JOIN "junior_code_repositories" r ON r."id" = c."repository_id"
|
|
30
|
+
WHERE c."provider" = 'github'
|
|
31
|
+
AND lower(r."name") = lower(split_part(github_ref, '#', 1))
|
|
32
|
+
AND c."number" = split_part(github_ref, '#', 2)::integer
|
|
33
|
+
LIMIT 1;
|
|
34
|
+
kind := CASE WHEN id IS NOT NULL THEN 'github:pull_request' END;
|
|
35
|
+
ELSIF github_ref IS NOT NULL THEN
|
|
36
|
+
id := NEW."annotation_json"->>'objectId';
|
|
37
|
+
kind := CASE WHEN id IS NOT NULL THEN 'github:issue' END;
|
|
38
|
+
ELSIF NEW."plugin" = 'google' AND object_type = 'calendar_event' THEN
|
|
39
|
+
kind := 'google:calendar_event';
|
|
40
|
+
id := NEW."key";
|
|
41
|
+
ELSIF NEW."plugin" = 'vercel' AND object_type = 'deployment' THEN
|
|
42
|
+
kind := 'vercel:deployment';
|
|
43
|
+
id := NEW."key";
|
|
44
|
+
ELSIF NEW."plugin" = 'linear' AND object_type = 'task' THEN
|
|
45
|
+
kind := 'linear:issue';
|
|
46
|
+
id := NEW."key";
|
|
47
|
+
END IF;
|
|
48
|
+
IF NEW."subject_kind" IS NULL THEN
|
|
49
|
+
NEW."subject_kind" := coalesce(kind, 'link');
|
|
50
|
+
NEW."subject_id" := CASE WHEN kind IS NOT NULL THEN id ELSE coalesce(url, NEW."key") END;
|
|
51
|
+
END IF;
|
|
52
|
+
IF NEW."action" IS NULL THEN
|
|
53
|
+
NEW."action" := 'changed';
|
|
54
|
+
END IF;
|
|
55
|
+
RETURN NEW;
|
|
56
|
+
END;
|
|
57
|
+
$function$;--> statement-breakpoint
|
|
58
|
+
-- An Annotation stores the title and the link of its object in columns,
|
|
59
|
+
-- and no other fact of it: a card reads the object live. Old workers still
|
|
60
|
+
-- write the title, the link, and the other facts in the JSON while this
|
|
61
|
+
-- release rolls out, so a trigger moves the title and the link to their
|
|
62
|
+
-- columns and drops the rest. A link that a person attached keeps no title.
|
|
63
|
+
-- Triggers run in name order, so this one runs after
|
|
64
|
+
-- `junior_conversation_annotations_legacy_subject`, which reads the old
|
|
65
|
+
-- JSON. The backfill below fires it for every saved Annotation.
|
|
66
|
+
CREATE OR REPLACE FUNCTION "junior_conversation_annotations_stored_fields"()
|
|
67
|
+
RETURNS trigger
|
|
68
|
+
LANGUAGE plpgsql
|
|
69
|
+
AS $function$
|
|
70
|
+
BEGIN
|
|
71
|
+
IF NEW."kind" = 'object' THEN
|
|
72
|
+
NEW."title" := coalesce(NEW."annotation_json"->>'title', NEW."title");
|
|
73
|
+
END IF;
|
|
74
|
+
NEW."url" := coalesce(NEW."annotation_json"->>'url', NEW."url");
|
|
75
|
+
NEW."annotation_json" := NEW."annotation_json" - ARRAY[
|
|
76
|
+
'title', 'url', 'label', 'status', 'description', 'facts',
|
|
77
|
+
'sourceUpdatedAt', 'warning', 'trigger', 'displayType'
|
|
78
|
+
];
|
|
79
|
+
RETURN NEW;
|
|
80
|
+
END;
|
|
81
|
+
$function$;--> statement-breakpoint
|
|
82
|
+
CREATE TRIGGER "junior_conversation_annotations_stored_fields" BEFORE INSERT OR UPDATE ON "junior_conversation_annotations" FOR EACH ROW WHEN (NEW."annotation_json" ?| ARRAY['title', 'url', 'label', 'status', 'description', 'facts', 'sourceUpdatedAt', 'warning', 'trigger', 'displayType']) EXECUTE FUNCTION "junior_conversation_annotations_stored_fields"();--> statement-breakpoint
|
|
83
|
+
-- junior:bounded-backfill: every saved Annotation needs its title and link in the columns before search and cards read them, so the update runs once over the Annotation table. Each Conversation has only the few objects that it created or changed, and the update writes each row once.
|
|
84
|
+
UPDATE "junior_conversation_annotations" SET "annotation_json" = "annotation_json" WHERE "annotation_json" ?| ARRAY['title', 'url', 'label', 'status', 'description', 'facts', 'sourceUpdatedAt', 'warning', 'trigger', 'displayType'];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "diff",
|
|
3
|
+
"version": "10",
|
|
4
|
+
"dialect": "postgres",
|
|
5
|
+
"id": "8a318893-4b46-4fb3-9e04-6361efea0a02",
|
|
6
|
+
"prevIds": ["89760bcd-1994-47e8-84ba-0c99d5b9f3b4"],
|
|
7
|
+
"footprints": [
|
|
8
|
+
{
|
|
9
|
+
"statementType": "add_column",
|
|
10
|
+
"statementTarget": [
|
|
11
|
+
"column",
|
|
12
|
+
"public",
|
|
13
|
+
"junior_conversation_annotations",
|
|
14
|
+
"title"
|
|
15
|
+
],
|
|
16
|
+
"writes": [
|
|
17
|
+
"s|col|public.junior_conversation_annotations.title",
|
|
18
|
+
"n|col|public.junior_conversation_annotations.title",
|
|
19
|
+
"e|col|public.junior_conversation_annotations.title"
|
|
20
|
+
],
|
|
21
|
+
"reads": ["n|tbl|public.junior_conversation_annotations", "n|sch|public"]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"statementType": "add_column",
|
|
25
|
+
"statementTarget": [
|
|
26
|
+
"column",
|
|
27
|
+
"public",
|
|
28
|
+
"junior_conversation_annotations",
|
|
29
|
+
"url"
|
|
30
|
+
],
|
|
31
|
+
"writes": [
|
|
32
|
+
"s|col|public.junior_conversation_annotations.url",
|
|
33
|
+
"n|col|public.junior_conversation_annotations.url",
|
|
34
|
+
"e|col|public.junior_conversation_annotations.url"
|
|
35
|
+
],
|
|
36
|
+
"reads": ["n|tbl|public.junior_conversation_annotations", "n|sch|public"]
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"deltas": [
|
|
40
|
+
{
|
|
41
|
+
"op": "create",
|
|
42
|
+
"row": {
|
|
43
|
+
"schema": "public",
|
|
44
|
+
"table": "junior_conversation_annotations",
|
|
45
|
+
"name": "title",
|
|
46
|
+
"type": "text",
|
|
47
|
+
"typeSchema": null,
|
|
48
|
+
"notNull": false,
|
|
49
|
+
"dimensions": 0,
|
|
50
|
+
"default": null,
|
|
51
|
+
"generated": null,
|
|
52
|
+
"identity": null,
|
|
53
|
+
"entityType": "columns"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"op": "create",
|
|
58
|
+
"row": {
|
|
59
|
+
"schema": "public",
|
|
60
|
+
"table": "junior_conversation_annotations",
|
|
61
|
+
"name": "url",
|
|
62
|
+
"type": "text",
|
|
63
|
+
"typeSchema": null,
|
|
64
|
+
"notNull": false,
|
|
65
|
+
"dimensions": 0,
|
|
66
|
+
"default": null,
|
|
67
|
+
"generated": null,
|
|
68
|
+
"identity": null,
|
|
69
|
+
"entityType": "columns"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.319.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -64,8 +64,9 @@
|
|
|
64
64
|
"@logtape/logtape": "^2.1.1",
|
|
65
65
|
"@modelcontextprotocol/sdk": "1.32.0",
|
|
66
66
|
"@neondatabase/serverless": "^1.1.0",
|
|
67
|
-
"@sentry/api": "2.
|
|
68
|
-
"@sentry/
|
|
67
|
+
"@sentry/api": "3.2.0",
|
|
68
|
+
"@sentry/http": "1.0.0",
|
|
69
|
+
"@sentry/junior-plugin-api": "0.319.0",
|
|
69
70
|
"@sentry/nitro": "11.16.0",
|
|
70
71
|
"@sentry/node": "11.16.0",
|
|
71
72
|
"@sentry/server-utils": "11.16.0",
|
|
@@ -88,7 +89,6 @@
|
|
|
88
89
|
"hono": "^4.13.11",
|
|
89
90
|
"jiti": "^2.7.0",
|
|
90
91
|
"jose": "^6.2.3",
|
|
91
|
-
"just-bash": "3.0.1",
|
|
92
92
|
"mdast-util-from-markdown": "^2.1.0",
|
|
93
93
|
"mdast-util-gfm": "^3.1.0",
|
|
94
94
|
"micromark-extension-gfm": "^3.0.0",
|
|
@@ -97,6 +97,7 @@
|
|
|
97
97
|
"parse5": "^7.3.0",
|
|
98
98
|
"pg": "^8.16.3",
|
|
99
99
|
"sharp": "^0.35.3",
|
|
100
|
+
"shell-quote": "1.12.0",
|
|
100
101
|
"undici": "7.30.1",
|
|
101
102
|
"web-push": "^3.6.7",
|
|
102
103
|
"yaml": "^2.9.0",
|
|
@@ -109,9 +110,10 @@
|
|
|
109
110
|
"@emnapi/core": "^1.10.0",
|
|
110
111
|
"@emnapi/runtime": "^1.10.0",
|
|
111
112
|
"@hono/node-server": "2.1.3",
|
|
112
|
-
"@sentry/junior-github": "0.
|
|
113
|
-
"@sentry/junior-
|
|
114
|
-
"@sentry/junior-
|
|
113
|
+
"@sentry/junior-github": "0.319.0",
|
|
114
|
+
"@sentry/junior-linear": "0.319.0",
|
|
115
|
+
"@sentry/junior-notion": "0.319.0",
|
|
116
|
+
"@sentry/junior-sentry": "0.319.0",
|
|
115
117
|
"@sentry/junior-testing": "0.0.0",
|
|
116
118
|
"@types/node": "^24.19.2",
|
|
117
119
|
"@types/pg": "^8.15.6",
|