neoctl 0.2.38 → 0.2.39

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 (34) hide show
  1. package/dist/context/context-manager.js +2 -1
  2. package/dist/context/context-manager.js.map +1 -1
  3. package/dist/context/prompt-config.test.js +4 -0
  4. package/dist/context/prompt-config.test.js.map +1 -1
  5. package/dist/context/prompts.d.ts +3 -0
  6. package/dist/context/prompts.js +10 -4
  7. package/dist/context/prompts.js.map +1 -1
  8. package/dist/context/system.md +1 -1
  9. package/dist/core/query-engine.d.ts +5 -2
  10. package/dist/core/query-engine.js +31 -13
  11. package/dist/core/query-engine.js.map +1 -1
  12. package/dist/core/query.js +2 -2
  13. package/dist/core/query.js.map +1 -1
  14. package/dist/core/session-prompt-inheritance.test.d.ts +1 -0
  15. package/dist/core/session-prompt-inheritance.test.js +132 -0
  16. package/dist/core/session-prompt-inheritance.test.js.map +1 -0
  17. package/dist/core/session-settings-prompt.d.ts +12 -4
  18. package/dist/core/session-settings-prompt.js +50 -27
  19. package/dist/core/session-settings-prompt.js.map +1 -1
  20. package/dist/core/session-settings-prompt.test.js +31 -22
  21. package/dist/core/session-settings-prompt.test.js.map +1 -1
  22. package/dist/plugins/plugin-system.js +3 -0
  23. package/dist/plugins/plugin-system.js.map +1 -1
  24. package/dist/session/session-export.d.ts +4 -0
  25. package/dist/session/session-export.js.map +1 -1
  26. package/dist/session/session-store.js +4 -6
  27. package/dist/session/session-store.js.map +1 -1
  28. package/dist/web/index.d.ts +5 -1
  29. package/dist/web/index.js +28 -6
  30. package/dist/web/index.js.map +1 -1
  31. package/dist/web/session-prompt-integration.test.js +1 -1
  32. package/dist/web/session-prompt-integration.test.js.map +1 -1
  33. package/docs/prompt-config.md +19 -4
  34. package/package.json +1 -1
@@ -50,7 +50,7 @@ test("WebRepl session editor uses real file baseline and session persistence wit
50
50
  await store.save("Latest global baseline", original.revision);
51
51
  const reset = await repl.saveSessionPrompt({ reset: true, revision: saved.revision });
52
52
  assert.equal(reset.override, false);
53
- assert.ok(reset.content.includes("Latest global baseline"));
53
+ assert.ok(reset.effectiveContent.includes("Latest global baseline"));
54
54
  assert.equal(published, 2);
55
55
  assert.equal((await store.read()).content, "Latest global baseline");
56
56
  });
