@sentry/junior 0.128.0 → 0.129.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.
Files changed (73) hide show
  1. package/dist/{agent-hooks-F75ANGBV.js → agent-hooks-ZM4WMZCN.js} +9 -9
  2. package/dist/api/schema/task.d.ts +152 -0
  3. package/dist/api/schema.d.ts +2 -0
  4. package/dist/api/schema.js +13 -3
  5. package/dist/api/tasks/routes.d.ts +4 -0
  6. package/dist/api.js +425 -23
  7. package/dist/app.d.ts +2 -1
  8. package/dist/app.js +315 -27
  9. package/dist/{catalog-runtime-ZPSA5QM2.js → catalog-runtime-TN2GPVEI.js} +5 -5
  10. package/dist/chat/agent-dispatch/context.d.ts +18 -0
  11. package/dist/chat/event-tasks/store.d.ts +7 -1
  12. package/dist/chat/event-tasks/tool-support.d.ts +1 -0
  13. package/dist/chat/resource-events/runtime-catalog.d.ts +3 -0
  14. package/dist/chat/sandbox/resources.d.ts +12 -1
  15. package/dist/chat/scheduled-tasks/cadence.d.ts +27 -0
  16. package/dist/chat/scheduled-tasks/heartbeat.d.ts +6 -0
  17. package/dist/chat/scheduled-tasks/identity.d.ts +6 -0
  18. package/dist/chat/scheduled-tasks/personal.d.ts +26 -0
  19. package/dist/chat/scheduled-tasks/schedule-intent.d.ts +61 -0
  20. package/dist/chat/scheduled-tasks/store.d.ts +77 -0
  21. package/dist/chat/scheduled-tasks/tool-support.d.ts +203 -0
  22. package/dist/chat/scheduled-tasks/tools/create.d.ts +80 -0
  23. package/dist/chat/scheduled-tasks/tools/delete.d.ts +56 -0
  24. package/dist/chat/scheduled-tasks/tools/list.d.ts +54 -0
  25. package/dist/chat/scheduled-tasks/tools/run-now.d.ts +56 -0
  26. package/dist/chat/scheduled-tasks/tools/update.d.ts +82 -0
  27. package/dist/chat/scheduled-tasks/tools.d.ts +6 -0
  28. package/dist/chat/scheduled-tasks/types.d.ts +81 -0
  29. package/dist/chat/tasks/read.d.ts +9 -0
  30. package/dist/chat/tools/scheduled-tasks.d.ts +4 -0
  31. package/dist/{chunk-K5ZB3WWH.js → chunk-2BCQKJTX.js} +2 -2
  32. package/dist/{chunk-G6XQODHM.js → chunk-3N4MWF3R.js} +1 -1
  33. package/dist/{chunk-NHWE6Y7G.js → chunk-6CMYU62S.js} +7 -7
  34. package/dist/{chunk-YY6CVET7.js → chunk-6QQOLIJJ.js} +1308 -804
  35. package/dist/{chunk-WZ365SQC.js → chunk-A6QQPVSH.js} +1 -1
  36. package/dist/chunk-BDIEEZK7.js +1470 -0
  37. package/dist/{chunk-AFJF3RGU.js → chunk-BVKP37NE.js} +61 -13
  38. package/dist/{chunk-5KKIBIIP.js → chunk-CZJUBH6O.js} +12 -12
  39. package/dist/{chunk-OLGB5Y7R.js → chunk-CZQ2DSQZ.js} +1 -1
  40. package/dist/{chunk-3PKF6YNU.js → chunk-E4UCPRYL.js} +1 -1
  41. package/dist/{chunk-KNRODVH2.js → chunk-ESYXDXNX.js} +6 -6
  42. package/dist/{chunk-Z4KTQMWW.js → chunk-GPWHBHAG.js} +1 -1
  43. package/dist/{chunk-JDCPDJ54.js → chunk-GURSWCI4.js} +2 -2
  44. package/dist/{chunk-RYWMDDWK.js → chunk-K3U5447S.js} +1 -1
  45. package/dist/{chunk-SHMHHXD5.js → chunk-KB2M27DL.js} +58 -0
  46. package/dist/{chunk-PBWUUVVG.js → chunk-LV2BQ26V.js} +1 -1
  47. package/dist/{chunk-KTGJAWRO.js → chunk-NNRV4T2C.js} +1 -2
  48. package/dist/{chunk-B6E3YA2H.js → chunk-P6I7LFKC.js} +1 -1
  49. package/dist/{chunk-B7FPRGUJ.js → chunk-PQFNTLZI.js} +3 -3
  50. package/dist/{chunk-A76LKS5W.js → chunk-QAOA4GUG.js} +5 -5
  51. package/dist/{chunk-BY43CEXN.js → chunk-R62DRNKB.js} +2 -2
  52. package/dist/{chunk-HBFQLSGV.js → chunk-U23X4ASF.js} +4 -4
  53. package/dist/{chunk-2HTHX6XV.js → chunk-XENYUOZG.js} +38 -17
  54. package/dist/cli/chat.js +24 -24
  55. package/dist/cli/check.js +6 -6
  56. package/dist/cli/plugins.js +12 -12
  57. package/dist/cli/snapshot-create.js +9 -9
  58. package/dist/cli/upgrade.js +9 -17
  59. package/dist/db/schema/scheduled-tasks.d.ts +257 -0
  60. package/dist/db/schema.d.ts +258 -1
  61. package/dist/{db-FYJYPAKG.js → db-ZI6TBXIS.js} +7 -7
  62. package/dist/instrumentation.js +4 -4
  63. package/dist/nitro.js +2 -2
  64. package/dist/{oauth-callback-server-W3PPIHCS.js → oauth-callback-server-TLA4GARF.js} +17 -17
  65. package/dist/{runner-5NOFUYKR.js → runner-23YFRWQJ.js} +11 -11
  66. package/dist/{skills-ENIBKF5V.js → skills-QIUG4D6M.js} +6 -6
  67. package/dist/{validation-BHLBOO6K.js → validation-3KGEBATS.js} +6 -6
  68. package/dist/version.js +1 -1
  69. package/migrations/0016_neat_the_anarchist.sql +171 -0
  70. package/migrations/meta/0016_snapshot.json +1617 -0
  71. package/migrations/meta/_journal.json +7 -0
  72. package/package.json +5 -6
  73. package/dist/chunk-FJEIX3AH.js +0 -37
