@cortexkit/magic-context 0.34.2 → 0.35.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 (2) hide show
  1. package/dist/index.js +75 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -26716,6 +26716,23 @@ var init_cron = __esm(() => {
26716
26716
  MAX_SEARCH_MS = 4 * 366 * 24 * 60 * MINUTE_MS;
26717
26717
  });
26718
26718
 
26719
+ // ../plugin/src/shared/prompt-surface.ts
26720
+ function isValidPromptSurfaceModelKey(key) {
26721
+ if (key.length === 0 || key.trim() !== key)
26722
+ return false;
26723
+ const slash = key.indexOf("/");
26724
+ if (slash <= 0 || slash === key.length - 1)
26725
+ return false;
26726
+ const provider = key.slice(0, slash);
26727
+ const modelID = key.slice(slash + 1);
26728
+ if (provider.trim() !== provider || modelID.trim() !== modelID || provider.includes("*") || modelID.includes("*") && modelID !== "*") {
26729
+ return false;
26730
+ }
26731
+ if (modelID === "*")
26732
+ return true;
26733
+ return modelID.length > 0 && !modelID.startsWith("/") && !modelID.endsWith("/") && !modelID.includes("//");
26734
+ }
26735
+
26719
26736
  // ../plugin/src/config/schema/agent-overrides.ts
26720
26737
  var PermissionValueSchema, PermissionSchema, AgentOverrideConfigSchema;
