@arnilo/prism 0.2.0 → 0.2.2

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 (46) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cache-telemetry.js +4 -1
  3. package/dist/content.d.ts +2 -2
  4. package/dist/content.js +30 -50
  5. package/dist/contracts-core.d.ts +32 -2
  6. package/dist/contracts-core.js +20 -0
  7. package/dist/conversations.d.ts +2 -0
  8. package/dist/conversations.js +1 -0
  9. package/dist/event-multiplexer.d.ts +13 -0
  10. package/dist/event-multiplexer.js +39 -16
  11. package/dist/index.d.ts +5 -3
  12. package/dist/index.js +5 -3
  13. package/dist/oauth-device-code.d.ts +58 -0
  14. package/dist/oauth-device-code.js +119 -0
  15. package/dist/pinned-fetch.d.ts +25 -0
  16. package/dist/pinned-fetch.js +246 -0
  17. package/dist/providers/openai-compatible.d.ts +2 -2
  18. package/dist/providers/openai-compatible.js +2 -2
  19. package/dist/providers/transport.d.ts +14 -1
  20. package/dist/providers/transport.js +43 -0
  21. package/dist/testing/persistence-schema.d.ts +1 -1
  22. package/dist/testing/persistence-schema.js +32 -28
  23. package/dist/testing/state-concurrency-conformance.d.ts +145 -0
  24. package/dist/testing/state-concurrency-conformance.js +348 -0
  25. package/docs/agent-events.md +1 -1
  26. package/docs/conversations.md +5 -2
  27. package/docs/credential-storage.md +1 -0
  28. package/docs/credentials-and-redaction.md +1 -0
  29. package/docs/database-persistence.md +4 -0
  30. package/docs/enterprise-postgres-state.md +4 -3
  31. package/docs/index.md +17 -17
  32. package/docs/mcp-tools.md +1 -1
  33. package/docs/migration.md +83 -0
  34. package/docs/model-routing.md +13 -10
  35. package/docs/multimodal-content.md +1 -0
  36. package/docs/policy-and-audit.md +1 -0
  37. package/docs/provider-caching.md +4 -1
  38. package/docs/provider-primitives.md +17 -0
  39. package/docs/providers/azure.md +1 -1
  40. package/docs/providers/bedrock.md +1 -0
  41. package/docs/providers/openai-compatible.md +4 -3
  42. package/docs/providers/vertex.md +1 -1
  43. package/docs/public-contracts.md +3 -3
  44. package/docs/release-and-install.md +39 -0
  45. package/docs/workflows.md +2 -1
  46. package/package.json +8 -4
