negotium 0.10.1 → 0.11.1

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.
@@ -3001,7 +3001,7 @@ var init_codex = __esm(async () => {
3001
3001
  });
3002
3002
 
3003
3003
  // ../../packages/core/src/version.ts
3004
- var NEGOTIUM_VERSION = "0.10.1";
3004
+ var NEGOTIUM_VERSION = "0.11.1";
3005
3005
 
3006
3006
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3007
3007
  import { spawn as spawn2 } from "child_process";
@@ -7118,12 +7118,13 @@ function createPromptBuilders(host = {}) {
7118
7118
  sections.sort((a, b) => (a.order ?? 0) - (b.order ?? 0) || a.id.localeCompare(b.id));
7119
7119
  const templateCache = new Map;
7120
7120
  const template = (request) => {
7121
- const cached = templateCache.get(request.kind);
7121
+ const cacheKey = `${request.kind}:${request.filename}`;
7122
+ const cached = templateCache.get(cacheKey);
7122
7123
  if (cached !== undefined)
7123
7124
  return cached;
7124
7125
  const loaded = loadTemplate?.(request);
7125
- const value = loaded ?? (request.kind === "topic-system" ? topicSystemPromptTemplate() : request.kind === "channel-system" ? channelSystemPromptTemplate() : request.kind === "manager-system" ? managerSystemPromptTemplate() : visualDesignGuide());
7126
- templateCache.set(request.kind, value);
7126
+ const value = loaded ?? (request.kind === "topic-system" ? topicSystemPromptTemplate() : request.kind === "channel-system" ? channelSystemPromptTemplate() : request.kind === "manager-system" ? managerSystemPromptTemplate() : request.kind === "surface-profile" ? loadSessionPrompt(request.filename, request.fallback) : visualDesignGuide());
7127
+ templateCache.set(cacheKey, value);
7127
7128
  return value;
7128
7129
  };
7129
7130
  const build = (sessionKind, opts, sessionTemplate) => {
@@ -7139,7 +7140,19 @@ function createPromptBuilders(host = {}) {
7139
7140
  UPLOADS_DIR: uploadsDir,
7140
7141
  RESPONSE_LANGUAGE: resolveOutputLanguage()
7141
7142
  };
7142
- let prompt = replaceVars(sessionTemplate, templateVars) + buildRuntimeToolSection({
7143
+ const environmentProfileFiles = [
7144
+ ...opts.surface === "terminal" ? ["surfaces/cli.md"] : [],
7145
+ ...opts.surface ? [SURFACE_PROFILE_FILES[opts.surface]] : []
7146
+ ];
7147
+ const environmentProfiles = environmentProfileFiles.map((filename) => template({
7148
+ kind: "surface-profile",
7149
+ filename,
7150
+ fallback: ""
7151
+ }));
7152
+ const basePrompt = [sessionTemplate, ...environmentProfiles].filter((part) => part.trim()).join(`
7153
+
7154
+ `);
7155
+ let prompt = replaceVars(basePrompt, templateVars) + buildRuntimeToolSection({
7143
7156
  agentKind: opts.agentKind,
7144
7157
  canSpawnSubagents: sessionKind === "channel" ? false : opts.canSpawnSubagents,
7145
7158
  canStageSubagents: sessionKind === "channel" ? false : opts.canStageSubagents,
@@ -7219,7 +7232,7 @@ function buildMemoryPromptSection(opts) {
7219
7232
  return parts.join(`
7220
7233
  `);
7221
7234
  }
7222
- var PROMPTS_DIR, SESSIONS_DIR, FALLBACK_TOPIC_SYSTEM_PROMPT_TEMPLATE = `You are a helpful AI assistant named "{{AI_LABEL}}".
7235
+ var PROMPTS_DIR, SESSIONS_DIR, SURFACE_PROFILE_FILES, FALLBACK_TOPIC_SYSTEM_PROMPT_TEMPLATE = `You are a helpful AI assistant named "{{AI_LABEL}}".
7223
7236
  Topic: {{TOPIC_TITLE}}.
7224
7237
  Respond in the user's language (default: {{RESPONSE_LANGUAGE}}).
7225
7238
 
@@ -7248,6 +7261,11 @@ var init_builders = __esm(() => {
7248
7261
  init_logger();
7249
7262
  PROMPTS_DIR = resolve11(PROJECT_ROOT, "src/prompts");
7250
7263
  SESSIONS_DIR = resolve11(PROMPTS_DIR, "sessions");
7264
+ SURFACE_PROFILE_FILES = {
7265
+ terminal: "surfaces/terminal.md",
7266
+ telegram: "surfaces/telegram.md",
7267
+ otium: "surfaces/otium.md"
7268
+ };
7251
7269
  defaultPromptBuilders = createPromptBuilders();
7252
7270
  buildTopicSystemPrompt = defaultPromptBuilders.buildTopicSystemPrompt;
7253
7271
  buildChannelSystemPrompt = defaultPromptBuilders.buildChannelSystemPrompt;
@@ -17816,6 +17834,7 @@ function startAiTurn(params) {
17816
17834
  topicTitle: topic.title,
17817
17835
  workspaceCwd,
17818
17836
  agentKind,
17837
+ surface: topicRecord?.surface ?? topic.surface,
17819
17838
  currentModel: resolvedModel,
17820
17839
  currentEffort: resolvedEffort,
17821
17840
  description: topic.description,
@@ -20233,4 +20252,4 @@ export {
20233
20252
  DEFAULT_SELF_CONFIG_PRODUCT
20234
20253
  };
20235
20254
 
20236
- //# debugId=6125C3400F8555BD64756E2164756E21
20255
+ //# debugId=6E0251D4E867F60764756E2164756E21