26721
26738
  var init_agent_overrides = __esm(() => {
@@ -26764,7 +26781,7 @@ function expandConfigPath(value) {
26764
26781
  return `${homedir6()}/${trimmed.slice(2)}`;
26765
26782
  return trimmed;
26766
26783
  }
26767
- var DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE = 65, EXECUTE_THRESHOLD_CAP_MESSAGE = "execute_threshold is capped at 90% for cache safety: output capacity is reserved from the usable context window, and the remaining 10% absorbs mid-turn growth before the absolute 95% emergency wall. Use a value between 20 and 90.", DEFAULT_HISTORIAN_TIMEOUT_MS = 300000, DEFAULT_HISTORY_BUDGET_PERCENTAGE = 0.15, DEFAULT_LOCAL_EMBEDDING_MODEL = "Xenova/all-MiniLM-L6-v2", PiThinkingLevelSchema, PiConfigSchema, CronScheduleSchema, DreamTaskBaseConfigSchema, PromotionThresholdSchema, PrimerPromotionThresholdSchema, DreamTaskConfigSchema, ReviewUserMemoriesTaskConfigSchema, PromotePrimersTaskConfigSchema, DEFAULT_TASK_SCHEDULES, DreamTasksSchema, DreamerConfigSchema, SidekickConfigSchema, HistorianConfigSchema, EmbeddingFallbackProviderSchema, BaseEmbeddingConfigSchema, EmbeddingConfigSchema, MagicContextConfigSchema;
26784
+ var DEFAULT_EXECUTE_THRESHOLD_PERCENTAGE = 65, EXECUTE_THRESHOLD_CAP_MESSAGE = "execute_threshold is capped at 90% for cache safety: output capacity is reserved from the usable context window, and the remaining 10% absorbs mid-turn growth before the absolute 95% emergency wall. Use a value between 20 and 90.", DEFAULT_HISTORIAN_TIMEOUT_MS = 300000, DEFAULT_HISTORY_BUDGET_PERCENTAGE = 0.15, DEFAULT_LOCAL_EMBEDDING_MODEL = "Xenova/all-MiniLM-L6-v2", PiThinkingLevelSchema, PiConfigSchema, PromptSurfacePresetSchema, PromptSurfaceModelKeySchema, PromptSurfaceToolKeySchema, PromptSurfaceConfigSchema, CronScheduleSchema, DreamTaskBaseConfigSchema, PromotionThresholdSchema, PrimerPromotionThresholdSchema, DreamTaskConfigSchema, ReviewUserMemoriesTaskConfigSchema, PromotePrimersTaskConfigSchema, DEFAULT_TASK_SCHEDULES, DreamTasksSchema, DreamerConfigSchema, SidekickConfigSchema, HistorianConfigSchema, EmbeddingFallbackProviderSchema, BaseEmbeddingConfigSchema, EmbeddingConfigSchema, MagicContextConfigSchema;
26768
26785
  var init_magic_context = __esm(() => {
26769
26786
  init_zod();
26770
26787
  init_language_directive();
@@ -26774,6 +26791,23 @@ var init_magic_context = __esm(() => {
26774
26791
  PiConfigSchema = exports_external.object({
26775
26792
  subagent_extensions: exports_external.array(exports_external.string().trim().min(1)).optional().describe("User-only allowlist of Pi extensions for Magic Context subagent children. When set, children use --no-extensions and load only these entries (plus Magic Context's scoped child extension where applicable). Relative paths resolve from ~/.pi/agent, matching Pi's settings.json package location. Unset preserves normal Pi extension discovery.")
26776
26793
  }).optional();
26794
+ PromptSurfacePresetSchema = exports_external.enum(["full", "light"]);
26795
+ PromptSurfaceModelKeySchema = exports_external.string().refine(isValidPromptSurfaceModelKey, {
26796
+ message: "Use a non-empty provider/model key or the literal provider/* wildcard; model IDs may contain additional slashes and matching is case-sensitive."
26797
+ });
26798
+ PromptSurfaceToolKeySchema = exports_external.string().refine((value) => value.trim().length > 0, {
26799
+ message: "tool description keys must not be empty or whitespace-only"
26800
+ });
26801
+ PromptSurfaceConfigSchema = exports_external.object({
26802
+ default: PromptSurfacePresetSchema.default("full").describe('Fallback prompt-surface preset ("full" or "light").'),
26803
+ models: exports_external.record(PromptSurfaceModelKeySchema, PromptSurfacePresetSchema).optional().describe("Literal per-model routing. Keys are provider/model or provider/*; matching is case-sensitive and preserves additional slashes in model IDs."),
26804
+ guidance_override_path: exports_external.string().refine((value) => value.trim().length > 0, {
26805
+ message: "guidance_override_path must not be empty or whitespace-only"
26806
+ }).optional().describe("USER-LEVEL ONLY path to a complete primary guidance section. Relative paths resolve from the user config file."),
26807
+ tool_descriptions: exports_external.record(PromptSurfaceToolKeySchema, exports_external.string().refine((value) => value.trim().length > 0, {
26808
+ message: "tool description values must not be empty or whitespace-only"
26809
+ })).optional().describe("USER-LEVEL ONLY top-level description overrides keyed by ctx_* tool ID; parameter schemas and descriptions are unchanged.")
26810
+ }).describe("Prompt-surface preset routing. Project config may select default/models, while guidance_override_path and tool_descriptions are user-level only.");
26777
26811
  CronScheduleSchema = exports_external.string().refine((s) => s.trim() === "" || isValidCron(s), {
26778
26812
  message: 'Invalid schedule: use a 5-field cron expression (e.g. "0 3 * * *" for 3am daily, "0 3 * * 0" for Sunday 3am, "0 */6 * * *" every 6h) or "" to disable.'
26779
26813
  }).describe('5-field cron schedule (e.g. "0 3 * * *"), or "" to disable this task.');
@@ -26940,6 +26974,7 @@ var init_magic_context = __esm(() => {
26940
26974
  historian: HistorianConfigSchema.describe("Historian agent configuration (model, fallback_models, variant, temperature, maxTokens, permission, two_pass, etc.)"),
26941
26975
  dreamer: DreamerConfigSchema.optional().describe("Dreamer agent + scheduling configuration (model, fallback_models, disable, schedule, tasks, etc.)"),
26942
26976
  cache_ttl: exports_external.union([exports_external.string(), exports_external.object({ default: exports_external.string() }).catchall(exports_external.string())]).default("5m").describe('Cache TTL: string (e.g. "5m", "1h", "30s") or per-model object ({ default: "5m", "model-id": "10m" }). Set to "never" for lanes kept warm by an external keepwarm proxy — disables the idle-TTL heuristic so MC never initiates a rebuild based on elapsed time.'),
26977
+ prompt_surface: PromptSurfaceConfigSchema.default({ default: "full" }).describe("Prompt-surface presets: default is full; models use the literal provider/model or provider/* routing grammar. Guidance and tool-description overrides are user-level only. On OpenCode and Pi, per-model routing applies to the guidance block only: tool descriptions are registered once per process, so they follow the default preset (a v1 plugin-surface limitation; per-model tool descriptions are planned for the OpenCode v2 plugin API once the SDK stabilizes)."),
26943
26978
  output_reserve: exports_external.union([
26944
26979
  exports_external.number().min(0),
26945
26980
  exports_external.object({ default: exports_external.number().min(0) }).catchall(exports_external.number().min(0))
@@ -26988,7 +27023,7 @@ var init_magic_context = __esm(() => {
26988
27023
  keep_subagents: exports_external.boolean().default(false).describe("Debug: keep the child sessions Magic Context spawns for its own subagents (historian, dreamer, sidekick, memory-migration) instead of deleting them on success. Useful for short-term inspection/data collection — their full transcript (prompt, tool calls, token usage, output) stays in the host session store. Kept sessions accumulate until manually cleared; leave false for normal use. Requires a restart to take effect."),
26989
27024
  fail_closed_blocking: exports_external.boolean().default(true).describe("When Magic Context cannot operate (schema fence mismatch, storage open/migration failure), block the primary-session prompt with a loud recovery error instead of silently degrading to native compaction. Default true. Set false only to restore the old degrade-silently behavior (not recommended). USER-LEVEL ONLY — ignored in project config for security. Requires a restart."),
26990
27025
  compaction: exports_external.object({
26991
- enabled: exports_external.boolean().default(true).describe("When false, Magic Context stops managing the context window and keeps its knowledge layer: memory and docs/user-profile/key-files injection through additive m[0]/m[1], raw-message FTS indexing, dreamer, notes, ctx_search, ctx_expand, ctx_memory, and /ctx-embed remain available. MC's historian/compartment preparation, tagging, markers, pruning, folding, drops, strips, splicing, synthetic context-management todos, temporal markers, nudges, and fail-closed blocking stop; ctx_expand remains a knowledge-surface tool. fail_closed_blocking is inert: a transform failure passes the input messages through without blocking or cancelling. This setting does not enable native compaction: OpenCode's compaction.auto / compaction.prune or Pi's equivalent owns the window, or nothing does. MC's compaction.enabled in magic-context.jsonc is distinct from OpenCode's compaction.auto / compaction.prune in opencode.jsonc; they are different files and different owners. On the first turn after disabling, a long session may trigger one native compaction cycle; MC removes only its own marker boundary, leaves native boundaries and stored compartments intact, and does no pre-trimming mitigation. Marker cleanup is lazy per session, so an unresumed session is cleaned when it is next resumed. If compaction is enabled again, run /ctx-wrapup when the historian is runnable to catch up. OpenCode peer verification against v1.18.4 confirms native compaction covers child sessions: subagents receive additive memory/docs injection and no MC reclaim in this mode, so keep subagent tasks small or leave compaction.enabled on for long subagent runs. If transform_mode is rust, compaction-off resolves to the TypeScript transform and emits one frozen boot warning because there is no Rust reduced-mode contract. This is boot-resolved and requires a process restart; project-tier compaction.enabled is stripped so a cloned repository cannot disable the user's setting. The sidebar reports raw usage as Context: <pct>% · native compaction or Context: <pct>% · no active compaction and does not show an MC execute-threshold fill. /ctx-wrapup, /ctx-recomp, /ctx-flush, and /ctx-session-upgrade refuse without context-management side effects; /ctx-embed remains functional. Raw content hidden by a native boundary before Magic Context's first pass is not retroactively indexed.")
27026
+ enabled: exports_external.boolean().default(true).describe("When false, Magic Context stops managing the context window and keeps its knowledge layer: memory and docs/user-profile/key-files injection through additive m[0]/m[1], raw-message FTS indexing, dreamer, notes, ctx_search, ctx_expand, ctx_memory, and /ctx-embed remain available. MC's historian/compartment preparation, tagging, markers, pruning, folding, drops, strips, splicing, synthetic context-management todos, temporal markers, nudges, and fail-closed blocking stop; ctx_expand remains a knowledge-surface tool. fail_closed_blocking is inert: a transform failure passes the input messages through without blocking or cancelling. This setting does not enable native compaction: OpenCode's compaction.auto / compaction.prune or Pi's equivalent owns the window, or nothing does. MC's compaction.enabled in magic-context.jsonc is distinct from OpenCode's compaction.auto / compaction.prune in opencode.jsonc; they are different files and different owners. On the first turn after disabling, a long session may trigger one native compaction cycle; MC removes only its own marker boundary, leaves native boundaries and stored compartments intact, and does no pre-trimming mitigation. Marker cleanup is lazy per session, so an unresumed session is cleaned when it is next resumed. If compaction is enabled again, run /ctx-wrapup when the historian is runnable to catch up. OpenCode peer verification against v1.18.4 confirms native compaction covers child sessions: subagents receive additive memory/docs injection and no MC reclaim in this mode, so keep subagent tasks small or leave compaction.enabled on for long subagent runs. This is boot-resolved and requires a process restart; project-tier compaction.enabled is stripped so a cloned repository cannot disable the user's setting. The sidebar reports raw usage as Context: <pct>% · native compaction or Context: <pct>% · no active compaction and does not show an MC execute-threshold fill. /ctx-wrapup, /ctx-recomp, /ctx-flush, and /ctx-session-upgrade refuse without context-management side effects; /ctx-embed remains functional. Raw content hidden by a native boundary before Magic Context's first pass is not retroactively indexed.")
26992
27027
  }).default({ enabled: true }).describe("Compaction-off mode gate. Default true (MC manages the context window as today). Set compaction.enabled=false to keep the knowledge layer while letting native compaction (or nothing) own the window. Boot-resolved; requires a restart to change."),
26993
27028
  todowrite: exports_external.object({
26994
27029
  enabled: exports_external.boolean().default(true).describe("Pi only: register Magic Context's todowrite task-list tool. Disable if you use your own todo extension. OpenCode ships its own built-in todowrite; this setting has no effect there."),
@@ -27163,6 +27198,19 @@ function stripUnsafeProjectConfigFields(projectRaw) {
27163
27198
  delete storage.enforce_private_permissions;
27164
27199
  warnings.push("Ignoring storage.enforce_private_permissions from project config (security: only user-level config may opt into externally managed shared storage permissions).");
27165
27200
  }
27201
+ const promptSurface = projectRaw.prompt_surface;
27202
+ if (isPlainObject2(promptSurface)) {
27203
+ const removed = [];
27204
+ for (const field of PROMPT_SURFACE_USER_ONLY_FIELDS) {
27205
+ if (field in promptSurface) {
27206
+ delete promptSurface[field];
27207
+ removed.push(field);
27208
+ }
27209
+ }
27210
+ if (removed.length > 0) {
27211
+ warnings.push(`Ignoring prompt_surface.${removed.join("/")} from project config (security: repositories may select prompt presets but only user config may provide guidance or tool-description text).`);
27212
+ }
27213
+ }
27166
27214
  const pi = projectRaw.pi;
27167
27215
  if (isPlainObject2(pi) && "subagent_extensions" in pi) {
27168
27216
  delete pi.subagent_extensions;
@@ -27357,11 +27405,12 @@ function dropInheritedEmbeddingKeyOnRedirect(projectRaw, mergedRaw, userRaw) {
27357
27405
  "Dropped inherited user embedding api_key because project config redirected " + "embedding.endpoint without supplying its own key (security: prevents key " + "exfiltration to a repository-chosen endpoint)."
27358
27406
  ];
27359
27407
  }
27360
- var HIDDEN_AGENT_KEYS, HISTORIAN_USER_ONLY_FIELDS, AGENT_ESCALATION_FIELDS, EMBEDDING_DESTINATION_FIELDS, PERCENTAGE_THRESHOLD_REASON = "security: a repository may only raise compaction thresholds above the user's effective value; it cannot force earlier historian work or cloned-repo cost escalation.", TOKEN_THRESHOLD_REASON = "security: a repository may only raise execute_threshold_tokens above the user's trusted token threshold; it cannot force earlier historian work or cloned-repo cost escalation.", TOKEN_THRESHOLD_INTRODUCTION_REASON = "security: a repository cannot introduce a new execute_threshold_tokens override when the user has no trusted token threshold for that key; that could force earlier historian work or cloned-repo cost escalation.";
27408
+ var HIDDEN_AGENT_KEYS, HISTORIAN_USER_ONLY_FIELDS, PROMPT_SURFACE_USER_ONLY_FIELDS, AGENT_ESCALATION_FIELDS, EMBEDDING_DESTINATION_FIELDS, PERCENTAGE_THRESHOLD_REASON = "security: a repository may only raise compaction thresholds above the user's effective value; it cannot force earlier historian work or cloned-repo cost escalation.", TOKEN_THRESHOLD_REASON = "security: a repository may only raise execute_threshold_tokens above the user's trusted token threshold; it cannot force earlier historian work or cloned-repo cost escalation.", TOKEN_THRESHOLD_INTRODUCTION_REASON = "security: a repository cannot introduce a new execute_threshold_tokens override when the user has no trusted token threshold for that key; that could force earlier historian work or cloned-repo cost escalation.";
27361
27409
  var init_project_security = __esm(() => {
27362
27410
  init_magic_context();
27363
27411
  HIDDEN_AGENT_KEYS = ["historian", "dreamer", "sidekick"];
27364
27412
  HISTORIAN_USER_ONLY_FIELDS = ["model", "fallback_models"];
27413
+ PROMPT_SURFACE_USER_ONLY_FIELDS = ["guidance_override_path", "tool_descriptions"];
27365
27414
  AGENT_ESCALATION_FIELDS = ["prompt", "permission", "tools", "system_prompt"];
27366
27415
  EMBEDDING_DESTINATION_FIELDS = ["endpoint", "provider", "fallback_provider"];
27367
27416
  });
@@ -27823,6 +27872,7 @@ function loadPluginConfigDetailed(directory) {
27823
27872
  };
27824
27873
  return {
27825
27874
  config: config2,
27875
+ registrationPromptSurface: trustedBaseConfig.prompt_surface,
27826
27876
  loadOutcome: combinedOutcome({ sources, substitutionFailures, recoveredTopLevelKeys }),
27827
27877
  sources,
27828
27878
  substitutionFailures,
@@ -29696,9 +29746,10 @@ function prepareMirrorPageStatements(db) {
29696
29746
  memoryById: db.prepare(`SELECT project_path, category, content, normalized_hash, importance, scope, shareable,
29697
29747
  source_session_id, source_type, seen_count, retrieval_count, first_seen_at,
29698
29748
  created_at, updated_at, last_seen_at, last_retrieved_at, status, expires_at,
29699
- verification_status, verified_at, classified_at, superseded_by_memory_id,
29700
- merged_from, metadata_json
29701
- FROM memories WHERE id = ?`),
29749
+ verification_status, verified_at, classified_at, superseded_by_memory_id,
29750
+ merged_from, metadata_json, mural_cue, mural_cue_hash, mural_cue_at,
29751
+ mural_cue_rejection_count
29752
+ FROM memories WHERE id = ?`),
29702
29753
  memoryIdByStoreId: db.prepare("SELECT id FROM memories WHERE id = ? AND project_path = ?"),
29703
29754
  memoryCandidates: db.prepare("SELECT id FROM memories WHERE project_path = ? AND category = ? AND normalized_hash = ? ORDER BY id"),
29704
29755
  insertMemory: db.prepare("INSERT INTO memories (project_path, category, content, normalized_hash, first_seen_at, created_at, updated_at, last_seen_at) VALUES (?, ?, '', '', 0, 0, 0, 0)"),
@@ -29719,8 +29770,9 @@ function prepareMirrorPageStatements(db) {
29719
29770
  importance = ?, scope = ?, shareable = ?, source_session_id = ?, source_type = ?,
29720
29771
  seen_count = ?, retrieval_count = ?, first_seen_at = ?, created_at = ?, updated_at = ?,
29721
29772
  last_seen_at = ?, last_retrieved_at = ?, status = ?, expires_at = ?,
29722
- verification_status = ?, verified_at = ?, classified_at = ?, superseded_by_memory_id = ?,
29723
- merged_from = ?, metadata_json = ? WHERE id = ?`),
29773
+ verification_status = ?, verified_at = ?, classified_at = ?, superseded_by_memory_id = ?,
29774
+ merged_from = ?, metadata_json = ?, mural_cue = ?, mural_cue_hash = ?, mural_cue_at = ?,
29775
+ mural_cue_rejection_count = ? WHERE id = ?`),
29724
29776
  updateSuperseded: db.prepare("UPDATE memories SET superseded_by_memory_id = ? WHERE id = ?"),
29725
29777
  deletePendingReference: db.prepare("DELETE FROM mirror_pending_references WHERE domain = 'memories' AND module_project = ? AND module_row_id = ?"),
29726
29778
  upsertPendingReference: db.prepare("INSERT INTO mirror_pending_references(domain, module_project, module_row_id, target_module_row_id) VALUES ('memories', ?, ?, ?) ON CONFLICT(domain, module_project, module_row_id) DO UPDATE SET target_module_row_id = excluded.target_module_row_id"),
@@ -29884,7 +29936,7 @@ function applyMemoryRow(db, feed, statements) {
29884
29936
  const nullableString = (key, previous) => has(key) ? rowNullableString(row, key) : previous ?? null;
29885
29937
  const hasSuperseded = has("superseded_by_memory_id");
29886
29938
  const previousHash = existing?.normalized_hash;
29887
- statements.updateMemory.run(has("project_path") ? rowString(row, "project_path") : existing?.project_path ?? moduleProject, has("category") ? rowString(row, "category", "CONSTRAINTS") : existing?.category ?? "CONSTRAINTS", has("content") ? rowString(row, "content") : existing?.content ?? "", has("normalized_hash") ? rowString(row, "normalized_hash") : existing?.normalized_hash ?? "", has("importance") ? typeof row.importance === "number" && Number.isFinite(row.importance) ? row.importance : null : existing?.importance ?? null, has("scope") ? rowString(row, "scope", "project") : existing?.scope ?? "project", has("shareable") ? rowNumber(row, "shareable") : existing?.shareable ?? 0, nullableString("source_session_id", existing?.source_session_id), nullableString("source_type", existing?.source_type), has("seen_count") ? rowNumber(row, "seen_count", 1) : existing?.seen_count ?? 1, has("retrieval_count") ? rowNumber(row, "retrieval_count") : existing?.retrieval_count ?? 0, has("first_seen_at") ? rowNumber(row, "first_seen_at") : existing?.first_seen_at ?? 0, has("created_at") ? rowNumber(row, "created_at") : existing?.created_at ?? 0, has("updated_at") ? rowNumber(row, "updated_at") : existing?.updated_at ?? 0, has("last_seen_at") ? rowNumber(row, "last_seen_at") : existing?.last_seen_at ?? 0, nullableNumber("last_retrieved_at", existing?.last_retrieved_at), has("status") ? rowString(row, "status", "active") : existing?.status ?? "active", nullableNumber("expires_at", existing?.expires_at), has("verification_status") ? rowString(row, "verification_status", "unverified") : existing?.verification_status ?? "unverified", nullableNumber("verified_at", existing?.verified_at), nullableNumber("classified_at", existing?.classified_at), hasSuperseded ? null : existing?.superseded_by_memory_id ?? null, nullableString("merged_from", existing?.merged_from), nullableString("metadata_json", existing?.metadata_json), contextId);
29939
+ statements.updateMemory.run(has("project_path") ? rowString(row, "project_path") : existing?.project_path ?? moduleProject, has("category") ? rowString(row, "category", "CONSTRAINTS") : existing?.category ?? "CONSTRAINTS", has("content") ? rowString(row, "content") : existing?.content ?? "", has("normalized_hash") ? rowString(row, "normalized_hash") : existing?.normalized_hash ?? "", has("importance") ? typeof row.importance === "number" && Number.isFinite(row.importance) ? row.importance : null : existing?.importance ?? null, has("scope") ? rowString(row, "scope", "project") : existing?.scope ?? "project", has("shareable") ? rowNumber(row, "shareable") : existing?.shareable ?? 0, nullableString("source_session_id", existing?.source_session_id), nullableString("source_type", existing?.source_type), has("seen_count") ? rowNumber(row, "seen_count", 1) : existing?.seen_count ?? 1, has("retrieval_count") ? rowNumber(row, "retrieval_count") : existing?.retrieval_count ?? 0, has("first_seen_at") ? rowNumber(row, "first_seen_at") : existing?.first_seen_at ?? 0, has("created_at") ? rowNumber(row, "created_at") : existing?.created_at ?? 0, has("updated_at") ? rowNumber(row, "updated_at") : existing?.updated_at ?? 0, has("last_seen_at") ? rowNumber(row, "last_seen_at") : existing?.last_seen_at ?? 0, nullableNumber("last_retrieved_at", existing?.last_retrieved_at), has("status") ? rowString(row, "status", "active") : existing?.status ?? "active", nullableNumber("expires_at", existing?.expires_at), has("verification_status") ? rowString(row, "verification_status", "unverified") : existing?.verification_status ?? "unverified", nullableNumber("verified_at", existing?.verified_at), nullableNumber("classified_at", existing?.classified_at), hasSuperseded ? null : existing?.superseded_by_memory_id ?? null, nullableString("merged_from", existing?.merged_from), nullableString("metadata_json", existing?.metadata_json), nullableString("mural_cue", existing?.mural_cue), nullableString("mural_cue_hash", existing?.mural_cue_hash), nullableNumber("mural_cue_at", existing?.mural_cue_at), has("mural_cue_rejection_count") ? rowNumber(row, "mural_cue_rejection_count") : existing?.mural_cue_rejection_count ?? 0, contextId);
29888
29940
  if (hasSuperseded && typeof row.superseded_by_memory_id === "number") {
29889
29941
  const translated = mirrorIdentity(db, "memories", moduleProject, row.superseded_by_memory_id, statements);
29890
29942
  if (translated) {
@@ -30175,7 +30227,11 @@ var init_context_authority = __esm(async () => {
30175
30227
  "merged_from",
30176
30228
  "metadata_json",
30177
30229
  "context_store_uuid",
30178
- "context_row_id"
30230
+ "context_row_id",
30231
+ "mural_cue",
30232
+ "mural_cue_hash",
30233
+ "mural_cue_at",
30234
+ "mural_cue_rejection_count"
30179
30235
  ];
30180
30236
  mirrorFlights = new WeakMap;
30181
30237
  });
@@ -32897,6 +32953,14 @@ class SubcModuleTransport {
32897
32953
  throw new Error("mirror.pull omitted page");
32898
32954
  return { page: response.page };
32899
32955
  }
32956
+ async deleteSession(sessionId, projectRoot) {
32957
+ await this.call({
32958
+ sessionId,
32959
+ projectRoot,
32960
+ method: "session.delete",
32961
+ body: { method: "session.delete", v: 1, session_id: sessionId }
32962
+ });
32963
+ }
32900
32964
  closeSession(sessionId) {
32901
32965
  const client = this.client;
32902
32966
  const prefix = `${sessionId}\x00`;
@@ -173057,6 +173121,7 @@ function loadPiConfig(opts = {}) {
173057
173121
  warnings.push(...parsed.warnings.map((warning) => `[merged config] ${warning}`));
173058
173122
  return {
173059
173123
  config: parsed.config,
173124
+ registrationPromptSurface: trustedBaseConfig.prompt_surface,
173060
173125
  warnings,
173061
173126
  loadedFromPaths: loadedFiles.map((loaded) => loaded.path)
173062
173127
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/magic-context",
3
- "version": "0.34.2",
3
+ "version": "0.35.0",
4
4
  "description": "Unified CLI for Magic Context — setup, doctor, and migration across OpenCode and Pi",
5
5
  "keywords": [
6
6
  "opencode",