omnius 1.0.923 → 1.0.925
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/dist/{providerRegistry.d.ts → _types/backend-vllm/providerRegistry.d.ts} +0 -1
- package/dist/_types/backend-vllm/types.d.ts +209 -0
- package/dist/_types/execution/av/media-capability.d.ts +94 -0
- package/dist/_types/execution/delegation-contract.d.ts +102 -0
- package/dist/_types/execution/evidence.d.ts +68 -0
- package/dist/_types/execution/html-source-evidence.d.ts +65 -0
- package/dist/_types/execution/mcp/types.d.ts +169 -0
- package/dist/_types/execution/mutation-contract.d.ts +102 -0
- package/dist/_types/execution/nol/artifacts.d.ts +39 -0
- package/dist/_types/execution/nol/checkpoint-edits.d.ts +98 -0
- package/dist/_types/execution/nol/distributions.d.ts +128 -0
- package/dist/_types/execution/nol/gguf-checkpoint-edits.d.ts +194 -0
- package/dist/_types/execution/nol/gguf-control-reader.d.ts +224 -0
- package/dist/_types/execution/nol/lora-exports.d.ts +129 -0
- package/dist/_types/execution/nol/neuronary.d.ts +212 -0
- package/dist/_types/execution/nol/pytorch-control-reader.d.ts +143 -0
- package/dist/_types/execution/nol/qwen35-head-sites.d.ts +61 -0
- package/dist/_types/execution/nol/worker-assets.d.ts +82 -0
- package/dist/_types/execution/nol/worker-protocol.d.ts +94 -0
- package/dist/_types/execution/page-content-source.d.ts +40 -0
- package/dist/_types/execution/rapid-computer-use/artifact-store.d.ts +21 -0
- package/dist/_types/execution/rapid-computer-use/contracts.d.ts +320 -0
- package/dist/_types/execution/rapid-computer-use/decision.d.ts +70 -0
- package/dist/_types/execution/rapid-computer-use/desktop-verification.d.ts +23 -0
- package/dist/_types/execution/rapid-computer-use/geometry.d.ts +57 -0
- package/dist/_types/execution/rapid-computer-use/planner.d.ts +78 -0
- package/dist/_types/execution/rapid-computer-use/trace.d.ts +80 -0
- package/dist/_types/execution/rapid-computer-use/visual.d.ts +48 -0
- package/dist/_types/execution/shell-runs.d.ts +78 -0
- package/dist/_types/execution/streamed-web-source.d.ts +64 -0
- package/dist/_types/execution/tools/browser-page-fallback.d.ts +25 -0
- package/dist/_types/execution/tools/network-egress-policy.d.ts +30 -0
- package/dist/_types/execution/tools/pdf-native-tables.d.ts +46 -0
- package/dist/_types/execution/tools/todo-store.d.ts +133 -0
- package/dist/_types/execution/tools/web-fetch.d.ts +57 -0
- package/dist/_types/execution/tools/workboard.d.ts +1223 -0
- package/dist/_types/execution/types.d.ts +549 -0
- package/dist/_types/execution/web-source.d.ts +14 -0
- package/dist/_types/memory/artifactReviewSourceIndex.d.ts +133 -0
- package/dist/_types/memory/contextMemoryLedger.d.ts +213 -0
- package/dist/_types/memory/db.d.ts +12 -0
- package/dist/_types/memory/embeddings.d.ts +36 -0
- package/dist/_types/memory/immutableEvidenceStore.d.ts +165 -0
- package/dist/_types/memory/memoryIngestion.d.ts +65 -0
- package/dist/_types/memory/memoryTypes.d.ts +312 -0
- package/dist/_types/memory/sourceCorpusStore.d.ts +331 -0
- package/dist/_types/memory/structuredMemoryStore.d.ts +105 -0
- package/dist/_types/memory/unifiedMemoryStore.d.ts +127 -0
- package/dist/_types/memory/virtualMemory.d.ts +187 -0
- package/dist/_types/orchestrator/agentic-page-content-receipt.d.ts +20 -0
- package/dist/_types/orchestrator/agentic-web-fetch-receipt.d.ts +20 -0
- package/dist/_types/orchestrator/agenticRunner.d.ts +5219 -0
- package/dist/_types/orchestrator/app-state.d.ts +171 -0
- package/dist/_types/orchestrator/artifactClaimCritic.d.ts +63 -0
- package/dist/_types/orchestrator/artifactQuality.d.ts +15 -0
- package/dist/_types/orchestrator/artifactSemanticIntegrity.d.ts +203 -0
- package/dist/_types/orchestrator/canonical-context-projection.d.ts +254 -0
- package/dist/_types/orchestrator/canonical-source-body-projection.d.ts +51 -0
- package/dist/_types/orchestrator/completion-review-pending.d.ts +24 -0
- package/dist/_types/orchestrator/completionContract.d.ts +103 -0
- package/dist/_types/orchestrator/completionFinalization.d.ts +224 -0
- package/dist/_types/orchestrator/completionLedger.d.ts +429 -0
- package/dist/_types/orchestrator/completionReadiness.d.ts +234 -0
- package/dist/_types/orchestrator/context-admission.d.ts +93 -0
- package/dist/_types/orchestrator/context-dump-retention.d.ts +25 -0
- package/dist/_types/orchestrator/context-fabric.d.ts +133 -0
- package/dist/_types/orchestrator/contextEngine.d.ts +68 -0
- package/dist/_types/orchestrator/contextWindowDump.d.ts +327 -0
- package/dist/_types/orchestrator/convergence-breaker.d.ts +225 -0
- package/dist/_types/orchestrator/convergence-progress.d.ts +66 -0
- package/dist/_types/orchestrator/deliveryCoverage.d.ts +181 -0
- package/dist/_types/orchestrator/document-persistence-goal-binding.d.ts +106 -0
- package/dist/_types/orchestrator/durable-document-worker.d.ts +85 -0
- package/dist/_types/orchestrator/evidenceBranch.d.ts +291 -0
- package/dist/_types/orchestrator/expected-inference-response.d.ts +55 -0
- package/dist/_types/orchestrator/expectedOutcomeContract.d.ts +58 -0
- package/dist/_types/orchestrator/failure-taxonomy.d.ts +36 -0
- package/dist/_types/orchestrator/focusSupervisor.d.ts +436 -0
- package/dist/_types/orchestrator/forced-update-requirement-recovery.d.ts +105 -0
- package/dist/_types/orchestrator/hooks.d.ts +100 -0
- package/dist/_types/orchestrator/inference-pressure.d.ts +61 -0
- package/dist/_types/orchestrator/integrationClosure.d.ts +89 -0
- package/dist/_types/orchestrator/interruption-lifecycle.d.ts +154 -0
- package/dist/_types/orchestrator/live-memory-passages.d.ts +51 -0
- package/dist/_types/orchestrator/liveVirtualContext.d.ts +84 -0
- package/dist/_types/orchestrator/memory-compiler.d.ts +254 -0
- package/dist/_types/orchestrator/memory-consolidation.d.ts +134 -0
- package/dist/_types/orchestrator/model-router.d.ts +17 -0
- package/dist/_types/orchestrator/modelResponseDiagnostics.d.ts +71 -0
- package/dist/_types/orchestrator/nativeRequirementAmendment.d.ts +63 -0
- package/dist/_types/orchestrator/nol/coordinator.d.ts +204 -0
- package/dist/_types/orchestrator/nol/datasets.d.ts +58 -0
- package/dist/_types/orchestrator/nol/discovery.d.ts +286 -0
- package/dist/_types/orchestrator/nol/evaluation.d.ts +59 -0
- package/dist/_types/orchestrator/nol/model-validation.d.ts +198 -0
- package/dist/_types/orchestrator/nol/statistics.d.ts +142 -0
- package/dist/_types/orchestrator/nol/store.d.ts +133 -0
- package/dist/_types/orchestrator/nol/variant-registry.d.ts +292 -0
- package/dist/_types/orchestrator/ollama-context-policy.d.ts +34 -0
- package/dist/_types/orchestrator/personality.d.ts +66 -0
- package/dist/_types/orchestrator/prompt-cache.d.ts +24 -0
- package/dist/_types/orchestrator/remote-inference-fallback.d.ts +224 -0
- package/dist/_types/orchestrator/remote-inference-policy.d.ts +58 -0
- package/dist/_types/orchestrator/request-budget.d.ts +75 -0
- package/dist/_types/orchestrator/requirementCoverage.d.ts +69 -0
- package/dist/_types/orchestrator/reviewedInterpretation.d.ts +111 -0
- package/dist/_types/orchestrator/runEvents.d.ts +115 -0
- package/dist/_types/orchestrator/runtime-rollout.d.ts +63 -0
- package/dist/_types/orchestrator/semanticVerification.d.ts +135 -0
- package/dist/_types/orchestrator/source-wide-extraction.d.ts +202 -0
- package/dist/_types/orchestrator/steeringIntake.d.ts +123 -0
- package/dist/_types/orchestrator/structured-memory-extraction-worker.d.ts +89 -0
- package/dist/_types/orchestrator/structuredMemoryInference.d.ts +62 -0
- package/dist/_types/orchestrator/successful-procedure-memory.d.ts +127 -0
- package/dist/_types/orchestrator/supportedAnswer.d.ts +68 -0
- package/dist/_types/orchestrator/taskEffectEvidence.d.ts +38 -0
- package/dist/_types/orchestrator/taskExecutionSnapshot.d.ts +67 -0
- package/dist/_types/orchestrator/taskObjective.d.ts +310 -0
- package/dist/_types/orchestrator/taskObjectiveContinuation.d.ts +134 -0
- package/dist/_types/orchestrator/taskRequirementReview.d.ts +246 -0
- package/dist/_types/orchestrator/taskRequirements.d.ts +80 -0
- package/dist/_types/orchestrator/taskSemanticAdmission.d.ts +159 -0
- package/dist/_types/orchestrator/taskWorkDelegation.d.ts +147 -0
- package/dist/_types/orchestrator/taskWorkPlan.d.ts +177 -0
- package/dist/_types/orchestrator/telegram-passive-history.d.ts +42 -0
- package/dist/_types/orchestrator/terminalTaskReport.d.ts +91 -0
- package/dist/_types/orchestrator/todoObservability.d.ts +147 -0
- package/dist/_types/orchestrator/tool-exposure-policy.d.ts +100 -0
- package/dist/_types/orchestrator/trajectory-checkpoint.d.ts +159 -0
- package/dist/_types/orchestrator/types.d.ts +185 -0
- package/dist/_types/schemas/dispatch.d.ts +53 -0
- package/dist/_types/schemas/feature-workflow.d.ts +362 -0
- package/dist/_types/schemas/messages.d.ts +15 -0
- package/dist/_types/schemas/nol-assets.d.ts +955 -0
- package/dist/_types/schemas/nol-json.d.ts +2 -0
- package/dist/_types/schemas/nol.d.ts +3995 -0
- package/dist/_types/schemas/patch.d.ts +47 -0
- package/dist/_types/schemas/plan.d.ts +47 -0
- package/dist/_types/schemas/repoProfile.d.ts +116 -0
- package/dist/_types/schemas/retrieval.d.ts +44 -0
- package/dist/_types/schemas/task.d.ts +57 -0
- package/dist/_types/schemas/tools.d.ts +16 -0
- package/dist/_types/schemas/verification.d.ts +31 -0
- package/dist/api/py-embed.js +3353 -1829
- package/dist/assets/nol-checkpoint-editor.py +701 -0
- package/dist/assets/nol-gguf-checkpoint-editor.py +785 -0
- package/dist/assets/nol-gguf-control-reader.py +428 -0
- package/dist/assets/nol-gne-tools-worker.py +425 -0
- package/dist/assets/nol-gne-worker.py +1081 -0
- package/dist/assets/nol-lora-exporter.py +349 -0
- package/dist/assets/nol-pytorch-control-reader.py +470 -0
- package/dist/assets/nol-transformers-nnsight-worker.py +512 -0
- package/dist/assets/nol-transformers-peft-validation-worker.py +385 -0
- package/dist/assets/nol-transformers-peft-worker.py +488 -0
- package/dist/assets/nol-transformers-research-worker.py +472 -0
- package/dist/assets/nol-transformers-worker.py +920 -0
- package/dist/assets/nol-vllm-owned-worker.py +803 -0
- package/dist/assets/nol-vllm-runtime.py +695 -0
- package/dist/assets/nol-vllm-tokenizer.py +93 -0
- package/dist/assets/nol-vllm-worker.py +201 -0
- package/dist/computer-use/configured-planner.d.ts +37 -0
- package/dist/computer-use/configured-point.d.ts +35 -0
- package/dist/computer-use/host-session.d.ts +60 -0
- package/dist/computer-use/runner-ui-port.d.ts +37 -0
- package/dist/computer-use/session-review.d.ts +14 -0
- package/dist/computer-use/task-spec.d.ts +84 -0
- package/dist/discovery.d.ts +16 -2
- package/dist/index.js +2 -2
- package/dist/library.d.ts +94 -10
- package/dist/library.js +144003 -87414
- package/dist/memory-maintenance-worker.js +1676 -511
- package/dist/nol/cpu-control-reader-profile.d.ts +93 -0
- package/dist/nol/cpu-control-reader-service.d.ts +87 -0
- package/dist/nol/cuda-lease.d.ts +111 -0
- package/dist/nol/cuda-mutations.d.ts +34 -0
- package/dist/nol/export-runtime-config.d.ts +114 -0
- package/dist/nol/export-service.d.ts +143 -0
- package/dist/nol/facade.d.ts +147 -0
- package/dist/nol/gguf-cpu-control-reader-profile.d.ts +106 -0
- package/dist/nol/gguf-cpu-control-reader-service.d.ts +91 -0
- package/dist/nol/gguf-model-control-verifier.d.ts +120 -0
- package/dist/nol/gguf-parameter-inventory.d.ts +28 -0
- package/dist/nol/gne-adapter.d.ts +134 -0
- package/dist/nol/gne-agent-evaluation.d.ts +84 -0
- package/dist/nol/gne-profile.d.ts +124 -0
- package/dist/nol/gne-tools-profile.d.ts +148 -0
- package/dist/nol/gne-tools-transport.d.ts +194 -0
- package/dist/nol/model-actions.d.ts +662 -0
- package/dist/nol/model-control-verifier.d.ts +135 -0
- package/dist/nol/model-json-scorer.d.ts +13 -0
- package/dist/nol/model-runtime-config.d.ts +830 -0
- package/dist/nol/model-serving.d.ts +130 -0
- package/dist/nol/model-subject-adapter.d.ts +72 -0
- package/dist/nol/model-validation-factory.d.ts +113 -0
- package/dist/nol/neuronary-catalog.d.ts +130 -0
- package/dist/nol/orphan-custody.d.ts +72 -0
- package/dist/nol/peft-conformance.d.ts +48 -0
- package/dist/nol/peft-control-types.d.ts +137 -0
- package/dist/nol/peft-control-verifier.d.ts +8 -0
- package/dist/nol/peft-model-actions.d.ts +41 -0
- package/dist/nol/peft-model-authority.d.ts +146 -0
- package/dist/nol/peft-model-controls.d.ts +20 -0
- package/dist/nol/peft-model-host.d.ts +47 -0
- package/dist/nol/peft-model-profile.d.ts +161 -0
- package/dist/nol/peft-model-runtime-config.d.ts +174 -0
- package/dist/nol/peft-model-subject-adapter.d.ts +36 -0
- package/dist/nol/peft-validation.d.ts +105 -0
- package/dist/nol/persistent-parameter-inventory.d.ts +32 -0
- package/dist/nol/runtime.d.ts +100 -0
- package/dist/nol/sqlite-store.d.ts +80 -0
- package/dist/nol/transformers-adapter.d.ts +119 -0
- package/dist/nol/transformers-nnsight.d.ts +87 -0
- package/dist/nol/transformers-peft.d.ts +107 -0
- package/dist/nol/transformers-research.d.ts +114 -0
- package/dist/nol/variant-service.d.ts +143 -0
- package/dist/nol/variant-store.d.ts +51 -0
- package/dist/nol/vllm-actions.d.ts +774 -0
- package/dist/nol/vllm-adapter.d.ts +1473 -0
- package/dist/nol/vllm-authority.d.ts +55 -0
- package/dist/nol/vllm-conformance.d.ts +662 -0
- package/dist/nol/vllm-profile.d.ts +850 -0
- package/dist/nol/vllm-protocol.d.ts +1505 -0
- package/dist/nol/vllm-runtime-config.d.ts +120 -0
- package/dist/nol/vllm-runtime.d.ts +34 -0
- package/dist/nol/vllm-startup.d.ts +235 -0
- package/dist/omni-setup-worker.js +3433 -1909
- package/dist/service-version.d.ts +0 -1
- package/dist/tui/async-process.d.ts +27 -0
- package/dist/tui/native/worker.js +3 -1
- package/dist/tui/telegram-action-session-registry.d.ts +136 -0
- package/dist/tui/telegram-cognition-queue.d.ts +154 -0
- package/dist/tui/telegram-context-packet-v2.d.ts +99 -0
- package/dist/tui/telegram-input-ownership.d.ts +78 -0
- package/dist/tui/telegram-turn-contract-v2.d.ts +62 -0
- package/dist/update-worker-runtime.js +4216 -2603
- package/docs/DISCOVERY.json +389 -0
- package/docs/DISCOVERY.md +4 -0
- package/npm-shrinkwrap.json +28 -12
- package/package.json +3 -2
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Independent CPU tokenizer port for the reviewed native harness only.
|
|
3
|
+
|
|
4
|
+
No framework import occurs on module import. Execution loads a local tokenizer,
|
|
5
|
+
never a model, with CUDA hidden and offline operation. Input/output are bounded
|
|
6
|
+
plain JSON; this is not an executable trace, pickle or general RPC endpoint.
|
|
7
|
+
"""
|
|
8
|
+
import hashlib
|
|
9
|
+
import importlib.util
|
|
10
|
+
import json
|
|
11
|
+
import os
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
import stat
|
|
14
|
+
import sys
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def require(value, message):
|
|
18
|
+
if not value: raise ValueError(message)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def main():
|
|
22
|
+
require(sys.flags.isolated and sys.flags.dont_write_bytecode and os.environ.get("CUDA_VISIBLE_DEVICES") == "-1", "Explicit isolated CPU tokenizer process required")
|
|
23
|
+
raw = sys.stdin.buffer.read(2 * 1048576 + 1)
|
|
24
|
+
require(len(raw) <= 2 * 1048576, "Tokenizer input bound exceeded")
|
|
25
|
+
def pairs(items):
|
|
26
|
+
out = {}
|
|
27
|
+
for key, value in items:
|
|
28
|
+
require(key not in out, "Duplicate tokenizer JSON key")
|
|
29
|
+
out[key] = value
|
|
30
|
+
return out
|
|
31
|
+
value = json.loads(raw.decode("utf8"), object_pairs_hook=pairs, parse_constant=lambda _: (_ for _ in ()).throw(ValueError("Nonfinite tokenizer JSON")))
|
|
32
|
+
expected = {"schema", "runtimePath", "runtimeSha256", "checkpointRoot", "model", "binding", "prompt", "promptArtifact", "maxPromptBytes", "maxInputTokens"}
|
|
33
|
+
require(type(value) is dict and set(value) == expected and value["schema"] == "omnius.nol.vllm-independent-tokenizer-input.v1", "Fixed tokenizer input schema required")
|
|
34
|
+
path = Path(value["runtimePath"])
|
|
35
|
+
require(path.is_absolute() and path.resolve(strict=True) == path and not path.is_symlink() and path.stat().st_size <= 1048576, "Exact bounded runtime source required")
|
|
36
|
+
require(hashlib.sha256(path.read_bytes()).hexdigest() == value["runtimeSha256"], "Tokenizer prompt-parser source differs")
|
|
37
|
+
spec = importlib.util.spec_from_file_location("_nol_independent_prompt_parser", path)
|
|
38
|
+
runtime = importlib.util.module_from_spec(spec); spec.loader.exec_module(runtime)
|
|
39
|
+
runtime.integer(value["maxPromptBytes"], 1, 1048576); runtime.integer(value["maxInputTokens"], 1, 256)
|
|
40
|
+
messages, ref = runtime.parse_prompt({"prompt": value["prompt"], "promptArtifact": value["promptArtifact"]}, value["maxPromptBytes"])
|
|
41
|
+
model, binding = value["model"], value["binding"]
|
|
42
|
+
require(type(model) is dict and type(binding) is dict and binding.get("backend") == "vllm" and model.get("modelDigest") == binding.get("modelDigest") and model.get("tokenizerDigest") == binding.get("tokenizerDigest") and model.get("chatTemplateDigest") == binding.get("chatTemplateDigest"), "Full exact tokenizer/model binding required")
|
|
43
|
+
root = Path(value["checkpointRoot"])
|
|
44
|
+
require(root.is_absolute() and root.resolve(strict=True) == root and root.is_dir() and not root.is_symlink(), "Canonical tokenizer checkpoint root required")
|
|
45
|
+
require(type(model.get("files")) is list and 1 <= len(model["files"]) <= 4096, "Bounded complete source inventory required")
|
|
46
|
+
total, names, tokenizers = 0, set(), []
|
|
47
|
+
for entry in model["files"]:
|
|
48
|
+
require(type(entry) is dict and set(entry) == {"path", "role", "artifact"}, "Fixed source file ref required")
|
|
49
|
+
name, artifact = entry["path"], entry["artifact"]
|
|
50
|
+
require(type(name) is str and len(name) <= 1024 and "\\" not in name and not name.startswith("/") and all(part not in ("", ".", "..") for part in name.split("/")) and name not in names, "Normalized distinct tokenizer source paths required")
|
|
51
|
+
names.add(name)
|
|
52
|
+
if entry["role"] == "weights":
|
|
53
|
+
require(name.endswith(".safetensors"), "Unknown source weight layout")
|
|
54
|
+
continue
|
|
55
|
+
require(type(artifact) is dict and set(artifact) == {"uri", "sha256", "sizeBytes", "mediaType"} and artifact["uri"] == "omnius-artifact://sha256/" + artifact["sha256"], "Full source artifact required")
|
|
56
|
+
runtime.integer(artifact["sizeBytes"], 0, 16 * 1048576)
|
|
57
|
+
total += artifact["sizeBytes"]; require(total <= 32 * 1048576, "Nonweight tokenizer inventory exceeds CPU budget")
|
|
58
|
+
local = root / name
|
|
59
|
+
require(local.resolve(strict=True) == local and local.is_file() and not local.is_symlink(), "Tokenizer source escaped the exact checkpoint")
|
|
60
|
+
fd = os.open(local, os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK)
|
|
61
|
+
try:
|
|
62
|
+
before = os.fstat(fd); require(stat.S_ISREG(before.st_mode) and before.st_size == artifact["sizeBytes"], "Source file extent/type differs")
|
|
63
|
+
digest, consumed = hashlib.sha256(), 0
|
|
64
|
+
while True:
|
|
65
|
+
block = os.read(fd, min(1048576, artifact["sizeBytes"] - consumed + 1))
|
|
66
|
+
if not block: break
|
|
67
|
+
consumed += len(block); require(consumed <= artifact["sizeBytes"], "Tokenizer source grew")
|
|
68
|
+
digest.update(block)
|
|
69
|
+
after = os.fstat(fd)
|
|
70
|
+
require(consumed == artifact["sizeBytes"] and digest.hexdigest() == artifact["sha256"] and (before.st_ino, before.st_size, before.st_mtime_ns, before.st_ctime_ns) == (after.st_ino, after.st_size, after.st_mtime_ns, after.st_ctime_ns), "Tokenizer source bytes changed")
|
|
71
|
+
finally: os.close(fd)
|
|
72
|
+
if entry["role"] == "tokenizer": tokenizers.append({"path": name, "sha256": artifact["sha256"], "sizeBytes": artifact["sizeBytes"]})
|
|
73
|
+
require({"config.json", "tokenizer.json", "tokenizer_config.json", "chat_template.jinja"} <= names and runtime.sha(runtime.canonical(tokenizers).encode()) == binding["tokenizerDigest"], "Tokenizer source inventory digest differs")
|
|
74
|
+
require(os.environ.get("HF_HUB_OFFLINE") == "1" and os.environ.get("TRANSFORMERS_OFFLINE") == "1", "Offline tokenizer load required")
|
|
75
|
+
wire = os.fdopen(os.dup(1), "wb", buffering=0); os.dup2(2, 1); sys.stdout = sys.stderr
|
|
76
|
+
from transformers import AutoTokenizer
|
|
77
|
+
tokenizer = AutoTokenizer.from_pretrained(str(root), local_files_only=True, trust_remote_code=False, use_fast=True)
|
|
78
|
+
require(getattr(tokenizer, "is_fast", False) and type(tokenizer.chat_template) is str and runtime.sha(tokenizer.chat_template.encode()) == binding["chatTemplateDigest"], "Exact source-native fast tokenizer/template required")
|
|
79
|
+
rendered = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
|
|
80
|
+
require(type(rendered) is str and len(rendered.encode()) <= value["maxPromptBytes"], "Independent rendered prompt exceeds bound")
|
|
81
|
+
ids = runtime.token_ids(tokenizer.encode(rendered, add_special_tokens=False), value["maxInputTokens"])
|
|
82
|
+
same_ids = runtime.token_ids(tokenizer.apply_chat_template(messages, tokenize=True, return_dict=False, add_generation_prompt=True, enable_thinking=False), value["maxInputTokens"])
|
|
83
|
+
require(ids == same_ids, "Independent template/encode paths differ")
|
|
84
|
+
result = {"schema": "omnius.nol.vllm-tokenization.v1", "binding": binding, "promptArtifact": ref, "renderedPrompt": rendered, "renderedSha256": runtime.sha(rendered.encode()), "renderedBytes": len(rendered.encode()), "tokenIds": ids, "promptTokens": len(ids), "thinking": False}
|
|
85
|
+
encoded = runtime.canonical(result).encode(); require(len(encoded) <= 2 * 1048576, "Tokenizer response bound exceeded")
|
|
86
|
+
wire.write(encoded); wire.flush()
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
if __name__ == "__main__":
|
|
90
|
+
try: main()
|
|
91
|
+
except BaseException as error:
|
|
92
|
+
sys.stderr.write("Independent tokenizer rejected: " + type(error).__name__ + "\n")
|
|
93
|
+
sys.exit(1)
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Data-only job-owned vLLM transport with lazy native construction.
|
|
3
|
+
|
|
4
|
+
Import/hello/inspect do not import frameworks or construct a model. Native work
|
|
5
|
+
requires the exact source designation and independent private load/placement
|
|
6
|
+
channels. CPU fixtures do not establish native compatibility or capabilities.
|
|
7
|
+
"""
|
|
8
|
+
import hashlib
|
|
9
|
+
import importlib.util
|
|
10
|
+
import os
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
import struct
|
|
13
|
+
import sys
|
|
14
|
+
|
|
15
|
+
sys.dont_write_bytecode = True
|
|
16
|
+
PROTOCOL = "omnius.nol.worker.v1"
|
|
17
|
+
COMPANION_SHA = "483652ee6df313830a11e3c3cd2a442902724dc854475e4f6459de824e573af8"
|
|
18
|
+
ROOT = Path(__file__).resolve().parent
|
|
19
|
+
COMPANION = ROOT / "nol-vllm-owned-worker.py"
|
|
20
|
+
if COMPANION.is_symlink() or not COMPANION.is_file() or COMPANION.stat().st_size > 1048576 or hashlib.sha256(COMPANION.read_bytes()).hexdigest() != COMPANION_SHA:
|
|
21
|
+
raise RuntimeError("Owned vLLM companion source changed")
|
|
22
|
+
spec = importlib.util.spec_from_file_location("_nol_vllm_owned_worker", COMPANION)
|
|
23
|
+
owned = importlib.util.module_from_spec(spec)
|
|
24
|
+
sys.modules[spec.name] = owned
|
|
25
|
+
spec.loader.exec_module(owned)
|
|
26
|
+
runtime = owned.runtime_module()
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def sources():
|
|
30
|
+
return {"workerSha256": hashlib.sha256(Path(__file__).read_bytes()).hexdigest(), "companionSha256": COMPANION_SHA, "runtimeSha256": owned.RUNTIME_SHA}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def hello(native=None):
|
|
34
|
+
return {"protocol": PROTOCOL, "workerVersion": owned.VERSION, "pid": os.getpid(), **sources(),
|
|
35
|
+
"loaded": native is not None, "torchImported": "torch" in sys.modules, "vllmImported": "vllm" in sys.modules,
|
|
36
|
+
"nnsightImported": "nnsight" in sys.modules, "nativeConstructed": native is not None,
|
|
37
|
+
"startupActivation": "unavailable_pending_model_specific_native_conformance", "capabilityAuthority": "none"}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def exact(stream, size):
|
|
41
|
+
raw = bytearray()
|
|
42
|
+
while len(raw) < size:
|
|
43
|
+
block = stream.read(size - len(raw))
|
|
44
|
+
if not block:
|
|
45
|
+
owned.require(not raw, "Truncated frame")
|
|
46
|
+
return None
|
|
47
|
+
raw.extend(block)
|
|
48
|
+
return bytes(raw)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _bounded_single_error(error, maximum=2048):
|
|
53
|
+
"""Private diagnostic data only: no locals, source lines, repr or imports."""
|
|
54
|
+
name = type(error).__name__[:96]
|
|
55
|
+
try:
|
|
56
|
+
reason = str(error)
|
|
57
|
+
except BaseException:
|
|
58
|
+
reason = "<message unavailable>"
|
|
59
|
+
frames, trace, visited = [], error.__traceback__, 0
|
|
60
|
+
while trace is not None and visited < 256:
|
|
61
|
+
code = trace.tb_frame.f_code
|
|
62
|
+
filename = code.co_filename.replace("\\", "/").rsplit("/", 1)[-1]
|
|
63
|
+
frame = filename[:96] + ":" + str(trace.tb_lineno) + ":" + code.co_name[:64]
|
|
64
|
+
frames.append("".join(char if char.isprintable() else "?" for char in frame))
|
|
65
|
+
frames = frames[-6:]
|
|
66
|
+
trace, visited = trace.tb_next, visited + 1
|
|
67
|
+
suffix = " | source_frames=" + " <- ".join(frames)[-512:] if frames else ""
|
|
68
|
+
budget = maximum - len(name) - 2 - len(suffix)
|
|
69
|
+
marker = " ...<truncated>... "
|
|
70
|
+
if len(reason) > budget:
|
|
71
|
+
head = (budget - len(marker)) // 2
|
|
72
|
+
reason = reason[:head] + marker + reason[-(budget - len(marker) - head):]
|
|
73
|
+
reason = "".join(char if char.isprintable() else " " for char in reason)
|
|
74
|
+
return name + (": " + reason if reason else "") + suffix
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def bounded_error_message(error):
|
|
78
|
+
"""Preserve explicit primary/cleanup causality without locals or source lines."""
|
|
79
|
+
chain, seen, current = [], set(), error
|
|
80
|
+
while current is not None and id(current) not in seen and len(chain) < 3:
|
|
81
|
+
seen.add(id(current))
|
|
82
|
+
cause = current.__cause__
|
|
83
|
+
relation = "explicit_cause" if cause is not None else "handling_context"
|
|
84
|
+
chain.append((current, relation))
|
|
85
|
+
current = cause if cause is not None else (None if current.__suppress_context__ else current.__context__)
|
|
86
|
+
if len(chain) == 1:
|
|
87
|
+
return _bounded_single_error(error)
|
|
88
|
+
# Read oldest-to-newest: the primary failure remains visible even when
|
|
89
|
+
# strict cleanup raises a second failure. No cause is treated as success.
|
|
90
|
+
chain.reverse()
|
|
91
|
+
labels = ["primary"] + [entry[1] + "_then" for entry in chain[1:]]
|
|
92
|
+
separators = " | caused_by_order | "
|
|
93
|
+
allowance = (2048 - len(separators) * (len(chain) - 1) - sum(len(label) + 2 for label in labels)) // len(chain)
|
|
94
|
+
return separators.join(label + "={" + _bounded_single_error(entry[0], allowance) + "}" for label, entry in zip(labels, chain))[:2048]
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def serve():
|
|
98
|
+
# Preserve the framed channel before redirecting both Python and native
|
|
99
|
+
# library stdout to stderr. Private placement descriptors remain 3/4.
|
|
100
|
+
wire = os.fdopen(os.dup(1), "wb", buffering=0)
|
|
101
|
+
os.dup2(2, 1)
|
|
102
|
+
sys.stdout = sys.stderr
|
|
103
|
+
maximum = int(os.environ.get("OMNIUS_NOL_MAX_FRAME_BYTES", "1048576"))
|
|
104
|
+
owned.integer(maximum, 1, 1048576)
|
|
105
|
+
identity = {"sessionId": os.environ.get("OMNIUS_NOL_WORKER_SESSION"), "jobId": os.environ.get("OMNIUS_NOL_JOB_ID"),
|
|
106
|
+
"ownerId": os.environ.get("OMNIUS_NOL_OWNER_ID"), "generation": int(os.environ.get("OMNIUS_NOL_GENERATION", "0"))}
|
|
107
|
+
owned.require(all(type(identity[key]) is str and 1 <= len(identity[key]) <= 1024 and not any(ord(char) < 32 for char in identity[key]) for key in ("sessionId", "jobId", "ownerId")), "Fixed private worker ownership required")
|
|
108
|
+
owned.integer(identity["generation"], 1, 9007199254740991)
|
|
109
|
+
sequence, native = 0, None
|
|
110
|
+
while True:
|
|
111
|
+
head = exact(sys.stdin.buffer, 4)
|
|
112
|
+
if head is None: return
|
|
113
|
+
size = struct.unpack(">I", head)[0]
|
|
114
|
+
owned.integer(size, 1, maximum)
|
|
115
|
+
raw = exact(sys.stdin.buffer, size)
|
|
116
|
+
owned.require(raw is not None, "Truncated request")
|
|
117
|
+
request = owned.parse_json(raw.decode("utf8"))
|
|
118
|
+
owned.fields(request, ("schema", "kind", "sessionId", "jobId", "ownerId", "generation", "id", "action", "payload"))
|
|
119
|
+
owned.require(request["schema"] == PROTOCOL and request["kind"] == "request" and all(request[key] == value for key, value in identity.items()) and type(request["id"]) is int and request["id"] == sequence + 1,
|
|
120
|
+
"Owned request sequence/scope mismatch", "IDENTITY")
|
|
121
|
+
sequence += 1
|
|
122
|
+
response = {key: request[key] for key in ("schema", "sessionId", "jobId", "ownerId", "generation", "id", "action")}
|
|
123
|
+
response["kind"] = "response"
|
|
124
|
+
close = False
|
|
125
|
+
try:
|
|
126
|
+
action, payload = request["action"], request["payload"]
|
|
127
|
+
if action == "hello":
|
|
128
|
+
owned.fields(payload, ())
|
|
129
|
+
result = hello(native)
|
|
130
|
+
elif action == "inspect":
|
|
131
|
+
owned.fields(payload, (), ("includePinnedSources", "runtimeInventory"))
|
|
132
|
+
owned.require(type(payload.get("includePinnedSources", False)) is bool, "Boolean source-inventory switch required")
|
|
133
|
+
inventory = None
|
|
134
|
+
if "runtimeInventory" in payload:
|
|
135
|
+
request_inventory = payload["runtimeInventory"]
|
|
136
|
+
owned.fields(request_inventory, ("dependencyLockPath", "dependencyLockSha256", "maxRuntimeBytes", "maxRuntimeFiles"))
|
|
137
|
+
inventory = owned.runtime_inventory(request_inventory["dependencyLockPath"], request_inventory["dependencyLockSha256"], request_inventory["maxRuntimeBytes"], request_inventory["maxRuntimeFiles"])
|
|
138
|
+
result = {**hello(), "reviewedSources": owned.source_inventory() if payload.get("includePinnedSources") else None,
|
|
139
|
+
"runtimeBuildComplete": False, "fullNativeInventoryRequiredBeforeFutureLoad": True,
|
|
140
|
+
"runtimeInventory": inventory}
|
|
141
|
+
elif action == "load":
|
|
142
|
+
owned.fields(payload, ("plan", "loadNonce", "descriptor"))
|
|
143
|
+
startup = owned.plan(payload["plan"])
|
|
144
|
+
owned.require(type(payload["loadNonce"]) is str and 1 <= len(payload["loadNonce"]) <= 128, "Bounded fresh load nonce required")
|
|
145
|
+
owned.require(startup["source"] == sources(), "Startup source identity mismatch", "IDENTITY")
|
|
146
|
+
if owned.NATIVE_RUNTIME_DESIGNATION is None:
|
|
147
|
+
raise owned.Rejected("Native startup activation awaits separate model-specific conformance; no framework imported or constructor called", "UNSUPPORTED")
|
|
148
|
+
owned.require(native is None, "Native load replay", "CUSTODY")
|
|
149
|
+
channel = owned.PrivatePlacement({**identity, "loadNonce": payload["loadNonce"]}, startup)
|
|
150
|
+
channel.await_grant("authorize_load")
|
|
151
|
+
controller = owned.Admission(startup); controller.begin_load()
|
|
152
|
+
native = runtime.create_designated_engine(owned, controller, channel, payload["descriptor"])
|
|
153
|
+
result = native["startupObservation"]
|
|
154
|
+
elif action in ("generate", "profile", "tokenize"):
|
|
155
|
+
if native is None: raise owned.Rejected("Native work unavailable before designated private load", "UNSUPPORTED", False)
|
|
156
|
+
if action == "tokenize": result = native["runtime"].tokenize(payload)
|
|
157
|
+
elif action == "generate": result = native["runtime"].generate(payload)
|
|
158
|
+
else:
|
|
159
|
+
owned.fields(payload, ("generation", "captureSiteId"))
|
|
160
|
+
owned.require(native["policy"]["purpose"] == "conformance" and payload["captureSiteId"] in native["policy"]["captureSiteIds"], "Unissued capture policy", "CUSTODY")
|
|
161
|
+
bridge = native["bridge"]; bridge.capture_site = payload["captureSiteId"]
|
|
162
|
+
output = native["runtime"].generate(payload["generation"])
|
|
163
|
+
capture = bridge.capture(output["native"]["requestId"], output["native"]["recipeDigest"], output["promptTokenIds"], output["native"]["operations"])
|
|
164
|
+
path = native["workRoot"] / ("capture-" + output["native"]["requestId"] + ".bin")
|
|
165
|
+
fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o600)
|
|
166
|
+
try:
|
|
167
|
+
block = memoryview(capture)
|
|
168
|
+
while block:
|
|
169
|
+
count = os.write(fd, block); owned.require(count > 0, "Capture write failed"); block = block[count:]
|
|
170
|
+
os.fsync(fd)
|
|
171
|
+
finally: os.close(fd)
|
|
172
|
+
bridge.capture_site = None
|
|
173
|
+
result = {"output": output, "capture": {"path": str(path), "sha256": hashlib.sha256(capture).hexdigest(), "sizeBytes": len(capture), "mediaType": "application/x-omnius-vllm-capture"}}
|
|
174
|
+
elif action == "confirm_placement":
|
|
175
|
+
raise owned.Rejected("Placement grants require private host descriptor channel", "UNSUPPORTED", False)
|
|
176
|
+
elif action == "reset":
|
|
177
|
+
owned.fields(payload, ())
|
|
178
|
+
result = native["runtime"].reset() if native is not None else {"loaded": False, "retainedCache": False, "nativeConstructed": False, "capabilityAuthority": "none"}
|
|
179
|
+
elif action == "close":
|
|
180
|
+
owned.fields(payload, ())
|
|
181
|
+
result, close = {"closed": True, "allocationReleaseRequiresHostVerification": True}, True
|
|
182
|
+
else:
|
|
183
|
+
raise owned.Rejected("Unknown worker action", "UNSUPPORTED", False)
|
|
184
|
+
response["result"] = result
|
|
185
|
+
except (owned.Rejected, runtime.Rejected) as error:
|
|
186
|
+
close = error.fatal or request["action"] == "load"
|
|
187
|
+
response["error"] = {"code": error.code, "message": bounded_error_message(error), "fatal": close}
|
|
188
|
+
except BaseException as error:
|
|
189
|
+
response["error"] = {"code": "RUNTIME_FAILURE", "message": bounded_error_message(error), "fatal": True}
|
|
190
|
+
close = True
|
|
191
|
+
body = owned.canonical(response).encode()
|
|
192
|
+
owned.require(len(body) <= maximum, "Response exceeds frame budget", "CAPACITY")
|
|
193
|
+
wire.write(struct.pack(">I", len(body)) + body); wire.flush()
|
|
194
|
+
if close: return
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
if __name__ == "__main__":
|
|
198
|
+
try: serve()
|
|
199
|
+
except BaseException as error:
|
|
200
|
+
sys.stderr.write("NOL vLLM worker retired: " + type(error).__name__ + "\n")
|
|
201
|
+
sys.exit(1)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type UiPlanRejectionCode } from "../_types/execution/rapid-computer-use/planner.js";
|
|
2
|
+
import { type AgenticBackend } from "../_types/orchestrator/agenticRunner.js";
|
|
3
|
+
import type { HostUiActionGrant, HostUiModelProfile } from "./task-spec.js";
|
|
4
|
+
export type AssertHostUiModelReady = (profile: Readonly<HostUiModelProfile>, signal: AbortSignal) => void | Promise<void>;
|
|
5
|
+
export interface HostUiPlannerReceipt {
|
|
6
|
+
schema: "omnius.host-ui-planner-receipt.v1";
|
|
7
|
+
requestId: string;
|
|
8
|
+
profile: Pick<HostUiModelProfile, "endpoint" | "model" | "revision" | "protocol">;
|
|
9
|
+
latencyMs: number;
|
|
10
|
+
promptSha256: string;
|
|
11
|
+
replySha256: string;
|
|
12
|
+
promptBytes: number;
|
|
13
|
+
replyBytes: number;
|
|
14
|
+
/** Syntactic plan validity only; this never grants authority or proves completion. */
|
|
15
|
+
status: "valid_plan" | "rejected";
|
|
16
|
+
rejectionCode?: UiPlanRejectionCode;
|
|
17
|
+
/** Present only when trusted host code opts into capture; may contain personal task data. */
|
|
18
|
+
prompt?: string;
|
|
19
|
+
reply?: string;
|
|
20
|
+
promptTruncated?: boolean;
|
|
21
|
+
replyTruncated?: boolean;
|
|
22
|
+
payloadsRedacted?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface HostUiPlannerDiagnostics {
|
|
25
|
+
onPlannerReceipt?: (receipt: HostUiPlannerReceipt) => void | Promise<void>;
|
|
26
|
+
/** Explicit host-only consent for bounded prompt/reply retention, never read from a task document. */
|
|
27
|
+
capturePlannerPayloads?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** A fully specified host grant is also a finite output alternative; omissions stay exact. */
|
|
30
|
+
export declare function createHostUiPlannerResponseSchema(grants?: readonly HostUiActionGrant[]): Record<string, unknown>;
|
|
31
|
+
/** Fresh backend per call: never borrow or replace a running agent's abort owner. */
|
|
32
|
+
export declare function createConfiguredUiPlannerInfer(profile: HostUiModelProfile, options: {
|
|
33
|
+
assertModelReady: AssertHostUiModelReady;
|
|
34
|
+
assertCurrent: () => void;
|
|
35
|
+
backendFactory?: (profile: HostUiModelProfile) => AgenticBackend;
|
|
36
|
+
allowedActions?: readonly HostUiActionGrant[];
|
|
37
|
+
} & HostUiPlannerDiagnostics): (prompt: string, signal: AbortSignal) => Promise<string>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type CaptureTransform, type GeometryRect } from "../_types/execution/rapid-computer-use/geometry.js";
|
|
2
|
+
import { type UiPointResult, type VisualUiOptions } from "../_types/execution/rapid-computer-use/visual.js";
|
|
3
|
+
import type { AssertHostUiModelReady } from "./configured-planner.js";
|
|
4
|
+
import type { HostUiPointProfile } from "./task-spec.js";
|
|
5
|
+
export interface HostUiPointReceipt {
|
|
6
|
+
schema: "omnius.host-ui-point-receipt.v1";
|
|
7
|
+
requestId: string;
|
|
8
|
+
profile: Pick<HostUiPointProfile, "endpoint" | "model" | "revision">;
|
|
9
|
+
captureSha256: string;
|
|
10
|
+
captureBytes: number;
|
|
11
|
+
captureBindingSha256: string;
|
|
12
|
+
transform: CaptureTransform;
|
|
13
|
+
liveBounds: GeometryRect;
|
|
14
|
+
querySha256: string;
|
|
15
|
+
requestSha256: string;
|
|
16
|
+
replySha256: string;
|
|
17
|
+
requestBytes: number;
|
|
18
|
+
replyBytes: number;
|
|
19
|
+
replyComplete: boolean;
|
|
20
|
+
requestDispatched: true;
|
|
21
|
+
responseReceived: boolean;
|
|
22
|
+
httpStatus?: number;
|
|
23
|
+
latencyMs: number;
|
|
24
|
+
status: "valid_points" | "rejected";
|
|
25
|
+
rejectionCode?: "transport" | "http" | "invalid_response" | "cancelled" | "timeout" | "postflight";
|
|
26
|
+
/** Model coordinates are candidates, never authority or proof that input occurred. */
|
|
27
|
+
points?: UiPointResult["points"];
|
|
28
|
+
}
|
|
29
|
+
/** Dedicated Photon transport. Host preflight verifies the resident service, never loads it. */
|
|
30
|
+
export declare function createConfiguredUiPoint(profile: HostUiPointProfile, options: {
|
|
31
|
+
assertModelReady: AssertHostUiModelReady;
|
|
32
|
+
assertCurrent?: () => void;
|
|
33
|
+
onPointReceipt?: (receipt: HostUiPointReceipt) => void | Promise<void>;
|
|
34
|
+
fetch?: typeof fetch;
|
|
35
|
+
}): VisualUiOptions["point"];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type DecisionProvider, type UiAdapter, type UiOutcome, type UiSnapshot } from "../_types/execution/rapid-computer-use/contracts.js";
|
|
2
|
+
import { type UiDecisionReceipt } from "../_types/execution/rapid-computer-use/decision.js";
|
|
3
|
+
import { type Tool } from "../_types/execution/types.js";
|
|
4
|
+
import { type UiTraceArchive } from "../_types/execution/rapid-computer-use/trace.js";
|
|
5
|
+
import { type VisualUiOptions } from "../_types/execution/rapid-computer-use/visual.js";
|
|
6
|
+
import { AgenticRunner, type AgenticBackend } from "../_types/orchestrator/agenticRunner.js";
|
|
7
|
+
import { type AssertHostUiModelReady, type HostUiPlannerDiagnostics } from "./configured-planner.js";
|
|
8
|
+
import { type HostUiPhaseReceipt } from "./runner-ui-port.js";
|
|
9
|
+
import { type HostUiTaskSpec } from "./task-spec.js";
|
|
10
|
+
import { type HostUiPointReceipt } from "./configured-point.js";
|
|
11
|
+
import { type HostUiSessionReview, type HostUiReviewResult } from "./session-review.js";
|
|
12
|
+
export * from "./task-spec.js";
|
|
13
|
+
export { createConfiguredUiPlannerInfer } from "./configured-planner.js";
|
|
14
|
+
export type { AssertHostUiModelReady, HostUiPlannerReceipt, HostUiPlannerDiagnostics } from "./configured-planner.js";
|
|
15
|
+
export { createConfiguredUiPoint } from "./configured-point.js";
|
|
16
|
+
export type { HostUiPointReceipt } from "./configured-point.js";
|
|
17
|
+
export type { HostUiSessionReview, HostUiReviewResult } from "./session-review.js";
|
|
18
|
+
export type { UiDecisionReceipt } from "../_types/execution/rapid-computer-use/decision.js";
|
|
19
|
+
export type { HostUiPhaseReceipt } from "./runner-ui-port.js";
|
|
20
|
+
export interface HostUiSessionOptions extends HostUiPlannerDiagnostics {
|
|
21
|
+
workingDirectory: string;
|
|
22
|
+
stateDirectory: string;
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
onProgress?: (text: string) => void | Promise<void>;
|
|
25
|
+
assertModelReady?: AssertHostUiModelReady;
|
|
26
|
+
/** Host injections for fixtures or an already owned semantic/visual surface. */
|
|
27
|
+
tool?: Tool;
|
|
28
|
+
nativeAdapter?: UiAdapter & {
|
|
29
|
+
close?: () => void | Promise<void>;
|
|
30
|
+
};
|
|
31
|
+
visual?: VisualUiOptions;
|
|
32
|
+
onPolicyReceipt?: (receipt: UiDecisionReceipt) => void | Promise<void>;
|
|
33
|
+
onPointReceipt?: (receipt: HostUiPointReceipt) => void | Promise<void>;
|
|
34
|
+
/** Host phase wall times. Execute includes the tool's independent effect verification. */
|
|
35
|
+
onUiPhase?: (receipt: HostUiPhaseReceipt) => void;
|
|
36
|
+
/** Bounded review of a completed task in the session's owned visible browser. */
|
|
37
|
+
review?: HostUiSessionReview;
|
|
38
|
+
plannerBackendFactory?: (profile: import("./task-spec.js").HostUiModelProfile) => AgenticBackend;
|
|
39
|
+
policyProvider?: DecisionProvider;
|
|
40
|
+
verifyGoal?: (state: UiSnapshot, outcomes: readonly UiOutcome[]) => boolean | Promise<boolean>;
|
|
41
|
+
onRunner?: (runner: AgenticRunner) => void;
|
|
42
|
+
}
|
|
43
|
+
export interface HostUiSessionResult {
|
|
44
|
+
status: "complete" | "needs_replan" | "cancelled";
|
|
45
|
+
plans: number;
|
|
46
|
+
outcomes: UiOutcome[];
|
|
47
|
+
reason?: string;
|
|
48
|
+
trace: UiTraceArchive;
|
|
49
|
+
workflow?: {
|
|
50
|
+
id: string;
|
|
51
|
+
revision: string;
|
|
52
|
+
};
|
|
53
|
+
persistenceError?: string;
|
|
54
|
+
cleanupError?: string;
|
|
55
|
+
terminalReceiptId?: string;
|
|
56
|
+
objectiveLedgerPath?: string;
|
|
57
|
+
review?: HostUiReviewResult;
|
|
58
|
+
}
|
|
59
|
+
/** Explicit local session. Construction and fixture mode issue no inference requests. */
|
|
60
|
+
export declare function runConfiguredHostUiSession(input: HostUiTaskSpec, options: HostUiSessionOptions): Promise<HostUiSessionResult>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { UiTraceRecorder } from "../_types/execution/rapid-computer-use/trace.js";
|
|
2
|
+
import { type DecisionProvider, type UiAction, type UiExecutionPort, type UiOutcome, type UiSnapshot, type UiStep } from "../_types/execution/rapid-computer-use/contracts.js";
|
|
3
|
+
import type { HostToolTaskContext } from "../_types/orchestrator/agenticRunner.js";
|
|
4
|
+
import { type HostUiTaskSpec } from "./task-spec.js";
|
|
5
|
+
export interface HostUiPhaseReceipt {
|
|
6
|
+
schema: "omnius.host-ui-phase.v1";
|
|
7
|
+
phase: "observe" | "decide" | "execute_verify";
|
|
8
|
+
elapsedMs: number;
|
|
9
|
+
status: "ok" | "failed" | "cancelled";
|
|
10
|
+
stepId?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Never calls an adapter/controller directly: every effect gets fresh runner admission. */
|
|
13
|
+
export declare class RunnerUiPort implements UiExecutionPort {
|
|
14
|
+
private readonly host;
|
|
15
|
+
private readonly spec;
|
|
16
|
+
private readonly trace;
|
|
17
|
+
private readonly onPhase?;
|
|
18
|
+
readonly outcomes: UiOutcome[];
|
|
19
|
+
private state?;
|
|
20
|
+
private request?;
|
|
21
|
+
private actions;
|
|
22
|
+
private ticket?;
|
|
23
|
+
private started;
|
|
24
|
+
private closed;
|
|
25
|
+
constructor(host: HostToolTaskContext, spec: HostUiTaskSpec, trace?: UiTraceRecorder, onPhase?: ((receipt: HostUiPhaseReceipt) => void) | undefined);
|
|
26
|
+
private signal;
|
|
27
|
+
private timed;
|
|
28
|
+
close(): void;
|
|
29
|
+
private finish;
|
|
30
|
+
private read;
|
|
31
|
+
observe(signal?: AbortSignal): Promise<UiSnapshot>;
|
|
32
|
+
observeForStep(step: UiStep, signal?: AbortSignal): Promise<UiSnapshot>;
|
|
33
|
+
enumerate(step: UiStep, state?: UiSnapshot | undefined): UiAction[];
|
|
34
|
+
execute(id: string, signal?: AbortSignal): Promise<UiOutcome>;
|
|
35
|
+
private executeAdmitted;
|
|
36
|
+
runStep(step: UiStep, provider?: DecisionProvider, signal?: AbortSignal): Promise<UiOutcome>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HostUiSessionResult } from "./host-session.js";
|
|
2
|
+
export interface HostUiSessionReview {
|
|
3
|
+
timeoutMs: number;
|
|
4
|
+
/** Read-only completed result. No execution handle is supplied after completion. */
|
|
5
|
+
run: (result: HostUiSessionResult, signal: AbortSignal) => Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export interface HostUiReviewResult {
|
|
8
|
+
status: "finished" | "cancelled" | "timed_out" | "failed";
|
|
9
|
+
elapsedMs: number;
|
|
10
|
+
reason?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function validateHostUiReview(review: HostUiSessionReview): void;
|
|
13
|
+
/** Post-completion review never advances task state and cannot delay Stop or cleanup. */
|
|
14
|
+
export declare function reviewCompletedHostUiSession(review: HostUiSessionReview, result: HostUiSessionResult, signal?: AbortSignal): Promise<HostUiReviewResult>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type UiArgs, type UiOutcome, type UiPredicate, type UiSnapshot, type UiVerb } from "../_types/execution/rapid-computer-use/contracts.js";
|
|
2
|
+
import { type DecisionFamily } from "../_types/execution/rapid-computer-use/decision.js";
|
|
3
|
+
export interface HostUiModelProfile {
|
|
4
|
+
endpoint: string;
|
|
5
|
+
model: string;
|
|
6
|
+
revision: string;
|
|
7
|
+
protocol?: "ollama" | "openai-chat";
|
|
8
|
+
preflight?: {
|
|
9
|
+
selectionFile: string;
|
|
10
|
+
receiptFile: string;
|
|
11
|
+
approvalFile: string;
|
|
12
|
+
};
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
contextTokens?: number;
|
|
15
|
+
}
|
|
16
|
+
export type HostUiPointProfile = Omit<HostUiModelProfile, "protocol" | "contextTokens"> & {
|
|
17
|
+
kind: "moondream-point";
|
|
18
|
+
};
|
|
19
|
+
export interface HostUiActionGrant {
|
|
20
|
+
verb: UiVerb;
|
|
21
|
+
target: {
|
|
22
|
+
role: string;
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
args?: UiArgs;
|
|
26
|
+
expect?: UiPredicate[];
|
|
27
|
+
}
|
|
28
|
+
export interface HostUiTerminalCheck {
|
|
29
|
+
target?: {
|
|
30
|
+
role: string;
|
|
31
|
+
name: string;
|
|
32
|
+
};
|
|
33
|
+
expect: UiPredicate[];
|
|
34
|
+
}
|
|
35
|
+
export interface HostUiTaskSpec {
|
|
36
|
+
schema: "omnius.host-ui-task.v1";
|
|
37
|
+
goal: string;
|
|
38
|
+
scope: {
|
|
39
|
+
kind: "browser";
|
|
40
|
+
url: string;
|
|
41
|
+
origin: string;
|
|
42
|
+
headless?: boolean;
|
|
43
|
+
} | {
|
|
44
|
+
kind: "native";
|
|
45
|
+
app: string;
|
|
46
|
+
};
|
|
47
|
+
allowedActions: HostUiActionGrant[];
|
|
48
|
+
terminal: HostUiTerminalCheck[];
|
|
49
|
+
planner: {
|
|
50
|
+
kind: "fixture";
|
|
51
|
+
plan: {
|
|
52
|
+
schema: "omnius.ui-plan.v1";
|
|
53
|
+
steps: Array<Omit<import("../_types/execution/rapid-computer-use/contracts.js").UiStep, "id">>;
|
|
54
|
+
};
|
|
55
|
+
} | ({
|
|
56
|
+
kind: "configured";
|
|
57
|
+
} & HostUiModelProfile);
|
|
58
|
+
policy: {
|
|
59
|
+
kind: "rules";
|
|
60
|
+
} | ({
|
|
61
|
+
kind: "system-one";
|
|
62
|
+
family: DecisionFamily;
|
|
63
|
+
} & HostUiModelProfile);
|
|
64
|
+
/** Explicit local vision selection; capture and input remain owned by the browser. */
|
|
65
|
+
visual?: HostUiPointProfile;
|
|
66
|
+
maxActions: number;
|
|
67
|
+
maxReplans: number;
|
|
68
|
+
persistence?: {
|
|
69
|
+
directory: string;
|
|
70
|
+
allowPlaintextPersistence: true;
|
|
71
|
+
workflowId?: string;
|
|
72
|
+
};
|
|
73
|
+
replay?: {
|
|
74
|
+
workflowId: string;
|
|
75
|
+
revision: string;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** A host/operator document; never infer grants, endpoints or completion from planner output. */
|
|
79
|
+
export declare function parseHostUiTaskSpec(input: unknown): HostUiTaskSpec;
|
|
80
|
+
export declare function hostUiScopeMatches(spec: HostUiTaskSpec, state: UiSnapshot): boolean;
|
|
81
|
+
/** Check a planned request before it can trigger a visual observation or inference. */
|
|
82
|
+
export declare function hostUiStepAllowed(spec: HostUiTaskSpec, step: import("../_types/execution/rapid-computer-use/contracts.js").UiStep): boolean;
|
|
83
|
+
export declare function hostUiActionAllowed(spec: HostUiTaskSpec, state: UiSnapshot, action: import("../_types/execution/rapid-computer-use/contracts.js").UiAction): boolean;
|
|
84
|
+
export declare function hostUiGoalSatisfied(spec: HostUiTaskSpec, state: UiSnapshot, outcomes: readonly UiOutcome[]): boolean;
|
package/dist/discovery.d.ts
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
export type DiscoveryKind = "capability" | "layer" | "module" | "workflow" | "runtime" | "store" | "provider" | "tool" | "api" | "command" | "skill" | "guide" | "config" | "operation";
|
|
2
|
-
export declare const DISCOVERY_KINDS: readonly [
|
|
2
|
+
export declare const DISCOVERY_KINDS: readonly [
|
|
3
|
+
"capability",
|
|
4
|
+
"layer",
|
|
5
|
+
"module",
|
|
6
|
+
"workflow",
|
|
7
|
+
"runtime",
|
|
8
|
+
"store",
|
|
9
|
+
"provider",
|
|
10
|
+
"tool",
|
|
11
|
+
"api",
|
|
12
|
+
"command",
|
|
13
|
+
"skill",
|
|
14
|
+
"guide",
|
|
15
|
+
"config",
|
|
16
|
+
"operation"
|
|
17
|
+
];
|
|
3
18
|
export interface DiscoveryInterface {
|
|
4
19
|
type: string;
|
|
5
20
|
target: string;
|
|
@@ -100,4 +115,3 @@ export declare function renderDiscoveryEntry(entry: DiscoveryEntry): string;
|
|
|
100
115
|
export declare function discoveryBootstrap(catalog?: DiscoveryCatalog): DiscoveryBootstrap;
|
|
101
116
|
export declare function discoverySchemaVersion(): string;
|
|
102
117
|
export declare function discoveryDocsRoot(): string | null;
|
|
103
|
-
//# sourceMappingURL=discovery.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/dist/index.js
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 41441939 bytes
|
|
4
|
+
sha256: 9ccdf2b1aa985c0582f0fb208de5807617781ed8080fe2735fbcee050a757e8d
|