sparkecoder 0.1.104 → 0.1.106

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 (103) hide show
  1. package/dist/agent/index.d.ts +3 -3
  2. package/dist/cli.js +15 -4
  3. package/dist/cli.js.map +1 -1
  4. package/dist/db/index.d.ts +2 -2
  5. package/dist/{index-D5l-DMGC.d.ts → index--JjYcERz.d.ts} +83 -83
  6. package/dist/index.d.ts +5 -5
  7. package/dist/{schema-ecQSnCMz.d.ts → schema-BQ3Wfu-a.d.ts} +3 -3
  8. package/dist/{search-DOzC4ojH.d.ts → search-BRnGaIl-.d.ts} +7 -7
  9. package/dist/tools/index.d.ts +3 -3
  10. package/package.json +1 -1
  11. package/web/.next/BUILD_ID +1 -1
  12. package/web/.next/standalone/web/.next/BUILD_ID +1 -1
  13. package/web/.next/standalone/web/.next/build-manifest.json +2 -2
  14. package/web/.next/standalone/web/.next/prerender-manifest.json +3 -3
  15. package/web/.next/standalone/web/.next/server/app/_global-error.html +2 -2
  16. package/web/.next/standalone/web/.next/server/app/_global-error.rsc +1 -1
  17. package/web/.next/standalone/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  18. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  19. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  20. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  21. package/web/.next/standalone/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  22. package/web/.next/standalone/web/.next/server/app/_not-found.html +1 -1
  23. package/web/.next/standalone/web/.next/server/app/_not-found.rsc +1 -1
  24. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  25. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  26. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  27. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  28. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  29. package/web/.next/standalone/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  30. package/web/.next/standalone/web/.next/server/app/agents.html +1 -1
  31. package/web/.next/standalone/web/.next/server/app/agents.rsc +1 -1
  32. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents/__PAGE__.segment.rsc +1 -1
  33. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p/agents.segment.rsc +1 -1
  34. package/web/.next/standalone/web/.next/server/app/agents.segments/!KG1haW4p.segment.rsc +1 -1
  35. package/web/.next/standalone/web/.next/server/app/agents.segments/_full.segment.rsc +1 -1
  36. package/web/.next/standalone/web/.next/server/app/agents.segments/_head.segment.rsc +1 -1
  37. package/web/.next/standalone/web/.next/server/app/agents.segments/_index.segment.rsc +1 -1
  38. package/web/.next/standalone/web/.next/server/app/agents.segments/_tree.segment.rsc +1 -1
  39. package/web/.next/standalone/web/.next/server/app/docs/installation.html +2 -2
  40. package/web/.next/standalone/web/.next/server/app/docs/installation.rsc +1 -1
  41. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_full.segment.rsc +1 -1
  42. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_head.segment.rsc +1 -1
  43. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_index.segment.rsc +1 -1
  44. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/_tree.segment.rsc +1 -1
  45. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation/__PAGE__.segment.rsc +1 -1
  46. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs/installation.segment.rsc +1 -1
  47. package/web/.next/standalone/web/.next/server/app/docs/installation.segments/docs.segment.rsc +1 -1
  48. package/web/.next/standalone/web/.next/server/app/docs/skills.html +2 -2
  49. package/web/.next/standalone/web/.next/server/app/docs/skills.rsc +1 -1
  50. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_full.segment.rsc +1 -1
  51. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_head.segment.rsc +1 -1
  52. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_index.segment.rsc +1 -1
  53. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/_tree.segment.rsc +1 -1
  54. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills/__PAGE__.segment.rsc +1 -1
  55. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs/skills.segment.rsc +1 -1
  56. package/web/.next/standalone/web/.next/server/app/docs/skills.segments/docs.segment.rsc +1 -1
  57. package/web/.next/standalone/web/.next/server/app/docs/tools.html +2 -2
  58. package/web/.next/standalone/web/.next/server/app/docs/tools.rsc +1 -1
  59. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_full.segment.rsc +1 -1
  60. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_head.segment.rsc +1 -1
  61. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_index.segment.rsc +1 -1
  62. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/_tree.segment.rsc +1 -1
  63. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools/__PAGE__.segment.rsc +1 -1
  64. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs/tools.segment.rsc +1 -1
  65. package/web/.next/standalone/web/.next/server/app/docs/tools.segments/docs.segment.rsc +1 -1
  66. package/web/.next/standalone/web/.next/server/app/docs.html +2 -2
  67. package/web/.next/standalone/web/.next/server/app/docs.rsc +1 -1
  68. package/web/.next/standalone/web/.next/server/app/docs.segments/_full.segment.rsc +1 -1
  69. package/web/.next/standalone/web/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  70. package/web/.next/standalone/web/.next/server/app/docs.segments/_index.segment.rsc +1 -1
  71. package/web/.next/standalone/web/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
  72. package/web/.next/standalone/web/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  73. package/web/.next/standalone/web/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  74. package/web/.next/standalone/web/.next/server/app/index.html +1 -1
  75. package/web/.next/standalone/web/.next/server/app/index.rsc +1 -1
  76. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p/__PAGE__.segment.rsc +1 -1
  77. package/web/.next/standalone/web/.next/server/app/index.segments/!KG1haW4p.segment.rsc +1 -1
  78. package/web/.next/standalone/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
  79. package/web/.next/standalone/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  80. package/web/.next/standalone/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  81. package/web/.next/standalone/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  82. package/web/.next/standalone/web/.next/server/app/settings.html +1 -1
  83. package/web/.next/standalone/web/.next/server/app/settings.rsc +1 -1
  84. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings/__PAGE__.segment.rsc +1 -1
  85. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p/settings.segment.rsc +1 -1
  86. package/web/.next/standalone/web/.next/server/app/settings.segments/!KG1haW4p.segment.rsc +1 -1
  87. package/web/.next/standalone/web/.next/server/app/settings.segments/_full.segment.rsc +1 -1
  88. package/web/.next/standalone/web/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  89. package/web/.next/standalone/web/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  90. package/web/.next/standalone/web/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  91. package/web/.next/standalone/web/.next/server/pages/404.html +1 -1
  92. package/web/.next/standalone/web/.next/server/pages/500.html +2 -2
  93. package/web/.next/standalone/web/.next/server/server-reference-manifest.js +1 -1
  94. package/web/.next/standalone/web/.next/server/server-reference-manifest.json +1 -1
  95. /package/web/.next/standalone/web/.next/static/{lNggYj2SYt56gUwNX0IuE → gBMaoIWuyMCzyJoRerJkB}/_buildManifest.js +0 -0
  96. /package/web/.next/standalone/web/.next/static/{lNggYj2SYt56gUwNX0IuE → gBMaoIWuyMCzyJoRerJkB}/_clientMiddlewareManifest.json +0 -0
  97. /package/web/.next/standalone/web/.next/static/{lNggYj2SYt56gUwNX0IuE → gBMaoIWuyMCzyJoRerJkB}/_ssgManifest.js +0 -0
  98. /package/web/.next/standalone/web/.next/static/static/{lNggYj2SYt56gUwNX0IuE → gBMaoIWuyMCzyJoRerJkB}/_buildManifest.js +0 -0
  99. /package/web/.next/standalone/web/.next/static/static/{lNggYj2SYt56gUwNX0IuE → gBMaoIWuyMCzyJoRerJkB}/_clientMiddlewareManifest.json +0 -0
  100. /package/web/.next/standalone/web/.next/static/static/{lNggYj2SYt56gUwNX0IuE → gBMaoIWuyMCzyJoRerJkB}/_ssgManifest.js +0 -0
  101. /package/web/.next/static/{lNggYj2SYt56gUwNX0IuE → gBMaoIWuyMCzyJoRerJkB}/_buildManifest.js +0 -0
  102. /package/web/.next/static/{lNggYj2SYt56gUwNX0IuE → gBMaoIWuyMCzyJoRerJkB}/_clientMiddlewareManifest.json +0 -0
  103. /package/web/.next/static/{lNggYj2SYt56gUwNX0IuE → gBMaoIWuyMCzyJoRerJkB}/_ssgManifest.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import 'ai';
