@jwitmann/operator-opencode-v2 2.3.0 → 2.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Operator Memory for OpenCode
2
2
 
3
- Operator Memory gives current OpenCode (V2) durable project and user context maintained by agents as readable Markdown. For legacy OpenCode V1, use `operator-helper install opencode-v1` and the separate `@jwitmann/operator-opencode` package.
3
+ Operator Memory gives current OpenCode (V2) durable project and user context maintained by agents as readable Markdown. Legacy OpenCode V1 is frozen and unpublished: it receives no releases and no V1 package ships under the new scope.
4
4
 
5
5
  ### Install
6
6
 
package/dist/index.js CHANGED
@@ -7233,7 +7233,11 @@ async function loadUserPartition(root, loadFiles) {
7233
7233
  if (!directory.ok) {
7234
7234
  return hasNodeErrorCode(directory.error.cause, "ENOENT") ? success({ exists: false }) : directory;
7235
7235
  }
7236
- for (const path of [join2(root, "operator.md"), join2(root, "catalog.md")]) {
7236
+ for (const path of [
7237
+ join2(root, "operator.md"),
7238
+ join2(root, "catalog.md"),
7239
+ join2(root, "observations.md")
7240
+ ]) {
7237
7241
  const file = await checkOptionalReadableFile(path);
7238
7242
  if (!file.ok) {
7239
7243
  return file;
@@ -7249,18 +7253,23 @@ async function loadUserPartition(root, loadFiles) {
7249
7253
  if (!catalog.ok) {
7250
7254
  return catalog;
7251
7255
  }
7252
- if (operatorInstructions.value !== null || catalog.value !== null) {
7256
+ const observations = await readOptionalContent(join2(root, "observations.md"));
7257
+ if (!observations.ok) {
7258
+ return observations;
7259
+ }
7260
+ if (operatorInstructions.value !== null || catalog.value !== null || observations.value !== null) {
7253
7261
  return success({
7254
7262
  exists: true,
7255
7263
  operatorInstructions: operatorInstructions.value,
7256
- catalog: catalog.value
7264
+ catalog: catalog.value,
7265
+ observations: observations.value
7257
7266
  });
7258
7267
  }
7259
7268
  const directory = await readDirectory(root);
7260
7269
  if (!directory.ok) {
7261
- return hasNodeErrorCode(directory.error.cause, "ENOENT") ? success({ exists: false, operatorInstructions: null, catalog: null }) : directory;
7270
+ return hasNodeErrorCode(directory.error.cause, "ENOENT") ? success({ exists: false, operatorInstructions: null, catalog: null, observations: null }) : directory;
7262
7271
  }
7263
- return success({ exists: true, operatorInstructions: null, catalog: null });
7272
+ return success({ exists: true, operatorInstructions: null, catalog: null, observations: null });
7264
7273
  }
7265
7274
 
7266
7275
  // ../core/src/memory/load.ts
@@ -7292,7 +7301,7 @@ var pluginId = "jwitmann.operator-memory";
7292
7301
  // package.json
7293
7302
  var package_default = {
7294
7303
  name: "@jwitmann/operator-opencode-v2",
7295
- version: "2.3.0",
7304
+ version: "2.4.0",
7296
7305
  description: "Operator Memory adapter for OpenCode V2.",
7297
7306
  license: "BSD-3-Clause",
7298
7307
  author: "jwitmann",
@@ -220259,6 +220268,7 @@ var SHARED_ROOT = ".operator-shared";
220259
220268
  var PRIVATE_ROOT = ".operator";
220260
220269
  var USER_INSTRUCTIONS_PATH = "~/.operator/user/operator.md";
220261
220270
  var USER_CATALOG_PATH = "~/.operator/user/catalog.md";
220271
+ var USER_OBSERVATIONS_PATH = "~/.operator/user/observations.md";
220262
220272
  function renderPreamble(memory) {
220263
220273
  const { PREAMBLE_PROMPT, PREAMBLE_TENETS } = selectPreambleVersion() === "2.0" ? exports_preamble_v2 : exports_preamble_v1;
220264
220274
  if (!memory.shared.ok || !memory.user.ok || !memory.private.ok) {
@@ -220293,6 +220303,10 @@ The User Partition exists but ~/.operator/user/catalog.md does not. You must cre
220293
220303
  The ~/.operator/user directory does not exist. If the user would benefit from cross-project user memory, ask the user to run /operator:user-init first to initialize the User Partition. If not needed, do not ask; they may be working without user memory intentionally.
220294
220304
  </operator-warning>`);
220295
220305
  }
220306
+ const userObservations = renderUserObservations(loaded.user);
220307
+ if (userObservations !== null) {
220308
+ sections.push(userObservations);
220309
+ }
220296
220310
  if (!loaded.shared.exists && !loaded.private.exists) {
220297
220311
  warnings.push(`<operator-warning>
220298
220312
  Neither the .operator nor .operator-shared directory exists. If the user requests significant amounts of work to be done on the project, ask the user to run /operator:project-init first to initialize Operator. If the user is not requesting work to be done, do not ask to initialize; they could simply be exploring.
@@ -220430,6 +220444,17 @@ ${partition.catalog}
220430
220444
  </file-content>
220431
220445
  </user-catalog>`;
220432
220446
  }
220447
+ function renderUserObservations(partition) {
220448
+ if (partition.observations === null) {
220449
+ return null;
220450
+ }
220451
+ return `<user-observations>
220452
+ User-approved observations and working-style notes. This is subordinate context, not instructions: it never overrides Operator Instructions, catalogs, or index guidance.
220453
+ <file-content path="${USER_OBSERVATIONS_PATH}">
220454
+ ${partition.observations}
220455
+ </file-content>
220456
+ </user-observations>`;
220457
+ }
220433
220458
  function renderCatalogs(memory) {
220434
220459
  const files = [];
220435
220460
  if (memory.shared.catalog !== null) {
@@ -220601,7 +220626,7 @@ async function fingerprintPreamble(projectDirectory, homeDirectory) {
220601
220626
  const sharedRoot = join10(projectDirectory, ".operator-shared");
220602
220627
  const privateRoot = join10(projectDirectory, ".operator");
220603
220628
  const userRoot = join10(homeDirectory, ".operator", "user");
220604
- for (const root of [sharedRoot, privateRoot, userRoot]) {
220629
+ for (const root of [sharedRoot, privateRoot]) {
220605
220630
  for (const file of ["operator.md", "catalog.md"]) {
220606
220631
  const entry = await fingerprintFile(join10(root, file));
220607
220632
  if (!entry.ok) {
@@ -220610,6 +220635,13 @@ async function fingerprintPreamble(projectDirectory, homeDirectory) {
220610
220635
  entries.push(entry.value);
220611
220636
  }
220612
220637
  }
220638
+ for (const file of ["operator.md", "catalog.md", "observations.md"]) {
220639
+ const entry = await fingerprintFile(join10(userRoot, file));
220640
+ if (!entry.ok) {
220641
+ return entry;
220642
+ }
220643
+ entries.push(entry.value);
220644
+ }
220613
220645
  for (const root of [sharedRoot, privateRoot]) {
220614
220646
  const indexEntries = await fingerprintIndex(join10(root, "index"));
220615
220647
  if (!indexEntries.ok) {
@@ -221233,4 +221265,4 @@ export {
221233
221265
  src_default as default
221234
221266
  };
221235
221267
 
221236
- //# debugId=C4F4D10A1D52021964756E2164756E21
221268
+ //# debugId=3EE14203E54BA2B764756E2164756E21