@@ -1 +1 @@
1
- {"version":3,"file":"session-prompt-integration.test.js","sourceRoot":"","sources":["../../src/web/session-prompt-integration.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAmB,MAAM,YAAY,CAAC;AAEtD,IAAI,CAAC,8FAA8F,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/G,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,yBAAyB,CAAC,CAAC,CAAC;IACjF,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7D,MAAM,KAAK,GAAG,IAAI,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CA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,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,YAAY,kBAAkB,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC;IAC/J,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,YAAY,kBAAkB,IAAI,CAAC,CAAC,UAAU,KAAK,GAAG,CAAC,CAAC;IACxJ,MAAM,KAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC9D,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtF,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,CAAC;IACrE,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAC3B,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;AACvE,CAAC,CAAC,CAAC"}
@@ -50,13 +50,28 @@ Reads use the actual file, not a process content cache. Initialization and compa
50
50
 
51
51
  The lock is deliberately **not stolen based on age** (which could allow two live writers). After a crashed/killed writer, an administrator may remove the leftover `.lock` directory only after confirming that no writer is active. The prior complete `system.md` remains readable; orphan `.tmp` files can likewise be removed. External editors should save atomically; the API detects edits made before its locked revision check, but cannot coordinate an external editor that ignores the lock and writes concurrently.
52
52
 
53
- ## Session prompt overrides
53
+ ## Layered session instructions
54
54
 
55
- `GET /api/session-prompt?tabId=...&sessionId=...` returns `{content, override, revision}`. The content is the current complete effective prompt without internal cache markers. Once overridden, it is the exact session-owned prompt, not an edit to the version file.
55
+ `GET /api/session-prompt?tabId=...&sessionId=...` returns `{content, mode, override, revision, effectiveContent, effectiveRevision}`. **content is only the editable session instruction**, empty when inheriting; `effectiveContent` is a read-only composition without internal cache markers. Clients must never save the effective preview as editable content.
56
56
 
57
- `POST` to the same scoped URL accepts `{content, revision}` or `{reset:true, revision}`. Success returns `{ok:true, content, override, revision, deferred}`. Invalid input returns HTTP 400 / `SESSION_PROMPT_INVALID`; stale revisions return 409 / `SESSION_PROMPT_CONFLICT`; storage failures return 500 / `SESSION_PROMPT_FAILED`. Empty text, internal cache markers, unknown fields and content above 256 Ki characters are rejected.
57
+ Modes:
58
58
 
59
- A saved override is persisted in the current session transcript and restored when that same session resumes. New sessions do not inherit it. While a model request is running, accepted changes are queued and applied at the next model-turn boundary; the current request is not changed. Reset removes the override and uses the latest version file plus current runtime/plugin/application sections. Tools and user/runtime context remain separate from the full prompt override. The runtime-context protocol additionally exposes `prompt.sessionPrompt` to distinguish active and pending state.
59
+ - `inherit`: no session instruction; follows the latest global file.
60
+ - `append`: latest global baseline plus session instructions (default for new edits).
61
+ - `replace_base`: replaces only sections tagged `source: "global"`, preserving runtime/tool/plugin/application sections. Embedded custom context managers must tag their global sections to opt into replacement.
62
+ - `legacy_full_override`: existing transcripts without a mode retain their exact historical full replacement. No automatic text stripping or migration occurs. The UI warns and requires confirmation before switching modes; new sessions cannot create this mode. Old clients editing an existing legacy prompt without specifying mode retain legacy semantics.
63
+
64
+ `POST` accepts `{content, mode?, revision}` or `{reset:true, revision}`. Success adds `{ok:true, deferred}` to the GET shape. Reset returns to inherit and clears only session configuration. Empty custom text, internal markers, invalid modes, unknown fields, and content over 256 Ki characters are rejected (400 / `SESSION_PROMPT_INVALID`). Competing session edits return 409 / `SESSION_PROMPT_CONFLICT`; storage failures return 500 / `SESSION_PROMPT_FAILED`.
65
+
66
+ `revision` covers the session configuration and its owner, not generated text. Global/tool/plugin changes update `effectiveRevision` and the preview without invalidating a session draft. Global editing retains its independent file CAS. Clients preserve drafts on failed saves and runtime preview updates.
67
+
68
+ Session content and mode persist in the transcript and restore in the same session only. Accepted busy edits persist immediately but become active at the next model-turn boundary; in-flight requests do not change. Runtime context exposes active `mode`, `effectiveRevision`, and queued `pendingMode`/`deferred`, separately from the editor's desired state.
69
+
70
+ ## Tool-dependent context
71
+
72
+ Effective tool definitions are captured once per model request and used both for capability instructions and the provider tools list. Plugin prompt sections may declare `requiresTools: ["tool_name"]`; such sections are included only when all dependencies are in the effective tool set. General plugin instructions remain independent. The downloads plugin uses this for `expose_downloads`. Disabled tools do not rewrite arbitrary user-authored text; runtime instructions explicitly explain that text cannot enable an unavailable tool.
73
+
74
+ Web hosts provide `resolveGlobalToolOverrides` alongside persistence. Existing runtimes re-read this shared source at the next model-turn boundary or idle preview/tool-list refresh, so `inherit` follows global changes without reconstructing the session. Explicit session enable/disable settings retain precedence. Busy previews never change the executing tool registry. This is lazy refresh within the host, not a cross-process file watcher or a push update to every browser tab. Tool settings publish only after successful persistence; concurrent global/session writes are serialized.
60
75
 
61
76
  ## Validation
62
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neoctl",
3
- "version": "0.2.38",
3
+ "version": "0.2.39",
4
4
  "description": "TypeScript scaffold for a streaming agent runtime with a REPL UI layer.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",