diff --git a/host/js/harness-api-test-bundle.js b/host/js/harness-api-test-bundle.js index f6bbb94..ce41898 100644 --- a/host/js/harness-api-test-bundle.js +++ b/host/js/harness-api-test-bundle.js @@ -32,9 +32,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge mod )); -// host/js/node_modules/partial-json/dist/options.js +// node_modules/partial-json/dist/options.js var require_options = __commonJS({ - "host/js/node_modules/partial-json/dist/options.js"(exports) { + "node_modules/partial-json/dist/options.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Allow = exports.ALL = exports.COLLECTION = exports.ATOM = exports.SPECIAL = exports.INF = exports._INFINITY = exports.INFINITY = exports.NAN = exports.BOOL = exports.NULL = exports.OBJ = exports.ARR = exports.NUM = exports.STR = void 0; @@ -57,9 +57,9 @@ var require_options = __commonJS({ } }); -// host/js/node_modules/partial-json/dist/index.js +// node_modules/partial-json/dist/index.js var require_dist = __commonJS({ - "host/js/node_modules/partial-json/dist/index.js"(exports) { + "node_modules/partial-json/dist/index.js"(exports) { "use strict"; var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) { if (k2 === void 0) k2 = k; @@ -268,7 +268,7 @@ var require_dist = __commonJS({ } }); -// host/js/node_modules/@earendil-works/chord/dist/context/index.js +// node_modules/@earendil-works/chord/dist/context/index.js var context_exports = {}; __export(context_exports, { BACKGROUND_CONTEXT: () => BACKGROUND_CONTEXT, @@ -283,7 +283,7 @@ __export(context_exports, { withoutAbortSignal: () => withoutAbortSignal }); -// host/js/node_modules/@earendil-works/pi-telemetry/dist/metrics.js +// node_modules/@earendil-works/pi-telemetry/dist/metrics.js function createTypedMetrics(metrics, schemas) { const definitions = /* @__PURE__ */ new Map(); for (const schema of schemas) { @@ -297,7 +297,7 @@ function createTypedMetrics(metrics, schemas) { }; } -// host/js/node_modules/@earendil-works/pi-telemetry/dist/noop.js +// node_modules/@earendil-works/pi-telemetry/dist/noop.js async function startNoopSpan(_options, callback) { return callback(noopTelemetrySpan); } @@ -332,7 +332,7 @@ var noopTelemetrySpan = { Object.freeze(noopTelemetrySpan); var NOOP_TELEMETRY_CONTEXT = noopTelemetrySpan; -// host/js/node_modules/@earendil-works/pi-telemetry/dist/index.js +// node_modules/@earendil-works/pi-telemetry/dist/index.js function defineTelemetrySchema(schema) { return schema; } @@ -344,7 +344,7 @@ function createTypedSpanStarter(telemetryContext, _schemas) { return bindTypedSpanStarter(telemetryContext); } -// host/js/node_modules/@earendil-works/chord/dist/context/index.js +// node_modules/@earendil-works/chord/dist/context/index.js var ABORT_SIGNAL_CONTEXT_KEY = Object.freeze({ token: /* @__PURE__ */ Symbol("chord.abortSignal") }); @@ -443,7 +443,7 @@ function abortError(signal) { return reason instanceof Error ? reason : new DOMException("The operation was aborted", "AbortError"); } -// host/js/node_modules/@earendil-works/pi-ai/dist/models.js +// node_modules/@earendil-works/pi-ai/dist/models.js var models_exports = {}; __export(models_exports, { AI_TELEMETRY_SCHEMA: () => AI_TELEMETRY_SCHEMA, @@ -459,7 +459,7 @@ __export(models_exports, { modelsAreEqual: () => modelsAreEqual }); -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js +// node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js var FifoQueue = class { incoming = []; outgoing = []; @@ -570,7 +570,7 @@ function createAssistantMessageEventStream() { return new AssistantMessageEventStream(); } -// host/js/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +// node_modules/@earendil-works/pi-ai/dist/api/lazy.js function createSetupErrorMessage(model2, error, timestamp) { return { role: "assistant", @@ -653,7 +653,7 @@ function lazyApi(load, capabilities) { return api2; } -// host/js/node_modules/@earendil-works/pi-ai/dist/auth/context.js +// node_modules/@earendil-works/pi-ai/dist/auth/context.js var __rewriteRelativeImportExtension = function(path, preserveJsx) { if (typeof path === "string" && /^\.\.?\//.test(path)) { return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { @@ -690,7 +690,7 @@ function defaultProviderAuthContext() { }; } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/abort.js +// node_modules/@earendil-works/pi-ai/dist/utils/abort.js function abortReason(signal) { if (signal.reason !== void 0) return signal.reason; @@ -736,7 +736,7 @@ function raceWithAbortSignal(operation, signal) { }); } -// host/js/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.js +// node_modules/@earendil-works/pi-ai/dist/auth/credential-store.js var InMemoryCredentialStore = class { credentials = /* @__PURE__ */ new Map(); chains = /* @__PURE__ */ new Map(); @@ -784,7 +784,7 @@ var InMemoryCredentialStore = class { } }; -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js +// node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js function formatThrownValue(value2) { if (value2 instanceof Error) return value2.message || value2.name; @@ -810,7 +810,7 @@ function appendAssistantMessageDiagnostic(message, diagnostic) { message.diagnostics = [...message.diagnostics ?? [], diagnostic]; } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/models-error.js +// node_modules/@earendil-works/pi-ai/dist/utils/models-error.js var ModelsError = class extends Error { code; constructor(code, message, options) { @@ -828,7 +828,7 @@ function withCauseDetail(message, cause) { return `${message}: ${detail}`; } -// host/js/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +// node_modules/@earendil-works/pi-ai/dist/auth/resolve.js function resolveProviderAuth(provider2, credentials, authContext, overrides) { const signal = operationSignal(overrides?.signal); return raceWithAbortSignal(resolveProviderAuthWithSignal(provider2, credentials, authContext, overrides, signal), signal); @@ -929,7 +929,7 @@ async function readCredential(credentials, providerId, signal) { } } -// host/js/node_modules/@earendil-works/pi-ai/dist/models-store.js +// node_modules/@earendil-works/pi-ai/dist/models-store.js var InMemoryModelsStore = class { entries = /* @__PURE__ */ new Map(); async read(providerId, options) { @@ -947,7 +947,7 @@ var InMemoryModelsStore = class { } }; -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/text.js +// node_modules/@earendil-works/pi-ai/dist/utils/text.js function contentText(content, separator = "\n") { if (typeof content === "string") return content; @@ -977,7 +977,7 @@ function ownedSlice(text, start, end = text.length) { return `${text.slice(start, end)} `.slice(0, -1); } -// host/js/node_modules/@earendil-works/pi-ai/dist/telemetry.js +// node_modules/@earendil-works/pi-ai/dist/telemetry.js var provider = { type: "string", description: "Provider identifier.", required: true }; var model = { type: "string", description: "Requested model identifier.", required: true }; var stop = { @@ -1165,10 +1165,10 @@ function observeModelRequest(requestedModel, options, poll) { }; } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/version.js +// node_modules/@earendil-works/pi-ai/dist/utils/version.js var PI_AI_VERSION = "1.5.0"; -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/identity.js +// node_modules/@earendil-works/pi-ai/dist/utils/identity.js var PI_ATTRIBUTION = { name: "pi", url: "https://pi.dev", categories: ["cli-agent"] }; var NVIDIA_NIM_HOST = "integrate.api.nvidia.com"; var OPENCODE_HOST = "opencode.ai"; @@ -1292,7 +1292,7 @@ function withClientIdentity(models, identity) { return mutable; } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js +// node_modules/@earendil-works/pi-ai/dist/utils/model-operations.js function getModelType(model2) { return model2.type ?? "chat"; } @@ -1342,7 +1342,7 @@ function classifierErrorResult(model2, error, aborted = false) { }; } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/transcript.js +// node_modules/@earendil-works/pi-ai/dist/utils/transcript.js function createInitialSystemMessage(systemPrompt, tools) { const hasSystemPrompt = systemPrompt !== void 0 && systemPrompt.length > 0; const hasTools = tools !== void 0 && tools.length > 0; @@ -1501,7 +1501,7 @@ function resolveTranscriptTools(messages, support) { return { requestTools: getCurrentTools(systemMessages.slice(0, folded)), foldedSystemMessages: folded }; } -// host/js/node_modules/@earendil-works/pi-ai/dist/models.js +// node_modules/@earendil-works/pi-ai/dist/models.js var KNOWN_MODEL_TYPES = { chat: true, image: true, classifier: true }; function hasKnownModelType(model2) { return Object.hasOwn(KNOWN_MODEL_TYPES, getModelType(model2)); @@ -2168,7 +2168,7 @@ function modelsAreEqual(a, b) { return getModelType(a) === getModelType(b) && a.id === b.id && a.provider === b.provider; } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js +// node_modules/@earendil-works/pi-ai/dist/utils/json-parse.js var import_partial_json = __toESM(require_dist(), 1); var VALID_JSON_ESCAPES = /* @__PURE__ */ new Set(['"', "\\", "/", "b", "f", "n", "r", "t"]); function isControlCharacter(char) { @@ -2285,7 +2285,7 @@ function parseStreamingJson(partialJson) { } } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.js +// node_modules/@earendil-works/pi-ai/dist/utils/streaming-json.js var MAX_REPORTED_DEPTH = 32; var ROOT_SLOT = { kind: "root" }; var CREDIT_PER_APPEND = 256; @@ -2724,7 +2724,7 @@ function setMember(members, key, value2) { } } -// host/js/node_modules/@earendil-works/pi-ai/dist/providers/faux.js +// node_modules/@earendil-works/pi-ai/dist/providers/faux.js var DEFAULT_API = "faux"; var DEFAULT_PROVIDER = "faux"; var DEFAULT_MODEL_ID = "faux-1"; @@ -3199,7 +3199,7 @@ function fauxProvider(options = {}) { }; } -// host/js/node_modules/@earendil-works/pi-durable/dist/index.js +// node_modules/@earendil-works/pi-durable/dist/index.js var dist_exports3 = {}; __export(dist_exports3, { AgentDoc: () => AgentDoc, @@ -3250,7 +3250,7 @@ __export(dist_exports3, { wrapTool: () => wrapTool }); -// host/js/node_modules/@earendil-works/chord/dist/index.js +// node_modules/@earendil-works/chord/dist/index.js var dist_exports2 = {}; __export(dist_exports2, { ChordError: () => ChordError, @@ -3282,7 +3282,7 @@ __export(dist_exports2, { webSocketLink: () => webSocketLink }); -// host/js/node_modules/@earendil-works/pi-schema/dist/index.js +// node_modules/@earendil-works/pi-schema/dist/index.js var dist_exports = {}; __export(dist_exports, { CoercingValidator: () => CoercingValidator, @@ -3307,7 +3307,7 @@ __export(dist_exports, { unknown: () => unknown }); -// host/js/node_modules/@earendil-works/pi-schema/dist/builders.js +// node_modules/@earendil-works/pi-schema/dist/builders.js function str(options = {}) { return { type: "string", ...options }; } @@ -3380,7 +3380,7 @@ function obj(properties, options = {}) { }; } -// host/js/node_modules/@earendil-works/pi-schema/dist/resolver.js +// node_modules/@earendil-works/pi-schema/dist/resolver.js var DEFAULT_BASE = "https://json-schema.invalid/root.json"; var Resolver = class { draft; @@ -3567,7 +3567,7 @@ function documentOf(uri) { return hash < 0 ? uri : uri.slice(0, hash); } -// host/js/node_modules/@earendil-works/pi-schema/dist/shared.js +// node_modules/@earendil-works/pi-schema/dist/shared.js function sharedRegex(source) { const hit = regexes.get(source)?.deref(); if (hit !== void 0) @@ -3588,7 +3588,7 @@ var regexCleanup = new FinalizationRegistry((source) => { regexes.delete(source); }); -// host/js/node_modules/@earendil-works/pi-schema/dist/coerce.js +// node_modules/@earendil-works/pi-schema/dist/coerce.js var Coercer = class { c; schema; @@ -4112,7 +4112,7 @@ function isPlainObject(value2) { return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/checks.js +// node_modules/@earendil-works/pi-schema/dist/checks.js var ALWAYS = () => true; var NEVER = () => false; var IS_STRING = (v) => typeof v === "string"; @@ -4515,7 +4515,7 @@ function deepEqual(a, b) { return true; } -// host/js/node_modules/@earendil-works/pi-schema/dist/annotations.js +// node_modules/@earendil-works/pi-schema/dist/annotations.js function newAnnotations() { return { props: null, allProps: false, items: 0, allItems: false, indexes: null }; } @@ -4692,7 +4692,7 @@ function unevaluatedItems(check2) { }; } -// host/js/node_modules/@earendil-works/pi-schema/dist/compiler.js +// node_modules/@earendil-works/pi-schema/dist/compiler.js var RESTART = /* @__PURE__ */ Symbol("restart"); var Compiler = class { r; @@ -5185,7 +5185,7 @@ function entries(value2) { return isSchemaObject(value2) ? Object.entries(value2) : []; } -// host/js/node_modules/@earendil-works/pi-schema/dist/explain.js +// node_modules/@earendil-works/pi-schema/dist/explain.js var Explainer = class { c; schema; @@ -5547,7 +5547,7 @@ function typeName(v) { return typeof v; } -// host/js/node_modules/@earendil-works/pi-schema/dist/validator.js +// node_modules/@earendil-works/pi-schema/dist/validator.js function compile(schema, options = NO_OPTIONS) { const check2 = compileCheck(schema, options); return options.coerce === true ? new CoercingValidator(schema, options, check2) : new Validator(schema, options, check2); @@ -5608,7 +5608,7 @@ function compiler(schema, options) { } } -// host/js/node_modules/@earendil-works/chord/dist/errors.js +// node_modules/@earendil-works/chord/dist/errors.js var CHORD_ERROR_CODES = [ "aborted", "contract_mismatch", @@ -5661,7 +5661,7 @@ async function runAll(steps, message) { throw new AggregateError(errors, message); } -// host/js/node_modules/@earendil-works/chord/dist/schema.js +// node_modules/@earendil-works/chord/dist/schema.js var asSchema = (schema) => schema !== null && typeof schema === "object" ? schema : schema === false ? { not: {} } : {}; function canonicalJson(value2) { if (value2 === null || typeof value2 !== "object") @@ -6021,7 +6021,7 @@ function functionFits(sub, sup) { return fits(sub.returnType, sup.returnType); } -// host/js/node_modules/@earendil-works/chord/dist/contract.js +// node_modules/@earendil-works/chord/dist/contract.js var MEMBER = /* @__PURE__ */ Symbol("chord.member"); function method(args, result) { return { [MEMBER]: "method", args, result }; @@ -6229,7 +6229,7 @@ function takesNoArgs(contract, name) { return false; } -// host/js/node_modules/@earendil-works/chord/dist/delta/diff.js +// node_modules/@earendil-works/chord/dist/delta/diff.js var DEFAULT_OVERLAP_SCAN = 65536; var MAX_DELTA_OPERATIONS = 4096; var overflowedBatches = /* @__PURE__ */ new WeakSet(); @@ -6650,7 +6650,7 @@ function diffRevisions(before, after2) { return deltaCost >= snapshotCost ? [["r", after2]] : operations; } -// host/js/node_modules/@earendil-works/chord/dist/json.js +// node_modules/@earendil-works/chord/dist/json.js var DATA_DESCRIPTOR = { value: void 0, writable: true, @@ -6766,7 +6766,7 @@ function check(value2, ancestors) { } } -// host/js/node_modules/@earendil-works/chord/dist/delta/apply-immutable-trusted.js +// node_modules/@earendil-works/chord/dist/delta/apply-immutable-trusted.js var DATA_DESCRIPTOR2 = { value: void 0, writable: true, @@ -6888,7 +6888,7 @@ function isContainer2(value2) { return value2 !== null && typeof value2 === "object"; } -// host/js/node_modules/@earendil-works/chord/dist/delta/tracker.js +// node_modules/@earendil-works/chord/dist/delta/tracker.js var NODE = /* @__PURE__ */ Symbol("chord.delta.overlay.node"); var PREPARED = /* @__PURE__ */ new WeakMap(); var RELEASED = {}; @@ -8937,7 +8937,7 @@ function isContainer3(value2) { return value2 !== null && typeof value2 === "object"; } -// host/js/node_modules/@earendil-works/chord/dist/delta/pending.js +// node_modules/@earendil-works/chord/dist/delta/pending.js var MAX_PENDING_OPS = 1e4; var EMPTY = { kind: "empty" }; var REPLACE = { kind: "replace" }; @@ -9055,7 +9055,7 @@ function merge2(previous, next2) { return void 0; } -// host/js/node_modules/@earendil-works/chord/dist/delta/index.js +// node_modules/@earendil-works/chord/dist/delta/index.js var isObj = (value2) => value2 !== null && typeof value2 === "object"; function overlap(a, b, scan2, probe = 64, maxCandidates = 8) { if (a.length === 0 || b.length === 0 || scan2 === 0) @@ -9604,7 +9604,7 @@ function decoder() { }; } -// host/js/node_modules/@earendil-works/chord/dist/publish.js +// node_modules/@earendil-works/chord/dist/publish.js var queue = []; var held = 0; var draining = false; @@ -9633,7 +9633,7 @@ function drain() { } } -// host/js/node_modules/@earendil-works/chord/dist/cell.js +// node_modules/@earendil-works/chord/dist/cell.js var sequence = 0; var Fanout = class { #values = /* @__PURE__ */ new Set(); @@ -9961,7 +9961,7 @@ var Derived = class extends Source { var isSource = (value2) => value2 instanceof Source; var notReady = (what) => new ChordError("not_ready", `${what} is not ready`); -// host/js/node_modules/@earendil-works/chord/dist/object.js +// node_modules/@earendil-works/chord/dist/object.js var noop = () => { }; var makeService = (contract, factory, options, facet) => { @@ -11427,7 +11427,7 @@ var SelfImpl = class { } }; -// host/js/node_modules/@earendil-works/chord/dist/reload.js +// node_modules/@earendil-works/chord/dist/reload.js function dryRun(candidate) { const { run: run2, migrated, service, object } = candidate; const exposed = memberSchemas(service, run2.implementation); @@ -12027,7 +12027,7 @@ var Reload = class { } }; -// host/js/node_modules/@earendil-works/chord/dist/wire.js +// node_modules/@earendil-works/chord/dist/wire.js var PROTOCOL_VERSION = 4; var Id = int({ minimum: 1 }); var Name = str({ minLength: 1 }); @@ -12168,7 +12168,7 @@ function toWireError(error) { } var fromWireError = (error) => new ChordError(error.code, error.message.replace(/^[a-z_]+(\/[a-z_]+)?: /, ""), { reason: error.reason }); -// host/js/node_modules/@earendil-works/chord/dist/cluster.js +// node_modules/@earendil-works/chord/dist/cluster.js var reloadSeq = 0; var modulesFor = (remote2, hostName) => { let best; @@ -12360,7 +12360,7 @@ var ChildReloads = class { } }; -// host/js/node_modules/@earendil-works/chord/dist/link.js +// node_modules/@earendil-works/chord/dist/link.js var BaseLink = class { #handler; #queue = []; @@ -12668,7 +12668,7 @@ var WebSocketLink = class extends BaseLink { }; var webSocketLink = (socket, options) => new WebSocketLink(socket, options); -// host/js/node_modules/@earendil-works/chord/dist/connection.js +// node_modules/@earendil-works/chord/dist/connection.js var DEFAULT_WINDOW = 256 * 1024; var PENDING_WINDOWS = 4; var unavailable = (message) => new ChordError("unavailable", message); @@ -13804,7 +13804,7 @@ function clientError(error) { return error; } -// host/js/node_modules/@earendil-works/chord/dist/remote.js +// node_modules/@earendil-works/chord/dist/remote.js var noop2 = () => { }; function deferred() { @@ -14381,7 +14381,7 @@ var RemoteRef = class { } }; -// host/js/node_modules/@earendil-works/chord/dist/host.js +// node_modules/@earendil-works/chord/dist/host.js var defineFacet = (setup, options = {}) => ({ setup, uses: options.uses }); var isFacet = (ref) => typeof ref === "object" && !(ref instanceof URL); var EMPTY_TABLE = /* @__PURE__ */ new Map(); @@ -15328,13 +15328,13 @@ function reaches(from, to) { return false; } -// host/js/node_modules/@earendil-works/chord/dist/registry.js +// node_modules/@earendil-works/chord/dist/registry.js var defineRegistry = (name, options = {}) => ({ name, conflict: options.conflict ?? "error" }); -// host/js/node_modules/@earendil-works/chord/dist/state.js +// node_modules/@earendil-works/chord/dist/state.js var StateSubscriber = class { #listener; #reportError; @@ -15599,7 +15599,7 @@ function isReplicatedStateSource(value2) { return typeof value2.attach === "function"; } -// host/js/node_modules/@earendil-works/chord/dist/watch.js +// node_modules/@earendil-works/chord/dist/watch.js var STOPPED = { kind: "stopped" }; var ABORTED = { kind: "aborted" }; var ENDED = { kind: "ended" }; @@ -15945,7 +15945,7 @@ var NativeWatch = class extends WatchLifecycle { } }; -// host/js/node_modules/@earendil-works/chord/dist/websocket.js +// node_modules/@earendil-works/chord/dist/websocket.js function acceptWebSockets(server, host, options) { server.on("connection", (socket, request2) => { const link = webSocketLink(socket, { compress: true, acceptPacked: false }); @@ -15958,7 +15958,7 @@ function acceptWebSockets(server, host, options) { }); } -// host/js/node_modules/@earendil-works/pi-durable/dist/ids.js +// node_modules/@earendil-works/pi-durable/dist/ids.js function idFromNumber(value2) { return value2; } @@ -15966,7 +15966,7 @@ function seqFromNumber(value2) { return value2; } -// host/js/node_modules/@earendil-works/pi-durable/dist/documents.js +// node_modules/@earendil-works/pi-durable/dist/documents.js function defineDoc(definition) { validateDefinition(definition); return { definition }; @@ -16050,7 +16050,7 @@ function materializeDocumentValue(definition, record2, version, value2) { return copyJson(definition.migrate(value2, version)); } -// host/js/node_modules/@earendil-works/pi-durable/dist/entries.js +// node_modules/@earendil-works/pi-durable/dist/entries.js function defineEntry(kind) { if (typeof kind !== "string" || kind.length === 0) throw new TypeError("Entry kind must be a non-empty string"); @@ -16066,7 +16066,7 @@ var ToolResultEntry = defineEntry("pi.tool-result"); var ResetEntry = defineEntry("pi.reset"); var CompactionEntry = defineEntry("pi.compaction"); -// host/js/node_modules/@earendil-works/pi-durable/dist/errors.js +// node_modules/@earendil-works/pi-durable/dist/errors.js function errorMessage(error) { if (error instanceof Error) return error.message; @@ -16118,7 +16118,7 @@ var ConversationIdle = class extends Error { } }; -// host/js/node_modules/@earendil-works/pi-durable/dist/timers.js +// node_modules/@earendil-works/pi-durable/dist/timers.js var MAX_TIMER_DELAY = 2147483647; var inWorkers = typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers"; var nativeTimer = (callback, delayMs, options) => { @@ -16174,7 +16174,7 @@ function hostTimers(setTimer, report2) { }; } -// host/js/node_modules/@earendil-works/pi-durable/dist/session/cached-storage.js +// node_modules/@earendil-works/pi-durable/dist/session/cached-storage.js var CachedStorage = class { #storage; #conversations = new Lru(4096); @@ -16424,7 +16424,7 @@ function freeze(value2) { return Object.freeze(value2); } -// host/js/node_modules/@earendil-works/pi-durable/dist/session/conversation-tails.js +// node_modules/@earendil-works/pi-durable/dist/session/conversation-tails.js var LATEST_CAPACITY = 4096; var MARKER_CAPACITY = 256; var ConversationTails = class { @@ -16510,7 +16510,7 @@ function freeze2(value2) { return Object.freeze(value2); } -// host/js/node_modules/@earendil-works/pi-durable/dist/session/keys.js +// node_modules/@earendil-works/pi-durable/dist/session/keys.js function taskKey(id2) { return `task:${id2}`; } @@ -16647,10 +16647,10 @@ var GatedStorage = class { } }; -// host/js/node_modules/@earendil-works/pi-durable/dist/types.js +// node_modules/@earendil-works/pi-durable/dist/types.js var ROOT_CONVERSATION_ID = 1; -// host/js/node_modules/@earendil-works/pi-durable/dist/session/forks.js +// node_modules/@earendil-works/pi-durable/dist/session/forks.js var SCAN_PAGE_SIZE = 256; async function prepareForkDocumentCopies(storage, parentConversationId, at, childConversationId, context) { const entry2 = await storage.entry(parentConversationId, at, context); @@ -16689,7 +16689,7 @@ async function collectCopies(storage, scope, at, policy, childConversationId, co } while (cursor !== void 0); } -// host/js/node_modules/@earendil-works/pi-durable/dist/session/transaction.js +// node_modules/@earendil-works/pi-durable/dist/session/transaction.js function applySubmissionChange(current, change) { if (current.status === "done" || current.status === "unanswered") return current; @@ -17625,7 +17625,7 @@ function publishes(plan) { return plan.retire || plan.change?.loaded === void 0 || plan.content !== void 0; } -// host/js/node_modules/@earendil-works/pi-durable/dist/session/writer.js +// node_modules/@earendil-works/pi-durable/dist/session/writer.js var SESSION_FAILED = { kind: "failed" }; var Writer = class { #host; @@ -17874,7 +17874,7 @@ function hop() { }); } -// host/js/node_modules/@earendil-works/pi-durable/dist/session/session.js +// node_modules/@earendil-works/pi-durable/dist/session/session.js var NO_HOLDS = []; var NO_OPERATIONS = []; var NO_KEYS = []; @@ -19383,7 +19383,7 @@ var GuardedStorage = class { } }; -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/agent.js +// node_modules/@earendil-works/pi-durable/dist/harness/agent.js var DEFAULT_RETRY_POLICY = { enabled: true, maxRetries: 3, @@ -19645,7 +19645,7 @@ function applyWrap(items, target, wrap, nameOf, report2) { } } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/estimate.js +// node_modules/@earendil-works/pi-ai/dist/utils/estimate.js var CHARS_PER_TOKEN = 3.5; var ESTIMATED_IMAGE_CHARS = 4800; function calculateContextTokens(usage) { @@ -19698,7 +19698,7 @@ function estimateToolsTokens(tools) { return estimateTextTokens(safeJsonStringify(tools)); } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +// node_modules/@earendil-works/pi-ai/dist/utils/retry.js function buildProviderErrorPattern(patterns) { return new RegExp(patterns.join("|"), "i"); } @@ -19879,12 +19879,12 @@ function isRetryableAssistantError(message) { return RETRYABLE_PROVIDER_ERROR_PATTERN.test(errorMessage2); } -// host/js/node_modules/@earendil-works/pi-durable/dist/tasks.js +// node_modules/@earendil-works/pi-durable/dist/tasks.js function defineTask(definition) { return { definition }; } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/context.js +// node_modules/@earendil-works/pi-durable/dist/harness/context.js var SCAN_PAGE_SIZE2 = 256; var EXCLUDED_STOP_REASONS = /* @__PURE__ */ new Set(["aborted", "error", "deferred"]); var MISSING_RESULT_TEXT = "Tool result unavailable: history ends before this call completed."; @@ -20112,7 +20112,7 @@ function missingResult(call, timestamp) { }); } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +// node_modules/@earendil-works/pi-ai/dist/utils/overflow.js var OVERFLOW_PATTERNS = [ /prompt (?:is )?too long/i, // Anthropic and z.ai token overflow @@ -20212,7 +20212,7 @@ function getOverflowPatterns() { return [...OVERFLOW_PATTERNS]; } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/inbox.js +// node_modules/@earendil-works/pi-durable/dist/harness/inbox.js var InboxDoc = defineDoc({ kind: "pi.inbox", version: 1, @@ -20316,7 +20316,7 @@ async function withdrawQueuedInputs(tx, conversationId, reason = "aborted") { } } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/json.js +// node_modules/@earendil-works/pi-durable/dist/harness/json.js function assignJson(target, key, value2, plan) { if (plan?.kind === "keep") return; @@ -20352,7 +20352,7 @@ function isRecord(value2) { return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/partial-changes.js +// node_modules/@earendil-works/pi-durable/dist/harness/partial-changes.js var PartialChanges = class { #text = /* @__PURE__ */ new Map(); #toolCalls = /* @__PURE__ */ new Map(); @@ -20491,7 +20491,7 @@ function isRecord2(value2) { return typeof value2 === "object" && value2 !== null && !Array.isArray(value2); } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/prompt.js +// node_modules/@earendil-works/pi-durable/dist/harness/prompt.js function replaySections(messages) { const shown = /* @__PURE__ */ new Map(); for (const message of messages) { @@ -20597,7 +20597,7 @@ function systemEntry(sections, tools, timestamp) { return { model: [message] }; } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/uuid.js +// node_modules/@earendil-works/pi-ai/dist/utils/uuid.js var MAX_UUID_V7_TIMESTAMP = 281474976710655; var MAX_SEQUENCE = (1n << 41n) - 1n; var lastOrdinaryTimestamp = -1; @@ -20633,7 +20633,7 @@ function uuidv7(timestampMs) { return `${hex.slice(0, 4).join("")}-${hex.slice(4, 6).join("")}-${hex.slice(6, 8).join("")}-${hex.slice(8, 10).join("")}-${hex.slice(10).join("")}`; } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/provider.js +// node_modules/@earendil-works/pi-durable/dist/harness/provider.js var ProviderDoc = defineDoc({ kind: "pi.provider", version: 1, @@ -20657,7 +20657,7 @@ async function ensureProviderSessionId(runtime, context) { return created; } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/telemetry.js +// node_modules/@earendil-works/pi-durable/dist/harness/telemetry.js var entry = { description: "A transcript entry was committed; content remains in the transcript.", attributes: { @@ -20792,7 +20792,7 @@ var DURABLE_TELEMETRY_SCHEMA = defineTelemetrySchema({ } }); -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/util.js +// node_modules/@earendil-works/pi-durable/dist/harness/util.js var Waiters = class { #sets = /* @__PURE__ */ new Map(); add(key, context) { @@ -20858,7 +20858,7 @@ function conversationEntries(conversationId, query) { }; } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js +// node_modules/@earendil-works/pi-durable/dist/harness/scheduler.js var SCAN_PAGE_SIZE3 = 256; var NO_KEYS2 = []; var LIVE_STATUSES = ["pending", "running", "waiting", "sleeping", "completing"]; @@ -23488,7 +23488,7 @@ function jsonEqual(left, right) { return keys.every((key) => Object.hasOwn(right, key) && jsonEqual(left[key], right[key])); } -// host/js/node_modules/@earendil-works/chord/dist/output.js +// node_modules/@earendil-works/chord/dist/output.js var NEWLINE = 10; var INVALID_OUTPUT = /[\x00-\x08\x0b-\x1f\ufff9-\ufffb]/g; var ESCAPE_SEQUENCE = /\x1b[\]PX^_][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]|\x1b[\x20-\x2f]*[\x30-\x7e]/g; @@ -23807,7 +23807,7 @@ var Progress = class { } }; -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/date.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/date.js var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; function IsLeapYear(year) { @@ -23823,7 +23823,7 @@ function IsDate(value2) { return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && IsLeapYear(year) ? 29 : DAYS[month]); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/time.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/time.js var TIME = /^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/; function IsTime(value2, strictTimeZone = true) { const matches = TIME.exec(value2); @@ -23851,25 +23851,25 @@ function IsTime(value2, strictTimeZone = true) { return (totalUtcMin % 1440 + 1440) % 1440 === 1439; } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/date_time.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/date_time.js function IsDateTime(value2) { const dateTime = value2.split(/T/i); return dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1]); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/duration.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/duration.js var Duration = /^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/; function IsDuration(value2) { return Duration.test(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/email.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/email.js var Email = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i; function IsEmail(value2) { return Email.test(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/pattern/pattern.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/pattern/pattern.js var RE_RULE_HYPHEN_PLACEMENT = /^(?!-).*(? regexp.source).join("|"), "u"); -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/ascii.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/ascii.js function IsAsciiLabel(value2) { return RE_RULE_HYPHEN_PLACEMENT.test(value2) && RE_RULE_NOT_RESERVED_ACE.test(value2) && RE_ASCII_LDH.test(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/format/puny.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/format/puny.js var PUNYCODE_BASE = 36; var PUNYCODE_TMIN = 1; var PUNYCODE_TMAX = 26; @@ -24025,7 +24025,7 @@ function Encode(input) { return result.join(""); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/format/bidi.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/format/bidi.js var RE_RTL_ALLOWED = /^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/; var RE_LTR_ALLOWED = /^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/; var RE_RTL_CLASSES = /^(?:R|AL|AN)$/; @@ -24080,7 +24080,7 @@ function SatisfiesBidiRule(value2) { return true; } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/unicode.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/unicode.js function ExceedsMaxALabelLength(value2) { return RE_NON_ASCII.test(value2) && Encode(value2).length + 4 > 63; } @@ -24146,7 +24146,7 @@ function IsUnicodeLabel(value2) { return true; } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/puny.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/label/puny.js function IsPunyLabel(value2) { if (!IsAcePrefixed(value2)) return false; @@ -24163,7 +24163,7 @@ function IsPunyLabel(value2) { } } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/hostname.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/hostname.js function IsValidLabelLength(value2) { return value2.length > 0 && value2.length <= 63; } @@ -24178,7 +24178,7 @@ function IsHostname(value2) { return value2.split(".").every((label) => IsLabel(label)); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/idn-hostname.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idna/idn-hostname.js function IsValidLabelLength2(value2) { return value2.length > 0 && value2.length <= 63; } @@ -24199,35 +24199,35 @@ function IsIdnHostname(value2) { return labels.every((label) => IsLabel2(label) && (!hasBidiChars || SatisfiesBidiRule(label))); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/hostname.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/hostname.js function IsHostname2(value2) { return IsHostname(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/idn_email.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/idn_email.js var IdnEmail = /^(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?^`{|}\\]/; @@ -24243,26 +24243,26 @@ function IsIri(value2) { return URL.canParse(NarrowIpvFuture(value2)); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/iri_reference.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/iri_reference.js var InvalidIriChars2 = /[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/; var MalformedScheme = /^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//; function IsIriReference(value2) { return !InvalidIriChars2.test(value2) && !MalformedScheme.test(value2) && URL.canParse(value2, "http://example.com"); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/json_pointer.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/json_pointer.js var JsonPointer = /^(?:\/(?:[^~/]|~0|~1)*)*$/; function IsJsonPointer(value2) { return JsonPointer.test(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/json_pointer_uri_fragment.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/json_pointer_uri_fragment.js var JsonPointerUriFragment = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; function IsJsonPointerUriFragment(value2) { return JsonPointerUriFragment.test(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/regex.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/regex.js function IsRegex(value2) { try { new RegExp(value2, "u"); @@ -24272,42 +24272,42 @@ function IsRegex(value2) { } } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/relative_json_pointer.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/relative_json_pointer.js var RelativeJsonPointer = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; function IsRelativeJsonPointer(value2) { return RelativeJsonPointer.test(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri.js var Uri = /^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; function IsUri(value2) { return Uri.test(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri_reference.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri_reference.js var UriReference = /^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)|(?:[-a-z0-9._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[-a-z0-9._~!$&'()*+,;=@]|%[0-9a-f]{2})+(?:\/(?:[-a-z0-9._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?)(?:\?(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[-a-z0-9._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; function IsUriReference(value2) { return UriReference.test(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri_template.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/uri_template.js var UriTemplate = /^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i; function IsUriTemplate(value2) { return UriTemplate.test(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/url.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/url.js function IsUrl(value2) { return URL.canParse(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/typebox/uuid.js +// node_modules/@earendil-works/pi-schema/dist/formats/typebox/uuid.js var Uuid = /^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; function IsUuid(value2) { return Uuid.test(value2); } -// host/js/node_modules/@earendil-works/pi-schema/dist/formats/index.js +// node_modules/@earendil-works/pi-schema/dist/formats/index.js var formats = Object.freeze({ date: IsDate, "date-time": IsDateTime, @@ -24332,7 +24332,7 @@ var formats = Object.freeze({ uuid: IsUuid }); -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/validation.js +// node_modules/@earendil-works/pi-ai/dist/utils/validation.js var validatorCache = /* @__PURE__ */ new WeakMap(); function getValidator(schema) { const cached = validatorCache.get(schema); @@ -24372,7 +24372,7 @@ ${JSON.stringify(toolCall.arguments, null, 2)}`; throw new Error(errorMessage2); } -// host/js/node_modules/@earendil-works/pi-durable/dist/truncate.js +// node_modules/@earendil-works/pi-durable/dist/truncate.js var DEFAULT_MAX_LINES = 2e3; var DEFAULT_MAX_BYTES = 50 * 1024; function splitLinesForCounting(content) { @@ -24461,7 +24461,7 @@ function truncateHeadOf(prefix, totals, options = {}) { }; } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/usage.js +// node_modules/@earendil-works/pi-durable/dist/harness/usage.js var UsageDoc = defineDoc({ kind: "pi.usage", version: 1, @@ -24511,7 +24511,7 @@ function addUsageState(sum, state) { } } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/tool.js +// node_modules/@earendil-works/pi-durable/dist/harness/tool.js var MADE_NESTED_CALLS = "pi.tool.madeNestedCalls"; var NestedCallDoc = defineDocFamily({ kind: "pi.tool.nested-call", @@ -25190,7 +25190,7 @@ function jsonEqual2(a, b) { return keys.length === Object.keys(b).length && keys.every((key) => Object.hasOwn(b, key) && jsonEqual2(a[key], b[key])); } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/generation.js +// node_modules/@earendil-works/pi-durable/dist/harness/generation.js var DEFAULT_POLL_AFTER_MS = 5e3; var GenerationTask = defineTask({ name: "pi.generation", @@ -25953,7 +25953,7 @@ function handOver(live, from, to) { live.run.taskId = to; } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/live.js +// node_modules/@earendil-works/pi-durable/dist/harness/live.js var LiveDoc = defineDoc({ kind: "pi.live", version: 3, @@ -26131,7 +26131,7 @@ async function settleSchedulerOutcome(tx, record2, outcome) { }); } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/submissions.js +// node_modules/@earendil-works/pi-durable/dist/harness/submissions.js var Submissions = class { #telemetry; #session; @@ -26356,7 +26356,7 @@ async function admitSubmission(tx, conversationId, draft, now, queueModes, span) return { id: id2, status: "placed" }; } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/compaction.js +// node_modules/@earendil-works/pi-durable/dist/harness/compaction.js var TOOL_RESULT_MAX_CHARS = 2e3; var SUMMARY_PREFIX = "The conversation history before this point was compacted into the following summary:\n\n\n"; var SUMMARY_SUFFIX = "\n"; @@ -26716,7 +26716,7 @@ async function failNoModel2(runtime, ref, context) { }, context); } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/define.js +// node_modules/@earendil-works/pi-durable/dist/harness/define.js function defineExtension(extension) { return extension; } @@ -26739,7 +26739,7 @@ function wrapSection(key, wrapper) { return { section: key, wrap: wrapper }; } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/registry.js +// node_modules/@earendil-works/pi-durable/dist/harness/registry.js var SECTION_KEY = /^[a-z][a-z0-9_-]*$/; var BUILTIN_TASKS = [GenerationTask, ToolTask, CompactionTask]; var RegistryState = class { @@ -26833,7 +26833,7 @@ function createRegistry() { return new RegistryImpl(); } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js +// node_modules/@earendil-works/pi-durable/dist/harness/task-graph.js var LIVE_STATUSES2 = ["pending", "running", "waiting", "sleeping", "completing"]; var SCAN_PAGE_SIZE4 = 256; var TaskGraphView = class { @@ -27029,7 +27029,7 @@ function phaseOf(checkpoint) { return checkpoint.phase; } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/view.js +// node_modules/@earendil-works/pi-durable/dist/harness/view.js var DEFAULT_WINDOW_MIN = 50; var MOUNTED = [ AgentDoc, @@ -27254,7 +27254,7 @@ function prefixed(op2, prefix) { } } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/harness.js +// node_modules/@earendil-works/pi-durable/dist/harness/harness.js var SCAN_PAGE_SIZE6 = 256; var SCHEDULER_INDEX_SIZES = /* @__PURE__ */ Symbol.for("pi-durable.schedulerIndexSizes"); var SCHEDULER_IDLE_STATE = /* @__PURE__ */ Symbol.for("pi-durable.schedulerIdleState"); @@ -27634,7 +27634,7 @@ var Harness = { } }; -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/registry-reader.js +// node_modules/@earendil-works/pi-durable/dist/harness/registry-reader.js function registryReader(value2, context) { return { snapshot: () => value2.value, @@ -27652,7 +27652,7 @@ function registryReader(value2, context) { }; } -// host/js/node_modules/@earendil-works/pi-durable/dist/harness/transcript.js +// node_modules/@earendil-works/pi-durable/dist/harness/transcript.js var EARLIER = Object.freeze({ kind: "earlier" }); var ConversationTranscript = class { #load; @@ -27884,7 +27884,7 @@ function mergeById(left, right) { return merged; } -// host/js/node_modules/@earendil-works/pi-durable/dist/storage/scan.js +// node_modules/@earendil-works/pi-durable/dist/storage/scan.js function scanStart(requested, cursor, fallback) { if (requested !== void 0 && requested !== "ascending" && requested !== "descending") { throw new StorageRequestError(`Invalid scan order: ${String(requested)}`); @@ -27907,7 +27907,7 @@ function nextCursor(id2, order) { return { after: id2, order }; } -// host/js/node_modules/@earendil-works/pi-durable/dist/storage/memory.js +// node_modules/@earendil-works/pi-durable/dist/storage/memory.js function* documentDeltaBatches(id2, version, revisions, start) { for (let index = start; index < revisions.length; index++) { const revision = revisions[index]; @@ -28631,7 +28631,7 @@ var MemoryStorage = class { } }; -// host/js/node_modules/@earendil-works/chord/dist/sqlite/schema.js +// node_modules/@earendil-works/chord/dist/sqlite/schema.js function validateSqliteSchemaPrefix(prefix) { if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(prefix)) { throw new Error(`Invalid SQLite schema prefix ${JSON.stringify(prefix)}`); @@ -28641,7 +28641,7 @@ function validateSqliteSchemaPrefix(prefix) { } } -// host/js/node_modules/@earendil-works/chord/dist/sqlite/migrations.js +// node_modules/@earendil-works/chord/dist/sqlite/migrations.js async function applySqliteMigrations(database, migrations, options) { const { table } = options; validateSqliteSchemaPrefix(table); @@ -28673,7 +28673,7 @@ async function applySqliteMigrations(database, migrations, options) { }); } -// host/js/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/schema.js +// node_modules/@earendil-works/pi-durable/dist/storage/sqlite/schema.js var TABLE_NAMES = { durableSchema: "durable_schema", durableMetadata: "durable_metadata", @@ -28717,7 +28717,7 @@ function createSqliteSchema(prefix) { } var DEFAULT_SQLITE_SCHEMA = createSqliteSchema(); -// host/js/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/migrations.js +// node_modules/@earendil-works/pi-durable/dist/storage/sqlite/migrations.js function createSqliteMigrations(schema) { const { tables, indexes } = schema; const initialSchema = [ @@ -28829,7 +28829,7 @@ async function applySqliteMigrationsForSchema(database, schema, migrations = cre await applySqliteMigrations(database, migrations, { table: schema.tables.durableSchema }); } -// host/js/node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js +// node_modules/@earendil-works/pi-durable/dist/storage/sqlite/storage.js var parseJson = (value2) => JSON.parse(value2); var encodeJson = (value2) => JSON.stringify(value2); var encodeIndexedString = (value2) => JSON.stringify(value2); @@ -29530,7 +29530,7 @@ var SqliteStorage = class _SqliteStorage { } }; -// host/js/sqlite.ts +// sqlite.ts var op = (kind, sql = "", params = []) => Deno.core.ops.op_sql(kind, sql, params.map((p) => p instanceof Uint8Array ? Array.from(p) : typeof p === "bigint" ? Number(p) : p)); async function openStorage(path) { op("open", path); @@ -29571,7 +29571,7 @@ async function openStorage(path) { return SqliteStorage.open(database); } -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/index.js +// node_modules/@earendil-works/pi-durable/dist/tools/index.js var tools_exports = {}; __export(tools_exports, { CodingTools: () => CodingTools, @@ -29584,14 +29584,14 @@ __export(tools_exports, { createWriteTool: () => createWriteTool }); -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/env.js +// node_modules/@earendil-works/pi-durable/dist/tools/env.js function requireEnv(api2) { if (api2.env === void 0) throw new Error("No execution environment is configured"); return api2.env; } -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/bash.js +// node_modules/@earendil-works/pi-durable/dist/tools/bash.js var MAX_TIMEOUT_SECONDS = 2147483647 / 1e3; var bashSchema = obj({ command: str({ description: "Bash command to execute" }), @@ -29708,7 +29708,7 @@ ${execution.command}`; }); } -// host/js/node_modules/diff/libesm/diff/base.js +// node_modules/diff/libesm/diff/base.js var Diff = class { diff(oldStr, newStr, options = {}) { let callback; @@ -29910,7 +29910,7 @@ var Diff = class { } }; -// host/js/node_modules/diff/libesm/diff/line.js +// node_modules/diff/libesm/diff/line.js var LineDiff = class extends Diff { constructor() { super(...arguments); @@ -29958,7 +29958,7 @@ function tokenize(value2, options) { return retLines; } -// host/js/node_modules/diff/libesm/patch/create.js +// node_modules/diff/libesm/patch/create.js var INCLUDE_HEADERS = { includeIndex: true, includeUnderline: true, @@ -30143,7 +30143,7 @@ function splitLines(text) { return result; } -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/edit-diff.js +// node_modules/@earendil-works/pi-durable/dist/tools/edit-diff.js function detectLineEnding(content) { const crlfIdx = content.indexOf("\r\n"); const lfIdx = content.indexOf("\n"); @@ -30452,7 +30452,7 @@ function generateDiffString(oldContent, newContent, contextLines = 4) { return { diff: output.join("\n"), firstChangedLine }; } -// host/js/node_modules/@earendil-works/pi-durable/dist/env/decode.js +// node_modules/@earendil-works/pi-durable/dist/env/decode.js function rangeDecoder() { return new TextDecoder("utf-8", { ignoreBOM: true }); } @@ -30460,14 +30460,14 @@ function startsWithBom(firstBytes) { return firstBytes[0] === 239 && firstBytes[1] === 187 && firstBytes[2] === 191; } -// host/js/node_modules/@earendil-works/pi-durable/dist/env/index.js +// node_modules/@earendil-works/pi-durable/dist/env/index.js function getOrThrow(result) { if (!result.ok) throw result.error; return result.value; } -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/file-mutation-queue.js +// node_modules/@earendil-works/pi-durable/dist/tools/file-mutation-queue.js var queues = /* @__PURE__ */ new Map(); async function mutationKey(env, path, context) { const absolutePath = getOrThrow(await env.absolutePath(path, context)); @@ -30507,7 +30507,7 @@ async function withFileMutationQueue(env, path, fn, context) { } } -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/path-utils.js +// node_modules/@earendil-works/pi-durable/dist/tools/path-utils.js var UNICODE_SPACES = /[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g; var NARROW_NO_BREAK_SPACE = "\u202F"; function normalizeToolPath(path) { @@ -30533,7 +30533,7 @@ async function resolveReadToolPath(env, path, context) { return resolved; } -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/edit.js +// node_modules/@earendil-works/pi-durable/dist/tools/edit.js var replaceEditSchema = obj({ oldText: str({ description: "Exact text for one targeted replacement. It must be unique in the original file and must not overlap with any other edits[].oldText in the same call." @@ -30637,7 +30637,7 @@ function createEditTool() { }); } -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/image.js +// node_modules/@earendil-works/pi-durable/dist/tools/image.js var PNG_SIGNATURE = [137, 80, 78, 71, 13, 10, 26, 10]; var HEADER_BYTES = 32; var BLOCK_BYTES = 64 * 1024; @@ -30797,7 +30797,7 @@ function startsWithAscii(buffer, offset, text) { return true; } -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js +// node_modules/@earendil-works/pi-durable/dist/tools/image-processor.js var DEFAULT_IMAGE_LIMITS = { maxWidth: 2e3, maxHeight: 2e3, maxBytes: 4.5 * 1024 * 1024 }; var INLINE_IMAGE_TYPES = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/gif", "image/webp"]); function toBase64(bytes2) { @@ -30811,7 +30811,7 @@ function base64Length(byteLength) { return Math.ceil(byteLength / 3) * 4; } -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/read.js +// node_modules/@earendil-works/pi-durable/dist/tools/read.js var readSchema = obj({ path: str({ description: "Path to the file to read (relative or absolute)" }), offset: opt(num({ description: "Line number to start reading from (1-indexed)" })), @@ -31007,7 +31007,7 @@ async function readText(reader, path, offset, limit, context) { }; } -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/write.js +// node_modules/@earendil-works/pi-durable/dist/tools/write.js var writeSchema = obj({ path: str({ description: "Path to the file to write (relative or absolute)" }), content: str({ description: "Content to write to the file" }) @@ -31033,7 +31033,7 @@ function createWriteTool() { }); } -// host/js/node_modules/@earendil-works/pi-durable/dist/tools/index.js +// node_modules/@earendil-works/pi-durable/dist/tools/index.js function createCodingTools(options = {}) { return defineExtension({ name: "coding-tools", @@ -31042,7 +31042,7 @@ function createCodingTools(options = {}) { } var CodingTools = createCodingTools(); -// host/js/node_modules/@earendil-works/pi-ai/dist/index.js +// node_modules/@earendil-works/pi-ai/dist/index.js var dist_exports4 = {}; __export(dist_exports4, { AI_TELEMETRY_SCHEMA: () => AI_TELEMETRY_SCHEMA, @@ -31125,7 +31125,7 @@ __export(dist_exports4, { withoutInitialSystemMessage: () => withoutInitialSystemMessage }); -// host/js/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js +// node_modules/@earendil-works/pi-ai/dist/auth/helpers.js function envApiKeyAuth(name, envVars) { return { name, @@ -31166,7 +31166,7 @@ function lazyOAuth(input) { }; } -// host/js/node_modules/@earendil-works/pi-ai/dist/session-resources.js +// node_modules/@earendil-works/pi-ai/dist/session-resources.js var sessionResourceCleanups = /* @__PURE__ */ new Set(); function registerSessionResourceCleanup(cleanup) { sessionResourceCleanups.add(cleanup); @@ -31188,7 +31188,7 @@ function cleanupSessionResources(sessionId) { } } -// host/js/node_modules/@earendil-works/pi-ai/dist/utils/string-enum.js +// node_modules/@earendil-works/pi-ai/dist/utils/string-enum.js function StringEnum(values, options) { return { type: "string", @@ -31198,7 +31198,7 @@ function StringEnum(values, options) { }; } -// host/js/events.ts +// events.ts var events_exports = {}; __export(events_exports, { EVENT_FEED: () => EVENT_FEED, @@ -31368,7 +31368,7 @@ function eventLog(harness2) { } } -// host/js/environment.ts +// environment.ts var CodingTools2 = { ...CodingTools, tools: CodingTools.tools.map((tool) => ({ ...tool, execute: (args, api2, context) => tool.execute(args, { ...api2, env: api2.env.forTool(api2.callId, tool.name) }, context) @@ -31405,7 +31405,7 @@ function conversationChains(harness2, context) { } var ops = Deno.core.ops; -// host/js/extensions.ts +// extensions.ts var ops2 = Deno.core.ops; var encoder4 = new TextEncoder(); var decoder4 = new TextDecoder(); @@ -31682,7 +31682,7 @@ Last good: ${fallback}` : failed; } }; } -// host/js/goal-questions-test-support.ts +// goal-questions-test-support.ts expect.objectContaining = (value2) => ({ __object: true, value: value2 }); expect.stringContaining = (value2) => ({ __string: true, value: value2 }); var assert = (value2, message) => { @@ -31733,7 +31733,7 @@ async function until2(condition) { } } -// host/js/goal-questions-fixture.ts +// goal-questions-fixture.ts var next = 0; async function fixture(clock = {}) { const models = createModels(), faux = fauxProvider({ tokensPerSecond: 1e5 }); @@ -31801,7 +31801,7 @@ async function fixture(clock = {}) { } }, ultimate, type, ask, answer: (args) => question2.actions.answer(args, action()), dismiss: (messageId) => question2.actions.dismiss({ messageId }, action()), log, entries: entries2, observed, settled, hear: (fn) => heard = fn }; } -// host/js/harness-api.ts +// harness-api.ts var Concluded = defineDoc({ kind: "conversations.concluded", version: 1, scope: "session", checkpointWhen: () => false, initial: () => ({ ids: [] }) }); var Started2 = defineDoc({ kind: "board.started", version: 1, scope: "conversation", history: "latest", fork: "initial", checkpointWhen: () => false, initial: () => ({}) }); var fail = (status, message) => { @@ -31961,7 +31961,7 @@ function harnessApi(harness2, models, extensions, context) { } }; } -// host/js/input.ts +// input.ts async function serve(harness2, context, afterSubmit, api2) { const pending = /* @__PURE__ */ new Set(); const track2 = (work) => { @@ -31996,7 +31996,7 @@ async function serve(harness2, context, afterSubmit, api2) { } } -// host/js/harness-api-test.ts +// harness-api-test.ts var f = await fixture(); var harness = f.opened.harness; var api = harnessApi(harness, f.host.models(), f.loader, BACKGROUND_CONTEXT);