2
- import '../schema-ecQSnCMz.js';
3
- export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, C as ContextManager, M as MessageAttachment, d as buildSystemPrompt, e as buildTaskPromptAddendum } from '../index-D5l-DMGC.js';
4
- import '../search-DOzC4ojH.js';
2
+ import '../schema-BQ3Wfu-a.js';
3
+ export { A as Agent, a as AgentOptions, b as AgentRunOptions, c as AgentStreamResult, C as ContextManager, M as MessageAttachment, d as buildSystemPrompt, e as buildTaskPromptAddendum } from '../index--JjYcERz.js';
4
+ import '../search-BRnGaIl-.js';
5
5
  import 'drizzle-orm/sqlite-core';
6
6
  import 'zod';
package/dist/cli.js CHANGED
@@ -16909,7 +16909,7 @@ program.command("slack-setup").description("Interactively configure Slack integr
16909
16909
  process.exit(1);
16910
16910
  }
16911
16911
  });
16912
- program.command("cloudflared-setup").description("Auto-detect cloudflared + set up a tunnel to this sparkecoder (interactive)").option("--port <port>", "Local sparkecoder web UI port", "6969").option("--api-port <port>", "Local sparkecoder API port", "3141").option("--hostname <host>", "Public hostname you want to assign (e.g. sf-mac-1.example.com)").option("--tunnel-name <name>", "Tunnel name to reuse or create", "sparkecoder").option("--team <team>", "Your Cloudflare Access team subdomain (e.g. studyfetch -> studyfetch.cloudflareaccess.com)").option("--allowed-emails <emails>", "Comma-separated allow-listed emails").option("-y, --yes", "Skip confirmations and do everything non-interactively", false).option("--print-only", "Skip auto-setup and just print the copy/paste recipe", false).option("--cf-api-token <token>", "Cloudflare API token (Account: Cloudflare Tunnel: Edit + Zone: DNS: Edit). Or set CF_API_TOKEN env").option("--cf-account-id <id>", "Cloudflare account ID. Or set CF_ACCOUNT_ID env").option("--cf-zone-id <id>", "Cloudflare zone ID for the hostname. Or set CF_ZONE_ID env").option("--remote", "Provision the tunnel via the remote sparkecoder server (server holds the Cloudflare credentials)", false).option("--setup-secret <secret>", "Tunnel setup secret (required when server has TUNNEL_SETUP_SECRET set). Or set SPARKECODER_TUNNEL_SECRET env").action(async (options) => {
16912
+ program.command("cloudflared-setup").description("Auto-detect cloudflared + set up a tunnel to this sparkecoder (interactive)").option("--port <port>", "Local sparkecoder web UI port", "6969").option("--api-port <port>", "Local sparkecoder API port", "3141").option("--hostname <host>", "Public hostname you want to assign (e.g. sf-mac-1.example.com)").option("--tunnel-name <name>", "Tunnel name to reuse or create", "sparkecoder").option("--team <team>", "Your Cloudflare Access team subdomain (e.g. studyfetch -> studyfetch.cloudflareaccess.com)").option("--allowed-emails <emails>", "Comma-separated allow-listed emails").option("-y, --yes", "Skip confirmations and do everything non-interactively", false).option("--print-only", "Skip auto-setup and just print the copy/paste recipe", false).option("--cf-api-token <token>", "Cloudflare API token (Account: Cloudflare Tunnel: Edit + Zone: DNS: Edit). Or set CF_API_TOKEN env").option("--cf-account-id <id>", "Cloudflare account ID. Or set CF_ACCOUNT_ID env").option("--cf-zone-id <id>", "Cloudflare zone ID for the hostname. Or set CF_ZONE_ID env").option("--remote", "Provision the tunnel via the remote sparkecoder server (server holds the Cloudflare credentials)", false).option("--setup-secret <secret>", "Tunnel setup secret (required when server has TUNNEL_SETUP_SECRET set). Or set SPARKECODER_TUNNEL_SECRET env").option("--new-tunnel", "In --remote mode: force a new tunnel even if this user already has one (default: re-use existing)", false).action(async (options) => {
16913
16913
  const { execSync: execSync2, spawnSync } = await import("child_process");
16914
16914
  const { homedir: homedir2 } = await import("os");
16915
16915
  const { copyFileSync } = await import("fs");
@@ -16942,7 +16942,14 @@ program.command("cloudflared-setup").description("Auto-detect cloudflared + set
16942
16942
  }
16943
16943
  return cfPath;
16944
16944
  };
16945
+ const uninstallService = () => {
16946
+ spawnSync("cloudflared", ["service", "uninstall"], { stdio: "ignore" });
16947
+ if (process.platform !== "win32") {
16948
+ spawnSync("sudo", ["cloudflared", "service", "uninstall"], { stdio: "ignore" });
16949
+ }
16950
+ };
16945
16951
  const installAsService = (token) => {
16952
+ uninstallService();
16946
16953
  let r = spawnSync("cloudflared", ["service", "install", token], { stdio: "inherit" });
16947
16954
  if (r.status !== 0 && process.platform !== "win32") {
16948
16955
  console.log(chalk.dim("Retrying with sudo..."));
@@ -16965,8 +16972,9 @@ program.command("cloudflared-setup").description("Auto-detect cloudflared + set
16965
16972
  }
16966
16973
  const setupSecret = options.setupSecret || process.env.SPARKECODER_TUNNEL_SECRET;
16967
16974
  const hostname = options.hostname;
16975
+ const path = options.newTunnel ? "/tunnels" : "/tunnels/ensure";
16968
16976
  console.log(chalk.bold(
16969
- hostname ? `Requesting tunnel for ${hostname} from remote server...` : "Requesting auto-generated tunnel from remote server..."
16977
+ options.newTunnel ? hostname ? `Requesting NEW tunnel for ${hostname} from remote server...` : "Requesting NEW auto-generated tunnel from remote server..." : "Ensuring tunnel exists on remote server (re-using if present)..."
16970
16978
  ));
16971
16979
  const reqBody = {
16972
16980
  port: Number(apiPort),
@@ -16974,7 +16982,7 @@ program.command("cloudflared-setup").description("Auto-detect cloudflared + set
16974
16982
  name: tunnelName
16975
16983
  };
16976
16984
  if (hostname) reqBody.hostname = hostname;
16977
- const res = await fetch(`${remoteUrl.replace(/\/$/, "")}/tunnels`, {
16985
+ const res = await fetch(`${remoteUrl.replace(/\/$/, "")}${path}`, {
16978
16986
  method: "POST",
16979
16987
  headers: {
16980
16988
  "Content-Type": "application/json",
@@ -16989,7 +16997,10 @@ program.command("cloudflared-setup").description("Auto-detect cloudflared + set
16989
16997
  process.exitCode = 1;
16990
16998
  return;
16991
16999
  }
16992
- const { tunnelToken, hostname: provisionedHost, apiHostname } = await res.json();
17000
+ const { tunnelToken, hostname: provisionedHost, apiHostname, reused } = await res.json();
17001
+ if (reused) {
17002
+ console.log(chalk.dim("\u2713 Re-using existing tunnel \u2014 no new tunnel created on Cloudflare."));
17003
+ }
16993
17004
  const cfPath = await installCloudflaredIfNeeded();
16994
17005
  if (!cfPath) {
16995
17006
  console.log(chalk.yellow("cloudflared not installed; run this once installed:"));