@openparachute/vault 0.5.0 → 0.5.1-rc.2

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.
@@ -5609,6 +5609,13 @@ describe("vault projection (vault#271)", async () => {
5609
5609
  expect(md).toContain("#person");
5610
5610
  expect(md).toContain("vault-info");
5611
5611
  expect(md).toContain("list-tags { include_schema: true }");
5612
+ // Scripting pointer (closes the "points nowhere" gap): the brief routes an
5613
+ // agent to the HTTP API + the public guide, with the vault name baked into
5614
+ // the copy-paste mint command.
5615
+ expect(md).toContain("## Scripting & automation (beyond this session)");
5616
+ expect(md).toContain("https://parachute.computer/scripting/");
5617
+ expect(md).toContain("parachute auth mint-token --scope vault:test:read --ephemeral");
5618
+ expect(md).toContain("vault/test/api");
5612
5619
  });
5613
5620
 
5614
5621
  it("markdown brief degrades gracefully when no schemas declared", async () => {
@@ -305,5 +305,25 @@ export function projectionToMarkdown(args: {
305
305
  lines.push("");
306
306
  lines.push("If schema or tags change during this session, call `vault-info` to refresh the full projection. Call `list-tags { include_schema: true }` for tag-only details.");
307
307
 
308
+ // Scripting pointer block: the connect-time brief used to dead-end on
309
+ // querying — an agent had no path to "how do I script/automate against this
310
+ // vault." Point at the guide rather than inlining it, to keep this brief
311
+ // lean (token-budget note above). Uses the concrete vault name so the mint
312
+ // command is copy-paste ready.
313
+ lines.push("");
314
+ lines.push("## Scripting & automation (beyond this session)");
315
+ lines.push("");
316
+ lines.push(
317
+ "This vault is also a plain HTTP API — reach for it when the user wants a script, cron job, or CI step rather than an interactive session:",
318
+ );
319
+ lines.push(
320
+ `- Mint a scoped credential: \`parachute auth mint-token --scope vault:${vaultName}:read --ephemeral\` (\`--ephemeral\` = short-lived, ideal for scripts; use \`:write\` to create/edit).`,
321
+ );
322
+ lines.push(`- Call the REST API at \`<hub-origin>/vault/${vaultName}/api/...\`.`);
323
+ lines.push(
324
+ "- Full guide — copy-paste bash/Python/JS examples, plus how to design tags vs paths vs schemas: https://parachute.computer/scripting/",
325
+ );
326
+ lines.push("- For a prompt on a schedule with no code, see Parachute Runner.");
327
+
308
328
  return lines.join("\n");
309
329
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openparachute/vault",
3
- "version": "0.5.0",
3
+ "version": "0.5.1-rc.2",
4
4
  "description": "Agent-native knowledge graph. Notes, tags, links over MCP.",
5
5
  "module": "src/cli.ts",
6
6
  "type": "module",
package/src/server.ts CHANGED
@@ -347,6 +347,15 @@ const server = Bun.serve({
347
347
  "Access-Control-Allow-Origin": "*",
348
348
  "Access-Control-Allow-Methods": "GET, POST, PUT, PATCH, DELETE, OPTIONS",
349
349
  "Access-Control-Allow-Headers": "Content-Type, Authorization, X-API-Key, Mcp-Session-Id",
350
+ // Expose response headers a BROWSER-based MCP client (e.g. claude.ai) must
351
+ // read cross-origin: `WWW-Authenticate` carries the RFC 9728 auth challenge
352
+ // (the `resource_metadata` PRM URL) the client follows to discover the auth
353
+ // server — without exposing it, the browser's fetch() can't see it and the
354
+ // OAuth flow never starts ("Couldn't register with the sign-in service").
355
+ // `Mcp-Session-Id` is the streamable-HTTP MCP session the client echoes
356
+ // back. (Claude Code is a CLI → no CORS → unaffected. The hub already
357
+ // exposes WWW-Authenticate; this matches it on the resource server.)
358
+ "Access-Control-Expose-Headers": "WWW-Authenticate, Mcp-Session-Id",
350
359
  };
351
360
 
352
361
  if (req.method === "OPTIONS") {