@vectorize-io/self-driving-agents 0.0.11 → 0.0.12

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 (2) hide show
  1. package/dist/cli.js +34 -14
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -888,16 +888,35 @@ async function main() {
888
888
  const claudeConfig = await promptClaudeConfig(agentId);
889
889
  ccConfig.hindsightApiUrl = claudeConfig.apiUrl;
890
890
  ccConfig.hindsightApiToken = claudeConfig.apiToken;
891
- ccConfig.enableKnowledgeTools = true;
892
- mkdirSync(ccConfigDir, { recursive: true });
893
- writeFileSync(ccConfigPath, JSON.stringify(ccConfig, null, 2) + "\n");
894
- p.log.success(`Hindsight connection saved to ${color.dim(ccConfigPath)}`);
895
891
  }
896
- else if (!ccConfig.enableKnowledgeTools) {
897
- ccConfig.enableKnowledgeTools = true;
898
- mkdirSync(ccConfigDir, { recursive: true });
899
- writeFileSync(ccConfigPath, JSON.stringify(ccConfig, null, 2) + "\n");
892
+ // Verify/set bank granularity. SDA agents need per-project isolation —
893
+ // bank derived as agentName::projectBasename. If the user has a conflicting
894
+ // config (dynamicBankId: false with a static bankId), bail with instructions.
895
+ if (ccConfig.dynamicBankId === false && ccConfig.bankId) {
896
+ p.cancel(`Conflicting plugin config in ${ccConfigPath}:\n` +
897
+ ` Found: dynamicBankId=false, bankId="${ccConfig.bankId}"\n` +
898
+ ` Self-driving agents need dynamicBankId=true with granularity ["agent", "project"].\n` +
899
+ ` Remove "dynamicBankId" and "bankId" from the config, or set them to:\n` +
900
+ ` "dynamicBankId": true,\n` +
901
+ ` "dynamicBankGranularity": ["agent", "project"]`);
902
+ process.exit(1);
903
+ }
904
+ const expectedGranularity = ["agent", "project"];
905
+ const currentGranularity = ccConfig.dynamicBankGranularity;
906
+ if (currentGranularity &&
907
+ JSON.stringify(currentGranularity) !== JSON.stringify(expectedGranularity)) {
908
+ p.cancel(`Conflicting plugin config in ${ccConfigPath}:\n` +
909
+ ` Found: dynamicBankGranularity=${JSON.stringify(currentGranularity)}\n` +
910
+ ` Self-driving agents require: ${JSON.stringify(expectedGranularity)}\n` +
911
+ ` Update the config to match, or remove the field to let the installer set it.`);
912
+ process.exit(1);
900
913
  }
914
+ ccConfig.dynamicBankId = true;
915
+ ccConfig.dynamicBankGranularity = expectedGranularity;
916
+ ccConfig.enableKnowledgeTools = true;
917
+ mkdirSync(ccConfigDir, { recursive: true });
918
+ writeFileSync(ccConfigPath, JSON.stringify(ccConfig, null, 2) + "\n");
919
+ p.log.success(`Plugin config: ${color.dim(ccConfigPath)}`);
901
920
  // Step 4: Save content locally for the agent
902
921
  const contentDir = join(homedir(), ".self-driving-agents", "claude-code", agentId);
903
922
  mkdirSync(contentDir, { recursive: true });
@@ -944,13 +963,14 @@ async function main() {
944
963
  writeFileSync(userSettingsPath, JSON.stringify(userSettings, null, 2) + "\n");
945
964
  p.log.success("Auto-approved hindsight tools in Claude Code");
946
965
  }
947
- const hasBankTemplate = existsSync(join(contentDir, "bank-template.json"));
948
- const prompt = hasBankTemplate
949
- ? `Use /hindsight-memory:create-agent to create a "${agentId}" agent. Then ingest all files from ${contentDir}/ (skip bank-template.json). Read ${contentDir}/bank-template.json and create the exact mental models (knowledge pages) defined in its "mental_models" array using agent_knowledge_create_page for each one.`
950
- : `Use /hindsight-memory:create-agent to create a "${agentId}" agent. Then ingest all files from ${contentDir}/ and create 3 knowledge pages that make sense based on the content.`;
966
+ const prompt = `/hindsight-memory:create-agent ${agentId} from ${contentDir}`;
951
967
  p.note([
952
- `${color.dim("1.")} Start Claude Code`,
953
- `${color.dim("2.")} Say: ${color.cyan(prompt)}`,
968
+ `${color.yellow("")} ${color.bold(`Important:`)} the agent's memory is scoped to the directory where you start ${color.cyan("claude")}.`,
969
+ ` Always start your Claude Code sessions from the same project directory.`,
970
+ ``,
971
+ `${color.dim("1.")} ${color.cyan("cd")} into your project directory`,
972
+ `${color.dim("2.")} Run: ${color.cyan("claude")}`,
973
+ `${color.dim("3.")} Say: ${color.cyan(prompt)}`,
954
974
  ].join("\n"), "Next steps");
955
975
  p.outro(color.green(`'${agentId}' content ready`));
956
976
  cleanup?.();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectorize-io/self-driving-agents",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "Install self-driving agents with portable memory on any harness",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",