@@ -6,8 +6,9 @@ import { juniorDestinations } from "./schema/destinations";
6
6
  import { juniorEventTasks } from "./schema/event-tasks";
7
7
  import { juniorIdentities } from "./schema/identities";
8
8
  import { juniorStats } from "./schema/stats";
9
+ import { juniorSchedulerRuns, juniorSchedulerTasks } from "./schema/scheduled-tasks";
9
10
  import { juniorUsers } from "./schema/users";
10
- export { juniorConversationAnnotations, juniorApiTokens, juniorConversationEvents, juniorConversations, juniorDestinations, juniorEventTasks, juniorIdentities, juniorStats, juniorUsers, };
11
+ export { juniorConversationAnnotations, juniorApiTokens, juniorConversationEvents, juniorConversations, juniorDestinations, juniorEventTasks, juniorIdentities, juniorStats, juniorSchedulerRuns, juniorSchedulerTasks, juniorUsers, };
11
12
  export declare const juniorSqlSchema: {
12
13
  juniorConversationAnnotations: import("drizzle-orm/pg-core").PgTableWithColumns<{
13
14
  name: "junior_conversation_annotations";
@@ -1820,6 +1821,262 @@ export declare const juniorSqlSchema: {
1820
1821
  };
1821
1822
  dialect: "pg";
1822
1823
  }>;
1824
+ juniorSchedulerRuns: import("drizzle-orm/pg-core").PgTableWithColumns<{
1825
+ name: "junior_scheduler_runs";
1826
+ schema: undefined;
1827
+ columns: {
1828
+ id: import("drizzle-orm/pg-core").PgColumn<{
1829
+ name: "id";
1830
+ tableName: "junior_scheduler_runs";
1831
+ dataType: "string";
1832
+ columnType: "PgText";
1833
+ data: string;
1834
+ driverParam: string;
1835
+ notNull: true;
1836
+ hasDefault: false;
1837
+ isPrimaryKey: true;
1838
+ isAutoincrement: false;
1839
+ hasRuntimeDefault: false;
1840
+ enumValues: [string, ...string[]];
1841
+ baseColumn: never;
1842
+ identity: undefined;
1843
+ generated: undefined;
1844
+ }, {}, {}>;
1845
+ taskId: import("drizzle-orm/pg-core").PgColumn<{
1846
+ name: "task_id";
1847
+ tableName: "junior_scheduler_runs";
1848
+ dataType: "string";
1849
+ columnType: "PgText";
1850
+ data: string;
1851
+ driverParam: string;
1852
+ notNull: true;
1853
+ hasDefault: false;
1854
+ isPrimaryKey: false;
1855
+ isAutoincrement: false;
1856
+ hasRuntimeDefault: false;
1857
+ enumValues: [string, ...string[]];
1858
+ baseColumn: never;
1859
+ identity: undefined;
1860
+ generated: undefined;
1861
+ }, {}, {}>;
1862
+ status: import("drizzle-orm/pg-core").PgColumn<{
1863
+ name: "status";
1864
+ tableName: "junior_scheduler_runs";
1865
+ dataType: "string";
1866
+ columnType: "PgText";
1867
+ data: string;
1868
+ driverParam: string;
1869
+ notNull: true;
1870
+ hasDefault: false;
1871
+ isPrimaryKey: false;
1872
+ isAutoincrement: false;
1873
+ hasRuntimeDefault: false;
1874
+ enumValues: [string, ...string[]];
1875
+ baseColumn: never;
1876
+ identity: undefined;
1877
+ generated: undefined;
1878
+ }, {}, {}>;
1879
+ scheduledForMs: import("drizzle-orm/pg-core").PgColumn<{
1880
+ name: "scheduled_for_ms";
1881
+ tableName: "junior_scheduler_runs";
1882
+ dataType: "number";
1883
+ columnType: "PgBigInt53";
1884
+ data: number;
1885
+ driverParam: string | number;
1886
+ notNull: true;
1887
+ hasDefault: false;
1888
+ isPrimaryKey: false;
1889
+ isAutoincrement: false;
1890
+ hasRuntimeDefault: false;
1891
+ enumValues: undefined;
1892
+ baseColumn: never;
1893
+ identity: undefined;
1894
+ generated: undefined;
1895
+ }, {}, {}>;
1896
+ record: import("drizzle-orm/pg-core").PgColumn<{
1897
+ name: "record";
1898
+ tableName: "junior_scheduler_runs";
1899
+ dataType: "json";
1900
+ columnType: "PgJsonb";
1901
+ data: import("../chat/scheduled-tasks/types").ScheduledRun;
1902
+ driverParam: unknown;
1903
+ notNull: true;
1904
+ hasDefault: false;
1905
+ isPrimaryKey: false;
1906
+ isAutoincrement: false;
1907
+ hasRuntimeDefault: false;
1908
+ enumValues: undefined;
1909
+ baseColumn: never;
1910
+ identity: undefined;
1911
+ generated: undefined;
1912
+ }, {}, {
1913
+ $type: import("../chat/scheduled-tasks/types").ScheduledRun;
1914
+ }>;
1915
+ };
1916
+ dialect: "pg";
1917
+ }>;
1918
+ juniorSchedulerTasks: import("drizzle-orm/pg-core").PgTableWithColumns<{
1919
+ name: "junior_scheduler_tasks";
1920
+ schema: undefined;
1921
+ columns: {
1922
+ id: import("drizzle-orm/pg-core").PgColumn<{
1923
+ name: "id";
1924
+ tableName: "junior_scheduler_tasks";
1925
+ dataType: "string";
1926
+ columnType: "PgText";
1927
+ data: string;
1928
+ driverParam: string;
1929
+ notNull: true;
1930
+ hasDefault: false;
1931
+ isPrimaryKey: true;
1932
+ isAutoincrement: false;
1933
+ hasRuntimeDefault: false;
1934
+ enumValues: [string, ...string[]];
1935
+ baseColumn: never;
1936
+ identity: undefined;
1937
+ generated: undefined;
1938
+ }, {}, {}>;
1939
+ teamId: import("drizzle-orm/pg-core").PgColumn<{
1940
+ name: "team_id";
1941
+ tableName: "junior_scheduler_tasks";
1942
+ dataType: "string";
1943
+ columnType: "PgText";
1944
+ data: string;
1945
+ driverParam: string;
1946
+ notNull: true;
1947
+ hasDefault: false;
1948
+ isPrimaryKey: false;
1949
+ isAutoincrement: false;
1950
+ hasRuntimeDefault: false;
1951
+ enumValues: [string, ...string[]];
1952
+ baseColumn: never;
1953
+ identity: undefined;
1954
+ generated: undefined;
1955
+ }, {}, {}>;
1956
+ creatorSlackUserId: import("drizzle-orm/pg-core").PgColumn<{
1957
+ name: "creator_slack_user_id";
1958
+ tableName: "junior_scheduler_tasks";
1959
+ dataType: "string";
1960
+ columnType: "PgText";
1961
+ data: string;
1962
+ driverParam: string;
1963
+ notNull: false;
1964
+ hasDefault: false;
1965
+ isPrimaryKey: false;
1966
+ isAutoincrement: false;
1967
+ hasRuntimeDefault: false;
1968
+ enumValues: [string, ...string[]];
1969
+ baseColumn: never;
1970
+ identity: undefined;
1971
+ generated: undefined;
1972
+ }, {}, {}>;
1973
+ creatorIdentityId: import("drizzle-orm/pg-core").PgColumn<{
1974
+ name: "creator_identity_id";
1975
+ tableName: "junior_scheduler_tasks";
1976
+ dataType: "string";
1977
+ columnType: "PgText";
1978
+ data: string;
1979
+ driverParam: string;
1980
+ notNull: false;
1981
+ hasDefault: false;
1982
+ isPrimaryKey: false;
1983
+ isAutoincrement: false;
1984
+ hasRuntimeDefault: false;
1985
+ enumValues: [string, ...string[]];
1986
+ baseColumn: never;
1987
+ identity: undefined;
1988
+ generated: undefined;
1989
+ }, {}, {}>;
1990
+ status: import("drizzle-orm/pg-core").PgColumn<{
1991
+ name: "status";
1992
+ tableName: "junior_scheduler_tasks";
1993
+ dataType: "string";
1994
+ columnType: "PgText";
1995
+ data: string;
1996
+ driverParam: string;
1997
+ notNull: true;
1998
+ hasDefault: false;
1999
+ isPrimaryKey: false;
2000
+ isAutoincrement: false;
2001
+ hasRuntimeDefault: false;
2002
+ enumValues: [string, ...string[]];
2003
+ baseColumn: never;
2004
+ identity: undefined;
2005
+ generated: undefined;
2006
+ }, {}, {}>;
2007
+ nextRunAtMs: import("drizzle-orm/pg-core").PgColumn<{
2008
+ name: "next_run_at_ms";
2009
+ tableName: "junior_scheduler_tasks";
2010
+ dataType: "number";
2011
+ columnType: "PgBigInt53";
2012
+ data: number;
2013
+ driverParam: string | number;
2014
+ notNull: false;
2015
+ hasDefault: false;
2016
+ isPrimaryKey: false;
2017
+ isAutoincrement: false;
2018
+ hasRuntimeDefault: false;
2019
+ enumValues: undefined;
2020
+ baseColumn: never;
2021
+ identity: undefined;
2022
+ generated: undefined;
2023
+ }, {}, {}>;
2024
+ runNowAtMs: import("drizzle-orm/pg-core").PgColumn<{
2025
+ name: "run_now_at_ms";
2026
+ tableName: "junior_scheduler_tasks";
2027
+ dataType: "number";
2028
+ columnType: "PgBigInt53";
2029
+ data: number;
2030
+ driverParam: string | number;
2031
+ notNull: false;
2032
+ hasDefault: false;
2033
+ isPrimaryKey: false;
2034
+ isAutoincrement: false;
2035
+ hasRuntimeDefault: false;
2036
+ enumValues: undefined;
2037
+ baseColumn: never;
2038
+ identity: undefined;
2039
+ generated: undefined;
2040
+ }, {}, {}>;
2041
+ createdAtMs: import("drizzle-orm/pg-core").PgColumn<{
2042
+ name: "created_at_ms";
2043
+ tableName: "junior_scheduler_tasks";
2044
+ dataType: "number";
2045
+ columnType: "PgBigInt53";
2046
+ data: number;
2047
+ driverParam: string | number;
2048
+ notNull: true;
2049
+ hasDefault: false;
2050
+ isPrimaryKey: false;
2051
+ isAutoincrement: false;
2052
+ hasRuntimeDefault: false;
2053
+ enumValues: undefined;
2054
+ baseColumn: never;
2055
+ identity: undefined;
2056
+ generated: undefined;
2057
+ }, {}, {}>;
2058
+ record: import("drizzle-orm/pg-core").PgColumn<{
2059
+ name: "record";
2060
+ tableName: "junior_scheduler_tasks";
2061
+ dataType: "json";
2062
+ columnType: "PgJsonb";
2063
+ data: import("../chat/scheduled-tasks/types").ScheduledTask;
2064
+ driverParam: unknown;
2065
+ notNull: true;
2066
+ hasDefault: false;
2067
+ isPrimaryKey: false;
2068
+ isAutoincrement: false;
2069
+ hasRuntimeDefault: false;
2070
+ enumValues: undefined;
2071
+ baseColumn: never;
2072
+ identity: undefined;
2073
+ generated: undefined;
2074
+ }, {}, {
2075
+ $type: import("../chat/scheduled-tasks/types").ScheduledTask;
2076
+ }>;
2077
+ };
2078
+ dialect: "pg";
2079
+ }>;
1823
2080
  juniorUsers: import("drizzle-orm/pg-core").PgTableWithColumns<{
1824
2081
  name: "junior_users";
1825
2082
  schema: undefined;
@@ -5,16 +5,16 @@ import {
5
5
  getConversationStore,
6
6
  getDb,
7
7
  getSqlExecutor
8
- } from "./chunk-B7FPRGUJ.js";
9
- import "./chunk-SHMHHXD5.js";
10
- import "./chunk-K5ZB3WWH.js";
8
+ } from "./chunk-PQFNTLZI.js";
9
+ import "./chunk-KB2M27DL.js";
10
+ import "./chunk-2BCQKJTX.js";
11
11
  import "./chunk-VFUK3X5B.js";
12
- import "./chunk-Z4KTQMWW.js";
12
+ import "./chunk-GPWHBHAG.js";
13
13
  import "./chunk-F3B2YJ76.js";
14
- import "./chunk-B6E3YA2H.js";
14
+ import "./chunk-P6I7LFKC.js";
15
15
  import "./chunk-6GWA276C.js";
16
- import "./chunk-RYWMDDWK.js";
17
- import "./chunk-KTGJAWRO.js";
16
+ import "./chunk-K3U5447S.js";
17
+ import "./chunk-NNRV4T2C.js";
18
18
  import "./chunk-MLKGABMK.js";
19
19
  export {
20
20
  closeDb,
@@ -3,8 +3,8 @@ import {
3
3
  } from "./chunk-UIE3R5XU.js";
4
4
  import {
5
5
  getCurrentConversationPrivacy
6
- } from "./chunk-Z4KTQMWW.js";
7
- import "./chunk-B6E3YA2H.js";
6
+ } from "./chunk-GPWHBHAG.js";
7
+ import "./chunk-P6I7LFKC.js";
8
8
  import {
9
9
  getClient,
10
10
  getGlobalScope,
@@ -15,8 +15,8 @@ import {
15
15
  import {
16
16
  getDeploymentServiceVersion,
17
17
  getDeploymentTelemetryAttributes
18
- } from "./chunk-RYWMDDWK.js";
19
- import "./chunk-KTGJAWRO.js";
18
+ } from "./chunk-K3U5447S.js";
19
+ import "./chunk-NNRV4T2C.js";
20
20
  import "./chunk-MLKGABMK.js";
21
21
 
22
22
  // src/chat/sentry-payload-filter.ts
package/dist/nitro.js CHANGED
@@ -26,8 +26,8 @@ import {
26
26
  JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE,
27
27
  JUNIOR_RETENTION_CRON_SCHEDULE,
28
28
  JUNIOR_RETENTION_ROUTE
29
- } from "./chunk-RYWMDDWK.js";
30
- import "./chunk-KTGJAWRO.js";
29
+ } from "./chunk-K3U5447S.js";
30
+ import "./chunk-NNRV4T2C.js";
31
31
  import "./chunk-MLKGABMK.js";
32
32
 
33
33
  // src/nitro.ts
@@ -2,38 +2,38 @@ import {
2
2
  GET,
3
3
  GET2,
4
4
  syncLocalOAuthCredential
5
- } from "./chunk-5KKIBIIP.js";
5
+ } from "./chunk-CZJUBH6O.js";
6
6
  import "./chunk-FA6POGLH.js";
