sosoapi 0.4.0 → 0.4.1

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sosoapi",
3
3
  "description": "Use the bundled SosoAPI MCP server with browser OAuth and explicit delegated consent. No SosoAPI API key belongs in this plugin configuration.",
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "author": {
6
6
  "name": "SosoAPI"
7
7
  },
package/dist/index.js CHANGED
@@ -24291,6 +24291,11 @@ var hc = (baseUrl, options) => createProxy(function proxyCallback(opts) {
24291
24291
  }, []);
24292
24292
 
24293
24293
  // src/client.ts
24294
+ function clientAgentHeader(info) {
24295
+ if (!info?.name) return null;
24296
+ const value = `${info.name}${info.version ? `/${info.version}` : ""}`.replace(/[^A-Za-z0-9@._+/-]/g, "-").slice(0, 80);
24297
+ return value || null;
24298
+ }
24294
24299
  function createVickyClient(cfg, auth, options = {}) {
24295
24300
  const vickyFetch = async (input, init) => {
24296
24301
  const headers = new Headers(init?.headers);
@@ -24299,6 +24304,8 @@ function createVickyClient(cfg, auth, options = {}) {
24299
24304
  }
24300
24305
  if (!headers.has("X-Client-Platform")) headers.set("X-Client-Platform", "mcp");
24301
24306
  if (!headers.has("X-Client-Version")) headers.set("X-Client-Version", cfg.version);
24307
+ const agent = options.clientAgent?.();
24308
+ if (agent && !headers.has("X-Client-Agent")) headers.set("X-Client-Agent", agent);
24302
24309
  if (cfg.functionRegion && !headers.has("x-region")) headers.set("x-region", cfg.functionRegion);
24303
24310
  const signal = options.signal ? AbortSignal.any([options.signal, ...init?.signal ? [init.signal] : []]) : init?.signal;
24304
24311
  return fetch(input, { ...init, headers, signal });
@@ -24372,10 +24379,13 @@ function createVickyClient(cfg, auth, options = {}) {
24372
24379
  };
24373
24380
  }
24374
24381
 
24382
+ // package.json
24383
+ var package_default = { version: "0.4.1" };
24384
+
24375
24385
  // src/config.ts
24376
24386
  var DEFAULT_BASE_URL = "https://gqeshlawtcexsapabaui.supabase.co/functions/v1";
24377
24387
  var DEFAULT_FUNCTION_REGION = "ap-south-1";
24378
- var SERVER_VERSION = "0.3.0";
24388
+ var SERVER_VERSION = package_default.version;
24379
24389
  function loadConfig() {
24380
24390
  const apiKey = process.env.VICKY_API_KEY?.trim();
24381
24391
  if (apiKey && !apiKey.startsWith("vai_live_")) {
@@ -42067,8 +42077,12 @@ async function main() {
42067
42077
  const cfg = loadConfig();
42068
42078
  if (await runCli(process.argv.slice(2), cfg)) return;
42069
42079
  const auth = new VickyAuthProvider(cfg);
42070
- const vicky = createVickyClient(cfg, auth);
42080
+ let clientAgent = null;
42081
+ const vicky = createVickyClient(cfg, auth, { clientAgent: () => clientAgent });
42071
42082
  const server = createServer2(vicky);
42083
+ server.server.oninitialized = () => {
42084
+ clientAgent = clientAgentHeader(server.server.getClientVersion());
42085
+ };
42072
42086
  const transport = new StdioServerTransport();
42073
42087
  const rawSend = transport.send.bind(transport);
42074
42088
  transport.send = ((message, options) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sosoapi",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "SosoAPI CLI and MCP server: let your coding agent draft, schedule and publish social posts you approve.",