@inflexa-ai/harness 0.15.0 → 0.16.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.
Files changed (35) hide show
  1. package/dist/agents/sandbox/drug-repurposing-agent.js +5 -1
  2. package/dist/agents/sandbox/immune-profiling-agent.js +4 -1
  3. package/dist/contracts/chat-events.d.ts +16 -0
  4. package/dist/contracts/message.d.ts +13 -8
  5. package/dist/contracts/schemas/chat-events.d.ts +7 -0
  6. package/dist/contracts/schemas/chat-events.js +2 -0
  7. package/dist/index.d.ts +8 -9
  8. package/dist/index.js +17 -16
  9. package/dist/memory/content-to-cortex.d.ts +12 -11
  10. package/dist/memory/content-to-cortex.js +17 -14
  11. package/dist/memory/conversation-display-backfill.d.ts +25 -0
  12. package/dist/memory/conversation-display-backfill.js +97 -0
  13. package/dist/memory/conversation-display-recorder.d.ts +17 -0
  14. package/dist/memory/conversation-display-recorder.js +156 -0
  15. package/dist/memory/conversation-display-replay.d.ts +19 -0
  16. package/dist/memory/conversation-display-replay.js +39 -0
  17. package/dist/memory/conversation-display-storage.d.ts +86 -0
  18. package/dist/memory/conversation-display-storage.js +168 -0
  19. package/dist/memory/reconstruct-cards.d.ts +7 -1
  20. package/dist/memory/reconstruct-cards.js +5 -1
  21. package/dist/memory/thread-history.d.ts +46 -11
  22. package/dist/memory/thread-history.js +55 -13
  23. package/dist/prompts/sandbox/bulk-transcriptomics-agent.d.ts +1 -1
  24. package/dist/prompts/sandbox/bulk-transcriptomics-agent.js +17 -13
  25. package/dist/prompts/sandbox/chromatin-agent.d.ts +1 -1
  26. package/dist/prompts/sandbox/chromatin-agent.js +45 -54
  27. package/dist/prompts/sandbox/genomic-variant-agent.d.ts +1 -1
  28. package/dist/prompts/sandbox/genomic-variant-agent.js +39 -37
  29. package/dist/prompts/sandbox-standards.d.ts +1 -1
  30. package/dist/prompts/sandbox-standards.js +21 -2
  31. package/dist/reference-data/catalog.js +536 -0
  32. package/dist/runtime/boot.d.ts +8 -2
  33. package/dist/runtime/boot.js +14 -2
  34. package/dist/state/init.js +4 -0
  35. package/package.json +1 -1
@@ -20,11 +20,17 @@
20
20
  * misconfigured pool fails loudly at boot, not under load.
21
21
  * 5. `assembleCoreRuntime(core)` — registers the durable-workflow cohort and
22
22
  * builds the conversation agent (register-before-launch invariant).
23
- * 6. `beforeLaunch()` — embedder hook for host-specific pre-launch work that
23
+ * 6. `backfillConversationDisplayEnvelopes(...)` — validates every stored
24
+ * display envelope and freezes one for each legacy turn that has none, so
25
+ * the runtime read path never meets a row without a display projection.
26
+ * Runs AFTER assembly because migrating a legacy call's one-line detail
27
+ * needs the assembled conversation roster, embedder-contributed tools
28
+ * included; assembly starts no traffic, so this is still before any read.
29
+ * 7. `beforeLaunch()` — embedder hook for host-specific pre-launch work that
24
30
  * must attach before DBOS launch re-emits events (scheduled sweeps, an
25
31
  * legacy-workflow reap, an agent-switch install). Runs after registration
26
32
  * so it may close over the registered callables.
27
- * 7. `launchDbos(...)` — the last registration-dependent step.
33
+ * 8. `launchDbos(...)` — the last registration-dependent step.
28
34
  *
29
35
  * Boot-step errors PROPAGATE (the embedder's composition root catches them and
30
36
  * releases whatever it acquired). Only `shutdown` swallows per-step failures —
@@ -33,6 +39,7 @@
33
39
  import { SANDBOX_AGENT_META } from "../agents/sandbox/index.js";
34
40
  import { validateAgentSkills } from "../agents/sandbox/validate-skills.js";
35
41
  import { initCortexState } from "../state/init.js";
42
+ import { backfillConversationDisplayEnvelopes } from "../memory/conversation-display-backfill.js";
36
43
  import { assembleCoreRuntime } from "./assemble.js";
37
44
  import { assertConnectionBudget } from "./connection-budget.js";
38
45
  import { launchDbos, shutdownDbos } from "./dbos.js";
@@ -47,6 +54,11 @@ export async function bootHarness(deps) {
47
54
  await initCortexState(pool);
48
55
  await assertConnectionBudget({ pool, logger, config: deps.connectionBudget });
49
56
  const runtime = assembleCoreRuntime(core);
57
+ await backfillConversationDisplayEnvelopes({
58
+ pool,
59
+ resolveWorkspaceRoot: core.conversation.resolveWorkspaceRoot,
60
+ tools: runtime.conversationAgent.tools,
61
+ });
50
62
  await deps.beforeLaunch?.();
51
63
  await launchDbos({ config: deps.dbos, logger });
52
64
  logger.named("boot").info("harness booted", { executorId: deps.dbos.executorId });
@@ -255,6 +255,9 @@ CREATE TABLE IF NOT EXISTS messages (
255
255
  role TEXT,
256
256
  content_jsonb JSONB,
257
257
  message_envelope JSON,
258
+ -- Versioned AI SDK UIMessage projection for the whole turn. Present only
259
+ -- on the genuine-user-start row. Model-history reads never select it.
260
+ display_envelope JSONB,
258
261
  tokens INTEGER NOT NULL,
259
262
  reported_usage JSONB,
260
263
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
@@ -475,6 +478,7 @@ export async function initCortexState(pool, injected) {
475
478
  ALTER TABLE messages ALTER COLUMN message_envelope TYPE JSON USING message_envelope::text::json;
476
479
  END IF;
477
480
  END $$`,
481
+ "ALTER TABLE messages ADD COLUMN IF NOT EXISTS display_envelope JSONB",
478
482
  // Grant key an 'always' records the standing grant under. Nullable
479
483
  // and unbackfilled: every new row writes it (command when absent), and
480
484
  // orphaned legacy pending rows are swept to 'expired' before any answer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inflexa-ai/harness",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Host-agnostic bioinformatics agent harness \u2014 hand-rolled agent loop, DBOS-durable workflows, sandboxed compute.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",