@theoremjs/studio 0.3.2 → 0.3.3

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 (33) hide show
  1. package/package.json +3 -3
  2. package/page/assets/{Banner-BISz3nXA.js → Banner-Buiul23B.js} +2 -2
  3. package/page/assets/{ContextMenu-CBu9H-9H.js → ContextMenu-Dw9_F5b0.js} +2 -2
  4. package/page/assets/{ToolResultCharts-CgshSv9Q.js → ToolResultCharts-CVlI3NkJ.js} +1 -1
  5. package/page/assets/{TraceInspector-_yZiz05W.js → TraceInspector-TusXx3zZ.js} +1 -1
  6. package/page/assets/{TraceOverview-BPO-HIYK.js → TraceOverview-DrHQgMQO.js} +1 -1
  7. package/page/assets/{_virtual_studio-type-sources-ByxqQaOG.js → _virtual_studio-type-sources-BwZOives.js} +39 -11
  8. package/page/assets/browser-engine-BTOR18GA.js +11 -0
  9. package/page/assets/{browser-transport-D-2jDYe7.js → browser-transport-BEFsWdzI.js} +3 -3
  10. package/page/assets/{export-agent-C3yyzXH8.js → export-agent-BnlMWFTv.js} +1 -1
  11. package/page/assets/{guardrail-tester-Gut5xK4a.js → guardrail-tester-DRsOgbwK.js} +1 -1
  12. package/page/assets/{index-CvvmFKgS.js → index-D2T8e_8Q.js} +6 -6
  13. package/page/assets/{live-messages-CnkL4GWi.js → live-messages-BYi31jQk.js} +1 -1
  14. package/page/assets/{reader-BOCCYaRp.js → reader-B0gVhfoZ.js} +1 -1
  15. package/page/assets/{stub-DhdcU_Ew.js → stub-DEZDrr-l.js} +1 -1
  16. package/page/assets/{studio-code-pane-C_SAbcOa.js → studio-code-pane-PndbSO1v.js} +3 -3
  17. package/page/assets/{studio-console-DZwlEsvr.js → studio-console-e6kqu38F.js} +1 -1
  18. package/page/assets/{studio-decision-B0FnCAXA.js → studio-decision-DFM0psog.js} +1 -1
  19. package/page/assets/{studio-embedding-CmA51HVo.js → studio-embedding-4qgdJ4gh.js} +1 -1
  20. package/page/assets/{studio-host-console-By7hqu2l.js → studio-host-console-DajI604W.js} +2 -2
  21. package/page/assets/{studio-live-BrcVQcyV.js → studio-live-B1a0aWbl.js} +1 -1
  22. package/page/assets/{studio-map-B_xSia-z.js → studio-map-CdrEm07d.js} +1 -1
  23. package/page/assets/{studio-type-checker-BOvxudki.js → studio-type-checker-DosSRFbd.js} +1 -1
  24. package/page/assets/tool-schema-BrqSc6vO.js +18 -0
  25. package/page/assets/{tree-DqyAMsbI.js → tree-DeO1319a.js} +1 -1
  26. package/page/assets/{turn-client-Du3Um3Mg.js → turn-client-DwVPS3TX.js} +1 -1
  27. package/page/assets/types-EVrOoUBG.js +1 -0
  28. package/page/assets/{use-one-call-Hcs8YBp1.js → use-one-call-9e3o5vH-.js} +1 -1
  29. package/page/assets/{workspace-DZALqEDX.js → workspace-Ck0o-_fd.js} +1 -1
  30. package/page/index.html +11 -11
  31. package/page/assets/browser-engine-CYq9DQAM.js +0 -9
  32. package/page/assets/tool-schema-idaOe2nI.js +0 -18
  33. package/page/assets/types-BhfXQCLx.js +0 -1