7
- import "./chunk-KNRODVH2.js";
7
+ import "./chunk-ESYXDXNX.js";
8
8
  import "./chunk-4CODA7P5.js";
9
9
  import "./chunk-6ZK6FZIV.js";
10
10
  import "./chunk-5I6ORJUY.js";
11
11
  import {
12
12
  createUserTokenStore
13
- } from "./chunk-NHWE6Y7G.js";
14
- import "./chunk-HBFQLSGV.js";
15
- import "./chunk-PBWUUVVG.js";
13
+ } from "./chunk-6CMYU62S.js";
14
+ import "./chunk-U23X4ASF.js";
15
+ import "./chunk-LV2BQ26V.js";
16
16
  import "./chunk-HX236W2U.js";
17
17
  import "./chunk-PDO5BLNM.js";
18
- import "./chunk-A76LKS5W.js";
19
- import "./chunk-B7FPRGUJ.js";
20
- import "./chunk-SHMHHXD5.js";
21
- import "./chunk-G6XQODHM.js";
22
- import "./chunk-K5ZB3WWH.js";
18
+ import "./chunk-QAOA4GUG.js";
19
+ import "./chunk-PQFNTLZI.js";
20
+ import "./chunk-KB2M27DL.js";
21
+ import "./chunk-3N4MWF3R.js";
22
+ import "./chunk-2BCQKJTX.js";
23
23
  import "./chunk-VFUK3X5B.js";
