@jwitmann/operator-codex 0.0.0-stage → 0.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.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "jwitmann",
3
+ "version": "0.1.0",
4
+ "description": "Operator Memory",
5
+ "hooks": "./hooks/hooks.json"
6
+ }
package/README.md CHANGED
@@ -1,3 +1,17 @@
1
- # Temporary Holding Version
1
+ # Operator Memory for Codex
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Operator Memory gives Codex durable project and user context maintained by agents as readable Markdown.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ operator-helper install codex
9
+ ```
10
+
11
+ Start a fresh Codex session after installation. Codex reviews plugin hooks on startup; approve the Operator hooks when prompted. Until the hooks are trusted, Codex skips preamble injection.
12
+
13
+ The plugin injects the Operator preamble into new and cleared sessions, reinjects it after context compaction, and injects it into delegated subagents. Resumed and forked sessions keep their existing context.
14
+
15
+ The three Operator workflows are available as explicitly invoked skills: `$operator-user-init`, `$operator-project-init`, and `$operator-index`. Codex plugins do not register slash commands; invoke the skills by name.
16
+
17
+ Updates are applied by rerunning `operator-helper install codex`. Hook definitions stay byte-stable across releases, so updates normally do not require renewed trust.
package/dist/hook.js ADDED
@@ -0,0 +1 @@
1
+ import{spawnSync as o}from"node:child_process";import{readFileSync as r}from"node:fs";var s=new Set(["startup","clear","compact"]),c="Operator could not load memory because operator-helper preamble failed.";function n(){process.stdout.write(JSON.stringify({continue:!1,systemMessage:c})),process.exit(0)}function a(){try{let t=JSON.parse(r(0,"utf8"));if(typeof t!=="object"||t===null)return n();let e=t;if(typeof e.cwd!=="string"||e.cwd.length===0)return n();return{cwd:e.cwd,hookEventName:typeof e.hook_event_name==="string"?e.hook_event_name:null,source:typeof e.source==="string"?e.source:null}}catch{return n()}}function u(){let t=a();if(t.hookEventName==="SessionStart"&&!s.has(t.source??""))return;let e=o("operator-helper",["preamble"],{cwd:t.cwd,encoding:"utf8",shell:process.platform==="win32"});if(e.error!==void 0||e.status!==0||e.stdout.length===0)n();process.stdout.write(e.stdout)}u();
@@ -0,0 +1,31 @@
1
+ {
2
+ "description": "Inject Operator Memory into Codex sessions and delegated subagents.",
3
+ "hooks": {
4
+ "SessionStart": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node \"$PLUGIN_ROOT/dist/hook.js\"",
10
+ "commandWindows": "node \"%PLUGIN_ROOT%\\dist\\hook.js\"",
11
+ "timeout": 120,
12
+ "additionalContextLimit": 0
13
+ }
14
+ ]
15
+ }
16
+ ],
17
+ "SubagentStart": [
18
+ {
19
+ "hooks": [
20
+ {
21
+ "type": "command",
22
+ "command": "node \"$PLUGIN_ROOT/dist/hook.js\"",
23
+ "commandWindows": "node \"%PLUGIN_ROOT%\\dist\\hook.js\"",
24
+ "timeout": 120,
25
+ "additionalContextLimit": 0
26
+ }
27
+ ]
28
+ }
29
+ ]
30
+ }
31
+ }
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "@jwitmann/operator-codex",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.4.0",
4
+ "description": "Operator Memory adapter for Codex.",
5
+ "license": "BSD-3-Clause",
6
+ "author": "jwitmann",
7
+ "homepage": "https://github.com/jwitmann/operator-memory#readme",
8
+ "bugs": {
9
+ "url": "https://github.com/jwitmann/operator-memory/issues"
10
+ },
11
+ "files": [
12
+ ".codex-plugin",
13
+ "hooks",
14
+ "dist",
15
+ "skills"
16
+ ],
17
+ "keywords": [
18
+ "codex",
19
+ "codex-plugin",
20
+ "memory",
21
+ "plugin"
22
+ ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/jwitmann/operator-memory.git",
26
+ "directory": "packages/codex"
27
+ },
28
+ "engines": {
29
+ "node": ">=20"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "scripts": {
35
+ "build": "bun ./scripts/build.ts",
36
+ "prepack": "bun run build"
37
+ },
38
+ "type": "module"
39
+ }
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: operator-index
3
+ description: Build or refresh the Operator Project Index.
4
+ ---
5
+
6
+ # Operator Project Index Setup
7
+
8
+ 1. Run `operator-helper version`. If an update is available, run `operator-helper upgrade` before continuing.
9
+ 2. Run `operator-helper index init` and follow the emitted Project Index Setup guide, including when inspection reports failures.
10
+
11
+ If the Project Brain is missing, tell the user to invoke `$operator-project-init` to set it up.
12
+
13
+ ## Recovery
14
+
15
+ - If Helper cannot start, install or repair the npm package `@jwitmann/operator-helper` globally and retry the failed command.
16
+ - If the version check or upgrade fails, diagnose the error and retry.
17
+ - If `operator-helper index init` reports a failure, use its output to resolve it and rerun it as needed.
18
+ - If you cannot resolve a problem, report the blocker.
19
+
20
+ Use Helper output as working context. Do not reproduce it wholesale or reimplement Helper logic.
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: operator-project-init
3
+ description: Initialize and configure the Operator Project Brain.
4
+ ---
5
+
6
+ # Operator Project Setup
7
+
8
+ 1. Run `operator-helper version`. If an update is available, run `operator-helper upgrade` before continuing.
9
+ 2. Run `operator-helper project init` and follow the emitted Project Setup guide, including when initialization reports failures.
10
+
11
+ For a new conversation to set up the Project Index, tell the user to invoke `$operator-index`.
12
+
13
+ ## Recovery
14
+
15
+ - If Helper cannot start, install or repair the npm package `@jwitmann/operator-helper` globally and retry the failed command.
16
+ - If the version check or upgrade fails, diagnose the error and retry.
17
+ - If `operator-helper project init` reports a failure, use its output to resolve it and rerun it as needed.
18
+ - If you cannot resolve a problem, report the blocker.
19
+
20
+ Use Helper output as working context. Do not reproduce it wholesale or reimplement Helper logic.
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: operator-user-init
3
+ description: Initialize and configure the Operator User Partition.
4
+ ---
5
+
6
+ # Operator User Setup
7
+
8
+ 1. Run `operator-helper version`. If an update is available, run `operator-helper upgrade` before continuing.
9
+ 2. Run `operator-helper user init` and follow the emitted User Setup guide, including when initialization reports failures.
10
+
11
+ ## Recovery
12
+
13
+ - If Helper cannot start, install or repair the npm package `@jwitmann/operator-helper` globally and retry the failed command.
14
+ - If the version check or upgrade fails, diagnose the error and retry.
15
+ - If `operator-helper user init` reports a failure, use its output to resolve it and rerun it as needed.
16
+ - If you cannot resolve a problem, report the blocker.
17
+
18
+ Use Helper output as working context. Do not reproduce it wholesale or reimplement Helper logic.
@@ -0,0 +1,2 @@
1
+ policy:
2
+ allow_implicit_invocation: false