blink 1.1.16 → 1.1.19

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 (88) hide show
  1. package/dist/browser/agent/client/index.cjs +8 -8
  2. package/dist/browser/agent/client/index.js +8 -8
  3. package/dist/cli/auth-CoJASYGP.js +2 -0
  4. package/dist/cli/chat-BDAEIrJW.js +1 -0
  5. package/dist/cli/{chat-manager-BtRfjylv.js → chat-manager-BRchJngj.js} +8 -8
  6. package/dist/cli/connect-CQUVd44y.js +1 -0
  7. package/dist/cli/connect-WyCmuQHj.js +1 -0
  8. package/dist/cli/{dev-Bz1veOUF.js → dev-BShY-dVP.js} +182 -200
  9. package/dist/cli/{dist-AXHevRdg.js → dist-Ceoe3h7v.js} +51 -56
  10. package/dist/cli/index.js +7 -7
  11. package/dist/cli/init-DoMgv4kU.js +25 -0
  12. package/dist/cli/{init-templates-C_keoZ45.js → init-templates-MqyReSD9.js} +132 -117
  13. package/dist/cli/login-DZFx5155.js +1 -0
  14. package/dist/cli/{run-DT3wRuFc.js → run-DFYLWiOa.js} +1 -1
  15. package/dist/cli/setup-slack-app-DQ3iSM5s.js +1 -0
  16. package/dist/cli/{token-CrWhcy44.js → token-DNRiDJM-.js} +1 -1
  17. package/dist/cli/token-util-C6Xu44iO.js +1 -0
  18. package/dist/cli/{token-util-1KocPoKS.js → token-util-IqDtKhK6.js} +1 -1
  19. package/dist/cli/undici-L5V8WBce.js +1 -0
  20. package/dist/cli/{util-DBfnc6lD.js → util-BQ3TH_Sv.js} +1 -1
  21. package/dist/cli/util-BgbIWOFE.js +6 -0
  22. package/dist/node/agent/index.node.cjs +1 -1
  23. package/dist/node/agent/index.node.d.ts +1 -1
  24. package/dist/node/agent/index.node.js +1 -1
  25. package/dist/node/build/index.d.ts +1 -1
  26. package/dist/node/index.node-D7Cvmag9.cjs +55 -0
  27. package/dist/node/index.node-TFdiI8lm.js +55 -0
  28. package/dist/node/react/index.node.cjs +252 -270
  29. package/dist/node/react/index.node.d.cts +3 -1
  30. package/dist/node/react/index.node.d.ts +5 -3
  31. package/dist/node/react/index.node.js +182 -200
  32. package/dist/node/{token-Bcs36BIo.cjs → token-BBGr-czK.cjs} +1 -1
  33. package/dist/node/{token-DY8sflMu.js → token-DOfE6QlD.js} +1 -1
  34. package/dist/node/{token-util-BIiR16HV.js → token-util-C_uzN2q9.js} +1 -1
  35. package/dist/node/token-util-D9kCwzE6.cjs +1 -0
  36. package/package.json +8 -4
  37. package/README.md +0 -3
  38. package/dist/cli/auth-DCUw-BJE.js +0 -2
  39. package/dist/cli/chat-ebiRKqit.js +0 -1
  40. package/dist/cli/connect-C3y3nGPW.js +0 -1
  41. package/dist/cli/connect-C__b725p.js +0 -1
  42. package/dist/cli/execAsync-BeUIz9nV.js +0 -1
  43. package/dist/cli/execAsync-Byz_iObc.js +0 -1
  44. package/dist/cli/execAsync-CQurQFgT.js +0 -1
  45. package/dist/cli/getMachineId-bsd-2l7jEJ9H.js +0 -1
  46. package/dist/cli/getMachineId-bsd-Cn9OZifa.js +0 -1
  47. package/dist/cli/getMachineId-bsd-DP_S0ZSE.js +0 -1
  48. package/dist/cli/getMachineId-darwin-C-kdKVWl.js +0 -2
  49. package/dist/cli/getMachineId-darwin-D6Y_ttQ1.js +0 -2
  50. package/dist/cli/getMachineId-darwin-D9mTsu57.js +0 -2
  51. package/dist/cli/getMachineId-linux-CI6sk5r7.js +0 -1
  52. package/dist/cli/getMachineId-linux-DA2UB-e3.js +0 -1
  53. package/dist/cli/getMachineId-linux-DGORKISs.js +0 -1
  54. package/dist/cli/getMachineId-unsupported-B4t2intc.js +0 -1
  55. package/dist/cli/getMachineId-unsupported-B6Ips7oB.js +0 -1
  56. package/dist/cli/getMachineId-unsupported-Cxfw7WwT.js +0 -1
  57. package/dist/cli/getMachineId-win-B6FQ_uBq.js +0 -1
  58. package/dist/cli/getMachineId-win-Dr2KTzTp.js +0 -1
  59. package/dist/cli/getMachineId-win-QxOtxJWo.js +0 -1
  60. package/dist/cli/init-DYcep43s.js +0 -3
  61. package/dist/cli/login-P-KIKeEv.js +0 -1
  62. package/dist/cli/open-DCYivxgo.js +0 -1
  63. package/dist/cli/server-C8plsU0X-b-FVGGZ1.js +0 -16
  64. package/dist/cli/setup-slack-app-Bo1yEsSq.js +0 -1
  65. package/dist/cli/token-util-CRJP9Uji.js +0 -1
  66. package/dist/cli/undici-CeDxbuSU.js +0 -1
  67. package/dist/node/execAsync-DDSV4gfK.cjs +0 -1
  68. package/dist/node/execAsync-DQysi_u6.js +0 -1
  69. package/dist/node/getMachineId-bsd-D2W6fhXU.js +0 -1
  70. package/dist/node/getMachineId-bsd-DM9BAly2.cjs +0 -1
  71. package/dist/node/getMachineId-darwin-BsTWxMfp.cjs +0 -2
  72. package/dist/node/getMachineId-darwin-Dk0tjVME.js +0 -2
  73. package/dist/node/getMachineId-linux-DZ7RMAHq.js +0 -1
  74. package/dist/node/getMachineId-linux-DmWhhrp6.cjs +0 -1
  75. package/dist/node/getMachineId-unsupported-CiZad6mc.js +0 -1
  76. package/dist/node/getMachineId-unsupported-y6X1AHF8.cjs +0 -1
  77. package/dist/node/getMachineId-win-_P_0Nv15.js +0 -1
  78. package/dist/node/getMachineId-win-e1UzWB2B.cjs +0 -1
  79. package/dist/node/index.node-CERnwYbK.js +0 -55
  80. package/dist/node/index.node-sb6fILn2.cjs +0 -55
  81. package/dist/node/token-util-BrE-Vihm.cjs +0 -1
  82. /package/dist/cli/{devtools-CcsObSm8.js → devtools-DvNholmW.js} +0 -0
  83. /package/dist/cli/{token-error-CoDMyqH1.js → token-error-DVSfBVaT.js} +0 -0
  84. /package/dist/cli/{undici-DS7K19Do.js → undici-BUZTy5qm.js} +0 -0
  85. /package/dist/node/{index-Q90WjL1a.d.ts → index-C28Wm0bG.d.ts} +0 -0
  86. /package/dist/node/{index.node-BgliWLNt.d.ts → index.node-qJt_7e9E.d.ts} +0 -0
  87. /package/dist/node/{token-util-B9ankBb5.cjs → token-util-BOoyY0PX.cjs} +0 -0
  88. /package/dist/node/{token-util-Czyk5fmW.js → token-util-_pz5CtFI.js} +0 -0
