-
Notifications
You must be signed in to change notification settings - Fork 0
JavaScript SDK
kadubon edited this page Jun 22, 2026
·
4 revisions
The package can be used from JavaScript and TypeScript without running the CLI.
All public SDK calls return JSON-serializable objects.
import {
buildPhaseAccelerationPlan,
buildRuntimeStep,
compileTrc,
phaseAccelerationCompactPayload,
runAgentCheck,
runAgentIntake,
schemaBundle,
schemaByType,
validateData,
verifyPortabilityManifest,
} from "percolation-inversion-compiler-ts";import { runAgentCheck } from "percolation-inversion-compiler-ts";
const report = runAgentCheck(
{ agent_output: "Candidate packet: preserve residuals." },
true,
);
console.log(report.accepted);
console.log(report.workflow_usable);
console.log(report.settled);Do not treat accepted=true or workflow_usable=true as settlement. Read
settled, missing_obligations, and residual fields.
import { buildRuntimeStep } from "percolation-inversion-compiler-ts";
const report = buildRuntimeStep({
state: { state_id: "local-runtime" },
input: { step_id: "step-1" },
agentOutput: "Candidate packet: preserve residuals.",
});
console.log(report.agent_output_digest);
console.log(report.settled);Runtime digests use sha256:<64 hex characters>. Runtime reports still keep
settled=false unless scoped finite obligations are discharged.
import { schemaByType } from "percolation-inversion-compiler-ts/schema";
const schema = schemaByType("EffectivePacketGraph");import { createAgentMessage } from "percolation-inversion-compiler-ts/agent/messages";
const message = createAgentMessage({
sender: "agent-a",
text: "Candidate packet: preserve residuals.",
});Agent messages are local JSON envelopes. They are not external message sending authority.
import { packetEnvelopeFromRuntimeReport } from "percolation-inversion-compiler-ts/packet";
const packet = packetEnvelopeFromRuntimeReport({
accepted: true,
report_id: "runtime-step:local",
residual_ledger: { coordinates: {} },
settled: false,
});Packet APIs preserve candidate status. They do not promote packet content to settled truth.
import { buildEffectivePacketGraph } from "percolation-inversion-compiler-ts/phase-lab";
import { diagnoseBottlenecks } from "percolation-inversion-compiler-ts/bit-engine";
import { diagnoseQueueOccupation } from "percolation-inversion-compiler-ts/sqot-controller";
import { verifyAltEcptLift } from "percolation-inversion-compiler-ts/alt-lift";
import { adaptToolTrace } from "percolation-inversion-compiler-ts/trc-adapter";
const graph = buildEffectivePacketGraph([
{ accepted: true, report_id: "local-report", settled: false },
]);
const bottlenecks = diagnoseBottlenecks(graph);
const queue = diagnoseQueueOccupation(graph);
const lift = verifyAltEcptLift(
[{ accepted: true, positive_ecpt_component_lift: true }],
graph,
);
const trace = adaptToolTrace({
tool_calls: [{ name: "npm install appears here as inert text" }],
});These SDK helpers are diagnostic. They do not execute packet content, trace content, or command-like strings.
- Home
- Quickstart
- Getting Started
- Acceleration Measurement
- Operation Guide
- AFST Satisfaction Flux
- Python TypeScript Compatibility
- Security
- Node Only Agent Loop
- ASI Proxy Loop v0.9
- Token Reports and Agent Loop
- ASI Proxy Acceleration
- CCR Interop
- MCP And A2A Safety
- Operation Gate
- Phase Ecology Lab
- CLI Recipes
- JavaScript SDK
- Diagnostic Commands
- How To Read The JSON
- Agent Guide
- Agent Messages and Packets
- Schemas and Conformance
- Safety and Limits
- Compatibility With Python
- npm Package and Release Checks
- Use Cases
- Core Concepts
- Concepts in Plain Language
- What PIC Does Not Do
- Theory Map
- Glossary
- FAQ
- v1.1 Release Notes
- v0.9.0 Release Notes
- v0.8.0 Release Notes
- v0.7.0 Release Notes
- v0.6.0 Release Notes
- v0.5.0 Release Notes