24
- import "./chunk-Z4KTQMWW.js";
25
- import "./chunk-BY43CEXN.js";
26
- import "./chunk-WZ365SQC.js";
27
- import "./chunk-OLGB5Y7R.js";
24
+ import "./chunk-GPWHBHAG.js";
25
+ import "./chunk-R62DRNKB.js";
26
+ import "./chunk-A6QQPVSH.js";
27
+ import "./chunk-CZQ2DSQZ.js";
28
28
  import "./chunk-77VDLF3Z.js";
29
29
  import "./chunk-HZF5P5UN.js";
30
30
  import "./chunk-F3B2YJ76.js";
31
- import "./chunk-B6E3YA2H.js";
31
+ import "./chunk-P6I7LFKC.js";
32
32
  import "./chunk-6GWA276C.js";
33
33
  import "./chunk-OOUNJNMR.js";
34
34
  import "./chunk-H4HBKISO.js";
35
- import "./chunk-RYWMDDWK.js";
36
- import "./chunk-KTGJAWRO.js";
35
+ import "./chunk-K3U5447S.js";
36
+ import "./chunk-NNRV4T2C.js";
37
37
  import "./chunk-MLKGABMK.js";
38
38
 
39
39
  // src/chat/local/oauth-callback-server.ts
@@ -5,7 +5,7 @@ import {
5
5
  finalizeFailedTurnReplyWithEvent,
6
6
  processPluginTask,
7
7
  scheduleSessionCompletedPluginTasks
8
- } from "./chunk-KNRODVH2.js";
8
+ } from "./chunk-ESYXDXNX.js";
9
9
  import "./chunk-5I6ORJUY.js";
