@sechroom/cli 2026.7.3-rc.f271682b → 2026.7.4-rc.ce2b31c6

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/index.js +30 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5065,24 +5065,45 @@ Examples:
5065
5065
  $ sechroom relationship suggestions --status Pending --memory mem_XXXX
5066
5066
  $ sechroom relationship suggestion accept rsg_XXXX`
5067
5067
  );
5068
- relationship.command("create <fromMemoryId> <toMemoryId>").description("Create a relationship (POST /memories/{memoryId}/relationships)").option("--type <type>", "Relationship type (Reference, Related, Parent, Child, Follows, \u2026)", "Reference").action(async (fromMemoryId, toMemoryId, opts, cmd) => {
5068
+ relationship.command("create <fromMemoryId> <toMemoryId>").description("Create a relationship (POST /memories/{memoryId}/relationships)").option("--type <type>", "Relationship type (Reference, Related, Parent, Child, Follows, \u2026)", "Reference").option(
5069
+ "--to-version <number>",
5070
+ "Version of the target memory to pin the edge to (defaults to the target's current version)"
5071
+ ).action(async (fromMemoryId, toMemoryId, opts, cmd) => {
5069
5072
  const cfg = resolveConfig(cmd.optsWithGlobals());
5070
- const data = await runApi("Creating relationship", async () => {
5071
- const client = await makeClient(cfg);
5072
- return client.POST("/memories/{memoryId}/relationships", {
5073
+ const client = await makeClient(cfg);
5074
+ let toVersion;
5075
+ if (opts.toVersion !== void 0) {
5076
+ toVersion = Number(opts.toVersion);
5077
+ if (!Number.isInteger(toVersion) || toVersion < 1) {
5078
+ fail(`--to-version must be a positive integer (got '${opts.toVersion}').`);
5079
+ }
5080
+ } else {
5081
+ const target = await runApi(
5082
+ "Resolving target version",
5083
+ async () => client.GET("/memories/{memoryId}", { params: { path: { memoryId: toMemoryId } } })
5084
+ );
5085
+ if (typeof target.item?.currentVersion !== "number") {
5086
+ fail(`Could not resolve the current version of ${toMemoryId}; pass --to-version explicitly.`);
5087
+ }
5088
+ toVersion = target.item.currentVersion;
5089
+ }
5090
+ const data = await runApi(
5091
+ "Creating relationship",
5092
+ async () => client.POST("/memories/{memoryId}/relationships", {
5073
5093
  params: { path: { memoryId: fromMemoryId } },
5074
5094
  body: {
5075
5095
  toMemoryId,
5076
- type: opts.type
5096
+ type: opts.type,
5097
+ toVersion
5077
5098
  }
5078
- });
5079
- });
5099
+ })
5100
+ );
5080
5101
  const inversePart = data.inverseId ? ` ${style.dim(`(inverse ${data.inverseId})`)}` : "";
5081
5102
  const view = resolveViewUrl(cfg.baseUrl, data.url);
5082
5103
  const urlPart = view ? ` ${style.dim("\u2192")} ${view}` : "";
5083
5104
  emitAction(
5084
- `created relationship ${style.bold(data.id)} ${style.dim(`${fromMemoryId} \u2192 ${toMemoryId}`)}${inversePart}${urlPart}`,
5085
- data,
5105
+ `created relationship ${style.bold(data.id)} ${style.dim(`${fromMemoryId} \u2192 ${toMemoryId} @v${toVersion}`)}${inversePart}${urlPart}`,
5106
+ { ...data, toVersion },
5086
5107
  cmd.optsWithGlobals().json
5087
5108
  );
5088
5109
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sechroom/cli",
3
- "version": "2026.7.3-rc.f271682b",
3
+ "version": "2026.7.4-rc.ce2b31c6",
4
4
  "description": "Sechroom CLI — a thin, generated client over the Sechroom HTTP API. An agent/human surface alongside MCP.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",