@keystrokehq/cli 0.0.53 → 0.0.55
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/{anthropic-BW7tKfye.mjs → anthropic-OIjNEgxk.mjs} +3 -3
- package/dist/{anthropic-BW7tKfye.mjs.map → anthropic-OIjNEgxk.mjs.map} +1 -1
- package/dist/{azure-openai-responses-CbpqfHpG.mjs → azure-openai-responses-J2iGyy4d.mjs} +3 -3
- package/dist/{azure-openai-responses-CbpqfHpG.mjs.map → azure-openai-responses-J2iGyy4d.mjs.map} +1 -1
- package/dist/{cat-TSFMZVYS-BfwZOafs.mjs → cat-TSFMZVYS-BUlDi5Qf.mjs} +2 -2
- package/dist/{cat-TSFMZVYS-BfwZOafs.mjs.map → cat-TSFMZVYS-BUlDi5Qf.mjs.map} +1 -1
- package/dist/{cut-OKARJCCV-Cm3OStWG.mjs → cut-OKARJCCV-p9v-ig7a.mjs} +2 -2
- package/dist/{cut-OKARJCCV-Cm3OStWG.mjs.map → cut-OKARJCCV-p9v-ig7a.mjs.map} +1 -1
- package/dist/{dist-BSgBg_mF.mjs → dist-OeT0Z7by.mjs} +3 -3
- package/dist/{dist-BSgBg_mF.mjs.map → dist-OeT0Z7by.mjs.map} +1 -1
- package/dist/{du-572XNP42-DeJ11TW7.mjs → du-572XNP42-Br0wC4cR.mjs} +2 -2
- package/dist/{du-572XNP42-DeJ11TW7.mjs.map → du-572XNP42-Br0wC4cR.mjs.map} +1 -1
- package/dist/{emit-route-manifest-DRcNXHCP-CSOVo0UZ.mjs → emit-route-manifest-DRcNXHCP-CuH5IaKl.mjs} +210 -209
- package/dist/emit-route-manifest-DRcNXHCP-CuH5IaKl.mjs.map +1 -0
- package/dist/{env-api-keys-CjsGqLnm.mjs → env-api-keys-Dj0phNAZ.mjs} +2 -2
- package/dist/{env-api-keys-CjsGqLnm.mjs.map → env-api-keys-Dj0phNAZ.mjs.map} +1 -1
- package/dist/{from-BVavsm7Y.mjs → from-CM85M090.mjs} +2 -2
- package/dist/{from-BVavsm7Y.mjs.map → from-CM85M090.mjs.map} +1 -1
- package/dist/{google-B3pBIkED.mjs → google-CZqUzYLL.mjs} +3 -3
- package/dist/{google-B3pBIkED.mjs.map → google-CZqUzYLL.mjs.map} +1 -1
- package/dist/{google-shared-CZrnlDVf.mjs → google-shared-DpSg5iXi.mjs} +5 -5
- package/dist/{google-shared-CZrnlDVf.mjs.map → google-shared-DpSg5iXi.mjs.map} +1 -1
- package/dist/{google-vertex-CK79qwUV.mjs → google-vertex-BM9RkknB.mjs} +2 -2
- package/dist/{google-vertex-CK79qwUV.mjs.map → google-vertex-BM9RkknB.mjs.map} +1 -1
- package/dist/{html-to-markdown-JW4MSQZO-CvfnlE0t.mjs → html-to-markdown-JW4MSQZO-CL7jZmA2.mjs} +2 -2
- package/dist/{html-to-markdown-JW4MSQZO-CvfnlE0t.mjs.map → html-to-markdown-JW4MSQZO-CL7jZmA2.mjs.map} +1 -1
- package/dist/index.mjs +717 -8
- package/dist/index.mjs.map +1 -1
- package/dist/{jq-4XLYLOS5-DrYXLsYH.mjs → jq-4XLYLOS5-KSRW1t5y.mjs} +2 -2
- package/dist/{jq-4XLYLOS5-DrYXLsYH.mjs.map → jq-4XLYLOS5-KSRW1t5y.mjs.map} +1 -1
- package/dist/{json-parse-4wvL0yab.mjs → json-parse-D7gmIw6y.mjs} +2 -2
- package/dist/{json-parse-4wvL0yab.mjs.map → json-parse-D7gmIw6y.mjs.map} +1 -1
- package/dist/{lib-L8rwARiF.mjs → lib-15JvMO_y.mjs} +2 -2
- package/dist/{lib-L8rwARiF.mjs.map → lib-15JvMO_y.mjs.map} +1 -1
- package/dist/{ls-ZJGQER7M-C_1bAeGq.mjs → ls-ZJGQER7M-CvMghjGY.mjs} +2 -2
- package/dist/{ls-ZJGQER7M-C_1bAeGq.mjs.map → ls-ZJGQER7M-CvMghjGY.mjs.map} +1 -1
- package/dist/{mistral-CO6JoIDU.mjs → mistral-BMK3QxKa.mjs} +3 -3
- package/dist/{mistral-CO6JoIDU.mjs.map → mistral-BMK3QxKa.mjs.map} +1 -1
- package/dist/{multipart-parser-CybO63Pn.mjs → multipart-parser-ChdFj-Tf.mjs} +3 -3
- package/dist/{multipart-parser-CybO63Pn.mjs.map → multipart-parser-ChdFj-Tf.mjs.map} +1 -1
- package/dist/{openai-codex-responses-BsV2OXkO.mjs → openai-codex-responses-FPOFDQCI.mjs} +3 -3
- package/dist/{openai-codex-responses-BsV2OXkO.mjs.map → openai-codex-responses-FPOFDQCI.mjs.map} +1 -1
- package/dist/{openai-completions-DtKMQJXz.mjs → openai-completions-DaFkurXZ.mjs} +3 -3
- package/dist/{openai-completions-DtKMQJXz.mjs.map → openai-completions-DaFkurXZ.mjs.map} +1 -1
- package/dist/{openai-responses-Dn8IOWpx.mjs → openai-responses-DjcjpFVd.mjs} +3 -3
- package/dist/{openai-responses-Dn8IOWpx.mjs.map → openai-responses-DjcjpFVd.mjs.map} +1 -1
- package/dist/{openai-responses-shared-rmpfdSMl.mjs → openai-responses-shared-DOajVKFM.mjs} +2 -2
- package/dist/{openai-responses-shared-rmpfdSMl.mjs.map → openai-responses-shared-DOajVKFM.mjs.map} +1 -1
- package/dist/{openrouter-Cq37VS4X.mjs → openrouter-BD82J9ov.mjs} +2 -2
- package/dist/{openrouter-Cq37VS4X.mjs.map → openrouter-BD82J9ov.mjs.map} +1 -1
- package/dist/{printf-TWGXF445-BcIEiMjE.mjs → printf-TWGXF445-CtbOGcY-.mjs} +2 -2
- package/dist/{printf-TWGXF445-BcIEiMjE.mjs.map → printf-TWGXF445-CtbOGcY-.mjs.map} +1 -1
- package/dist/{sort-SW2YEO5B-D08jaQ5v.mjs → sort-SW2YEO5B-BT2dtrqE.mjs} +2 -2
- package/dist/{sort-SW2YEO5B-D08jaQ5v.mjs.map → sort-SW2YEO5B-BT2dtrqE.mjs.map} +1 -1
- package/dist/{sqlite3-CGOEFJAO-DVuaAgm0.mjs → sqlite3-CGOEFJAO-DKaf3b_T.mjs} +2 -2
- package/dist/{sqlite3-CGOEFJAO-DVuaAgm0.mjs.map → sqlite3-CGOEFJAO-DKaf3b_T.mjs.map} +1 -1
- package/dist/{src-xQsWiElt.mjs → src-BhFu0wxf.mjs} +4 -4
- package/dist/{src-xQsWiElt.mjs.map → src-BhFu0wxf.mjs.map} +1 -1
- package/dist/{src-DuFA6S6A.mjs → src-CO4ATuDw.mjs} +2 -2
- package/dist/{src-DuFA6S6A.mjs.map → src-CO4ATuDw.mjs.map} +1 -1
- package/dist/{tar-STHHZTZ6-C7-gpnmi.mjs → tar-STHHZTZ6-Cy8WppFl.mjs} +3 -3
- package/dist/{tar-STHHZTZ6-C7-gpnmi.mjs.map → tar-STHHZTZ6-Cy8WppFl.mjs.map} +1 -1
- package/dist/{tree-YLD52CNT-DiHyiFBi.mjs → tree-YLD52CNT-CFtEJCzO.mjs} +2 -2
- package/dist/{tree-YLD52CNT-DiHyiFBi.mjs.map → tree-YLD52CNT-CFtEJCzO.mjs.map} +1 -1
- package/dist/{uniq-XSIZR6PB-BA-vRB1O.mjs → uniq-XSIZR6PB-ERG9Mu92.mjs} +2 -2
- package/dist/{uniq-XSIZR6PB-BA-vRB1O.mjs.map → uniq-XSIZR6PB-ERG9Mu92.mjs.map} +1 -1
- package/dist/{watch-app-DTIeKrbl-BdEadl4m.mjs → watch-app-DTIeKrbl-C-BThJEO.mjs} +2 -2
- package/dist/{watch-app-DTIeKrbl-BdEadl4m.mjs.map → watch-app-DTIeKrbl-C-BThJEO.mjs.map} +1 -1
- package/dist/{wc-LF7NU4LA-BWoItyXd.mjs → wc-LF7NU4LA-CsPoPEAk.mjs} +2 -2
- package/dist/{wc-LF7NU4LA-BWoItyXd.mjs.map → wc-LF7NU4LA-CsPoPEAk.mjs.map} +1 -1
- package/dist/{websocket-server-DBCa1Df9.mjs → websocket-server-m6wiYSFm.mjs} +2 -2
- package/dist/{websocket-server-DBCa1Df9.mjs.map → websocket-server-m6wiYSFm.mjs.map} +1 -1
- package/dist/{xan-Y6WF3IRG-BilR2MsH.mjs → xan-Y6WF3IRG-ovCpFLkA.mjs} +2 -2
- package/dist/{xan-Y6WF3IRG-BilR2MsH.mjs.map → xan-Y6WF3IRG-ovCpFLkA.mjs.map} +1 -1
- package/package.json +8 -4
- package/dist/chunk-lXUa1qmO.mjs +0 -37
- package/dist/emit-route-manifest-DRcNXHCP-CSOVo0UZ.mjs.map +0 -1
package/dist/{emit-route-manifest-DRcNXHCP-CSOVo0UZ.mjs → emit-route-manifest-DRcNXHCP-CuH5IaKl.mjs}
RENAMED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as __toESM, i as __require, r as __exportAll$1, t as __commonJSMin } from "./chunk-lXUa1qmO.mjs";
|
|
3
2
|
import { a as createSession$1, c as isCredentialError$1, d as withSpan$1, i as captureConsole$1, l as listMessageEvents$1, m as ZodIssueCode, n as appendEvent$1, o as getSession$1, p as defineCredential, r as buildCredentialRunContext$1, s as getTraceContext$1, t as MESSAGE_EVENT_TYPE$3, u as touchSession$1 } from "./dist-CXHSlVhd-CTQzOALD.mjs";
|
|
4
|
-
import { $ as getTableUniqueName, $t as _enum, A as applyMixins, At as TriggerListResponseSchema, B as Param, Bt as WorkflowSubscriptionListResponseSchema, C as PgJsonb, Cn as url$2, Ct as PollRunRequestSchema, D as PgDate, Dt as QueuedAgentPromptResponseSchema, E as integer$1, En as toJSONSchema, Et as PromptResponseSchema, F as isConfig, Ft as UpsertGatewayAttachmentBodySchema, G as fillPlaceholders, Gt as parsePollRunRequest, H as SQL, Ht as credentialInputSchema, I as mapResultRow, It as UpsertWorkflowSubscriptionBodySchema, J as sql, Jt as parseWorkflowRunDetailInclude, K as isDriverValueEncoder, Kt as parsePromptInput, L as mapUpdateSet, Lt as WorkflowRunDetailResponseSchema, M as getTableColumns, Mt as TriggerRunListQuerySchema, N as getTableLikeName, Nt as TriggerRunListResponseSchema, O as PgDateString, Ot as SkipResponseSchema, P as haveSameKeys, Pt as UpdateCredentialInstanceBodySchema, Q as getTableName, Qt as ZodType, R as orderSelectedFields, Rt as WorkflowRunListQuerySchema, S as PgNumeric, Sn as unknown$1, St as GatewayAttachmentRecordSchema, T as PgJson, Tn as datetime, Tt as PromptInputSchema, U as StringChunk, Ut as normalizeCredentialList, V as Placeholder, Vt as WorkflowSubscriptionRecordSchema, W as View, Wt as parseAgentSessionDetailInclude, X as Schema, Y as Columns, Yt as validationErrorResponse, Z as Table$1, Zt as number$1, _ as PgTimestamp, _n as optional, _t as CredentialInstanceListResponseSchema, a as entryIdFromFile, an as boolean, at as PgColumn, b as PgTime, bn as string$2, bt as ErrorResponseSchema, c as authSessions, cn as discriminatedUnion, ct as Column, d as users, dt as AgentListResponseSchema, en as _function, et as ViewBaseConfig, f as index$2, fn as literal, ft as AgentSessionDetailResponseSchema, g as PgUUID, gn as object, gt as CreateCredentialInstanceBodySchema, h as pgTable, hn as number, ht as CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE, i as resolveSandboxRoot, in as array, it as pgEnum, j as getColumnNameAndConfig, jt as TriggerRunDetailResponseSchema, k as boolean$1, kn as NEVER, kt as TriggerDetailResponseSchema, l as authVerifications, lt as entityKind, m as PgTable, mt as AgentSessionListResponseSchema, n as ensureWorkspaceDir, nt as Subquery, o as authAccounts, on as custom, ot as TableName, p as uniqueIndex$1, pn as looseObject, pt as AgentSessionListQuerySchema, q as isSQLWrapper, qt as parseTriggerRunDetailInclude, r as materializeSandbox, rn as any, rt as WithSubquery, s as authDeviceCodes, st as ColumnBuilder, t as SandboxDefinitionSchema, tn as _null, tt as tracer, u as getDbFromContext$1, un as intersection, ut as is, v as PgTimestampString, vn as preprocess$1, vt as CredentialInstanceRecordSchema, w as jsonb, wn as ZodError, wt as PollRunResponseSchema, x as text$6, xn as union$2, xt as GatewayAttachmentListResponseSchema, y as timestamp, yn as record, yt as DISCOVERY_CONVENTIONS, z as textDecoder, zt as WorkflowRunListResponseSchema } from "./index.mjs";
|
|
5
|
-
import "./env-api-keys-
|
|
3
|
+
import { $ as getTableUniqueName, $t as _enum, A as applyMixins, An as __commonJSMin, At as TriggerListResponseSchema, B as Param, Bt as WorkflowSubscriptionListResponseSchema, C as PgJsonb, Cn as url$2, Ct as PollRunRequestSchema, D as PgDate, Dt as QueuedAgentPromptResponseSchema, E as integer$1, En as toJSONSchema, Et as PromptResponseSchema, F as isConfig, Ft as UpsertGatewayAttachmentBodySchema, G as fillPlaceholders, Gt as parsePollRunRequest, H as SQL, Ht as credentialInputSchema, I as mapResultRow, It as UpsertWorkflowSubscriptionBodySchema, J as sql, Jt as parseWorkflowRunDetailInclude, K as isDriverValueEncoder, Kt as parsePromptInput, L as mapUpdateSet, Lt as WorkflowRunDetailResponseSchema, M as getTableColumns, Mn as __exportAll$1, Mt as TriggerRunListQuerySchema, N as getTableLikeName, Nn as __require, Nt as TriggerRunListResponseSchema, O as PgDateString, Ot as SkipResponseSchema, P as haveSameKeys, Pn as __toESM, Pt as UpdateCredentialInstanceBodySchema, Q as getTableName, Qt as ZodType, R as orderSelectedFields, Rt as WorkflowRunListQuerySchema, S as PgNumeric, Sn as unknown$1, St as GatewayAttachmentRecordSchema, T as PgJson, Tn as datetime, Tt as PromptInputSchema, U as StringChunk, Ut as normalizeCredentialList, V as Placeholder, Vt as WorkflowSubscriptionRecordSchema, W as View, Wt as parseAgentSessionDetailInclude, X as Schema, Y as Columns, Yt as validationErrorResponse, Z as Table$1, Zt as number$1, _ as PgTimestamp, _n as optional, _t as CredentialInstanceListResponseSchema, a as entryIdFromFile, an as boolean, at as PgColumn, b as PgTime, bn as string$2, bt as ErrorResponseSchema, c as authSessions, cn as discriminatedUnion, ct as Column, d as users, dt as AgentListResponseSchema, en as _function, et as ViewBaseConfig, f as index$2, fn as literal, ft as AgentSessionDetailResponseSchema, g as PgUUID, gn as object, gt as CreateCredentialInstanceBodySchema, h as pgTable, hn as number, ht as CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE, i as resolveSandboxRoot, in as array, it as pgEnum, j as getColumnNameAndConfig, jt as TriggerRunDetailResponseSchema, k as boolean$1, kn as NEVER, kt as TriggerDetailResponseSchema, l as authVerifications, lt as entityKind, m as PgTable, mt as AgentSessionListResponseSchema, n as ensureWorkspaceDir, nt as Subquery, o as authAccounts, on as custom, ot as TableName, p as uniqueIndex$1, pn as looseObject, pt as AgentSessionListQuerySchema, q as isSQLWrapper, qt as parseTriggerRunDetailInclude, r as materializeSandbox, rn as any, rt as WithSubquery, s as authDeviceCodes, st as ColumnBuilder, t as SandboxDefinitionSchema, tn as _null, tt as tracer, u as getDbFromContext$1, un as intersection, ut as is, v as PgTimestampString, vn as preprocess$1, vt as CredentialInstanceRecordSchema, w as jsonb, wn as ZodError, wt as PollRunResponseSchema, x as text$6, xn as union$2, xt as GatewayAttachmentListResponseSchema, y as timestamp, yn as record, yt as DISCOVERY_CONVENTIONS, z as textDecoder, zt as WorkflowRunListResponseSchema } from "./index.mjs";
|
|
4
|
+
import "./env-api-keys-Dj0phNAZ.mjs";
|
|
6
5
|
import { t as AssistantMessageEventStream } from "./event-stream-FOdgPz2L.mjs";
|
|
7
|
-
import "./json-parse-
|
|
8
|
-
import { a as require_extension, c as require_permessage_deflate, i as require_websocket, l as require_extend, n as require_subprotocol, o as require_sender, r as require_stream, s as require_receiver, t as require_websocket_server, u as require_p_retry } from "./websocket-server-
|
|
9
|
-
import { t as require_src$2 } from "./src-
|
|
6
|
+
import "./json-parse-D7gmIw6y.mjs";
|
|
7
|
+
import { a as require_extension, c as require_permessage_deflate, i as require_websocket, l as require_extend, n as require_subprotocol, o as require_sender, r as require_stream, s as require_receiver, t as require_websocket_server, u as require_p_retry } from "./websocket-server-m6wiYSFm.mjs";
|
|
8
|
+
import { t as require_src$2 } from "./src-CO4ATuDw.mjs";
|
|
10
9
|
import "./chunk-BZUGFHVS-CPWRFwK8.mjs";
|
|
11
10
|
import "./chunk-DLL7UR66-BUYgzxnR.mjs";
|
|
12
11
|
import "./chunk-TN7HHBQW-CSB_R-XD.mjs";
|
|
@@ -5169,15 +5168,15 @@ var tt = [
|
|
|
5169
5168
|
},
|
|
5170
5169
|
{
|
|
5171
5170
|
name: "cat",
|
|
5172
|
-
load: async () => (await import("./cat-TSFMZVYS-
|
|
5171
|
+
load: async () => (await import("./cat-TSFMZVYS-BUlDi5Qf.mjs")).catCommand
|
|
5173
5172
|
},
|
|
5174
5173
|
{
|
|
5175
5174
|
name: "printf",
|
|
5176
|
-
load: async () => (await import("./printf-TWGXF445-
|
|
5175
|
+
load: async () => (await import("./printf-TWGXF445-CtbOGcY-.mjs")).printfCommand
|
|
5177
5176
|
},
|
|
5178
5177
|
{
|
|
5179
5178
|
name: "ls",
|
|
5180
|
-
load: async () => (await import("./ls-ZJGQER7M-
|
|
5179
|
+
load: async () => (await import("./ls-ZJGQER7M-CvMghjGY.mjs")).lsCommand
|
|
5181
5180
|
},
|
|
5182
5181
|
{
|
|
5183
5182
|
name: "mkdir",
|
|
@@ -5229,7 +5228,7 @@ var tt = [
|
|
|
5229
5228
|
},
|
|
5230
5229
|
{
|
|
5231
5230
|
name: "wc",
|
|
5232
|
-
load: async () => (await import("./wc-LF7NU4LA-
|
|
5231
|
+
load: async () => (await import("./wc-LF7NU4LA-CsPoPEAk.mjs")).wcCommand
|
|
5233
5232
|
},
|
|
5234
5233
|
{
|
|
5235
5234
|
name: "stat",
|
|
@@ -5261,11 +5260,11 @@ var tt = [
|
|
|
5261
5260
|
},
|
|
5262
5261
|
{
|
|
5263
5262
|
name: "sort",
|
|
5264
|
-
load: async () => (await import("./sort-SW2YEO5B-
|
|
5263
|
+
load: async () => (await import("./sort-SW2YEO5B-BT2dtrqE.mjs")).sortCommand
|
|
5265
5264
|
},
|
|
5266
5265
|
{
|
|
5267
5266
|
name: "uniq",
|
|
5268
|
-
load: async () => (await import("./uniq-XSIZR6PB-
|
|
5267
|
+
load: async () => (await import("./uniq-XSIZR6PB-ERG9Mu92.mjs")).uniqCommand
|
|
5269
5268
|
},
|
|
5270
5269
|
{
|
|
5271
5270
|
name: "comm",
|
|
@@ -5273,7 +5272,7 @@ var tt = [
|
|
|
5273
5272
|
},
|
|
5274
5273
|
{
|
|
5275
5274
|
name: "cut",
|
|
5276
|
-
load: async () => (await import("./cut-OKARJCCV-
|
|
5275
|
+
load: async () => (await import("./cut-OKARJCCV-p9v-ig7a.mjs")).cutCommand
|
|
5277
5276
|
},
|
|
5278
5277
|
{
|
|
5279
5278
|
name: "paste",
|
|
@@ -5337,11 +5336,11 @@ var tt = [
|
|
|
5337
5336
|
},
|
|
5338
5337
|
{
|
|
5339
5338
|
name: "tree",
|
|
5340
|
-
load: async () => (await import("./tree-YLD52CNT-
|
|
5339
|
+
load: async () => (await import("./tree-YLD52CNT-CFtEJCzO.mjs")).treeCommand
|
|
5341
5340
|
},
|
|
5342
5341
|
{
|
|
5343
5342
|
name: "du",
|
|
5344
|
-
load: async () => (await import("./du-572XNP42-
|
|
5343
|
+
load: async () => (await import("./du-572XNP42-Br0wC4cR.mjs")).duCommand
|
|
5345
5344
|
},
|
|
5346
5345
|
{
|
|
5347
5346
|
name: "env",
|
|
@@ -5389,7 +5388,7 @@ var tt = [
|
|
|
5389
5388
|
},
|
|
5390
5389
|
{
|
|
5391
5390
|
name: "jq",
|
|
5392
|
-
load: async () => (await import("./jq-4XLYLOS5-
|
|
5391
|
+
load: async () => (await import("./jq-4XLYLOS5-KSRW1t5y.mjs")).jqCommand
|
|
5393
5392
|
},
|
|
5394
5393
|
{
|
|
5395
5394
|
name: "base64",
|
|
@@ -5441,7 +5440,7 @@ var tt = [
|
|
|
5441
5440
|
},
|
|
5442
5441
|
{
|
|
5443
5442
|
name: "html-to-markdown",
|
|
5444
|
-
load: async () => (await import("./html-to-markdown-JW4MSQZO-
|
|
5443
|
+
load: async () => (await import("./html-to-markdown-JW4MSQZO-CL7jZmA2.mjs")).htmlToMarkdownCommand
|
|
5445
5444
|
},
|
|
5446
5445
|
{
|
|
5447
5446
|
name: "help",
|
|
@@ -5482,16 +5481,16 @@ var tt = [
|
|
|
5482
5481
|
];
|
|
5483
5482
|
(typeof __BROWSER__ > "u" || !__BROWSER__) && (tt.push({
|
|
5484
5483
|
name: "tar",
|
|
5485
|
-
load: async () => (await import("./tar-STHHZTZ6-
|
|
5484
|
+
load: async () => (await import("./tar-STHHZTZ6-Cy8WppFl.mjs")).tarCommand
|
|
5486
5485
|
}), tt.push({
|
|
5487
5486
|
name: "yq",
|
|
5488
5487
|
load: async () => (await import("./yq-4QJW3EQG-XhB3aACo.mjs")).yqCommand
|
|
5489
5488
|
}), tt.push({
|
|
5490
5489
|
name: "xan",
|
|
5491
|
-
load: async () => (await import("./xan-Y6WF3IRG-
|
|
5490
|
+
load: async () => (await import("./xan-Y6WF3IRG-ovCpFLkA.mjs")).xanCommand
|
|
5492
5491
|
}), tt.push({
|
|
5493
5492
|
name: "sqlite3",
|
|
5494
|
-
load: async () => (await import("./sqlite3-CGOEFJAO-
|
|
5493
|
+
load: async () => (await import("./sqlite3-CGOEFJAO-DKaf3b_T.mjs")).sqlite3Command
|
|
5495
5494
|
}));
|
|
5496
5495
|
var Yt = [];
|
|
5497
5496
|
(typeof __BROWSER__ > "u" || !__BROWSER__) && (Yt.push({
|
|
@@ -23347,7 +23346,7 @@ function createLazyLoadErrorImages$1(model, error) {
|
|
|
23347
23346
|
};
|
|
23348
23347
|
}
|
|
23349
23348
|
function loadOpenRouterImagesProviderModule$1() {
|
|
23350
|
-
openRouterImagesProviderModulePromise$1 ||= import("./openrouter-
|
|
23349
|
+
openRouterImagesProviderModulePromise$1 ||= import("./openrouter-BD82J9ov.mjs").then((module) => module);
|
|
23351
23350
|
return openRouterImagesProviderModulePromise$1;
|
|
23352
23351
|
}
|
|
23353
23352
|
const generateImagesOpenRouter$1 = async (model, context, options) => {
|
|
@@ -23451,7 +23450,7 @@ function createLazySimpleStream$1(loadModule) {
|
|
|
23451
23450
|
};
|
|
23452
23451
|
}
|
|
23453
23452
|
function loadAnthropicProviderModule$1() {
|
|
23454
|
-
anthropicProviderModulePromise$1 ||= import("./anthropic-
|
|
23453
|
+
anthropicProviderModulePromise$1 ||= import("./anthropic-OIjNEgxk.mjs").then((module) => {
|
|
23455
23454
|
const provider = module;
|
|
23456
23455
|
return {
|
|
23457
23456
|
stream: provider.streamAnthropic,
|
|
@@ -23461,7 +23460,7 @@ function loadAnthropicProviderModule$1() {
|
|
|
23461
23460
|
return anthropicProviderModulePromise$1;
|
|
23462
23461
|
}
|
|
23463
23462
|
function loadAzureOpenAIResponsesProviderModule$1() {
|
|
23464
|
-
azureOpenAIResponsesProviderModulePromise$1 ||= import("./azure-openai-responses-
|
|
23463
|
+
azureOpenAIResponsesProviderModulePromise$1 ||= import("./azure-openai-responses-J2iGyy4d.mjs").then((module) => {
|
|
23465
23464
|
const provider = module;
|
|
23466
23465
|
return {
|
|
23467
23466
|
stream: provider.streamAzureOpenAIResponses,
|
|
@@ -23471,7 +23470,7 @@ function loadAzureOpenAIResponsesProviderModule$1() {
|
|
|
23471
23470
|
return azureOpenAIResponsesProviderModulePromise$1;
|
|
23472
23471
|
}
|
|
23473
23472
|
function loadGoogleProviderModule$1() {
|
|
23474
|
-
googleProviderModulePromise$1 ||= import("./google-
|
|
23473
|
+
googleProviderModulePromise$1 ||= import("./google-CZqUzYLL.mjs").then((module) => {
|
|
23475
23474
|
const provider = module;
|
|
23476
23475
|
return {
|
|
23477
23476
|
stream: provider.streamGoogle,
|
|
@@ -23481,7 +23480,7 @@ function loadGoogleProviderModule$1() {
|
|
|
23481
23480
|
return googleProviderModulePromise$1;
|
|
23482
23481
|
}
|
|
23483
23482
|
function loadGoogleVertexProviderModule$1() {
|
|
23484
|
-
googleVertexProviderModulePromise$1 ||= import("./google-vertex-
|
|
23483
|
+
googleVertexProviderModulePromise$1 ||= import("./google-vertex-BM9RkknB.mjs").then((module) => {
|
|
23485
23484
|
const provider = module;
|
|
23486
23485
|
return {
|
|
23487
23486
|
stream: provider.streamGoogleVertex,
|
|
@@ -23491,7 +23490,7 @@ function loadGoogleVertexProviderModule$1() {
|
|
|
23491
23490
|
return googleVertexProviderModulePromise$1;
|
|
23492
23491
|
}
|
|
23493
23492
|
function loadMistralProviderModule$1() {
|
|
23494
|
-
mistralProviderModulePromise$1 ||= import("./mistral-
|
|
23493
|
+
mistralProviderModulePromise$1 ||= import("./mistral-BMK3QxKa.mjs").then((module) => {
|
|
23495
23494
|
const provider = module;
|
|
23496
23495
|
return {
|
|
23497
23496
|
stream: provider.streamMistral,
|
|
@@ -23501,7 +23500,7 @@ function loadMistralProviderModule$1() {
|
|
|
23501
23500
|
return mistralProviderModulePromise$1;
|
|
23502
23501
|
}
|
|
23503
23502
|
function loadOpenAICodexResponsesProviderModule$1() {
|
|
23504
|
-
openAICodexResponsesProviderModulePromise$1 ||= import("./openai-codex-responses-
|
|
23503
|
+
openAICodexResponsesProviderModulePromise$1 ||= import("./openai-codex-responses-FPOFDQCI.mjs").then((module) => {
|
|
23505
23504
|
const provider = module;
|
|
23506
23505
|
return {
|
|
23507
23506
|
stream: provider.streamOpenAICodexResponses,
|
|
@@ -23511,7 +23510,7 @@ function loadOpenAICodexResponsesProviderModule$1() {
|
|
|
23511
23510
|
return openAICodexResponsesProviderModulePromise$1;
|
|
23512
23511
|
}
|
|
23513
23512
|
function loadOpenAICompletionsProviderModule$1() {
|
|
23514
|
-
openAICompletionsProviderModulePromise$1 ||= import("./openai-completions-
|
|
23513
|
+
openAICompletionsProviderModulePromise$1 ||= import("./openai-completions-DaFkurXZ.mjs").then((module) => {
|
|
23515
23514
|
const provider = module;
|
|
23516
23515
|
return {
|
|
23517
23516
|
stream: provider.streamOpenAICompletions,
|
|
@@ -23521,7 +23520,7 @@ function loadOpenAICompletionsProviderModule$1() {
|
|
|
23521
23520
|
return openAICompletionsProviderModulePromise$1;
|
|
23522
23521
|
}
|
|
23523
23522
|
function loadOpenAIResponsesProviderModule$1() {
|
|
23524
|
-
openAIResponsesProviderModulePromise$1 ||= import("./openai-responses-
|
|
23523
|
+
openAIResponsesProviderModulePromise$1 ||= import("./openai-responses-DjcjpFVd.mjs").then((module) => {
|
|
23525
23524
|
const provider = module;
|
|
23526
23525
|
return {
|
|
23527
23526
|
stream: provider.streamOpenAIResponses,
|
|
@@ -47335,10 +47334,6 @@ function wrapScheduler(jobQueue) {
|
|
|
47335
47334
|
async function createScheduler(options = {}) {
|
|
47336
47335
|
return wrapScheduler(await createUnderlyingJobQueue(options));
|
|
47337
47336
|
}
|
|
47338
|
-
defineCredential({
|
|
47339
|
-
key: "google",
|
|
47340
|
-
kind: "oauth"
|
|
47341
|
-
});
|
|
47342
47337
|
//#endregion
|
|
47343
47338
|
//#region ../../packages/oauth/dist/index.mjs
|
|
47344
47339
|
function oauthRoutes(key, options = {}) {
|
|
@@ -47545,7 +47540,7 @@ function parseGrantedScopes(scope, options = {}) {
|
|
|
47545
47540
|
return options.fallback ? [...options.fallback] : [];
|
|
47546
47541
|
}
|
|
47547
47542
|
//#endregion
|
|
47548
|
-
//#region ../../packages/integrations/google/dist/
|
|
47543
|
+
//#region ../../packages/integrations/google/dist/provider-BcVUhsgN.mjs
|
|
47549
47544
|
function googleNotConfiguredResponse() {
|
|
47550
47545
|
return {
|
|
47551
47546
|
error: "google_not_configured",
|
|
@@ -47718,10 +47713,190 @@ const googleOAuthProvider = defineOAuthProvider({
|
|
|
47718
47713
|
},
|
|
47719
47714
|
refreshAccessToken: refreshGoogleAccessToken
|
|
47720
47715
|
});
|
|
47716
|
+
defineCredential({
|
|
47717
|
+
key: "google",
|
|
47718
|
+
kind: "oauth"
|
|
47719
|
+
});
|
|
47721
47720
|
googleOAuthProvider.routes.start;
|
|
47722
47721
|
googleOAuthProvider.routes.authorizeUrl;
|
|
47723
47722
|
googleOAuthProvider.routes.callback;
|
|
47724
47723
|
//#endregion
|
|
47724
|
+
//#region ../../packages/integrations/slack/dist/provider-D51h-OH1.mjs
|
|
47725
|
+
function slackNotConfiguredResponse() {
|
|
47726
|
+
return {
|
|
47727
|
+
error: "slack_not_configured",
|
|
47728
|
+
message: "Slack OAuth is not configured. Install via the UI or seed oauth_apps."
|
|
47729
|
+
};
|
|
47730
|
+
}
|
|
47731
|
+
const LOG_PREFIX = "[slack]";
|
|
47732
|
+
function envValue(name) {
|
|
47733
|
+
return process.env[name]?.trim() || void 0;
|
|
47734
|
+
}
|
|
47735
|
+
function missingSlackAppEnv(options) {
|
|
47736
|
+
return [
|
|
47737
|
+
!options.clientId ? "SLACK_CLIENT_ID" : null,
|
|
47738
|
+
!options.clientSecret ? "SLACK_CLIENT_SECRET" : null,
|
|
47739
|
+
!options.signingSecret ? "SLACK_SIGNING_SECRET" : null
|
|
47740
|
+
].filter((name) => name !== null);
|
|
47741
|
+
}
|
|
47742
|
+
async function fetchSlackTeamId(botToken, fetchImpl) {
|
|
47743
|
+
const body = await (await fetchImpl("https://slack.com/api/auth.test", {
|
|
47744
|
+
method: "POST",
|
|
47745
|
+
headers: {
|
|
47746
|
+
Authorization: `Bearer ${botToken}`,
|
|
47747
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
47748
|
+
}
|
|
47749
|
+
})).json();
|
|
47750
|
+
if (!body.ok || !body.team_id) throw new Error(body.error ?? "Slack auth.test failed");
|
|
47751
|
+
return {
|
|
47752
|
+
teamId: body.team_id,
|
|
47753
|
+
teamName: body.team,
|
|
47754
|
+
botUserId: body.user_id
|
|
47755
|
+
};
|
|
47756
|
+
}
|
|
47757
|
+
async function seedSlackOAuthFromEnv(options = {}) {
|
|
47758
|
+
const fetchImpl = options.fetchImpl ?? fetch;
|
|
47759
|
+
const clientId = envValue("SLACK_CLIENT_ID");
|
|
47760
|
+
const clientSecret = envValue("SLACK_CLIENT_SECRET");
|
|
47761
|
+
const signingSecret = envValue("SLACK_SIGNING_SECRET");
|
|
47762
|
+
const botToken = envValue("SLACK_BOT_TOKEN");
|
|
47763
|
+
const hasAppEnv = Boolean(clientId && clientSecret && signingSecret);
|
|
47764
|
+
const hasPartialAppEnv = Boolean(clientId || clientSecret || signingSecret);
|
|
47765
|
+
let appId;
|
|
47766
|
+
if (hasAppEnv) {
|
|
47767
|
+
const app = await ensureOAuthApp({
|
|
47768
|
+
key: SLACK_OAUTH_APP_KEY,
|
|
47769
|
+
provider: SLACK_OAUTH_APP_KEY,
|
|
47770
|
+
tokenStrategy: "installation",
|
|
47771
|
+
clientId,
|
|
47772
|
+
clientSecret,
|
|
47773
|
+
signingSecret,
|
|
47774
|
+
metadata: { appName: "Slack" }
|
|
47775
|
+
});
|
|
47776
|
+
appId = app.id;
|
|
47777
|
+
if (app.updated) console.log(`${LOG_PREFIX} Updated oauth_apps from env`);
|
|
47778
|
+
} else if (hasPartialAppEnv) {
|
|
47779
|
+
const missing = missingSlackAppEnv({
|
|
47780
|
+
clientId,
|
|
47781
|
+
clientSecret,
|
|
47782
|
+
signingSecret
|
|
47783
|
+
});
|
|
47784
|
+
console.warn(`${LOG_PREFIX} Incomplete Slack OAuth env — missing ${missing.join(", ")}. Skipping oauth_apps seed.`);
|
|
47785
|
+
}
|
|
47786
|
+
if (!appId) {
|
|
47787
|
+
appId = (await getDecryptedOAuthAppByKey(SLACK_OAUTH_APP_KEY))?.id;
|
|
47788
|
+
if (!appId && !botToken) console.warn(`${LOG_PREFIX} Slack OAuth not configured — install routes and gateway will fail until configured.`);
|
|
47789
|
+
}
|
|
47790
|
+
if (!appId || !botToken) return;
|
|
47791
|
+
try {
|
|
47792
|
+
const team = await fetchSlackTeamId(botToken, fetchImpl);
|
|
47793
|
+
const existingConnection = (await getDecryptedOAuthConnectionsByAppKey(SLACK_OAUTH_APP_KEY)).find((connection) => connection.externalId === team.teamId);
|
|
47794
|
+
await ensureOAuthCredentialInstance({
|
|
47795
|
+
credentialKey: SLACK_OAUTH_APP_KEY,
|
|
47796
|
+
connectionId: await saveOAuthConnection({
|
|
47797
|
+
appId,
|
|
47798
|
+
externalId: team.teamId,
|
|
47799
|
+
accessToken: botToken,
|
|
47800
|
+
metadata: {
|
|
47801
|
+
teamName: team.teamName,
|
|
47802
|
+
botUserId: team.botUserId
|
|
47803
|
+
}
|
|
47804
|
+
})
|
|
47805
|
+
});
|
|
47806
|
+
if (existingConnection && existingConnection.accessToken !== botToken) console.log(`${LOG_PREFIX} Updated Slack bot token connection from SLACK_BOT_TOKEN`);
|
|
47807
|
+
} catch (error) {
|
|
47808
|
+
console.warn(`${LOG_PREFIX} Failed to seed Slack bot token from SLACK_BOT_TOKEN:`, error instanceof Error ? error.message : error);
|
|
47809
|
+
}
|
|
47810
|
+
}
|
|
47811
|
+
const SLACK_OAUTH_SCOPES = [
|
|
47812
|
+
"chat:write",
|
|
47813
|
+
"app_mentions:read",
|
|
47814
|
+
"im:history",
|
|
47815
|
+
"im:write",
|
|
47816
|
+
"channels:history",
|
|
47817
|
+
"groups:history",
|
|
47818
|
+
"users:read",
|
|
47819
|
+
"users:read.email"
|
|
47820
|
+
];
|
|
47821
|
+
const SLACK_OAUTH_SCOPE = SLACK_OAUTH_SCOPES.join(",");
|
|
47822
|
+
const SLACK_OAUTH_APP_KEY = "slack";
|
|
47823
|
+
/**
|
|
47824
|
+
* Slack OAuth provider — mount handlers from `slackOAuthProvider.handlers` in the plugin.
|
|
47825
|
+
*
|
|
47826
|
+
* Requires an authenticated session to start the install (a workspace bot token is
|
|
47827
|
+
* org-scoped, so we gate who can install it but do not track which user ran connect).
|
|
47828
|
+
*/
|
|
47829
|
+
const slackOAuthProvider = defineOAuthProvider({
|
|
47830
|
+
key: SLACK_OAUTH_APP_KEY,
|
|
47831
|
+
stateCookie: "slack_oauth_state",
|
|
47832
|
+
requiresAuth: true,
|
|
47833
|
+
authorizeUrlPath: true,
|
|
47834
|
+
async resolveApp() {
|
|
47835
|
+
await seedSlackOAuthFromEnv();
|
|
47836
|
+
const app = await getDecryptedOAuthAppByKey(SLACK_OAUTH_APP_KEY);
|
|
47837
|
+
if (!app) return null;
|
|
47838
|
+
return {
|
|
47839
|
+
id: app.id,
|
|
47840
|
+
clientId: app.clientId,
|
|
47841
|
+
clientSecret: app.clientSecret,
|
|
47842
|
+
redirectUri: app.redirectUri
|
|
47843
|
+
};
|
|
47844
|
+
},
|
|
47845
|
+
notConfigured: slackNotConfiguredResponse,
|
|
47846
|
+
buildAuthorizeUrl({ app, redirectUri, state }) {
|
|
47847
|
+
const authorizeUrl = new URL("https://slack.com/oauth/v2/authorize");
|
|
47848
|
+
authorizeUrl.searchParams.set("client_id", app.clientId);
|
|
47849
|
+
authorizeUrl.searchParams.set("scope", SLACK_OAUTH_SCOPE);
|
|
47850
|
+
authorizeUrl.searchParams.set("redirect_uri", redirectUri);
|
|
47851
|
+
authorizeUrl.searchParams.set("state", state);
|
|
47852
|
+
return authorizeUrl.toString();
|
|
47853
|
+
},
|
|
47854
|
+
async exchange({ app, redirectUri, code }) {
|
|
47855
|
+
const body = new URLSearchParams({
|
|
47856
|
+
client_id: app.clientId,
|
|
47857
|
+
client_secret: app.clientSecret,
|
|
47858
|
+
code,
|
|
47859
|
+
redirect_uri: redirectUri
|
|
47860
|
+
});
|
|
47861
|
+
const payload = await (await fetch("https://slack.com/api/oauth.v2.access", {
|
|
47862
|
+
method: "POST",
|
|
47863
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
47864
|
+
body
|
|
47865
|
+
})).json();
|
|
47866
|
+
if (!payload.ok || !payload.access_token || !payload.team?.id) throw new Error(payload.error ?? "Slack OAuth token exchange failed.");
|
|
47867
|
+
return {
|
|
47868
|
+
externalId: payload.team.id,
|
|
47869
|
+
accessToken: payload.access_token,
|
|
47870
|
+
grantedScopes: parseGrantedScopes(payload.scope, {
|
|
47871
|
+
delimiter: "comma",
|
|
47872
|
+
fallback: SLACK_OAUTH_SCOPES
|
|
47873
|
+
}),
|
|
47874
|
+
metadata: {
|
|
47875
|
+
teamName: payload.team.name,
|
|
47876
|
+
botUserId: payload.bot_user_id,
|
|
47877
|
+
enterpriseId: payload.enterprise?.id
|
|
47878
|
+
}
|
|
47879
|
+
};
|
|
47880
|
+
},
|
|
47881
|
+
async persist({ app, result }) {
|
|
47882
|
+
await ensureOAuthCredentialInstance({
|
|
47883
|
+
credentialKey: SLACK_OAUTH_APP_KEY,
|
|
47884
|
+
connectionId: await saveOAuthConnection({
|
|
47885
|
+
appId: app.id,
|
|
47886
|
+
externalId: result.externalId,
|
|
47887
|
+
accessToken: result.accessToken,
|
|
47888
|
+
grantedScopes: [...result.grantedScopes],
|
|
47889
|
+
metadata: result.metadata
|
|
47890
|
+
})
|
|
47891
|
+
});
|
|
47892
|
+
return {
|
|
47893
|
+
status: "installed",
|
|
47894
|
+
teamId: result.externalId,
|
|
47895
|
+
teamName: result.metadata?.teamName ?? null
|
|
47896
|
+
};
|
|
47897
|
+
}
|
|
47898
|
+
});
|
|
47899
|
+
//#endregion
|
|
47725
47900
|
//#region ../../node_modules/.pnpm/@slack+web-api@7.16.0/node_modules/@slack/web-api/dist/errors.js
|
|
47726
47901
|
var require_errors$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
47727
47902
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -104973,180 +105148,6 @@ var SessionAgentMismatchError = class extends Error {
|
|
|
104973
105148
|
};
|
|
104974
105149
|
//#endregion
|
|
104975
105150
|
//#region ../../packages/integrations/slack/dist/index.mjs
|
|
104976
|
-
function slackNotConfiguredResponse() {
|
|
104977
|
-
return {
|
|
104978
|
-
error: "slack_not_configured",
|
|
104979
|
-
message: "Slack OAuth is not configured. Install via the UI or seed oauth_apps."
|
|
104980
|
-
};
|
|
104981
|
-
}
|
|
104982
|
-
const LOG_PREFIX = "[slack]";
|
|
104983
|
-
function envValue(name) {
|
|
104984
|
-
return process.env[name]?.trim() || void 0;
|
|
104985
|
-
}
|
|
104986
|
-
function missingSlackAppEnv(options) {
|
|
104987
|
-
return [
|
|
104988
|
-
!options.clientId ? "SLACK_CLIENT_ID" : null,
|
|
104989
|
-
!options.clientSecret ? "SLACK_CLIENT_SECRET" : null,
|
|
104990
|
-
!options.signingSecret ? "SLACK_SIGNING_SECRET" : null
|
|
104991
|
-
].filter((name) => name !== null);
|
|
104992
|
-
}
|
|
104993
|
-
async function fetchSlackTeamId(botToken, fetchImpl) {
|
|
104994
|
-
const body = await (await fetchImpl("https://slack.com/api/auth.test", {
|
|
104995
|
-
method: "POST",
|
|
104996
|
-
headers: {
|
|
104997
|
-
Authorization: `Bearer ${botToken}`,
|
|
104998
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
104999
|
-
}
|
|
105000
|
-
})).json();
|
|
105001
|
-
if (!body.ok || !body.team_id) throw new Error(body.error ?? "Slack auth.test failed");
|
|
105002
|
-
return {
|
|
105003
|
-
teamId: body.team_id,
|
|
105004
|
-
teamName: body.team,
|
|
105005
|
-
botUserId: body.user_id
|
|
105006
|
-
};
|
|
105007
|
-
}
|
|
105008
|
-
async function seedSlackOAuthFromEnv(options = {}) {
|
|
105009
|
-
const fetchImpl = options.fetchImpl ?? fetch;
|
|
105010
|
-
const clientId = envValue("SLACK_CLIENT_ID");
|
|
105011
|
-
const clientSecret = envValue("SLACK_CLIENT_SECRET");
|
|
105012
|
-
const signingSecret = envValue("SLACK_SIGNING_SECRET");
|
|
105013
|
-
const botToken = envValue("SLACK_BOT_TOKEN");
|
|
105014
|
-
const hasAppEnv = Boolean(clientId && clientSecret && signingSecret);
|
|
105015
|
-
const hasPartialAppEnv = Boolean(clientId || clientSecret || signingSecret);
|
|
105016
|
-
let appId;
|
|
105017
|
-
if (hasAppEnv) {
|
|
105018
|
-
const app = await ensureOAuthApp({
|
|
105019
|
-
key: SLACK_OAUTH_APP_KEY,
|
|
105020
|
-
provider: SLACK_OAUTH_APP_KEY,
|
|
105021
|
-
tokenStrategy: "installation",
|
|
105022
|
-
clientId,
|
|
105023
|
-
clientSecret,
|
|
105024
|
-
signingSecret,
|
|
105025
|
-
metadata: { appName: "Slack" }
|
|
105026
|
-
});
|
|
105027
|
-
appId = app.id;
|
|
105028
|
-
if (app.updated) console.log(`${LOG_PREFIX} Updated oauth_apps from env`);
|
|
105029
|
-
} else if (hasPartialAppEnv) {
|
|
105030
|
-
const missing = missingSlackAppEnv({
|
|
105031
|
-
clientId,
|
|
105032
|
-
clientSecret,
|
|
105033
|
-
signingSecret
|
|
105034
|
-
});
|
|
105035
|
-
console.warn(`${LOG_PREFIX} Incomplete Slack OAuth env — missing ${missing.join(", ")}. Skipping oauth_apps seed.`);
|
|
105036
|
-
}
|
|
105037
|
-
if (!appId) {
|
|
105038
|
-
appId = (await getDecryptedOAuthAppByKey(SLACK_OAUTH_APP_KEY))?.id;
|
|
105039
|
-
if (!appId && !botToken) console.warn(`${LOG_PREFIX} Slack OAuth not configured — install routes and gateway will fail until configured.`);
|
|
105040
|
-
}
|
|
105041
|
-
if (!appId || !botToken) return;
|
|
105042
|
-
try {
|
|
105043
|
-
const team = await fetchSlackTeamId(botToken, fetchImpl);
|
|
105044
|
-
const existingConnection = (await getDecryptedOAuthConnectionsByAppKey(SLACK_OAUTH_APP_KEY)).find((connection) => connection.externalId === team.teamId);
|
|
105045
|
-
await ensureOAuthCredentialInstance({
|
|
105046
|
-
credentialKey: SLACK_OAUTH_APP_KEY,
|
|
105047
|
-
connectionId: await saveOAuthConnection({
|
|
105048
|
-
appId,
|
|
105049
|
-
externalId: team.teamId,
|
|
105050
|
-
accessToken: botToken,
|
|
105051
|
-
metadata: {
|
|
105052
|
-
teamName: team.teamName,
|
|
105053
|
-
botUserId: team.botUserId
|
|
105054
|
-
}
|
|
105055
|
-
})
|
|
105056
|
-
});
|
|
105057
|
-
if (existingConnection && existingConnection.accessToken !== botToken) console.log(`${LOG_PREFIX} Updated Slack bot token connection from SLACK_BOT_TOKEN`);
|
|
105058
|
-
} catch (error) {
|
|
105059
|
-
console.warn(`${LOG_PREFIX} Failed to seed Slack bot token from SLACK_BOT_TOKEN:`, error instanceof Error ? error.message : error);
|
|
105060
|
-
}
|
|
105061
|
-
}
|
|
105062
|
-
const SLACK_OAUTH_SCOPES = [
|
|
105063
|
-
"chat:write",
|
|
105064
|
-
"app_mentions:read",
|
|
105065
|
-
"im:history",
|
|
105066
|
-
"im:write",
|
|
105067
|
-
"channels:history",
|
|
105068
|
-
"groups:history",
|
|
105069
|
-
"users:read",
|
|
105070
|
-
"users:read.email"
|
|
105071
|
-
];
|
|
105072
|
-
const SLACK_OAUTH_SCOPE = SLACK_OAUTH_SCOPES.join(",");
|
|
105073
|
-
const SLACK_OAUTH_APP_KEY = "slack";
|
|
105074
|
-
/**
|
|
105075
|
-
* Slack OAuth provider — mount handlers from `slackOAuthProvider.handlers` in the plugin.
|
|
105076
|
-
*
|
|
105077
|
-
* Requires an authenticated session to start the install (a workspace bot token is
|
|
105078
|
-
* org-scoped, so we gate who can install it but do not track which user ran connect).
|
|
105079
|
-
*/
|
|
105080
|
-
const slackOAuthProvider = defineOAuthProvider({
|
|
105081
|
-
key: SLACK_OAUTH_APP_KEY,
|
|
105082
|
-
stateCookie: "slack_oauth_state",
|
|
105083
|
-
requiresAuth: true,
|
|
105084
|
-
authorizeUrlPath: true,
|
|
105085
|
-
async resolveApp() {
|
|
105086
|
-
await seedSlackOAuthFromEnv();
|
|
105087
|
-
const app = await getDecryptedOAuthAppByKey(SLACK_OAUTH_APP_KEY);
|
|
105088
|
-
if (!app) return null;
|
|
105089
|
-
return {
|
|
105090
|
-
id: app.id,
|
|
105091
|
-
clientId: app.clientId,
|
|
105092
|
-
clientSecret: app.clientSecret,
|
|
105093
|
-
redirectUri: app.redirectUri
|
|
105094
|
-
};
|
|
105095
|
-
},
|
|
105096
|
-
notConfigured: slackNotConfiguredResponse,
|
|
105097
|
-
buildAuthorizeUrl({ app, redirectUri, state }) {
|
|
105098
|
-
const authorizeUrl = new URL("https://slack.com/oauth/v2/authorize");
|
|
105099
|
-
authorizeUrl.searchParams.set("client_id", app.clientId);
|
|
105100
|
-
authorizeUrl.searchParams.set("scope", SLACK_OAUTH_SCOPE);
|
|
105101
|
-
authorizeUrl.searchParams.set("redirect_uri", redirectUri);
|
|
105102
|
-
authorizeUrl.searchParams.set("state", state);
|
|
105103
|
-
return authorizeUrl.toString();
|
|
105104
|
-
},
|
|
105105
|
-
async exchange({ app, redirectUri, code }) {
|
|
105106
|
-
const body = new URLSearchParams({
|
|
105107
|
-
client_id: app.clientId,
|
|
105108
|
-
client_secret: app.clientSecret,
|
|
105109
|
-
code,
|
|
105110
|
-
redirect_uri: redirectUri
|
|
105111
|
-
});
|
|
105112
|
-
const payload = await (await fetch("https://slack.com/api/oauth.v2.access", {
|
|
105113
|
-
method: "POST",
|
|
105114
|
-
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
105115
|
-
body
|
|
105116
|
-
})).json();
|
|
105117
|
-
if (!payload.ok || !payload.access_token || !payload.team?.id) throw new Error(payload.error ?? "Slack OAuth token exchange failed.");
|
|
105118
|
-
return {
|
|
105119
|
-
externalId: payload.team.id,
|
|
105120
|
-
accessToken: payload.access_token,
|
|
105121
|
-
grantedScopes: parseGrantedScopes(payload.scope, {
|
|
105122
|
-
delimiter: "comma",
|
|
105123
|
-
fallback: SLACK_OAUTH_SCOPES
|
|
105124
|
-
}),
|
|
105125
|
-
metadata: {
|
|
105126
|
-
teamName: payload.team.name,
|
|
105127
|
-
botUserId: payload.bot_user_id,
|
|
105128
|
-
enterpriseId: payload.enterprise?.id
|
|
105129
|
-
}
|
|
105130
|
-
};
|
|
105131
|
-
},
|
|
105132
|
-
async persist({ app, result }) {
|
|
105133
|
-
await ensureOAuthCredentialInstance({
|
|
105134
|
-
credentialKey: SLACK_OAUTH_APP_KEY,
|
|
105135
|
-
connectionId: await saveOAuthConnection({
|
|
105136
|
-
appId: app.id,
|
|
105137
|
-
externalId: result.externalId,
|
|
105138
|
-
accessToken: result.accessToken,
|
|
105139
|
-
grantedScopes: [...result.grantedScopes],
|
|
105140
|
-
metadata: result.metadata
|
|
105141
|
-
})
|
|
105142
|
-
});
|
|
105143
|
-
return {
|
|
105144
|
-
status: "installed",
|
|
105145
|
-
teamId: result.externalId,
|
|
105146
|
-
teamName: result.metadata?.teamName ?? null
|
|
105147
|
-
};
|
|
105148
|
-
}
|
|
105149
|
-
});
|
|
105150
105151
|
async function resolveSlackBotUserIdFromDb(credentialKey) {
|
|
105151
105152
|
const connections = await getDecryptedOAuthConnectionsByAppKey(credentialKey);
|
|
105152
105153
|
if (connections.length !== 1) return null;
|
|
@@ -108121,4 +108122,4 @@ async function emitRouteManifest(root) {
|
|
|
108121
108122
|
//#endregion
|
|
108122
108123
|
export { emitRouteManifest };
|
|
108123
108124
|
|
|
108124
|
-
//# sourceMappingURL=emit-route-manifest-DRcNXHCP-
|
|
108125
|
+
//# sourceMappingURL=emit-route-manifest-DRcNXHCP-CuH5IaKl.mjs.map
|