10
10
  import {
11
11
  authorizationId
@@ -34,28 +34,28 @@ import {
34
34
  trimTrailingAssistantMessages,
35
35
  updateConversationStats,
36
36
  upsertConversationMessage
37
- } from "./chunk-HBFQLSGV.js";
37
+ } from "./chunk-U23X4ASF.js";
38
38
  import "./chunk-HX236W2U.js";
39
39
  import "./chunk-PDO5BLNM.js";
40
- import "./chunk-A76LKS5W.js";
40
+ import "./chunk-QAOA4GUG.js";
41
41
  import {
42
42
  getConversationEventStore
43
- } from "./chunk-B7FPRGUJ.js";
44
- import "./chunk-SHMHHXD5.js";
45
- import "./chunk-G6XQODHM.js";
46
- import "./chunk-K5ZB3WWH.js";
43
+ } from "./chunk-PQFNTLZI.js";
44
+ import "./chunk-KB2M27DL.js";
45
+ import "./chunk-3N4MWF3R.js";
46
+ import "./chunk-2BCQKJTX.js";
47
47
  import "./chunk-VFUK3X5B.js";
48
- import "./chunk-Z4KTQMWW.js";
48
+ import "./chunk-GPWHBHAG.js";
49
49
  import "./chunk-HZF5P5UN.js";
