@plurnk/plurnk-service 1.6.0 → 1.7.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/.env.defaults +7 -21
- package/INSTALL.md +18 -17
- package/README.md +1 -1
- package/SPEC.md +209 -136
- package/dist/build-info.json +1 -1
- package/dist/core/ChannelWrite.sql +3 -3
- package/dist/core/ClientInteractions.d.ts +19 -0
- package/dist/core/ClientInteractions.d.ts.map +1 -0
- package/dist/core/ClientInteractions.js +124 -0
- package/dist/core/ClientInteractions.js.map +1 -0
- package/dist/core/ClientInteractions.sql +34 -0
- package/dist/core/CoreSchemeServices.d.ts +9 -3
- package/dist/core/CoreSchemeServices.d.ts.map +1 -1
- package/dist/core/CoreSchemeServices.js +8 -2
- package/dist/core/CoreSchemeServices.js.map +1 -1
- package/dist/core/Dispatcher.d.ts +4 -2
- package/dist/core/Dispatcher.d.ts.map +1 -1
- package/dist/core/Dispatcher.js +116 -1149
- package/dist/core/Dispatcher.js.map +1 -1
- package/dist/core/Engine.d.ts +24 -34
- package/dist/core/Engine.d.ts.map +1 -1
- package/dist/core/Engine.js +137 -1672
- package/dist/core/Engine.js.map +1 -1
- package/dist/core/Engine.sql +46 -32
- package/dist/core/ExecutableTools.d.ts +1 -0
- package/dist/core/ExecutableTools.d.ts.map +1 -1
- package/dist/core/ExecutableTools.js +17 -9
- package/dist/core/ExecutableTools.js.map +1 -1
- package/dist/core/ExecutorRegistry.d.ts +11 -3
- package/dist/core/ExecutorRegistry.d.ts.map +1 -1
- package/dist/core/ExecutorRegistry.js +139 -16
- package/dist/core/ExecutorRegistry.js.map +1 -1
- package/dist/core/LogBody.d.ts +1 -0
- package/dist/core/LogBody.d.ts.map +1 -1
- package/dist/core/LogBody.js +4 -0
- package/dist/core/LogBody.js.map +1 -1
- package/dist/core/ModelCall.d.ts +2 -2
- package/dist/core/ModelCall.d.ts.map +1 -1
- package/dist/core/ModelCall.js +4 -2
- package/dist/core/ModelCall.js.map +1 -1
- package/dist/core/PacketBuilder.d.ts +11 -22
- package/dist/core/PacketBuilder.d.ts.map +1 -1
- package/dist/core/PacketBuilder.js +90 -180
- package/dist/core/PacketBuilder.js.map +1 -1
- package/dist/core/ProblemLog.d.ts +1 -1
- package/dist/core/ProblemLog.d.ts.map +1 -1
- package/dist/core/ProblemLog.js +14 -3
- package/dist/core/ProblemLog.js.map +1 -1
- package/dist/core/ProposalLifecycle.d.ts +4 -2
- package/dist/core/ProposalLifecycle.d.ts.map +1 -1
- package/dist/core/ProposalLifecycle.js +19 -7
- package/dist/core/ProposalLifecycle.js.map +1 -1
- package/dist/core/ProviderInstantiate.js +2 -2
- package/dist/core/ProviderInstantiate.js.map +1 -1
- package/dist/core/ResourceMutations.d.ts +73 -0
- package/dist/core/ResourceMutations.d.ts.map +1 -0
- package/dist/core/ResourceMutations.js +1142 -0
- package/dist/core/ResourceMutations.js.map +1 -0
- package/dist/core/SchemeRegistry.d.ts +18 -10
- package/dist/core/SchemeRegistry.d.ts.map +1 -1
- package/dist/core/SchemeRegistry.js +195 -43
- package/dist/core/SchemeRegistry.js.map +1 -1
- package/dist/core/StoredPacket.d.ts +2 -2
- package/dist/core/StoredPacket.js +7 -7
- package/dist/core/TurnRunner.d.ts +74 -0
- package/dist/core/TurnRunner.d.ts.map +1 -0
- package/dist/core/TurnRunner.js +1733 -0
- package/dist/core/TurnRunner.js.map +1 -0
- package/dist/core/WorkspaceGate.d.ts +1 -0
- package/dist/core/WorkspaceGate.d.ts.map +1 -1
- package/dist/core/WorkspaceGate.js +39 -0
- package/dist/core/WorkspaceGate.js.map +1 -1
- package/dist/core/caps/CoreInteractionCaps.d.ts +9 -0
- package/dist/core/caps/CoreInteractionCaps.d.ts.map +1 -0
- package/dist/core/caps/CoreInteractionCaps.js +14 -0
- package/dist/core/caps/CoreInteractionCaps.js.map +1 -0
- package/dist/core/caps/DbChannelCaps.js +4 -4
- package/dist/core/caps/DbChannelCaps.js.map +1 -1
- package/dist/core/caps/SchemeCtxImpl.d.ts +2 -1
- package/dist/core/caps/SchemeCtxImpl.d.ts.map +1 -1
- package/dist/core/caps/SchemeCtxImpl.js +3 -0
- package/dist/core/caps/SchemeCtxImpl.js.map +1 -1
- package/dist/core/content-hash.js +2 -2
- package/dist/core/content-hash.js.map +1 -1
- package/dist/core/content-weight.d.ts +2 -0
- package/dist/core/content-weight.d.ts.map +1 -0
- package/dist/core/content-weight.js +4 -0
- package/dist/core/content-weight.js.map +1 -0
- package/dist/core/content_weight.d.ts +4 -0
- package/dist/core/content_weight.d.ts.map +1 -0
- package/dist/core/content_weight.js +6 -0
- package/dist/core/content_weight.js.map +1 -0
- package/dist/core/fork.sql +5 -5
- package/dist/core/packet-wire.d.ts +4 -4
- package/dist/core/packet-wire.d.ts.map +1 -1
- package/dist/core/packet-wire.js +21 -21
- package/dist/core/packet-wire.js.map +1 -1
- package/dist/core/scheme-types.d.ts +3 -2
- package/dist/core/scheme-types.d.ts.map +1 -1
- package/dist/core/scheme-types.js.map +1 -1
- package/dist/digest/Digest.js +1 -1
- package/dist/digest/Digest.js.map +1 -1
- package/dist/schemes/Exec.d.ts.map +1 -1
- package/dist/schemes/Exec.js +53 -15
- package/dist/schemes/Exec.js.map +1 -1
- package/dist/schemes/ExecOutputScheme.js +1 -1
- package/dist/schemes/ExecOutputScheme.js.map +1 -1
- package/dist/schemes/File.d.ts.map +1 -1
- package/dist/schemes/File.js +1 -1
- package/dist/schemes/File.js.map +1 -1
- package/dist/schemes/Log.d.ts.map +1 -1
- package/dist/schemes/Log.js +2 -2
- package/dist/schemes/Log.sql +2 -2
- package/dist/schemes/Worker.js +2 -2
- package/dist/schemes/Worker.js.map +1 -1
- package/dist/schemes/_entry-crud.js +4 -4
- package/dist/schemes/_entry-crud.js.map +1 -1
- package/dist/schemes/_entry-crud.sql +2 -2
- package/dist/schemes/_entry-find.d.ts +5 -5
- package/dist/schemes/_entry-find.d.ts.map +1 -1
- package/dist/schemes/_entry-find.js +29 -28
- package/dist/schemes/_entry-find.js.map +1 -1
- package/dist/schemes/_entry-manifest.js +4 -4
- package/dist/schemes/_entry-manifest.js.map +1 -1
- package/dist/schemes/_entry-ops.d.ts.map +1 -1
- package/dist/schemes/_entry-ops.js +3 -3
- package/dist/schemes/_entry-ops.js.map +1 -1
- package/dist/schemes/_entry-ops.sql +3 -3
- package/dist/server/Daemon.d.ts +20 -49
- package/dist/server/Daemon.d.ts.map +1 -1
- package/dist/server/Daemon.js +311 -908
- package/dist/server/Daemon.js.map +1 -1
- package/dist/server/DaemonModule.d.ts +31 -3
- package/dist/server/DaemonModule.d.ts.map +1 -1
- package/dist/server/DrainSupervisor.d.ts +117 -0
- package/dist/server/DrainSupervisor.d.ts.map +1 -0
- package/dist/server/DrainSupervisor.js +802 -0
- package/dist/server/DrainSupervisor.js.map +1 -0
- package/dist/server/client-input.d.ts +2 -0
- package/dist/server/client-input.d.ts.map +1 -1
- package/dist/server/client-input.js +12 -0
- package/dist/server/client-input.js.map +1 -1
- package/dist/server/lifecycle-recovery.sql +9 -0
- package/dist/server/logEntry.d.ts +1 -1
- package/dist/server/logEntry.js +1 -1
- package/dist/server/loopDocs.d.ts +1 -0
- package/dist/server/loopDocs.d.ts.map +1 -1
- package/dist/server/loopDocs.js +37 -8
- package/dist/server/loopDocs.js.map +1 -1
- package/dist/server/loopDocs.sql +10 -0
- package/dist/server/seam-entry-read.sql +2 -2
- package/dist/server/workspace-capabilities.sql +19 -0
- package/dist/service.js +1 -1
- package/dist/service.js.map +1 -1
- package/migrations/001_schema.sql +51 -10
- package/package.json +34 -33
- package/dist/core/ruler_count.d.ts +0 -4
- package/dist/core/ruler_count.d.ts.map +0 -1
- package/dist/core/ruler_count.js +0 -7
- package/dist/core/ruler_count.js.map +0 -1
- package/dist/core/token-ruler.d.ts +0 -2
- package/dist/core/token-ruler.d.ts.map +0 -1
- package/dist/core/token-ruler.js +0 -5
- package/dist/core/token-ruler.js.map +0 -1
package/.env.defaults
CHANGED
|
@@ -45,7 +45,7 @@ PLURNK_PORT=3044
|
|
|
45
45
|
# Optional default child-provider alias. Unset = each WORK/FORK child inherits
|
|
46
46
|
# its spawning loop's provider. Clients may override this per top-level loop.
|
|
47
47
|
# PLURNK_MODEL_CHILD=fast
|
|
48
|
-
# Operator turn ceiling. -1 (default) = no cap (loops end via SEND,
|
|
48
|
+
# Operator turn ceiling. -1 (default) = no cap (loops end via SEND, provider capacity,
|
|
49
49
|
# strikes, or cycle detection). A positive value is an inviolable hard cap a
|
|
50
50
|
# CoreSeam runLoop({maxTurns}) request cannot exceed (min wins).
|
|
51
51
|
PLURNK_SERVICE_MAX_TURNS=-1
|
|
@@ -180,30 +180,16 @@ PLURNK_SERVICE_EDIT_RECEIPT_CONTEXT_LINES=2
|
|
|
180
180
|
# the ceiling fails hard (508 — no queue, no retry); the acting run counts itself.
|
|
181
181
|
PLURNK_SERVICE_WORKSPACE_WORKERS_MAX_ACTIVE=-1
|
|
182
182
|
|
|
183
|
-
# --- Prompt
|
|
184
|
-
# Providers
|
|
185
|
-
#
|
|
186
|
-
#
|
|
187
|
-
#
|
|
188
|
-
#
|
|
189
|
-
# gauge; a set value can only tighten it. Both core knobs resolve per
|
|
190
|
-
# alias: _<alias> wins over bare.
|
|
191
|
-
# The retired PLURNK_SERVICE_{CONTEXT_WINDOW,REASONING,COMPLETION} names FAIL HARD at boot naming
|
|
192
|
-
# their successors — a stale .env never silently loses its envelope.
|
|
193
|
-
# PLURNK_SERVICE_PROMPT_BUDGET=128000
|
|
194
|
-
# Maximum aggregate share of the stable model-facing prompt gauge used by
|
|
183
|
+
# --- Prompt projection — PER ALIAS ---
|
|
184
|
+
# Providers derive physical input capacity from model limits and the total output envelope.
|
|
185
|
+
# Core projects that number into its model-facing curation gauge; no second service-side token
|
|
186
|
+
# budget or packing margin exists. The retired PLURNK_SERVICE_{PROMPT_BUDGET,SAFETY,
|
|
187
|
+
# CONTEXT_WINDOW,REASONING,COMPLETION} names fail hard at boot.
|
|
188
|
+
# Maximum aggregate share of the model-facing curation budget used by
|
|
195
189
|
# automatic OPEN prompt bodies. The complete prompt remains stored and
|
|
196
190
|
# READ/FIND-addressable; this controls projection, not prompt admission.
|
|
197
191
|
# Alias-scoped overrides follow the ordinary _<alias> convention.
|
|
198
192
|
PLURNK_SERVICE_PROMPT_PROJECTION=25%
|
|
199
|
-
PLURNK_SERVICE_SAFETY=1024
|
|
200
|
-
#
|
|
201
|
-
# LOCAL aliases (llama-server): the window is PROBED and the reserves DERIVE from it in the
|
|
202
|
-
# provider tier (percent defaults) — zero-config. Absolute pins, when wanted, are provider-tier:
|
|
203
|
-
# PLURNK_PROVIDERS_{REASONING,COMPLETION}_RESERVE_<alias> (see plurnk-providers/.env.defaults).
|
|
204
|
-
# The provider sends the resolved reasoning allowance per request; no llama-server launch-flag
|
|
205
|
-
# synchronization is required. Pinned absolutes exceeding the detected window fail HARD at build
|
|
206
|
-
# time, naming the provider-tier knobs.
|
|
207
193
|
|
|
208
194
|
# --- Plugins (third-party trust) ---
|
|
209
195
|
# (PLURNK_PLUGINS_TRUSTED_ONLY lives in @plurnk/plurnk-meta — reader-declares: the
|
package/INSTALL.md
CHANGED
|
@@ -4,7 +4,7 @@ Operator guide. Put machine-specific choices in `~/.plurnk/.env`. Each installed
|
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```sh
|
|
8
8
|
npm install -g @plurnk/plurnk-service
|
|
9
9
|
plurnk-service migrate # apply the disposable version-1 schema baseline
|
|
10
10
|
plurnk-service start
|
|
@@ -40,19 +40,20 @@ When a value is required, an unset or retired name fails boot naming the violate
|
|
|
40
40
|
|
|
41
41
|
These are relationships *between* flags. Set them as a unit.
|
|
42
42
|
|
|
43
|
-
- **
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
- **One generation envelope derives input capacity.** The provider resolves
|
|
44
|
+
model input/output limits, the effective context window, one total output
|
|
45
|
+
budget, and an optional reasoning subset. Its resulting input capacity drives
|
|
46
|
+
both physical request admission and Core's model-independent curation gauge;
|
|
47
|
+
Core has no second token budget or packing margin. Request-shaped token
|
|
48
|
+
evidence remains provider-owned ({§tokenomics-window-partition}).
|
|
48
49
|
`PLURNK_SERVICE_PROMPT_PROJECTION_<alias>` assigns a stable percentage of
|
|
49
50
|
that gauge to automatic prompt bodies; it never limits stored prompt size
|
|
50
51
|
({§prompt-projection}).
|
|
51
|
-
- **Reasoning
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
- **Reasoning is part of output.** `PLURNK_PROVIDERS_OUTPUT_BUDGET_<alias>` is
|
|
53
|
+
the complete response ceiling, including hidden reasoning. Optional
|
|
54
|
+
`PLURNK_PROVIDERS_REASONING_BUDGET_<alias>` is a strict subset; unset leaves
|
|
55
|
+
depth provider-adaptive. Activation remains the independent
|
|
56
|
+
`PLURNK_PROVIDERS_REASONING_<alias>` contract.
|
|
56
57
|
- **Local GBNF is optional.** The PLURNK language is always parsed normally.
|
|
57
58
|
Local llama-server users may set `PLURNK_PROVIDERS_GBNF_<alias>`; transport
|
|
58
59
|
and enforcement are verified at boot. Cloud and endpoint-managed aliases
|
|
@@ -66,7 +67,7 @@ These are relationships *between* flags. Set them as a unit.
|
|
|
66
67
|
|
|
67
68
|
## Profiles (examples, not a decision tree — adapt to the real box)
|
|
68
69
|
|
|
69
|
-
- **Local GPU (llama-server).** `PLURNK_MODEL_local="openai/<name>"`, `OPENAI_BASE_URL=http://127.0.0.1:<port>`, `PLURNK_MODEL=local`, `PLURNK_PROVIDERS_GBNF_local=plurnk.qwen.gbnf` for Qwen's template-prefilled `<think>` protocol (or `plurnk.gemma.gbnf` when Gemma generates a complete Harmony channel). The provider detects llama-server, verifies its GBNF transport, and derives
|
|
70
|
+
- **Local GPU (llama-server).** `PLURNK_MODEL_local="openai/<name>"`, `OPENAI_BASE_URL=http://127.0.0.1:<port>`, `PLURNK_MODEL=local`, `PLURNK_PROVIDERS_GBNF_local=plurnk.qwen.gbnf` for Qwen's template-prefilled `<think>` protocol (or `plurnk.gemma.gbnf` when Gemma generates a complete Harmony channel). The provider detects llama-server, verifies its GBNF transport, and derives input capacity from the detected window and configured output envelope. Add `PLURNK_PROVIDERS_LLAMA_SERVER_local=1` only when the endpoint cannot be fingerprinted reliably.
|
|
70
71
|
- **Cloud, bring-your-own-key.** `PLURNK_MODEL_cloud="openrouter/<model>"`, `OPENROUTER_API_KEY=…`, `PLURNK_MODEL=cloud`. No local GBNF or `LLAMA_SERVER` pin.
|
|
71
72
|
- **plurnk.ai endpoint.** `PLURNK_MODEL_plurnk="plurnk/plurnk"`, `PLURNK_API_KEY=…`, `PLURNK_MODEL=plurnk`.
|
|
72
73
|
- **Headless / CI / constrained container.** A CPU-only box should NOT disable semantic search — it should point derivation at a real embedder: `PLURNK_MIMETYPES_EMBED_BASE_URL` (any OpenAI-compatible `/v1/embeddings` — a host GPU turns a CPU-hours corpus grind into seconds). Weak hardware is the target workload, not a reason to shed capability; `PLURNK_SERVICE_EMBED_DISABLE=1` exists for test lanes that deterministically assert non-semantic behavior, nothing else. Consider `PLURNK_SERVICE_MAX_TURNS=<n>` as a cost cap, `PLURNK_SERVICE_GIT_ALLOWED=0` to lock out git in a sandbox.
|
|
@@ -84,11 +85,11 @@ Each mirrors a `# --- section ---` in the floor; consult the floor for exact def
|
|
|
84
85
|
- **Providers** — the portable provider knobs and defaults are defined by
|
|
85
86
|
`@plurnk/plurnk-providers/.env.defaults`; any provider knob may take an alias
|
|
86
87
|
suffix that wins over the bare fallback.
|
|
87
|
-
- **Provider
|
|
88
|
-
`PLURNK_PROVIDERS_CONTEXT_WINDOW`/`
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
- **Provider envelope and prompt projection** —
|
|
89
|
+
`PLURNK_PROVIDERS_CONTEXT_WINDOW`/`_OUTPUT_BUDGET` and optional
|
|
90
|
+
`_REASONING_BUDGET` derive physical input capacity.
|
|
91
|
+
`PLURNK_SERVICE_PROMPT_PROJECTION` assigns the automatic prompt-body share
|
|
92
|
+
of that provider-derived curation gauge.
|
|
92
93
|
- **Plugins** — bare `PLURNK_PLUGINS_TRUSTED_ONLY` (0/unset = load all installed; a value = `@plurnk/*` plus an allowlist).
|
|
93
94
|
- **Semantic search** — `PLURNK_SERVICE_SEMANTIC_CHUNK_TOKENS`/`_CHUNK_OVERLAP` (service-side chunking), `PLURNK_SERVICE_EMBED_DISABLE` (FTS-only), `PLURNK_MIMETYPES_EMBED_WORKERS` (the embedder's pool — mimetypes-owned).
|
|
94
95
|
- **Schemes: http** — `PLURNK_SCHEMES_HTTP_FETCH_TIMEOUT`, `_TTL_MS`, optional `# TAVILY_API_KEY=`, and `PLURNK_SCHEMES_HTTP_TAVILY_DEPTH`/`_TAVILY_TIMEOUT_MS`.
|