package/docs/workflows.md CHANGED
@@ -262,7 +262,8 @@ runRpcServer({
262
262
 
263
263
  - Workflow semantics stay in this optional package; generic checkpoint persistence and bounded event fan-in live in core.
264
264
  - `ProductionPersistenceStore.checkpoints` and `.leases` are optional generic capabilities. First-party SQLite/PostgreSQL adapters own `prism_checkpoints` / `prism_leases`; workflows only adapt them.
265
- - `createWorkflowEventBus()` delegates queueing, source fan-in, overflow, abort, and close behavior to core `createEventMultiplexer()`.
265
+ - `createWorkflowEventBus()` delegates queueing, source fan-in, overflow, abort, and close behavior to core `createEventMultiplexer()`, including its single-consumer contract: a second concurrent `subscribe()` is rejected with `EventMultiplexerError` (`ERR_PRISM_EVENT_MULTIPLEXER_SINGLE_CONSUMER`) instead of silently splitting the stream.
266
+ - The in-process active-run registry (`registerActiveWorkflowRun` / `getActiveWorkflowRun` / `abortActiveWorkflowRun`) is **non-durable, in-process only — it does not survive restart**; durable active-run recovery is a later milestone. It is bounded: every register sweeps aborted/leaked entries (runs whose promise never settled) and the registry fails closed at `MAX_ACTIVE_WORKFLOW_RUNS` (512) rather than evicting a live run; `sweepActiveWorkflowRuns()` is available for hosts. Cross-tenant lookups stay ownership-isolated.
266
267
  - `createWorkflowCommands()` is optional; hosts can drive `workflow.start` / `enqueue` / `replay` / `status` / `list` / `cancel` / `resume`. The six `schedule.*` commands appear only when a scoped `schedules` service is supplied.
267
268
  - Hosts may bridge `WorkflowEvent` into OpenTelemetry or custom sinks; there is no built-in TUI.
268
269
  - Agent exclusivity is per session: one active `run()` at a time, same as core.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arnilo/prism",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Agent harness for AI providers, agents, sessions, and tools.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,6 +34,10 @@
34
34
  "types": "./dist/testing/agent-event-source-conformance.d.ts",
35
35
  "default": "./dist/testing/agent-event-source-conformance.js"
36
36
  },
37
+ "./testing/state-concurrency-conformance": {
38
+ "types": "./dist/testing/state-concurrency-conformance.d.ts",
39
+ "default": "./dist/testing/state-concurrency-conformance.js"
40
+ },
37
41
  "./testing/session-store-conformance": {
38
42
  "types": "./dist/testing/session-store-conformance.d.ts",
39
43
  "default": "./dist/testing/session-store-conformance.js"
@@ -143,20 +147,20 @@
143
147
  "build": "npm run build:core && npm run build --workspaces --if-present",
144
148
  "typecheck": "npm run build && npm run typecheck --workspaces --if-present && tsc -p examples --noEmit",
145
149
  "sweep:unused": "node scripts/sweep-unused.mjs",
146
- "test": "npm run build && node --test dist/__tests__/*.test.js && node --test scripts/release-gate.test.mjs scripts/tooling-gate.test.mjs scripts/budget-gate.test.mjs scripts/phase8-conformance.test.mjs scripts/phase9-conformance.test.mjs scripts/phase10-conformance.test.mjs scripts/phase11-conformance.test.mjs scripts/phase11-freeze.test.mjs scripts/phase12-freeze.test.mjs scripts/phase13-freeze.test.mjs scripts/phase14-freeze.test.mjs scripts/phase15-freeze.test.mjs scripts/phase16-freeze.test.mjs scripts/phase17-freeze.test.mjs scripts/phase18-freeze.test.mjs scripts/phase19-freeze.test.mjs scripts/phase20-freeze.test.mjs scripts/benchmark-0.1.0.test.mjs scripts/sweep-unused.test.mjs scripts/e2e-enterprise-journey.test.mjs scripts/e2e-coding-journey.test.mjs && npm run test --workspaces --if-present",
150
+ "test": "npm run build && node --test dist/__tests__/*.test.js && node --test scripts/release-gate.test.mjs scripts/tooling-gate.test.mjs scripts/budget-gate.test.mjs scripts/phase8-conformance.test.mjs scripts/phase9-conformance.test.mjs scripts/phase10-conformance.test.mjs scripts/phase11-conformance.test.mjs scripts/phase11-freeze.test.mjs scripts/phase12-freeze.test.mjs scripts/phase13-freeze.test.mjs scripts/phase14-freeze.test.mjs scripts/phase15-freeze.test.mjs scripts/phase16-freeze.test.mjs scripts/phase17-freeze.test.mjs scripts/phase18-freeze.test.mjs scripts/phase19-freeze.test.mjs scripts/phase20-freeze.test.mjs scripts/phase21-freeze.test.mjs scripts/benchmark-0.1.0.test.mjs scripts/sweep-unused.test.mjs scripts/e2e-enterprise-journey.test.mjs scripts/e2e-coding-journey.test.mjs && npm run test --workspaces --if-present",
147
151
  "test:coverage": "node --test --experimental-test-coverage --test-coverage-lines=60 --test-coverage-functions=70 --test-coverage-branches=75 --test-coverage-exclude='**/__tests__/**' --test-coverage-exclude='**/node_modules/**' --test-coverage-exclude='**/scripts/**' --test-coverage-exclude='**/packages/**' --test-coverage-exclude='**/examples/**' dist/__tests__/*.test.js && node scripts/coverage-summary.mjs",
148
152
  "coverage:summary": "node scripts/coverage-summary.mjs",
149
153
  "lint": "biome lint .",
150
154
  "format": "biome format --write .",
151
155
  "format:check": "biome format .",
152
156
  "pack:dry-run": "npm pack --dry-run && npm run pack:dry-run --workspaces --if-present",
153
- "test:postgres": "node scripts/require-postgres-url.mjs && npm run test:postgres --workspace @arnilo/prism-session-store-postgres && npm run test:postgres --workspace @arnilo/prism-memory && npm run test:postgres --workspace @arnilo/prism-enterprise-postgres && node --test scripts/phase7-conformance.test.mjs scripts/phase12-restart-recovery.test.mjs",
157
+ "test:postgres": "node scripts/require-postgres-url.mjs && npm run test:postgres --workspace @arnilo/prism-session-store-postgres && npm run test:postgres --workspace @arnilo/prism-memory && npm run test:postgres --workspace @arnilo/prism-enterprise-postgres && node --test scripts/phase7-conformance.test.mjs scripts/phase12-restart-recovery.test.mjs scripts/phase22-conformance.test.mjs",
154
158
  "release:dry-run": "npm run sdk:ready",
155
159
  "release:check": "node scripts/release.mjs check",
156
160
  "release:publish": "node scripts/release.mjs publish",
157
161
  "sdk:ready": "npm run typecheck && npm run lint && npm run format:check && npm test && npm run test:coverage && npm run pack:dry-run && npm run release:gate",
158
162
  "release:gate": "node scripts/release.mjs gate",
159
- "security:threat-suites": "node --test scripts/phase8-conformance.test.mjs scripts/phase9-conformance.test.mjs scripts/phase10-conformance.test.mjs scripts/phase11-conformance.test.mjs scripts/phase20-security.test.mjs"
163
+ "security:threat-suites": "node --test scripts/phase8-conformance.test.mjs scripts/phase9-conformance.test.mjs scripts/phase10-conformance.test.mjs scripts/phase11-conformance.test.mjs scripts/phase20-security.test.mjs scripts/phase21-security.test.mjs scripts/phase22-security.test.mjs"
160
164
  },
161
165
  "devDependencies": {
162
166
  "@biomejs/biome": "^2.5.5",