50
50
  import "./chunk-F3B2YJ76.js";
51
51
  import {
52
52
  logException,
53
53
  setTags,
54
54
  withLogContext
55
- } from "./chunk-B6E3YA2H.js";
55
+ } from "./chunk-P6I7LFKC.js";
56
56
  import "./chunk-6GWA276C.js";
57
- import "./chunk-RYWMDDWK.js";
58
- import "./chunk-KTGJAWRO.js";
57
+ import "./chunk-K3U5447S.js";
58
+ import "./chunk-NNRV4T2C.js";
59
59
  import "./chunk-MLKGABMK.js";
60
60
 
61
61
  // src/chat/local/runner.ts
@@ -6,18 +6,18 @@ import {
6
6
  parseSkillInvocation,
7
7
  resetSkillDiscoveryCache,
8
8
  stripFrontmatter
9
- } from "./chunk-BY43CEXN.js";
10
- import "./chunk-WZ365SQC.js";
11
- import "./chunk-OLGB5Y7R.js";
9
+ } from "./chunk-R62DRNKB.js";
10
+ import "./chunk-A6QQPVSH.js";
11
+ import "./chunk-CZQ2DSQZ.js";
12
12
  import "./chunk-77VDLF3Z.js";
13
13
  import "./chunk-HZF5P5UN.js";
14
14
  import "./chunk-F3B2YJ76.js";
15
- import "./chunk-B6E3YA2H.js";
15
+ import "./chunk-P6I7LFKC.js";
16
16
  import "./chunk-6GWA276C.js";
17
17
  import "./chunk-OOUNJNMR.js";
18
18
  import "./chunk-H4HBKISO.js";
19
- import "./chunk-RYWMDDWK.js";
20
- import "./chunk-KTGJAWRO.js";
19
+ import "./chunk-K3U5447S.js";
20
+ import "./chunk-NNRV4T2C.js";
21
21
  import "./chunk-MLKGABMK.js";
22
22
  export {
23
23
  discoverSkills,
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  validatePluginEgressCredentialHooks,
3
3
  validatePluginRegistrations
4
- } from "./chunk-3PKF6YNU.js";
5
- import "./chunk-WZ365SQC.js";
6
- import "./chunk-OLGB5Y7R.js";
4
+ } from "./chunk-E4UCPRYL.js";
5
+ import "./chunk-A6QQPVSH.js";
6
+ import "./chunk-CZQ2DSQZ.js";
7
7
  import "./chunk-77VDLF3Z.js";
8
8
  import "./chunk-HZF5P5UN.js";
9
9
  import "./chunk-F3B2YJ76.js";
10
- import "./chunk-B6E3YA2H.js";
10
+ import "./chunk-P6I7LFKC.js";
11
11
  import "./chunk-6GWA276C.js";
12
12
  import "./chunk-OOUNJNMR.js";
13
13
  import "./chunk-H4HBKISO.js";
14
- import "./chunk-RYWMDDWK.js";
15
- import "./chunk-KTGJAWRO.js";
14
+ import "./chunk-K3U5447S.js";
15
+ import "./chunk-NNRV4T2C.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17
  export {
18
18
  validatePluginEgressCredentialHooks,
package/dist/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JUNIOR_VERSION
3
- } from "./chunk-KTGJAWRO.js";
3
+ } from "./chunk-NNRV4T2C.js";
4
4
  import "./chunk-MLKGABMK.js";