@@ -4763,6 +4763,8 @@ export type { MediaTurnBehaviourSpec, ProfileTurnBehaviourSpec, ProfileTurnResum
4763
4763
  export { AUTO_CONTINUE_DELAY_MS, DEFAULT_ALLOW_CONTINUE, DEFAULT_AUTO_CONTINUE, GenerationStopError, isContinueStopKind, isGenerationStopError, isResumeableStop, isUserCancelledStop, profileAllowsInject, profileAllowsSteering, profileTurnResumption, shouldAutoContinue, turnStopFromClientStreamEnd, turnStopFromInteractionStatus, turnStopFromOpenAiFinishReason, } from './src/kernel/stop.js';
4764
4764
  export { authorizeToolReplay } from './src/kernel/tools/execute.js';
4765
4765
  export { GATE_DECISIONS, type GateDecision } from './src/kernel/tools/gate-answer.js';
4766
+ export type { MemoryToolExecutionOptions } from './src/kernel/tools/memory-execution.js';
4767
+ export { createMemoryToolExecution } from './src/kernel/tools/memory-execution.js';
4766
4768
  export type { CredentialQuery, McpProtocolVersion, McpRpcResponse, ToolRegistry, } from './src/kernel/tools/mod.js';
4767
4769
  export { askUserTool, buildHttpToolTarget, createToolRegistry, credentialPlacement, executeHttpTool, executeMcpTool, formatToolResult, isUnsupportedMcpProtocolError, MCP_PROTOCOL_VERSIONS, parseMcpRpcResponse, prepareTurnToolSnapshot, registerHarnessTools, resolveToolAuth, UncheckedOutput, uncheckedOutput, withCredentialQuery, } from './src/kernel/tools/mod.js';
4768
4770
  export type { BeginToolOperationResult, PageToolDispatch, PageToolExecution, SavedToolInvocation, TerminalToolEvent, ToolExecutionCoordinator, ToolOperationClaim, ToolOperationIdentity, ToolOperationOutcome, ToolOperationUncertainty, } from './src/kernel/tools/operation.js';
@@ -7022,6 +7024,12 @@ export type TurnEvent = {
7022
7024
  injected?: {
7023
7025
  id: string;
7024
7026
  }[];
7027
+ /**
7028
+ * An inject at this stage dropped a draft the user never got: of the reply text since the
7029
+ * turn began or its last \`attempt\`, only the first \`released\` characters stay the reply.
7030
+ * {@linkcode keptReply} drops the rest.
7031
+ */
7032
+ released?: number;
7025
7033
  }
7026
7034
  /**
7027
7035
  * A tool call the model is still writing: the next piece of its arguments' JSON text, in order,
@@ -7102,8 +7110,9 @@ export declare const TURN_EVENT_SCHEMAS: {
7102
7110
  };
7103
7111
  /**
7104
7112
  * \`events\` without the replies a retry threw away: each \`attempt\` drops the text, media and
7105
- * structured output before it, back to the turn's start or its last \`done\`. Tool calls, thoughts
7106
- * and everything else stay, since they happened.
7113
+ * structured output before it, back to the turn's start or its last \`done\`. A \`stage\` event with
7114
+ * \`released\` keeps only that much of the reply's text, and drops what followed it. Tool calls,
7115
+ * thoughts and everything else stay, since they happened.
7107
7116
  */
7108
7117
  export declare function keptReply(events: readonly TurnEvent[]): TurnEvent[];
7109
7118
  `,"file:///node_modules/@theoremjs/agents/src/kernel/schema.d.ts":`import { BLOCKED_REPLY_ON_BLOCK, type BlockedReplyOnBlock } from '../guardrails/types.js';
@@ -7227,7 +7236,7 @@ export declare const AWAITING_USER_INPUT_KINDS: readonly ["confirm", "choice", "
7227
7236
  /** One of {@linkcode AWAITING_USER_INPUT_KINDS}. */
7228
7237
  export type AwaitingUserInputKind = (typeof AWAITING_USER_INPUT_KINDS)[number];
7229
7238
  /** Why a stage handler's result was partly or wholly ignored. */
7230
- export declare const STAGE_APPLY_WARNING_CODES: readonly ["affordance_not_allowed", "inject_not_allowed", "inject_rejected_max_steps", "inject_invalid_messages", "inject_id_invalid", "deny_invalid", "confirm_invalid", "mutate_invalid", "label_failed_invalid", "abort_invalid", "wait_for_invalid", "unknown_field", "result_invalid"];
7239
+ export declare const STAGE_APPLY_WARNING_CODES: readonly ["affordance_not_allowed", "inject_not_allowed", "inject_rejected_max_steps", "inject_invalid_messages", "inject_id_invalid", "inject_released_invalid", "deny_invalid", "confirm_invalid", "mutate_invalid", "label_failed_invalid", "abort_invalid", "wait_for_invalid", "unknown_field", "result_invalid"];
7231
7240
  /** One of {@linkcode STAGE_APPLY_WARNING_CODES}. */
7232
7241
  export type StageApplyWarningCode = (typeof STAGE_APPLY_WARNING_CODES)[number];
7233
7242
  /** The \`status\` of a tool output that asks the user a question. */
@@ -9381,6 +9390,13 @@ export interface StageResult {
9381
9390
  * non-string id refuses the inject whole.
9382
9391
  */
9383
9392
  injectId?: string;
9393
+ /**
9394
+ * With \`inject\`, at \`post_tool\` or \`before_end\`: how many characters of the attempt's reply text,
9395
+ * as the turn gave it, the user already has. The rest is a draft they never got: it leaves the
9396
+ * turn's history and its reply when the inject lands, so the model answers everything afresh
9397
+ * after the part they have. Left out, they have all of it.
9398
+ */
9399
+ released?: number;
9384
9400
  abort?: boolean | {
9385
9401
  reason?: string;
9386
9402
  };
@@ -9431,6 +9447,8 @@ export interface StageApplyInput {
9431
9447
  export interface InjectUnit {
9432
9448
  id?: string;
9433
9449
  messages: TurnHistoryMessage[];
9450
+ /** {@linkcode StageResult.released}: the reply text the user has when this inject lands. */
9451
+ released?: number;
9434
9452
  }
9435
9453
  /** A stage handler's result after validation: the parts the turn will act on. */
9436
9454
  export interface StageApplyOutput {
@@ -9465,16 +9483,18 @@ export type StageEventExtra = {
9465
9483
  injected?: {
9466
9484
  id: string;
9467
9485
  }[];
9486
+ released?: number;
9468
9487
  };
9469
9488
  /** Build a stream \`stage\` event. Unknown extra keys are not copied. */
9470
9489
  export declare function stageEventFields(stage: TurnStage, extra?: Partial<StageEventExtra>): TurnEventOf<'stage'>;
9471
9490
  export declare function injectMessages(units: readonly InjectUnit[]): TurnHistoryMessage[];
9472
9491
  /**
9473
9492
  * The \`stage\` event recording that \`units\` landed, naming the ones the host
9474
- * named; \`undefined\` when none was named. Emit it where the messages land,
9475
- * never before: an inject that never lands is never reported.
9493
+ * named, and the reply text the user has when they dropped a draft (\`released\`);
9494
+ * \`undefined\` when there is neither. Emit it where the messages land, never
9495
+ * before: an inject that never lands is never reported.
9476
9496
  */
9477
- export declare function injectedStageEvent(stage: TurnStage, units: readonly InjectUnit[], extra?: Pick<StageEventExtra, 'callId' | 'toolName'>): TurnEventOf<'stage'> | undefined;
9497
+ export declare function injectedStageEvent(stage: TurnStage, units: readonly InjectUnit[], extra?: Pick<StageEventExtra, 'callId' | 'toolName' | 'released'>): TurnEventOf<'stage'> | undefined;
9478
9498
  export declare function injectWouldExceedMaxSteps(stepCount: number, maxSteps: number | undefined): boolean;
9479
9499
  export interface RunStageArgs extends StageCallBag {
9480
9500
  stage: TurnStage;
@@ -9517,8 +9537,8 @@ export declare function uncheckedOutput(value: unknown): UncheckedOutput;
9517
9537
  `,"file:///node_modules/@theoremjs/agents/src/kernel/tools/operation.d.ts":`import { z } from 'zod';
9518
9538
  import { TheoremError } from '../../guardrails/error.js';
9519
9539
  import { type JsonObject, type JsonValue } from '../json.js';
9540
+ import type { InjectUnit } from '../stages.js';
9520
9541
  import type { GateReference, TurnEventOf } from '../turn-events.js';
9521
- import type { TurnHistoryMessage } from '../types.js';
9522
9542
  import type { ModelToolResult, PageAnswer, ToolFailure } from './types.js';
9523
9543
  export type TerminalToolEvent = TurnEventOf<'tool'> & {
9524
9544
  tool: Extract<TurnEventOf<'tool'>['tool'], {
@@ -9559,10 +9579,7 @@ export interface ToolOperationOutcome {
9559
9579
  aborted?: boolean | {
9560
9580
  reason?: string;
9561
9581
  };
9562
- pendingInject?: {
9563
- id?: string;
9564
- messages: TurnHistoryMessage[];
9565
- }[];
9582
+ pendingInject?: InjectUnit[];
9566
9583
  };
9567
9584
  }
9568
9585
  export type ToolOperationUncertainty = 'execution_interrupted' | 'settlement_write_failed' | 'worker_lost';
@@ -11628,6 +11645,17 @@ declare function hitRules(hits: GuardrailHit[]): string[];
11628
11645
  declare function boundaryNote({ canary, labels, }: Pick<GuardrailContext, 'canary' | 'labels'>): string | undefined;
11629
11646
  export type { EventLeak, LeakScope };
11630
11647
  export { boundaryNote, eventLeak, eventPromptLeakHits, hitRules, isPromptLeakHit, promptEchoHits, promptLeakReason, WITHHELD_REASON, };
11648
+ `,"file:///node_modules/@theoremjs/agents/src/kernel/tools/memory-execution.d.ts":`import { type ToolExecutionCoordinator } from './operation.js';
11649
+ export interface MemoryToolExecutionOptions {
11650
+ /** The most operations it holds. A full coordinator refuses dispatch and keeps what it has. */
11651
+ maxOperations?: number;
11652
+ }
11653
+ /**
11654
+ * A coordinator that keeps claims and outcomes in process memory.
11655
+ * Use one per turn or per process when nothing needs to resume after a restart.
11656
+ * A host that resumes across requests or workers supplies its own \`ToolExecutionCoordinator\`.
11657
+ */
11658
+ export declare function createMemoryToolExecution(options?: MemoryToolExecutionOptions): ToolExecutionCoordinator;
11631
11659
  `,"file:///node_modules/@theoremjs/agents/src/kernel/scope.d.ts":`import type { TraceSink } from '../observability/trace-sink.js';
11632
11660
  import { type RunDecisionOptions } from './engine/decision.js';
11633
11661
  import { type RunEmbeddingOptions } from './engine/embedding.js';