@hasna/oldpal 0.3.9 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -28788,36 +28788,37 @@ import { join } from "path";
28788
28788
 
28789
28789
  class ConnectorBridge {
28790
28790
  connectors = new Map;
28791
+ static cache = new Map;
28791
28792
  async discover(connectorNames) {
28792
- const names = connectorNames || [
28793
- "notion",
28794
- "googledrive",
28795
- "gmail",
28796
- "googlecalendar",
28797
- "googlecontacts",
28798
- "linear",
28799
- "slack",
28800
- "discord",
28801
- "github",
28802
- "x",
28803
- "exa",
28804
- "anthropic",
28805
- "openai",
28806
- "elevenlabs"
28807
- ];
28808
- const results = await Promise.all(names.map(async (name) => {
28809
- const cli = `connect-${name}`;
28810
- try {
28811
- const result = await Bun.$`which ${cli}`.quiet().nothrow();
28812
- if (result.exitCode !== 0)
28793
+ const names = connectorNames || [];
28794
+ if (names.length === 0) {
28795
+ return [];
28796
+ }
28797
+ const uncached = names.filter((n) => !ConnectorBridge.cache.has(n));
28798
+ if (uncached.length > 0) {
28799
+ const results = await Promise.all(uncached.map(async (name) => {
28800
+ const cli = `connect-${name}`;
28801
+ try {
28802
+ const result = await Promise.race([
28803
+ Bun.$`which ${cli}`.quiet().nothrow(),
28804
+ new Promise((_, reject) => setTimeout(() => reject(new Error("timeout")), 500))
28805
+ ]);
28806
+ if (result.exitCode !== 0) {
28807
+ ConnectorBridge.cache.set(name, null);
28808
+ return null;
28809
+ }
28810
+ const connector = this.createMinimalConnector(name, cli);
28811
+ ConnectorBridge.cache.set(name, connector);
28812
+ return connector;
28813
+ } catch {
28814
+ ConnectorBridge.cache.set(name, null);
28813
28815
  return null;
28814
- } catch {
28815
- return null;
28816
- }
28817
- return this.discoverConnector(name, cli);
28818
- }));
28816
+ }
28817
+ }));
28818
+ }
28819
28819
  const discovered = [];
28820
- for (const connector of results) {
28820
+ for (const name of names) {
28821
+ const connector = ConnectorBridge.cache.get(name);
28821
28822
  if (connector) {
28822
28823
  discovered.push(connector);
28823
28824
  this.connectors.set(connector.name, connector);
@@ -28825,6 +28826,20 @@ class ConnectorBridge {
28825
28826
  }
28826
28827
  return discovered;
28827
28828
  }
28829
+ createMinimalConnector(name, cli) {
28830
+ return {
28831
+ name,
28832
+ cli,
28833
+ description: `${name} connector`,
28834
+ commands: [
28835
+ { name: "help", description: "Show available commands", args: [], options: [] }
28836
+ ],
28837
+ auth: {
28838
+ type: "oauth2",
28839
+ statusCommand: `${cli} auth status`
28840
+ }
28841
+ };
28842
+ }
28828
28843
  async discoverConnector(name, cli) {
28829
28844
  try {
28830
28845
  const helpResult = await Bun.$`${cli} --help`.quiet();
@@ -30534,11 +30549,11 @@ Cache savings: ~$${cacheSavings.toFixed(4)}
30534
30549
  **Model Information**
30535
30550
 
30536
30551
  `;
30537
- message += `Current model: claude-3-5-sonnet-20241022
30552
+ message += `Current model: claude-sonnet-4-20250514 (Claude 4 Sonnet)
30538
30553
  `;
30539
30554
  message += `Context window: 200,000 tokens
30540
30555
  `;
30541
- message += `Max output: 8,192 tokens
30556
+ message += `Max output: 64,000 tokens
30542
30557
 
30543
30558
  `;
30544
30559
  message += `*Model selection coming in a future update*
@@ -32397,8 +32412,8 @@ function App2({ cwd: cwd2 }) {
32397
32412
  padding: 1,
32398
32413
  children: [
32399
32414
  showWelcome && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(WelcomeBanner, {
32400
- version: "0.3.9",
32401
- model: "claude-sonnet-4-20250514",
32415
+ version: "0.4.0",
32416
+ model: "claude-4-sonnet",
32402
32417
  directory: cwd2
32403
32418
  }, undefined, false, undefined, this),
32404
32419
  scrollOffset > 0 && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
@@ -32487,7 +32502,7 @@ var options = {
32487
32502
  help: args.includes("--help") || args.includes("-h")
32488
32503
  };
32489
32504
  if (options.version) {
32490
- console.log("oldpal v0.3.9");
32505
+ console.log("oldpal v0.4.0");
32491
32506
  process.exit(0);
32492
32507
  }
32493
32508
  if (options.help) {
@@ -32518,4 +32533,4 @@ waitUntilExit().then(() => {
32518
32533
  process.exit(0);
32519
32534
  });
32520
32535
 
32521
- //# debugId=4B7AD4CD51004C7264756E2164756E21
32536
+ //# debugId=CE824906A098BE1564756E2164756E21