5
5
  export {
6
6
  JUNIOR_VERSION
@@ -0,0 +1,171 @@
1
+ -- Adopt the former scheduler plugin tables without copying or renaming data.
2
+ CREATE TABLE IF NOT EXISTS "junior_scheduler_runs" (
3
+ "id" text PRIMARY KEY NOT NULL,
4
+ "task_id" text NOT NULL,
5
+ "status" text NOT NULL,
6
+ "scheduled_for_ms" bigint NOT NULL,
7
+ "record" jsonb NOT NULL
8
+ );--> statement-breakpoint
9
+ CREATE TABLE IF NOT EXISTS "junior_scheduler_tasks" (
10
+ "id" text PRIMARY KEY NOT NULL,
11
+ "team_id" text NOT NULL,
12
+ "creator_slack_user_id" text,
13
+ "creator_identity_id" text,
14
+ "status" text NOT NULL,
15
+ "next_run_at_ms" bigint,
16
+ "run_now_at_ms" bigint,
17
+ "created_at_ms" bigint NOT NULL,
18
+ "record" jsonb NOT NULL
19
+ );--> statement-breakpoint
20
+ ALTER TABLE "junior_scheduler_tasks" ADD COLUMN IF NOT EXISTS "creator_slack_user_id" text;--> statement-breakpoint
21
+ ALTER TABLE "junior_scheduler_tasks" ADD COLUMN IF NOT EXISTS "creator_identity_id" text;--> statement-breakpoint
22
+ UPDATE "junior_scheduler_tasks"
23
+ SET "record" = ("record" - 'credentialSubject') || jsonb_build_object('credentialMode', 'system')
24
+ WHERE NOT ("record" ? 'credentialMode')
25
+ OR "record" ? 'credentialSubject';--> statement-breakpoint
26
+ UPDATE "junior_scheduler_tasks"
27
+ SET "creator_slack_user_id" = "record"->'createdBy'->>'slackUserId'
28
+ WHERE "creator_slack_user_id" IS NULL;--> statement-breakpoint
29
+ UPDATE "junior_scheduler_tasks" AS "task"
30
+ SET "record" = jsonb_set(
31
+ "task"."record",
32
+ '{conversationAccess}',
33
+ jsonb_build_object(
34
+ 'audience',
35
+ CASE
36
+ WHEN "task"."record"#>>'{conversationAccess,audience}' IN ('direct', 'group', 'channel')
37
+ THEN "task"."record"#>>'{conversationAccess,audience}'
38
+ WHEN "task"."record"#>>'{destination,channelId}' LIKE 'D%' THEN 'direct'
39
+ WHEN "task"."record"#>>'{destination,channelId}' LIKE 'G%' THEN 'group'
40
+ ELSE 'channel'
41
+ END,
42
+ 'visibility',
43
+ COALESCE("destination"."visibility", 'private')
44
+ ),
45
+ true
46
+ )
47
+ FROM public."junior_destinations" AS "destination"
48
+ WHERE COALESCE("task"."record"#>>'{conversationAccess,visibility}', 'unknown') = 'unknown'
49
+ AND "destination"."provider" = 'slack'
50
+ AND "destination"."provider_tenant_id" = "task"."team_id"
51
+ AND "destination"."provider_destination_id" = "task"."record"#>>'{destination,channelId}'
52
+ AND "destination"."visibility" IN ('public', 'private');--> statement-breakpoint
53
+ UPDATE "junior_scheduler_tasks" AS "task"
54
+ SET "record" = jsonb_set(
55
+ "task"."record",
56
+ '{conversationAccess}',
57
+ jsonb_build_object(
58
+ 'audience',
59
+ CASE
60
+ WHEN "task"."record"#>>'{conversationAccess,audience}' IN ('direct', 'group', 'channel')
61
+ THEN "task"."record"#>>'{conversationAccess,audience}'
62
+ WHEN "task"."record"#>>'{destination,channelId}' LIKE 'D%' THEN 'direct'
63
+ WHEN "task"."record"#>>'{destination,channelId}' LIKE 'G%' THEN 'group'
64
+ ELSE 'channel'
65
+ END,
66
+ 'visibility',
67
+ 'private'
68
+ ),
69
+ true
70
+ )
71
+ WHERE COALESCE("task"."record"#>>'{conversationAccess,visibility}', 'unknown') = 'unknown';--> statement-breakpoint
72
+ INSERT INTO "junior_identities" (
73
+ "id",
74
+ "kind",
75
+ "provider",
76
+ "provider_tenant_id",
77
+ "provider_subject_id",
78
+ "created_at",
79
+ "updated_at"
80
+ )
81
+ SELECT DISTINCT ON (task."team_id", task."creator_slack_user_id")
82
+ 'scheduler-slack-' || md5(task."team_id" || ':' || task."creator_slack_user_id"),
83
+ 'user',
84
+ 'slack',
85
+ task."team_id",
86
+ task."creator_slack_user_id",
87
+ to_timestamp(task."created_at_ms" / 1000.0),
88
+ CURRENT_TIMESTAMP
89
+ FROM "junior_scheduler_tasks" AS task
90
+ WHERE task."creator_slack_user_id" IS NOT NULL
91
+ ORDER BY task."team_id", task."creator_slack_user_id", task."created_at_ms"
92
+ ON CONFLICT DO NOTHING;--> statement-breakpoint
93
+ UPDATE "junior_scheduler_tasks" AS task
94
+ SET
95
+ "creator_identity_id" = identity."id",
96
+ "record" = CASE
97
+ WHEN jsonb_typeof(task."record") = 'object' THEN
98
+ task."record" || jsonb_build_object('creatorIdentityId', identity."id")
99
+ ELSE task."record"
100
+ END
101
+ FROM "junior_identities" AS identity
102
+ WHERE identity."kind" = 'user'
103
+ AND identity."provider" = 'slack'
104
+ AND identity."provider_tenant_id" = task."team_id"
105
+ AND identity."provider_subject_id" = task."creator_slack_user_id"
106
+ AND task."creator_identity_id" IS NULL;--> statement-breakpoint
107
+ -- Keep rolling old workers compatible until the legacy creator column is retired.
108
+ CREATE OR REPLACE FUNCTION "junior_scheduler_assign_creator_identity"()
109
+ RETURNS trigger
110
+ LANGUAGE plpgsql
111
+ AS $function$
112
+ DECLARE
113
+ resolved_identity_id text;
114
+ BEGIN
115
+ IF NEW."creator_identity_id" IS NOT NULL
116
+ OR NEW."creator_slack_user_id" IS NULL THEN
117
+ RETURN NEW;
118
+ END IF;
119
+
120
+ INSERT INTO "junior_identities" (
121
+ "id",
122
+ "kind",
123
+ "provider",
124
+ "provider_tenant_id",
125
+ "provider_subject_id",
126
+ "created_at",
127
+ "updated_at"
128
+ ) VALUES (
129
+ 'scheduler-slack-' || md5(NEW."team_id" || ':' || NEW."creator_slack_user_id"),
130
+ 'user',
131
+ 'slack',
132
+ NEW."team_id",
133
+ NEW."creator_slack_user_id",
134
+ to_timestamp(NEW."created_at_ms" / 1000.0),
135
+ CURRENT_TIMESTAMP
136
+ )
137
+ ON CONFLICT DO NOTHING;
138
+
139
+ SELECT "id"
140
+ INTO resolved_identity_id
141
+ FROM "junior_identities"
142
+ WHERE "kind" = 'user'
143
+ AND "provider" = 'slack'
144
+ AND "provider_tenant_id" = NEW."team_id"
145
+ AND "provider_subject_id" = NEW."creator_slack_user_id"
146
+ LIMIT 1;
147
+
148
+ IF resolved_identity_id IS NOT NULL THEN
149
+ NEW."creator_identity_id" := resolved_identity_id;
150
+ IF jsonb_typeof(NEW."record") = 'object' THEN
151
+ NEW."record" := NEW."record" || jsonb_build_object(
152
+ 'creatorIdentityId',
153
+ resolved_identity_id
154
+ );
155
+ END IF;
156
+ END IF;
157
+ RETURN NEW;
158
+ END
159
+ $function$;--> statement-breakpoint
160
+ DROP TRIGGER IF EXISTS "junior_scheduler_assign_creator_identity" ON "junior_scheduler_tasks";--> statement-breakpoint
161
+ CREATE TRIGGER "junior_scheduler_assign_creator_identity"
162
+ BEFORE INSERT ON "junior_scheduler_tasks"
163
+ FOR EACH ROW
164
+ EXECUTE FUNCTION "junior_scheduler_assign_creator_identity"();--> statement-breakpoint
165
+ CREATE INDEX IF NOT EXISTS "junior_scheduler_runs_task_status_idx" ON "junior_scheduler_runs" USING btree ("task_id","status","scheduled_for_ms");--> statement-breakpoint
166
+ CREATE INDEX IF NOT EXISTS "junior_scheduler_runs_status_idx" ON "junior_scheduler_runs" USING btree ("status","scheduled_for_ms");--> statement-breakpoint
167
+ CREATE INDEX IF NOT EXISTS "junior_scheduler_tasks_creator_idx" ON "junior_scheduler_tasks" USING btree ("team_id","creator_slack_user_id","created_at_ms","id") WHERE "junior_scheduler_tasks"."status" <> 'deleted';--> statement-breakpoint
168
+ CREATE INDEX IF NOT EXISTS "junior_scheduler_tasks_creator_identity_idx" ON "junior_scheduler_tasks" USING btree ("creator_identity_id","created_at_ms","id") WHERE "junior_scheduler_tasks"."status" <> 'deleted' AND "junior_scheduler_tasks"."creator_identity_id" IS NOT NULL;--> statement-breakpoint
169
+ CREATE INDEX IF NOT EXISTS "junior_scheduler_tasks_team_status_idx" ON "junior_scheduler_tasks" USING btree ("team_id","created_at_ms","id") WHERE "junior_scheduler_tasks"."status" <> 'deleted';--> statement-breakpoint
170
+ CREATE INDEX IF NOT EXISTS "junior_scheduler_tasks_run_now_due_idx" ON "junior_scheduler_tasks" USING btree ("run_now_at_ms","created_at_ms","id") WHERE "junior_scheduler_tasks"."status" = 'active' AND "junior_scheduler_tasks"."run_now_at_ms" IS NOT NULL;--> statement-breakpoint
171
+ CREATE INDEX IF NOT EXISTS "junior_scheduler_tasks_next_run_due_idx" ON "junior_scheduler_tasks" USING btree ("next_run_at_ms","created_at_ms","id") WHERE "junior_scheduler_tasks"."status" = 'active' AND "junior_scheduler_tasks"."next_run_at_ms" IS NOT NULL;