@@ -1,12 +1,70 @@
1
- const e={scratch:{"agent.ts":`import { convertToModelMessages, streamText, tool } from "ai";
1
+ const e={scratch:{".gitignore":`# dependencies
2
+ node_modules
3
+
4
+ # config and build
5
+ data
6
+
7
+ # dotenv environment variables file
8
+ .env
9
+ .env.*
10
+
11
+ # Finder (MacOS) folder config
12
+ .DS_Store
13
+ `,"tsconfig.json":`{
14
+ "compilerOptions": {
15
+ "lib": ["ESNext"],
16
+ "target": "ESNext",
17
+ "module": "Preserve",
18
+ "moduleDetection": "force",
19
+
20
+ "moduleResolution": "bundler",
21
+ "allowImportingTsExtensions": true,
22
+ "verbatimModuleSyntax": true,
23
+ "resolveJsonModule": true,
24
+ "noEmit": true,
25
+
26
+ "strict": true,
27
+ "skipLibCheck": true,
28
+ "noFallthroughCasesInSwitch": true,
29
+ "noUncheckedIndexedAccess": true,
30
+ "noImplicitOverride": true,
31
+
32
+ "noUnusedLocals": false,
33
+ "noUnusedParameters": false,
34
+
35
+ "types": ["node"]
36
+ }
37
+ }
38
+ `,".env.local":`
39
+ # Store local environment variables here.
40
+ # They will be used by blink dev for development.
41
+ # EXTERNAL_SERVICE_API_KEY=
42
+ `,".env.production":`# Store production environment variables here.
43
+ # They will be upserted as secrets on blink deploy.
44
+ # EXTERNAL_SERVICE_API_KEY=
45
+ `,"agent.ts.hbs":`import { convertToModelMessages, streamText, tool } from "ai";
2
46
  import * as blink from "blink";
3
47
  import { z } from "zod";
48
+ {{#if (eq aiProvider "anthropic")}}
49
+ import { anthropic } from "@ai-sdk/anthropic";
50
+ {{else if (eq aiProvider "openai")}}
51
+ import { openai } from "@ai-sdk/openai";
52
+ {{/if}}
4
53
 
5
- const agent = blink.agent();
54
+ const agent = new blink.Agent();
6
55
 
7
56
  agent.on("chat", async ({ messages }) => {
8
57
  return streamText({
9
- model: blink.model("anthropic/claude-sonnet-4.5"),
58
+ {{#if (eq aiProvider "anthropic")}}
59
+ model: anthropic("claude-sonnet-4-5"),
60
+ {{else if (eq aiProvider "openai")}}
61
+ model: openai("gpt-5-chat-latest"),
62
+ {{else if (eq aiProvider "vercel")}}
63
+ model: "anthropic/claude-sonnet-4.5",
64
+ {{else}}
65
+ // Unknown provider: {{aiProvider}}. Defaulting to Vercel AI Gateway syntax.
66
+ model: "anthropic/claude-sonnet-4.5",
67
+ {{/if}}
10
68
  system: \`You are a basic agent the user will customize.
11
69
 
12
70
  Suggest the user enters edit mode with Ctrl+T or /edit to customize the agent.
@@ -26,8 +84,8 @@ Demonstrate your capabilities with the IP tool.\`,
26
84
  });
27
85
 
28
86
  agent.serve();
29
- `,"package.json":`{
30
- "name": "{{name}}",
87
+ `,"package.json.hbs":`{
88
+ "name": "{{packageName}}",
31
89
  "main": "agent.ts",
32
90
  "type": "module",
33
91
  "private": true,
@@ -38,49 +96,17 @@ agent.serve();
38
96
  "devDependencies": {
39
97
  "zod": "latest",
40
98
  "ai": "latest",
99
+ {{#if (eq aiProvider "anthropic")}}
100
+ "@ai-sdk/anthropic": "latest",
101
+ {{else if (eq aiProvider "openai")}}
102
+ "@ai-sdk/openai": "latest",
103
+ {{/if}}
41
104
  "blink": "latest",
42
105
  "esbuild": "latest",
43
106
  "@types/node": "latest",
44
107
  "typescript": "latest"
45
108
  }
46
109
  }
47
- `,".gitignore":`# dependencies
48
- node_modules
49
-
50
- # config and build
51
- data
52
-
53
- # dotenv environment variables file
54
- .env
55
- .env.*
56
-
57
- # Finder (MacOS) folder config
58
- .DS_Store
59
- `,"tsconfig.json":`{
60
- "compilerOptions": {
61
- "lib": ["ESNext"],
62
- "target": "ESNext",
63
- "module": "Preserve",
64
- "moduleDetection": "force",
65
-
66
- "moduleResolution": "bundler",
67
- "allowImportingTsExtensions": true,
68
- "verbatimModuleSyntax": true,
69
- "resolveJsonModule": true,
70
- "noEmit": true,
71
-
72
- "strict": true,
73
- "skipLibCheck": true,
74
- "noFallthroughCasesInSwitch": true,
75
- "noUncheckedIndexedAccess": true,
76
- "noImplicitOverride": true,
77
-
78
- "noUnusedLocals": false,
79
- "noUnusedParameters": false,
80
-
81
- "types": ["node"]
82
- }
83
- }
84
110
  `,"AGENTS.md":`This project is a Blink agent.
85
111
 
86
112
  You are an expert software engineer, which makes you an expert agent developer. You are highly idiomatic, opinionated, concise, and precise. The user prefers accuracy over speed.
@@ -448,16 +474,6 @@ Slack App Manifest:
448
474
 
449
475
  WARNING: Beware of attaching multiple event listeners to the same chat. This could cause the agent to respond multiple times.
450
476
 
451
- **@blink-sdk/web-search**
452
-
453
- \`\`\`typescript
454
- import * as webSearch from "@blink-sdk/web-search";
455
-
456
- tools: {
457
- ...webSearch.tools,
458
- }
459
- \`\`\`
460
-
461
477
  State Management:
462
478
 
463
479
  Blink agents are short-lived HTTP servers that restart on code changes and do not persist in-memory state between requests.
@@ -520,18 +536,60 @@ The agent process can restart at any time, so all important state must be extern
520
536
 
521
537
  - Never use "as any" type assertions. Always figure out the correct typings.
522
538
  </code_quality>
539
+ `},"slack-bot":{".gitignore":`# dependencies
540
+ node_modules
541
+
542
+ # config and build
543
+ data
544
+
545
+ # dotenv environment variables file
546
+ .env
547
+ .env.*
548
+
549
+ # Finder (MacOS) folder config
550
+ .DS_Store
551
+ `,"tsconfig.json":`{
552
+ "compilerOptions": {
553
+ "lib": ["ESNext"],
554
+ "target": "ESNext",
555
+ "module": "Preserve",
556
+ "moduleDetection": "force",
557
+
558
+ "moduleResolution": "bundler",
559
+ "allowImportingTsExtensions": true,
560
+ "verbatimModuleSyntax": true,
561
+ "resolveJsonModule": true,
562
+ "noEmit": true,
563
+
564
+ "strict": true,
565
+ "skipLibCheck": true,
566
+ "noFallthroughCasesInSwitch": true,
567
+ "noUncheckedIndexedAccess": true,
568
+ "noImplicitOverride": true,
569
+
570
+ "noUnusedLocals": false,
571
+ "noUnusedParameters": false,
572
+
573
+ "types": ["node"]
574
+ }
575
+ }
523
576
  `,".env.local":`
524
577
  # Store local environment variables here.
525
578
  # They will be used by blink dev for development.
526
- # EXTERNAL_SERVICE_API_KEY=
527
- `,".env.production":`
528
- # Store production environment variables here.
579
+ SLACK_BOT_TOKEN=xoxb-your-token-here
580
+ SLACK_SIGNING_SECRET=your-signing-secret-here
581
+ `,".env.production":`# Store production environment variables here.
529
582
  # They will be upserted as secrets on blink deploy.
530
583
  # EXTERNAL_SERVICE_API_KEY=
531
- `},"slack-bot":{"agent.ts":`import { convertToModelMessages, streamText } from "ai";
584
+ `,"agent.ts.hbs":`import { convertToModelMessages, streamText } from "ai";
532
585
  import * as blink from "blink";
533
586
  import * as slack from "@blink-sdk/slack";
534
587
  import { App } from "@slack/bolt";
588
+ {{#if (eq aiProvider "anthropic")}}
589
+ import { anthropic } from "@ai-sdk/anthropic";
590
+ {{else if (eq aiProvider "openai")}}
591
+ import { openai } from "@ai-sdk/openai";
592
+ {{/if}}
535
593
 
536
594
  const receiver = new slack.Receiver();
537
595
  const app = new App({
@@ -584,6 +642,7 @@ app.event("message", async ({ event }) => {
584
642
  thread_ts: event.thread_ts ?? event.ts,
585
643
  });
586
644
  });
645
+
587
646
  const agent = new blink.Agent();
588
647
 
589
648
  agent.on("request", async (request) => {
@@ -611,7 +670,16 @@ agent.on("chat", async ({ messages }) => {
611
670
  }
612
671
 
613
672
  return streamText({
614
- model: blink.model("anthropic/claude-sonnet-4.5"),
673
+ {{#if (eq aiProvider "anthropic")}}
674
+ model: anthropic("claude-sonnet-4-5"),
675
+ {{else if (eq aiProvider "openai")}}
676
+ model: openai("gpt-5-chat-latest"),
677
+ {{else if (eq aiProvider "vercel")}}
678
+ model: "anthropic/claude-sonnet-4.5",
679
+ {{else}}
680
+ // Unknown provider: {{aiProvider}}. Defaulting to Vercel AI Gateway syntax.
681
+ model: "anthropic/claude-sonnet-4.5",
682
+ {{/if}}
615
683
  system: "You are a helpful Slack bot assistant.",
616
684
  messages: convertToModelMessages(messages, {
617
685
  ignoreIncompleteToolCalls: true,
@@ -621,9 +689,8 @@ agent.on("chat", async ({ messages }) => {
621
689
  });
622
690
  });
623
691
 
624
- agent.serve();
625
- `,"package.json":`{
626
- "name": "{{name}}",
692
+ agent.serve();`,"package.json.hbs":`{
693
+ "name": "{{packageName}}",
627
694
  "main": "agent.ts",
628
695
  "type": "module",
629
696
  "private": true,
@@ -634,6 +701,11 @@ agent.serve();
634
701
  "devDependencies": {
635
702
  "zod": "latest",
636
703
  "ai": "latest",
704
+ {{#if (eq aiProvider "anthropic")}}
705
+ "@ai-sdk/anthropic": "latest",
706
+ {{else if (eq aiProvider "openai")}}
707
+ "@ai-sdk/openai": "latest",
708
+ {{/if}}
637
709
  "blink": "latest",
638
710
  "esbuild": "latest",
639
711
  "@types/node": "latest",
@@ -642,43 +714,6 @@ agent.serve();
642
714
  "@blink-sdk/slack": "latest"
643
715
  }
644
716
  }
645
- `,".gitignore":`# dependencies
646
- node_modules
647
-
648
- # config and build
649
- data
650
-
651
- # dotenv environment variables file
652
- .env
653
- .env.*
654
-
655
- # Finder (MacOS) folder config
656
- .DS_Store
657
- `,"tsconfig.json":`{
658
- "compilerOptions": {
659
- "lib": ["ESNext"],
660
- "target": "ESNext",
661
- "module": "Preserve",
662
- "moduleDetection": "force",
663
-
664
- "moduleResolution": "bundler",
665
- "allowImportingTsExtensions": true,
666
- "verbatimModuleSyntax": true,
667
- "resolveJsonModule": true,
668
- "noEmit": true,
669
-
670
- "strict": true,
671
- "skipLibCheck": true,
672
- "noFallthroughCasesInSwitch": true,
673
- "noUncheckedIndexedAccess": true,
674
- "noImplicitOverride": true,
675
-
676
- "noUnusedLocals": false,
677
- "noUnusedParameters": false,
678
-
679
- "types": ["node"]
680
- }
681
- }
682
717
  `,"AGENTS.md":`This project is a Blink agent.
683
718
 
684
719
  You are an expert software engineer, which makes you an expert agent developer. You are highly idiomatic, opinionated, concise, and precise. The user prefers accuracy over speed.
@@ -1046,16 +1081,6 @@ Slack App Manifest:
1046
1081
 
1047
1082
  WARNING: Beware of attaching multiple event listeners to the same chat. This could cause the agent to respond multiple times.
1048
1083
 
1049
- **@blink-sdk/web-search**
1050
-
1051
- \`\`\`typescript
1052
- import * as webSearch from "@blink-sdk/web-search";
1053
-
1054
- tools: {
1055
- ...webSearch.tools,
1056
- }
1057
- \`\`\`
1058
-
1059
1084
  State Management:
1060
1085
 
1061
1086
  Blink agents are short-lived HTTP servers that restart on code changes and do not persist in-memory state between requests.
@@ -1118,14 +1143,4 @@ The agent process can restart at any time, so all important state must be extern
1118
1143
 
1119
1144
  - Never use "as any" type assertions. Always figure out the correct typings.
1120
1145
  </code_quality>
1121
- `,".env.local":`
1122
- # Store local environment variables here.
1123
- # They will be used by blink dev for development.
1124
- SLACK_BOT_TOKEN=xoxb-your-token-here
1125
- SLACK_SIGNING_SECRET=your-signing-secret-here
1126
- `,".env.production":`
1127
- # Store production environment variables here.
1128
- # They will be upserted as secrets on blink deploy.
1129
- SLACK_BOT_TOKEN=
1130
- SLACK_SIGNING_SECRET=
1131
1146
  `}};export{e as templates};
@@ -0,0 +1 @@
1
+ import"./dist-Ceoe3h7v.js";import{login as e}from"./auth-CoJASYGP.js";import"./util-BgbIWOFE.js";async function t(){await e()}export{t as default};
@@ -1 +1 @@
1
- import{__toESM as e}from"./chunk-D9KrCrVq.js";import{findNearestEntry as t,migrateBlinkToData as n,require_main as r,resolveConfig as i}from"./util-DBfnc6lD.js";import"./dist-AXHevRdg.js";import{getAuthToken as a}from"./auth-DCUw-BJE.js";import"./open-DCYivxgo.js";import{ChatManager as o,Client as s}from"./chat-manager-BtRfjylv.js";import{spawn as c}from"node:child_process";import{join as l,resolve as u}from"node:path";import{existsSync as d}from"node:fs";import{readFile as f}from"node:fs/promises";import{createServer as p}from"node:net";async function m(e){let t=e.env?.PORT??await h(),n=e.env?.HOST??`127.0.0.1`,r=`http://${n}:${t}`,i={...e.env??process.env,PORT:t.toString(),HOST:n},a=c(e.command,e.args,{stdio:`pipe`,env:i});e.signal?.addEventListener(`abort`,()=>{try{a.kill()}catch{}},{once:!0});let o=new AbortController,l=[o.signal];e.signal&&l.push(e.signal);let u=AbortSignal.any(l);a.stdout.on(`data`,t=>{e.onStdout?.(Buffer.from(t).toString(`utf-8`))});let d=``;a.stderr.on(`data`,t=>{o.signal.aborted||(d+=Buffer.from(t).toString(`utf-8`)),e.onStderr?.(Buffer.from(t).toString(`utf-8`))}),a.on(`error`,e=>{o.abort(e)}),a.on(`exit`,(t,n)=>{o.signal.aborted?e.onExit?.(t,n):o.abort()});let f=new s({baseUrl:r}),p=0;for(;!u.aborted;){try{await f.health();break}catch{}if(await new Promise(e=>setTimeout(e,p*5)),p++,p>100)throw Error(`Health endpoint timed out`)}if(u.aborted)throw u.reason;return o.abort(),{client:f,dispose:()=>{a.kill()}}}async function h(){let e=p();return new Promise((t,n)=>{e.listen(0,()=>{let n=e.address().port;t(n)}).on(`error`,e=>{n(e)})}).finally(()=>{e.close()})}var g=e(r(),1);async function _(e,r={}){if(!r.directory){let e=process.cwd();try{i(e),r.directory=e}catch{let n=await t(e,`.blink`);n&&d(l(n,`build`))&&(n=void 0),n?r.directory=n:r.directory=e}}await n(r.directory);let s=i(r.directory),c={};try{c=(0,g.parse)(await f(l(r.directory,`.env.local`),`utf-8`))}catch{}let p=await a(),h=await m({command:`node`,args:[`--experimental-strip-types`,`--no-deprecation`,s.entry],env:{...process.env,...c,BLINK_TOKEN:p}});console.log(`Agent spawned`);let _=u(r?.directory??process.cwd(),`data`,`chats`),v=new o({chatId:r?.chat,chatsDirectory:_});v.setAgent(h.client);try{let t=new Promise(e=>{let t=v.subscribe(n=>{(n.status===`idle`||n.status===`error`)&&(t(),e())})});await v.sendMessages([{id:crypto.randomUUID(),created_at:new Date().toISOString(),metadata:void 0,parts:[{type:`text`,text:e.join(` `)}],role:`user`,mode:`run`}]),await t;let n=v.getState();n.error&&console.error(`Error:`,n.error),console.log(`Final state:`,n.messages.pop())}finally{v.dispose(),h.dispose()}}export{_ as default};
1
+ import{__toESM as e}from"./chunk-D9KrCrVq.js";import{findNearestEntry as t,migrateBlinkToData as n,require_main as r,resolveConfig as i}from"./util-BQ3TH_Sv.js";import"./dist-Ceoe3h7v.js";import{getAuthToken as a}from"./auth-CoJASYGP.js";import"./util-BgbIWOFE.js";import{ChatManager as o,Client as s}from"./chat-manager-BRchJngj.js";import{spawn as c}from"node:child_process";import{join as l,resolve as u}from"node:path";import{existsSync as d}from"node:fs";import{readFile as f}from"node:fs/promises";import{createServer as p}from"node:net";async function m(e){let t=e.env?.PORT??await h(),n=e.env?.HOST??`127.0.0.1`,r=`http://${n}:${t}`,i={...e.env??process.env,PORT:t.toString(),HOST:n},a=c(e.command,e.args,{stdio:`pipe`,env:i});e.signal?.addEventListener(`abort`,()=>{try{a.kill()}catch{}},{once:!0});let o=new AbortController,l=[o.signal];e.signal&&l.push(e.signal);let u=AbortSignal.any(l);a.stdout.on(`data`,t=>{e.onStdout?.(Buffer.from(t).toString(`utf-8`))});let d=``;a.stderr.on(`data`,t=>{o.signal.aborted||(d+=Buffer.from(t).toString(`utf-8`)),e.onStderr?.(Buffer.from(t).toString(`utf-8`))}),a.on(`error`,e=>{o.abort(e)}),a.on(`exit`,(t,n)=>{o.signal.aborted?e.onExit?.(t,n):o.abort()});let f=new s({baseUrl:r}),p=0;for(;!u.aborted;){try{await f.health();break}catch{}if(await new Promise(e=>setTimeout(e,p*5)),p++,p>100)throw Error(`Health endpoint timed out`)}if(u.aborted)throw u.reason;return o.abort(),{client:f,dispose:()=>{a.kill()}}}async function h(){let e=p();return new Promise((t,n)=>{e.listen(0,()=>{let n=e.address().port;t(n)}).on(`error`,e=>{n(e)})}).finally(()=>{e.close()})}var g=e(r(),1);async function _(e,r={}){if(!r.directory){let e=process.cwd();try{i(e),r.directory=e}catch{let n=await t(e,`.blink`);n&&d(l(n,`build`))&&(n=void 0),n?r.directory=n:r.directory=e}}await n(r.directory);let s=i(r.directory),c={};try{c=(0,g.parse)(await f(l(r.directory,`.env.local`),`utf-8`))}catch{}let p=await a(),h=await m({command:`node`,args:[`--experimental-strip-types`,`--no-deprecation`,s.entry],env:{...process.env,...c,BLINK_TOKEN:p}});console.log(`Agent spawned`);let _=u(r?.directory??process.cwd(),`data`,`chats`),v=new o({chatId:r?.chat,chatsDirectory:_});v.setAgent(h.client);try{let t=new Promise(e=>{let t=v.subscribe(n=>{(n.status===`idle`||n.status===`error`)&&(t(),e())})});await v.sendMessages([{id:crypto.randomUUID(),created_at:new Date().toISOString(),metadata:void 0,parts:[{type:`text`,text:e.join(` `)}],role:`user`,mode:`run`}]),await t;let n=v.getState();n.error&&console.error(`Error:`,n.error),console.log(`Final state:`,n.messages.pop())}finally{v.dispose(),h.dispose()}}export{_ as default};
@@ -0,0 +1 @@
1
+ import{__toESM as e}from"./chunk-D9KrCrVq.js";import{Client as t,Ie as n,M as r,Se as i,Y as a,ge as o,he as s,pD as c,ye as l}from"./dist-Ceoe3h7v.js";import{openUrl as u,require_source as d}from"./util-BgbIWOFE.js";import{createDevhookID as f,createSlackApp as p,getDevhookID as m,hasDevhook as h}from"./create-slack-app-CNDXDwfs.js";import g from"crypto";import{basename as _,join as v}from"path";import{access as y,readFile as b,readdir as x,writeFile as S}from"fs/promises";import C from"node:util";function w(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}var T=e(d(),1);async function E(e){try{let t=await(await fetch(`https://slack.com/api/auth.test`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`}})).json();return t.ok?{valid:!0,botName:t.user}:{valid:!1,error:t.error||`Invalid bot token`}}catch(e){return{valid:!1,error:`Failed to verify credentials: ${e}`}}}function D(e,t,n,r){let i=Math.floor(Date.now()/1e3),a=parseInt(t,10);if(Math.abs(i-a)>300)return!1;let o=g.createHmac(`sha256`,e),s=`v0:${t}:${n}`;o.update(s);let c=`v0=${o.digest(`hex`)}`;return g.timingSafeEqual(Buffer.from(c),Buffer.from(r))}const O=e=>{if(!(typeof e==`object`&&e))throw Error(`Unable to make value disposable, it's not an object`);if(Symbol.dispose in e)return e;if(`dispose`in e&&typeof e.dispose==`function`)return e[Symbol.dispose]=()=>e.dispose(),e;throw Error(`Unable to make value disposable`)};async function k(e,t,n){let r=await b(e,`utf-8`);t&&(r=r.replace(/SLACK_BOT_TOKEN=.*/,`SLACK_BOT_TOKEN=${t}`)),n&&(r=r.replace(/SLACK_SIGNING_SECRET=.*/,`SLACK_SIGNING_SECRET=${n}`)),await S(e,r)}async function A(e){let t=await x(e);for(let[e,n]of[[`bun`,`bun.lock`],[`npm`,`package-lock.json`],[`pnpm`,`pnpm-lock.yaml`],[`yarn`,`yarn.lock`]])for(let r of t)if(r.includes(n))return e;return`npm`}async function j(e,n){try{var d=w();let g=n?.name||_(e).replace(/[^a-zA-Z0-9]/g,`-`),b=n?.packageManager||await A(e),x=v(e,`.env.local`);try{await y(x)}catch{r.error(`No .env.local file found in this directory. Please run this command from a Blink agent directory.`),i(`Slack app setup cancelled`);return}let S=await s({message:`What should your Slack app be called? This will be the name displayed in Slack. You can change it later.`,placeholder:g,defaultValue:g,validate:e=>{if(!e||e.trim().length===0)return`App name cannot be empty`}});if(c(S))return;let j=h(e)?m(e):f(e),M=`https://${j}.blink.host`;if(!j)throw Error(`Failed to obtain devhook ID`);r.info(`Starting webhook listener...`);let N=``,P=``,F=!1,I=``,L=``,R=!1,z,B=new t({baseURL:`https://blink.so`}),V=()=>{},H=e=>{},U=new Promise((e,t)=>{V=e,H=t}),W=B.devhook.listen({id:j,onRequest:async e=>{let t=await e.text(),n;try{n=JSON.parse(t)}catch{return new Response(`Invalid JSON`,{status:400})}if(n.type===`url_verification`)return r.info(`✓ Webhook challenge received`),new Response(JSON.stringify({challenge:n.challenge}),{headers:{"Content-Type":`application/json`}});if(N){let r=e.headers.get(`x-slack-signature`),i=e.headers.get(`x-slack-request-timestamp`);if(!r||!i)return new Response(`Missing signature`,{status:401});if(!D(N,i,t,r))return R=!0,n.event?.type===`message`&&n.event.channel_type===`im`&&!n.event.bot_id&&(z=n.event.channel),new Response(`Invalid signature`,{status:401})}return n.event?.type===`message`&&n.event.channel_type===`im`&&!n.event.bot_id&&(F=!0,I=n.event.channel,L=n.event.ts),new Response(`OK`)},onConnect:()=>{V()},onDisconnect:()=>{},onError:e=>{H(e)}});d.u(O(W));let G={display_information:{name:S.toString(),description:`A Blink agent for Slack`,background_color:`#4A154B`},features:{bot_user:{display_name:S.toString(),always_online:!0},app_home:{home_tab_enabled:!1,messages_tab_enabled:!0,messages_tab_read_only_enabled:!1},assistant_view:{assistant_description:`A helpful assistant powered by Blink`}},oauth_config:{scopes:{bot:[`app_mentions:read`,`assistant:write`,`reactions:write`,`reactions:read`,`channels:history`,`chat:write`,`groups:history`,`groups:read`,`files:read`,`im:history`,`im:read`,`im:write`,`mpim:history`,`mpim:read`,`users:read`,`links:read`,`commands`]}},settings:{event_subscriptions:{request_url:M,bot_events:[`app_mention`,`message.channels`,`message.groups`,`message.im`,`reaction_added`,`reaction_removed`,`assistant_thread_started`,`member_joined_channel`]},interactivity:{is_enabled:!0,request_url:M},token_rotation_enabled:!1,org_deploy_enabled:!1,socket_mode_enabled:!1}},K=p(G);r.info(`Please visit this URL to create your Slack app and return here after finishing:\n\n${T.default.gray(K)}\n`);let q=await l({message:`Open this URL in your browser automatically?`,initialValue:!0});if(c(q)){r.warn(`Skipping Slack app setup`);return}q&&await u(K,`Could not open the browser. Please visit the URL manually.`);let J=await s({message:`After creating the app, paste the App ID from the "Basic Information" page:`,placeholder:`A01234567AB`,validate:e=>{if(!e||e.trim().length===0)return`App ID is required`}});if(c(J)){r.warn(`Skipping Slack app setup`);return}if(N=await o({message:`Paste your Signing Secret from the same page:`,validate:e=>{if(!e||e.trim().length===0)return`Signing secret is required`}}),c(N)){r.warn(`Skipping Slack app setup`);return}let Y=!1;for(;!Y;){if(P=await o({message:`Install your app and paste your Bot Token from ${T.default.cyan(`https://api.slack.com/apps/${J}/install-on-team`)}`,validate:e=>{if(!e||e.trim().length===0)return`Bot token is required`}}),c(P)){r.warn(`Skipping Slack app setup`);return}let e=a();e.start(`Verifying bot token...`);let t=await E(P);if(t.valid)e.stop(`✓ Bot token verified!`),Y=!0;else{e.stop(`✗ Failed to verify bot token: ${t.error}`);let n=await l({message:`Would you like to try again?`,initialValue:!0});if(c(n)||!n){r.warn(`Skipping Slack app setup`);return}}}await k(x,P,N),r.success(`Credentials saved to .env.local`),await U;let X=a();X.start(`Try sending a DM to the bot on Slack - it's ${T.default.bold(T.default.cyan(S))} in the search bar.`);let Z={bun:`bun run dev`,npm:`npm run dev`,pnpm:`pnpm run dev`,yarn:`yarn dev`}[b];for(;!F;){if(R){if(X.stop(`✗ Invalid signing secret detected`),z&&P)try{await fetch(`https://slack.com/api/chat.postMessage`,{method:`POST`,headers:{Authorization:`Bearer ${P}`,"Content-Type":`application/json`},body:JSON.stringify({channel:z,text:`⚠️ There seems to be a problem with the signing secret. Please check the CLI for instructions on how to fix it.`})})}catch{}let e=await o({message:`The signing secret appears to be incorrect. Please paste the correct Signing Secret from ${T.default.cyan(`https://api.slack.com/apps/${J}/general`)}`,validate:e=>{if(!e||e.trim().length===0)return`Signing secret is required`}});if(c(e)){r.warn(`Skipping Slack app setup`);return}N=e,R=!1,z=void 0,await k(x,void 0,N),X.start(`Please try sending a DM to the bot again on Slack...`)}await new Promise(e=>setTimeout(e,500))}X.stop(T.default.green(`✓ DM received!`));try{await fetch(`https://slack.com/api/chat.postMessage`,{method:`POST`,headers:{Authorization:`Bearer ${P}`,"Content-Type":`application/json`},body:JSON.stringify({channel:I,thread_ts:L,text:`Congrats, your app is now installed and ready to use! Run \`${Z}\` to use your agent.`})})}catch(e){r.warn(`Could not send message to Slack: ${C.inspect(e)}`)}r.success(`Slack app setup complete!`)}catch(e){d.e=e}finally{d.d()}}async function M(e){e||=process.cwd(),n(`Setting up Slack app`),await j(e),process.exit(0)}export{j as setupSlackApp,M as setupSlackAppCommand};
@@ -1 +1 @@
1
- import{__commonJSMin as e}from"./chunk-D9KrCrVq.js";import{require_token_error as t}from"./token-error-CoDMyqH1.js";import{require_token_util as n}from"./token-util-1KocPoKS.js";var r=e(((e,r)=>{var i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of o(t))!s.call(e,c)&&c!==n&&i(e,c,{get:()=>t[c],enumerable:!(r=a(t,c))||r.enumerable});return e},u=e=>l(i({},`__esModule`,{value:!0}),e),d={};c(d,{refreshToken:()=>m}),r.exports=u(d);var f=t(),p=n();async function m(){let{projectId:e,teamId:t}=(0,p.findProjectInfo)(),n=(0,p.loadToken)(e);if(!n||(0,p.isExpired)((0,p.getTokenPayload)(n.token))){let r=(0,p.getVercelCliToken)();if(!r)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token: login to vercel cli`);if(!e)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token: project id not found`);if(n=await(0,p.getVercelOidcToken)(r,e,t),!n)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token`);(0,p.saveToken)(n,e)}process.env.VERCEL_OIDC_TOKEN=n.token}}));export default r();export{};
1
+ import{__commonJSMin as e}from"./chunk-D9KrCrVq.js";import{require_token_error as t}from"./token-error-DVSfBVaT.js";import{require_token_util as n}from"./token-util-IqDtKhK6.js";var r=e(((e,r)=>{var i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,c=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of o(t))!s.call(e,c)&&c!==n&&i(e,c,{get:()=>t[c],enumerable:!(r=a(t,c))||r.enumerable});return e},u=e=>l(i({},`__esModule`,{value:!0}),e),d={};c(d,{refreshToken:()=>m}),r.exports=u(d);var f=t(),p=n();async function m(){let{projectId:e,teamId:t}=(0,p.findProjectInfo)(),n=(0,p.loadToken)(e);if(!n||(0,p.isExpired)((0,p.getTokenPayload)(n.token))){let r=(0,p.getVercelCliToken)();if(!r)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token: login to vercel cli`);if(!e)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token: project id not found`);if(n=await(0,p.getVercelOidcToken)(r,e,t),!n)throw new f.VercelOidcTokenError(`Failed to refresh OIDC token`);(0,p.saveToken)(n,e)}process.env.VERCEL_OIDC_TOKEN=n.token}}));export default r();export{};
@@ -0,0 +1 @@
1
+ import"./token-error-DVSfBVaT.js";import{require_token_util as e}from"./token-util-IqDtKhK6.js";export default e();export{};
@@ -1 +1 @@
1
- import{__commonJSMin as e,__require as t}from"./chunk-D9KrCrVq.js";import{require_token_error as n}from"./token-error-CoDMyqH1.js";var r=e(((e,r)=>{var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of s(t))!l.call(e,i)&&i!==n&&a(e,i,{get:()=>t[i],enumerable:!(r=o(t,i))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:i(c(e)),d(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)),p=e=>d(a({},`__esModule`,{value:!0}),e),m={};u(m,{findRootDir:()=>y,getUserDataDir:()=>b}),r.exports=p(m);var h=f(t(`path`)),g=f(t(`fs`)),_=f(t(`os`)),v=n();function y(){try{let e=process.cwd();for(;e!==h.default.dirname(e);){let t=h.default.join(e,`.vercel`);if(g.default.existsSync(t))return e;e=h.default.dirname(e)}}catch{throw new v.VercelOidcTokenError(`Token refresh only supported in node server environments`)}throw new v.VercelOidcTokenError(`Unable to find root directory`)}function b(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(_.default.platform()){case`darwin`:return h.default.join(_.default.homedir(),`Library/Application Support`);case`linux`:return h.default.join(_.default.homedir(),`.local/share`);case`win32`:return process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:null;default:return null}}})),i=e(((e,i)=>{var a=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,d=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},f=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of c(t))!u.call(e,i)&&i!==n&&o(e,i,{get:()=>t[i],enumerable:!(r=s(t,i))||r.enumerable});return e},p=(e,t,n)=>(n=e==null?{}:a(l(e)),f(t||!e||!e.__esModule?o(n,`default`,{value:e,enumerable:!0}):n,e)),m=e=>f(o({},`__esModule`,{value:!0}),e),h={};d(h,{assertVercelOidcTokenResponse:()=>C,findProjectInfo:()=>w,getTokenPayload:()=>D,getVercelCliToken:()=>x,getVercelDataDir:()=>b,getVercelOidcToken:()=>S,isExpired:()=>O,loadToken:()=>E,saveToken:()=>T}),i.exports=m(h);var g=p(t(`path`)),_=p(t(`fs`)),v=n(),y=r();function b(){let e=(0,y.getUserDataDir)();return e?g.join(e,`com.vercel.cli`):null}function x(){let e=b();if(!e)return null;let t=g.join(e,`auth.json`);if(!_.existsSync(t))return null;let n=_.readFileSync(t,`utf8`);return n?JSON.parse(n).token:null}async function S(e,t,n){try{let r=`https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n?`&teamId=${n}`:``}`,i=await fetch(r,{method:`POST`,headers:{Authorization:`Bearer ${e}`}});if(!i.ok)throw new v.VercelOidcTokenError(`Failed to refresh OIDC token: ${i.statusText}`);let a=await i.json();return C(a),a}catch(e){throw new v.VercelOidcTokenError(`Failed to refresh OIDC token`,e)}}function C(e){if(!e||typeof e!=`object`)throw TypeError(`Expected an object`);if(!(`token`in e)||typeof e.token!=`string`)throw TypeError(`Expected a string-valued token property`)}function w(){let e=(0,y.findRootDir)();if(!e)throw new v.VercelOidcTokenError(`Unable to find root directory`);try{let t=g.join(e,`.vercel`,`project.json`);if(!_.existsSync(t))throw new v.VercelOidcTokenError(`project.json not found`);let n=JSON.parse(_.readFileSync(t,`utf8`));if(typeof n.projectId!=`string`&&typeof n.orgId!=`string`)throw TypeError(`Expected a string-valued projectId property`);return{projectId:n.projectId,teamId:n.orgId}}catch(e){throw new v.VercelOidcTokenError(`Unable to find project ID`,e)}}function T(e,t){try{let n=(0,y.getUserDataDir)();if(!n)throw new v.VercelOidcTokenError(`Unable to find user data directory`);let r=g.join(n,`com.vercel.token`,`${t}.json`),i=JSON.stringify(e);_.mkdirSync(g.dirname(r),{mode:432,recursive:!0}),_.writeFileSync(r,i),_.chmodSync(r,432);return}catch(e){throw new v.VercelOidcTokenError(`Failed to save token`,e)}}function E(e){try{let t=(0,y.getUserDataDir)();if(!t)return null;let n=g.join(t,`com.vercel.token`,`${e}.json`);if(!_.existsSync(n))return null;let r=JSON.parse(_.readFileSync(n,`utf8`));return C(r),r}catch(e){throw new v.VercelOidcTokenError(`Failed to load token`,e)}}function D(e){let t=e.split(`.`);if(t.length!==3)throw new v.VercelOidcTokenError(`Invalid token`);let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`),r=n.padEnd(n.length+(4-n.length%4)%4,`=`);return JSON.parse(Buffer.from(r,`base64`).toString(`utf8`))}function O(e){return e.exp*1e3<Date.now()+9e5}}));export{i as require_token_util};
1
+ import{__commonJSMin as e,__require as t}from"./chunk-D9KrCrVq.js";import{require_token_error as n}from"./token-error-DVSfBVaT.js";var r=e(((e,r)=>{var i=Object.create,a=Object.defineProperty,o=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,c=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,u=(e,t)=>{for(var n in t)a(e,n,{get:t[n],enumerable:!0})},d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of s(t))!l.call(e,i)&&i!==n&&a(e,i,{get:()=>t[i],enumerable:!(r=o(t,i))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:i(c(e)),d(t||!e||!e.__esModule?a(n,`default`,{value:e,enumerable:!0}):n,e)),p=e=>d(a({},`__esModule`,{value:!0}),e),m={};u(m,{findRootDir:()=>y,getUserDataDir:()=>b}),r.exports=p(m);var h=f(t(`path`)),g=f(t(`fs`)),_=f(t(`os`)),v=n();function y(){try{let e=process.cwd();for(;e!==h.default.dirname(e);){let t=h.default.join(e,`.vercel`);if(g.default.existsSync(t))return e;e=h.default.dirname(e)}}catch{throw new v.VercelOidcTokenError(`Token refresh only supported in node server environments`)}throw new v.VercelOidcTokenError(`Unable to find root directory`)}function b(){if(process.env.XDG_DATA_HOME)return process.env.XDG_DATA_HOME;switch(_.default.platform()){case`darwin`:return h.default.join(_.default.homedir(),`Library/Application Support`);case`linux`:return h.default.join(_.default.homedir(),`.local/share`);case`win32`:return process.env.LOCALAPPDATA?process.env.LOCALAPPDATA:null;default:return null}}})),i=e(((e,i)=>{var a=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,l=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,d=(e,t)=>{for(var n in t)o(e,n,{get:t[n],enumerable:!0})},f=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of c(t))!u.call(e,i)&&i!==n&&o(e,i,{get:()=>t[i],enumerable:!(r=s(t,i))||r.enumerable});return e},p=(e,t,n)=>(n=e==null?{}:a(l(e)),f(t||!e||!e.__esModule?o(n,`default`,{value:e,enumerable:!0}):n,e)),m=e=>f(o({},`__esModule`,{value:!0}),e),h={};d(h,{assertVercelOidcTokenResponse:()=>C,findProjectInfo:()=>w,getTokenPayload:()=>D,getVercelCliToken:()=>x,getVercelDataDir:()=>b,getVercelOidcToken:()=>S,isExpired:()=>O,loadToken:()=>E,saveToken:()=>T}),i.exports=m(h);var g=p(t(`path`)),_=p(t(`fs`)),v=n(),y=r();function b(){let e=(0,y.getUserDataDir)();return e?g.join(e,`com.vercel.cli`):null}function x(){let e=b();if(!e)return null;let t=g.join(e,`auth.json`);if(!_.existsSync(t))return null;let n=_.readFileSync(t,`utf8`);return n?JSON.parse(n).token:null}async function S(e,t,n){try{let r=`https://api.vercel.com/v1/projects/${t}/token?source=vercel-oidc-refresh${n?`&teamId=${n}`:``}`,i=await fetch(r,{method:`POST`,headers:{Authorization:`Bearer ${e}`}});if(!i.ok)throw new v.VercelOidcTokenError(`Failed to refresh OIDC token: ${i.statusText}`);let a=await i.json();return C(a),a}catch(e){throw new v.VercelOidcTokenError(`Failed to refresh OIDC token`,e)}}function C(e){if(!e||typeof e!=`object`)throw TypeError(`Expected an object`);if(!(`token`in e)||typeof e.token!=`string`)throw TypeError(`Expected a string-valued token property`)}function w(){let e=(0,y.findRootDir)();if(!e)throw new v.VercelOidcTokenError(`Unable to find root directory`);try{let t=g.join(e,`.vercel`,`project.json`);if(!_.existsSync(t))throw new v.VercelOidcTokenError(`project.json not found`);let n=JSON.parse(_.readFileSync(t,`utf8`));if(typeof n.projectId!=`string`&&typeof n.orgId!=`string`)throw TypeError(`Expected a string-valued projectId property`);return{projectId:n.projectId,teamId:n.orgId}}catch(e){throw new v.VercelOidcTokenError(`Unable to find project ID`,e)}}function T(e,t){try{let n=(0,y.getUserDataDir)();if(!n)throw new v.VercelOidcTokenError(`Unable to find user data directory`);let r=g.join(n,`com.vercel.token`,`${t}.json`),i=JSON.stringify(e);_.mkdirSync(g.dirname(r),{mode:432,recursive:!0}),_.writeFileSync(r,i),_.chmodSync(r,432);return}catch(e){throw new v.VercelOidcTokenError(`Failed to save token`,e)}}function E(e){try{let t=(0,y.getUserDataDir)();if(!t)return null;let n=g.join(t,`com.vercel.token`,`${e}.json`);if(!_.existsSync(n))return null;let r=JSON.parse(_.readFileSync(n,`utf8`));return C(r),r}catch(e){throw new v.VercelOidcTokenError(`Failed to load token`,e)}}function D(e){let t=e.split(`.`);if(t.length!==3)throw new v.VercelOidcTokenError(`Invalid token`);let n=t[1].replace(/-/g,`+`).replace(/_/g,`/`),r=n.padEnd(n.length+(4-n.length%4)%4,`=`);return JSON.parse(Buffer.from(r,`base64`).toString(`utf8`))}function O(e){return e.exp*1e3<Date.now()+9e5}}));export{i as require_token_util};
@@ -0,0 +1 @@
1
+ import{require_undici as e}from"./undici-BUZTy5qm.js";export default e();export{};
@@ -1,4 +1,4 @@
1
- import{__commonJSMin as e,__require as t,__toESM as n}from"./chunk-D9KrCrVq.js";import{require_source as r}from"./dist-AXHevRdg.js";import i,{dirname as a,join as o}from"path";import{existsSync as s,readFileSync as c,readdirSync as l,writeFileSync as u}from"fs";import{builtinModules as d}from"module";import{mkdir as f,rename as p,rm as m,stat as h,writeFile as g}from"fs/promises";const _=`ai-telemetry-wrapper`;function v(e={}){let{functions:t=[`streamText`,`generateText`,`generateObject`,`streamObject`,`embed`,`embedMany`],telemetryConfig:n={isEnabled:!0}}=e;return{name:`ai-telemetry`,setup(e){e.onResolve({filter:/^ai$/},e=>{if(e.namespace!==_)return{path:`ai`,namespace:_,pluginData:{resolveDir:e.resolveDir}}}),e.onLoad({filter:/^ai$/,namespace:_},e=>{let r=JSON.stringify(n),i=e.pluginData;return{contents:`
1
+ import{__commonJSMin as e,__require as t,__toESM as n}from"./chunk-D9KrCrVq.js";import{require_source as r}from"./util-BgbIWOFE.js";import i,{dirname as a,join as o}from"path";import{existsSync as s,readFileSync as c,readdirSync as l,writeFileSync as u}from"fs";import{builtinModules as d}from"module";import{mkdir as f,rename as p,rm as m,stat as h,writeFile as g}from"fs/promises";const _=`ai-telemetry-wrapper`;function v(e={}){let{functions:t=[`streamText`,`generateText`,`generateObject`,`streamObject`,`embed`,`embedMany`],telemetryConfig:n={isEnabled:!0}}=e;return{name:`ai-telemetry`,setup(e){e.onResolve({filter:/^ai$/},e=>{if(e.namespace!==_)return{path:`ai`,namespace:_,pluginData:{resolveDir:e.resolveDir}}}),e.onLoad({filter:/^ai$/,namespace:_},e=>{let r=JSON.stringify(n),i=e.pluginData;return{contents:`
2
2
  // Import everything from the original 'ai' package
3
3
  import * as aiOriginal from 'ai';
4
4
 
@@ -0,0 +1,6 @@
1
+ import{__commonJSMin as e,__require as t,__toESM as n}from"./chunk-D9KrCrVq.js";import r,{execFile as i}from"node:child_process";import a from"node:path";import o from"node:fs";import s from"node:process";import c,{constants as l}from"node:fs/promises";import{promisify as u}from"node:util";import{Buffer as d}from"node:buffer";import{fileURLToPath as f}from"node:url";import p from"node:os";var m=e(((e,t)=>{t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}})),h=e(((e,t)=>{let n=m(),r={};for(let e of Object.keys(n))r[n[e]]=e;let i={rgb:{channels:3,labels:`rgb`},hsl:{channels:3,labels:`hsl`},hsv:{channels:3,labels:`hsv`},hwb:{channels:3,labels:`hwb`},cmyk:{channels:4,labels:`cmyk`},xyz:{channels:3,labels:`xyz`},lab:{channels:3,labels:`lab`},lch:{channels:3,labels:`lch`},hex:{channels:1,labels:[`hex`]},keyword:{channels:1,labels:[`keyword`]},ansi16:{channels:1,labels:[`ansi16`]},ansi256:{channels:1,labels:[`ansi256`]},hcg:{channels:3,labels:[`h`,`c`,`g`]},apple:{channels:3,labels:[`r16`,`g16`,`b16`]},gray:{channels:1,labels:[`gray`]}};t.exports=i;for(let e of Object.keys(i)){if(!(`channels`in i[e]))throw Error(`missing channels property: `+e);if(!(`labels`in i[e]))throw Error(`missing channel labels property: `+e);if(i[e].labels.length!==i[e].channels)throw Error(`channel and label counts mismatch: `+e);let{channels:t,labels:n}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],`channels`,{value:t}),Object.defineProperty(i[e],`labels`,{value:n})}i.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},i.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};return u===0?(i=0,a=0):(a=u/l,t=d(o),n=d(s),r=d(c),o===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&--i),[i*360,a*100,l*100]},i.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],a=i.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[a,o*100,r*100]},i.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function a(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){let t=r[e];if(t)return t;let i=1/0,o;for(let t of Object.keys(n)){let r=n[t],s=a(e,r);s<i&&(i=s,o=t)}return o},i.keyword.rgb=function(e){return n[e]},i.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]},i.rgb.lab=function(e){let t=i.rgb.xyz(e),n=t[0],r=t[1],a=t[2];n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;let o=116*r-16,s=500*(n-r),c=200*(r-a);return[o,s,c]},i.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o;if(n===0)return o=r*255,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;let s=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+(i-s)*6*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,c[e]=o*255;return c},i.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2,s=r===0?2*i/(a+i):2*n/(r+n);return[t,s*100,o*100]},i.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},i.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},i.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},i.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},i.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]},i.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let i=116*n-16,a=500*(t-n),o=200*(n-r);return[i,a,o]},i.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,l=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},i.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360);let a=Math.sqrt(n*n+r*r);return[t,a,i]},i.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI,i=n*Math.cos(r),a=n*Math.sin(r);return[t,i,a]},i.rgb.ansi16=function(e,t=null){let[n,r,a]=e,o=t===null?i.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(s+=60),s},i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])},i.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5,r=(t&1)*n*255,i=(t>>1&1)*n*255,a=(t>>2&1)*n*255;return[r,i,a]},i.ansi256.rgb=function(e){if(e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t,n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,i=t%6/5*255;return[n,r,i]},i.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.substring(t.length)+t},i.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split(``).map(e=>e+e).join(``));let r=parseInt(n,16),i=r>>16&255,a=r>>8&255,o=r&255;return[i,a,o]},i.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c;return s=o<1?a/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[c*360,o*100,s*100]},i.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},i.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},i.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},i.hcg.hsv=function(e){let t=e[1]/100,n=e[2]/100,r=t+n*(1-t),i=0;return r>0&&(i=t/r),[e[0],i*100,r*100]},i.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},i.hcg.hwb=function(e){let t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]},i.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*100]},i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},i.gray.hsl=function(e){return[0,0,e[0]]},i.gray.hsv=i.gray.hsl,i.gray.hwb=function(e){return[0,100,e[0]]},i.gray.cmyk=function(e){return[0,0,0,e[0]]},i.gray.lab=function(e){return[e[0],0,0]},i.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.substring(n.length)+n},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}})),g=e(((e,t)=>{let n=h();function r(){let e={},t=Object.keys(n);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function i(e){let t=r(),i=[e];for(t[e].distance=0;i.length;){let e=i.pop(),r=Object.keys(n[e]);for(let n=r.length,a=0;a<n;a++){let n=r[a],o=t[n];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,i.unshift(n))}}return t}function a(e,t){return function(n){return t(e(n))}}function o(e,t){let r=[t[e].parent,e],i=n[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),i=a(n[t[o].parent][o],i),o=t[o].parent;return i.conversion=r,i}t.exports=function(e){let t=i(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=o(e,t))}return n}})),_=e(((e,t)=>{let n=h(),r=g(),i={},a=Object.keys(n);function o(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function s(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return`conversion`in e&&(t.conversion=e.conversion),t}a.forEach(e=>{i[e]={},Object.defineProperty(i[e],`channels`,{value:n[e].channels}),Object.defineProperty(i[e],`labels`,{value:n[e].labels});let t=r(e);Object.keys(t).forEach(n=>{let r=t[n];i[e][n]=s(r),i[e][n].raw=o(r)})}),t.exports=i})),ee=e(((e,t)=>{let n=(e,t)=>(...n)=>`\u001B[${e(...n)+t}m`,r=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};5;${r}m`},i=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},a=e=>e,o=(e,t,n)=>[e,t,n],s=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{let r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})},c,l=(e,t,n,r)=>{c===void 0&&(c=_());let i=r?10:0,a={};for(let[r,o]of Object.entries(c)){let s=r===`ansi16`?`ansi`:r;r===t?a[s]=e(n,i):typeof o==`object`&&(a[s]=e(o[t],i))}return a};function u(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[n,r]of Object.entries(t)){for(let[n,i]of Object.entries(r))t[n]={open:`\u001B[${i[0]}m`,close:`\u001B[${i[1]}m`},r[n]=t[n],e.set(i[0],i[1]);Object.defineProperty(t,n,{value:r,enumerable:!1})}return Object.defineProperty(t,`codes`,{value:e,enumerable:!1}),t.color.close=`\x1B[39m`,t.bgColor.close=`\x1B[49m`,s(t.color,`ansi`,()=>l(n,`ansi16`,a,!1)),s(t.color,`ansi256`,()=>l(r,`ansi256`,a,!1)),s(t.color,`ansi16m`,()=>l(i,`rgb`,o,!1)),s(t.bgColor,`ansi`,()=>l(n,`ansi16`,a,!0)),s(t.bgColor,`ansi256`,()=>l(r,`ansi256`,a,!0)),s(t.bgColor,`ansi16m`,()=>l(i,`rgb`,o,!0)),t}Object.defineProperty(t,`exports`,{enumerable:!0,get:u})})),v=e(((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}})),y=e(((e,n)=>{let r=t(`os`),i=t(`tty`),a=v(),{env:o}=process,s;a(`no-color`)||a(`no-colors`)||a(`color=false`)||a(`color=never`)?s=0:(a(`color`)||a(`colors`)||a(`color=true`)||a(`color=always`))&&(s=1),`FORCE_COLOR`in o&&(s=o.FORCE_COLOR===`true`?1:o.FORCE_COLOR===`false`?0:o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3));function c(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function l(e,t){if(s===0)return 0;if(a(`color=16m`)||a(`color=full`)||a(`color=truecolor`))return 3;if(a(`color=256`))return 2;if(e&&!t&&s===void 0)return 0;let n=s||0;if(o.TERM===`dumb`)return n;if(process.platform===`win32`){let e=r.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in o)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in o)||o.CI_NAME===`codeship`?1:n;if(`TEAMCITY_VERSION`in o)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0;if(o.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in o){let e=parseInt((o.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(o.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(o.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)||`COLORTERM`in o?1:n}function u(e){let t=l(e,e&&e.isTTY);return c(t)}n.exports={supportsColor:u,stdout:c(l(!0,i.isatty(1))),stderr:c(l(!0,i.isatty(2)))}})),b=e(((e,t)=>{t.exports={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(r===-1)return e;let i=t.length,a=0,o=``;do o+=e.substr(a,r-a)+t+n,a=r+i,r=e.indexOf(t,a);while(r!==-1);return o+=e.substr(a),o},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let i=0,a=``;do{let o=e[r-1]===`\r`;a+=e.substr(i,(o?r-1:r)-i)+t+(o?`\r
2
+ `:`
3
+ `)+n,i=r+1,r=e.indexOf(`
4
+ `,i)}while(r!==-1);return a+=e.substr(i),a}}})),te=e(((e,t)=>{let n=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,i=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,a=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,o=new Map([[`n`,`
5
+ `],[`r`,`\r`],[`t`,` `],[`b`,`\b`],[`f`,`\f`],[`v`,`\v`],[`0`,`\0`],[`\\`,`\\`],[`e`,`\x1B`],[`a`,`\x07`]]);function s(e){let t=e[0]===`u`,n=e[1]===`{`;return t&&!n&&e.length===5||e[0]===`x`&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):o.get(e)||e}function c(e,t){let n=[],r=t.trim().split(/\s*,\s*/g),o;for(let t of r){let r=Number(t);if(!Number.isNaN(r))n.push(r);else if(o=t.match(i))n.push(o[2].replace(a,(e,t,n)=>t?s(t):n));else throw Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}return n}function l(e){r.lastIndex=0;let t=[],n;for(;(n=r.exec(e))!==null;){let e=n[1];if(n[2]){let r=c(e,n[2]);t.push([e].concat(r))}else t.push([e])}return t}function u(e,t){let n={};for(let e of t)for(let t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(let[e,t]of Object.entries(n))if(Array.isArray(t)){if(!(e in r))throw Error(`Unknown Chalk style: ${e}`);r=t.length>0?r[e](...t):r[e]}return r}t.exports=(e,t)=>{let r=[],i=[],a=[];if(t.replace(n,(t,n,o,c,d,f)=>{if(n)a.push(s(n));else if(c){let t=a.join(``);a=[],i.push(r.length===0?t:u(e,r)(t)),r.push({inverse:o,styles:l(c)})}else if(d){if(r.length===0)throw Error(`Found extraneous } in Chalk template literal`);i.push(u(e,r)(a.join(``))),a=[],r.pop()}else a.push(f)}),i.push(a.join(``)),r.length>0){let e=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?``:`s`} (\`}\`)`;throw Error(e)}return i.join(``)}})),x=e(((e,t)=>{let n=ee(),{stdout:r,stderr:i}=y(),{stringReplaceAll:a,stringEncaseCRLFWithFirstIndex:o}=b(),{isArray:s}=Array,c=[`ansi`,`ansi`,`ansi256`,`ansi16m`],l=Object.create(null),u=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let n=r?r.level:0;e.level=t.level===void 0?n:t.level};var d=class{constructor(e){return f(e)}};let f=e=>{let t={};return u(t,e),t.template=(...e)=>S(t.template,...e),Object.setPrototypeOf(t,p.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=d,t.template};function p(e){return f(e)}for(let[e,t]of Object.entries(n))l[e]={get(){let n=_(this,g(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};l.visible={get(){let e=_(this,this._styler,!0);return Object.defineProperty(this,`visible`,{value:e}),e}};let m=[`rgb`,`hex`,`keyword`,`hsl`,`hsv`,`hwb`,`ansi`,`ansi256`];for(let e of m)l[e]={get(){let{level:t}=this;return function(...r){let i=g(n.color[c[t]][e](...r),n.color.close,this._styler);return _(this,i,this._isEmpty)}}};for(let e of m){let t=`bg`+e[0].toUpperCase()+e.slice(1);l[t]={get(){let{level:t}=this;return function(...r){let i=g(n.bgColor[c[t]][e](...r),n.bgColor.close,this._styler);return _(this,i,this._isEmpty)}}}}let h=Object.defineProperties(()=>{},{...l,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),g=(e,t,n)=>{let r,i;return n===void 0?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},_=(e,t,n)=>{let r=(...e)=>s(e[0])&&s(e[0].raw)?v(r,S(r,...e)):v(r,e.length===1?``+e[0]:e.join(` `));return Object.setPrototypeOf(r,h),r._generator=e,r._styler=t,r._isEmpty=n,r},v=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?``:t;let n=e._styler;if(n===void 0)return t;let{openAll:r,closeAll:i}=n;if(t.indexOf(`\x1B`)!==-1)for(;n!==void 0;)t=a(t,n.close,n.open),n=n.parent;let s=t.indexOf(`
6
+ `);return s!==-1&&(t=o(t,i,r,s)),r+t+i},x,S=(e,...t)=>{let[n]=t;if(!s(n)||!s(n.raw))return t.join(` `);let r=t.slice(1),i=[n.raw[0]];for(let e=1;e<n.length;e++)i.push(String(r[e-1]).replace(/[{}\\]/g,`\\$&`),String(n.raw[e]));return x===void 0&&(x=te()),x(e,i.join(``))};Object.defineProperties(p.prototype,l);let C=p();C.supportsColor=r,C.stderr=p({level:i?i.level:0}),C.stderr.supportsColor=i,t.exports=C}));let S;function C(){try{return o.statSync(`/.dockerenv`),!0}catch{return!1}}function ne(){try{return o.readFileSync(`/proc/self/cgroup`,`utf8`).includes(`docker`)}catch{return!1}}function re(){return S===void 0&&(S=C()||ne()),S}let w;const ie=()=>{try{return o.statSync(`/run/.containerenv`),!0}catch{return!1}};function T(){return w===void 0&&(w=ie()||re()),w}const E=()=>{if(s.platform!==`linux`)return!1;if(p.release().toLowerCase().includes(`microsoft`))return!T();try{return o.readFileSync(`/proc/version`,`utf8`).toLowerCase().includes(`microsoft`)?!T():!1}catch{return!1}};var D=s.env.__IS_WSL_TEST__?E:E();const O=(()=>{let e=`/mnt/`,t;return async function(){if(t)return t;let n=`/etc/wsl.conf`,r=!1;try{await c.access(n,l.F_OK),r=!0}catch{}if(!r)return e;let i=await c.readFile(n,{encoding:`utf8`}),a=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return a?(t=a.groups.mountPoint.trim(),t=t.endsWith(`/`)?t:`${t}/`,t):e}})(),k=async()=>`${await O()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,A=async()=>D?k():`${s.env.SYSTEMROOT||s.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;function j(e,t,n){let r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let e=n();return r(e),e},set(e){r(e)}}),e}const M=u(i);async function N(){if(s.platform!==`darwin`)throw Error(`macOS only`);let{stdout:e}=await M(`defaults`,[`read`,`com.apple.LaunchServices/com.apple.launchservices.secure`,`LSHandlers`]);return/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??`com.apple.Safari`}const P=u(i);async function F(e,{humanReadableOutput:t=!0,signal:n}={}){if(s.platform!==`darwin`)throw Error(`macOS only`);let r=t?[]:[`-ss`],i={};n&&(i.signal=n);let{stdout:a}=await P(`osascript`,[`-e`,e,r],i);return a.trim()}async function I(e){return F(`tell application "Finder" to set app_path to application file id "${e}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}const L=u(i),R={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:`Edge`,id:`com.microsoft.edge.old`},MSEdgeDHTML:{name:`Edge`,id:`com.microsoft.edge`},MSEdgeHTM:{name:`Edge`,id:`com.microsoft.edge`},"IE.HTTP":{name:`Internet Explorer`,id:`com.microsoft.ie`},FirefoxURL:{name:`Firefox`,id:`org.mozilla.firefox`},ChromeHTML:{name:`Chrome`,id:`com.google.chrome`},BraveHTML:{name:`Brave`,id:`com.brave.Browser`},BraveBHTML:{name:`Brave Beta`,id:`com.brave.Browser.beta`},BraveSSHTM:{name:`Brave Nightly`,id:`com.brave.Browser.nightly`}};var z=class extends Error{};async function B(e=L){let{stdout:t}=await e(`reg`,[`QUERY`,` HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice`,`/v`,`ProgId`]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new z(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:r}=n.groups,i=R[r];if(!i)throw new z(`Unknown browser ID: ${r}`);return i}const V=u(i),H=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,e=>e.toUpperCase());async function ae(){if(s.platform===`darwin`){let e=await N();return{name:await I(e),id:e}}if(s.platform===`linux`){let{stdout:e}=await V(`xdg-mime`,[`query`,`default`,`x-scheme-handler/http`]),t=e.trim();return{name:H(t.replace(/.desktop$/,``).replace(`-`,` `)),id:t}}if(s.platform===`win32`)return B();throw Error(`Only macOS, Linux, and Windows are supported`)}const oe=u(r.execFile),U=a.dirname(f(import.meta.url)),W=a.join(U,`xdg-open`),{platform:G,arch:K}=s;async function se(){let e=await A(),t=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,n=d.from(t,`utf16le`).toString(`base64`),{stdout:r}=await oe(e,[`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`,n],{encoding:`utf8`}),i=r.trim(),a={ChromeHTML:`com.google.chrome`,BraveHTML:`com.brave.Browser`,MSEdgeHTM:`com.microsoft.edge`,FirefoxURL:`org.mozilla.firefox`};return a[i]?{id:a[i]}:{}}const q=async(e,t)=>{let n;for(let r of e)try{return await t(r)}catch(e){n=e}throw n},J=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return q(e.app,t=>J({...e,app:t}));let{name:t,arguments:n=[]}=e.app??{};if(n=[...n],Array.isArray(t))return q(t,t=>J({...e,app:{name:t,arguments:n}}));if(t===`browser`||t===`browserPrivate`){let r={"com.google.chrome":`chrome`,"google-chrome.desktop":`chrome`,"com.brave.Browser":`brave`,"org.mozilla.firefox":`firefox`,"firefox.desktop":`firefox`,"com.microsoft.msedge":`edge`,"com.microsoft.edge":`edge`,"com.microsoft.edgemac":`edge`,"microsoft-edge.desktop":`edge`},i={chrome:`--incognito`,brave:`--incognito`,firefox:`--private-window`,edge:`--inPrivate`},a=D?await se():await ae();if(a.id in r){let o=r[a.id];return t===`browserPrivate`&&n.push(i[o]),J({...e,app:{name:Z[o],arguments:n}})}throw Error(`${a.name} is not supported as a default browser`)}let i,a=[],o={};if(G===`darwin`)i=`open`,e.wait&&a.push(`--wait-apps`),e.background&&a.push(`--background`),e.newInstance&&a.push(`--new`),t&&a.push(`-a`,t);else if(G===`win32`||D&&!T()&&!t){i=await A(),a.push(`-NoProfile`,`-NonInteractive`,`-ExecutionPolicy`,`Bypass`,`-EncodedCommand`),D||(o.windowsVerbatimArguments=!0);let r=[`Start`];e.wait&&r.push(`-Wait`),t?(r.push(`"\`"${t}\`""`),e.target&&n.push(e.target)):e.target&&r.push(`"${e.target}"`),n.length>0&&(n=n.map(e=>`"\`"${e}\`""`),r.push(`-ArgumentList`,n.join(`,`))),e.target=d.from(r.join(` `),`utf16le`).toString(`base64`)}else{if(t)i=t;else{let e=!U||U===`/`,t=!1;try{await c.access(W,l.X_OK),t=!0}catch{}i=s.versions.electron??(G===`android`||e||!t)?`xdg-open`:W}n.length>0&&a.push(...n),e.wait||(o.stdio=`ignore`,o.detached=!0)}G===`darwin`&&n.length>0&&a.push(`--args`,...n),e.target&&a.push(e.target);let u=r.spawn(i,a,o);return e.wait?new Promise((t,n)=>{u.once(`error`,n),u.once(`close`,r=>{if(!e.allowNonzeroExitCode&&r>0){n(Error(`Exited with code ${r}`));return}t(u)})}):(u.unref(),u)},ce=(e,t)=>{if(typeof e!=`string`)throw TypeError("Expected a `target`");return J({...t,target:e})};function Y(e){if(typeof e==`string`||Array.isArray(e))return e;let{[K]:t}=e;if(!t)throw Error(`${K} is not supported`);return t}function X({[G]:e},{wsl:t}){if(t&&D)return Y(t);if(!e)throw Error(`${G} is not supported`);return Y(e)}const Z={};j(Z,`chrome`,()=>X({darwin:`google chrome`,win32:`chrome`,linux:[`google-chrome`,`google-chrome-stable`,`chromium`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`,x64:[`/mnt/c/Program Files/Google/Chrome/Application/chrome.exe`,`/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe`]}})),j(Z,`brave`,()=>X({darwin:`brave browser`,win32:`brave`,linux:[`brave-browser`,`brave`]},{wsl:{ia32:`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`,x64:[`/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe`,`/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe`]}})),j(Z,`firefox`,()=>X({darwin:`firefox`,win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:`firefox`},{wsl:`/mnt/c/Program Files/Mozilla Firefox/firefox.exe`})),j(Z,`edge`,()=>X({darwin:`microsoft edge`,win32:`msedge`,linux:[`microsoft-edge`,`microsoft-edge-dev`]},{wsl:`/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe`})),j(Z,`browser`,()=>`browser`),j(Z,`browserPrivate`,()=>`browserPrivate`);var Q=ce,$=n(x(),1);async function le(e,t=void 0){try{(await Q(e)).once(`error`,n=>{console.log($.default.yellow(t??`Could not open the browser. Please visit the URL manually: ${e}`))})}catch{console.log($.default.yellow(t??`Could not open the browser. Please visit the URL manually: ${e}`))}}export{le as openUrl,Q as open_default,v as require_has_flag,x as require_source};
@@ -1 +1 @@
1
- const e=require(`../chunk-iXuH7AlR.cjs`),t=require(`../index.node-sb6fILn2.cjs`);require(`../token-error-BoNG8ooW.cjs`),require(`../esm-0UNjvroT.cjs`),exports.Agent=t.Agent,exports.StreamResponseFormatHeader=t.StreamResponseFormatHeader,exports.agent=t.agent,exports.api=t.api,exports.isToolApprovalOutput=t.isToolApprovalOutput,exports.lastUIOptions=t.lastUIOptions,exports.model=t.model,exports.toolWithApproval=t.toolWithApproval,exports.tools=t.tools,exports.waitUntil=t.waitUntil,exports.withResponseFormat=t.withResponseFormat;
1
+ const e=require(`../chunk-iXuH7AlR.cjs`),t=require(`../index.node-D7Cvmag9.cjs`);require(`../token-error-BoNG8ooW.cjs`),require(`../esm-0UNjvroT.cjs`),exports.Agent=t.Agent,exports.StreamResponseFormatHeader=t.StreamResponseFormatHeader,exports.agent=t.agent,exports.api=t.api,exports.isToolApprovalOutput=t.isToolApprovalOutput,exports.lastUIOptions=t.lastUIOptions,exports.model=t.model,exports.toolWithApproval=t.toolWithApproval,exports.tools=t.tools,exports.waitUntil=t.waitUntil,exports.withResponseFormat=t.withResponseFormat;
@@ -1,2 +1,2 @@
1
- import { Agent, AgentChat, AgentOtel, AgentStore, Chat, ChatEvent, ChatHandler, ChatResponse, ContextFromTools, ErrorHandler, ExtractUIOptions, ID, NewMessage, RequestHandler, SendBehavior, SendOptions, ServeOptions, StreamResponseFormat, StreamResponseFormatHeader, ToolApprovalOutput, ToolSetWithApproval, ToolWithApproval, ToolWithContext, UIEvent, UIHandler, UIOptionSelect, UIOptionSelectValue, UIOptions, UIOptionsSchema, UpsertedChat, WithUIOptions, agent, api, isToolApprovalOutput, lastUIOptions, model, toolWithApproval, tools, waitUntil, withResponseFormat } from "../index.node-BgliWLNt.js";
1
+ import { Agent, AgentChat, AgentOtel, AgentStore, Chat, ChatEvent, ChatHandler, ChatResponse, ContextFromTools, ErrorHandler, ExtractUIOptions, ID, NewMessage, RequestHandler, SendBehavior, SendOptions, ServeOptions, StreamResponseFormat, StreamResponseFormatHeader, ToolApprovalOutput, ToolSetWithApproval, ToolWithApproval, ToolWithContext, UIEvent, UIHandler, UIOptionSelect, UIOptionSelectValue, UIOptions, UIOptionsSchema, UpsertedChat, WithUIOptions, agent, api, isToolApprovalOutput, lastUIOptions, model, toolWithApproval, tools, waitUntil, withResponseFormat } from "../index.node-qJt_7e9E.js";
2
2
  export { Agent, AgentChat, AgentOtel, AgentStore, Chat, ChatEvent, ChatHandler, ChatResponse, ContextFromTools, ErrorHandler, ExtractUIOptions, ID, NewMessage, RequestHandler, SendBehavior, SendOptions, ServeOptions, StreamResponseFormat, StreamResponseFormatHeader, ToolApprovalOutput, ToolSetWithApproval, ToolWithApproval, ToolWithContext, UIEvent, UIHandler, UIOptionSelect, UIOptionSelectValue, UIOptions, UIOptionsSchema, UpsertedChat, WithUIOptions, agent, api, isToolApprovalOutput, lastUIOptions, model, toolWithApproval, tools, waitUntil, withResponseFormat };
@@ -1 +1 @@
1
- import{Agent as e,StreamResponseFormatHeader as t,agent as n,api as r,isToolApprovalOutput as i,lastUIOptions as a,model as o,toolWithApproval as s,tools as c,waitUntil as l,withResponseFormat as u}from"../index.node-CERnwYbK.js";import"../token-error-488npYdU.js";import"../esm-CbZfjZBn.js";export{e as Agent,t as StreamResponseFormatHeader,n as agent,r as api,i as isToolApprovalOutput,a as lastUIOptions,o as model,s as toolWithApproval,c as tools,l as waitUntil,u as withResponseFormat};
1
+ import{Agent as e,StreamResponseFormatHeader as t,agent as n,api as r,isToolApprovalOutput as i,lastUIOptions as a,model as o,toolWithApproval as s,tools as c,waitUntil as l,withResponseFormat as u}from"../index.node-TFdiI8lm.js";import"../token-error-488npYdU.js";import"../esm-CbZfjZBn.js";export{e as Agent,t as StreamResponseFormatHeader,n as agent,r as api,i as isToolApprovalOutput,a as lastUIOptions,o as model,s as toolWithApproval,c as tools,l as waitUntil,u as withResponseFormat};
@@ -1,2 +1,2 @@
1
- import { BuildContext, BuildLog, BuildResult, Config, ResolvedConfig, buildWithEsbuild, defineConfig, resolveConfig, setEsbuildInstance } from "../index-Q90WjL1a.js";
1
+ import { BuildContext, BuildLog, BuildResult, Config, ResolvedConfig, buildWithEsbuild, defineConfig, resolveConfig, setEsbuildInstance } from "../index-C28Wm0bG.js";
2
2
  export { BuildContext, BuildLog, BuildResult, Config, ResolvedConfig, buildWithEsbuild, defineConfig, resolveConfig, setEsbuildInstance };