impel-cli 0.19.1 → 0.19.2-beta.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.
- package/package.json +1 -1
- package/src/agents.js +41 -7
- package/src/apps.js +6 -1
- package/src/commands/launch.js +11 -2
- package/src/remote/transfer.js +2 -10
- package/src/verbatimRelay.js +64 -0
package/package.json
CHANGED
package/src/agents.js
CHANGED
|
@@ -12,6 +12,15 @@ import path from "node:path";
|
|
|
12
12
|
import { normalizeGatewayUrl, redactSecretText } from "./config.js";
|
|
13
13
|
import { impelMcpInvocation } from "./selfInvocation.js";
|
|
14
14
|
import { normalizeTenantId } from "./tenants.js";
|
|
15
|
+
import {
|
|
16
|
+
adapterCallerSpawnGuidance,
|
|
17
|
+
adapterHardCompletionGuidance,
|
|
18
|
+
adapterSoftCompletionGuidance,
|
|
19
|
+
claudeHardCompletionGuidance,
|
|
20
|
+
claudeSoftCompletionGuidance,
|
|
21
|
+
customAgentVerbatimDescriptionLead,
|
|
22
|
+
usesVerbatimRelay,
|
|
23
|
+
} from "./verbatimRelay.js";
|
|
15
24
|
import { renameWithWindowsRetry } from "./windowsFs.js";
|
|
16
25
|
|
|
17
26
|
export const AGENT_SYNC_TTL_MS = 6 * 60 * 60 * 1000;
|
|
@@ -21,7 +30,7 @@ export const NATIVE_AGENT_LIST_TOOL = "impel_specialists-list_native_agents";
|
|
|
21
30
|
export const NATIVE_AGENT_START_TOOL = "impel_specialists-start_native_agent_run";
|
|
22
31
|
export const NATIVE_AGENT_READ_TOOL = "impel_specialists-read_native_agent_run";
|
|
23
32
|
export const MANAGED_AGENT_MCP_SERVER = "impel_agent";
|
|
24
|
-
export const MANAGED_AGENT_MANIFEST_VERSION =
|
|
33
|
+
export const MANAGED_AGENT_MANIFEST_VERSION = 5;
|
|
25
34
|
|
|
26
35
|
const NATIVE_AGENT_TOOL_NAMES = [
|
|
27
36
|
NATIVE_AGENT_LIST_TOOL,
|
|
@@ -125,6 +134,9 @@ export function normalizeNativeAgentCatalog(payload, expectedTenantId) {
|
|
|
125
134
|
throw new Error(`native-agent catalog returned duplicate binding ${binding}`);
|
|
126
135
|
}
|
|
127
136
|
seenBindings.add(binding);
|
|
137
|
+
if (agent.verbatimRelay !== undefined && typeof agent.verbatimRelay !== "boolean") {
|
|
138
|
+
throw new Error("native-agent catalog returned an invalid verbatimRelay");
|
|
139
|
+
}
|
|
128
140
|
return {
|
|
129
141
|
agentId,
|
|
130
142
|
title: boundedString(agent.title, "title", { max: 160 }),
|
|
@@ -135,6 +147,7 @@ export function normalizeNativeAgentCatalog(payload, expectedTenantId) {
|
|
|
135
147
|
exclusions: stringList(agent.exclusions, "exclusions"),
|
|
136
148
|
requiredContext: stringList(agent.requiredContext, "requiredContext"),
|
|
137
149
|
sideEffects: enumString(agent.sideEffects, "sideEffects", ["read-only", "writes"]),
|
|
150
|
+
...(agent.verbatimRelay === true ? { verbatimRelay: true } : {}),
|
|
138
151
|
};
|
|
139
152
|
});
|
|
140
153
|
return { orgId: tenantId, agents };
|
|
@@ -329,14 +342,21 @@ function claudeAdapterInstructions(tenantId, agent) {
|
|
|
329
342
|
const sideEffectInstruction = agent.sideEffects === "writes"
|
|
330
343
|
? `The catalog declares that this agent writes user or workspace data. Use this adapter only when the user explicitly selected this exact agent for the current request; that explicit selection is the required side-effect confirmation, so pass confirmedSideEffects true. If the agent was chosen automatically or the selection is ambiguous, do not start it and ask the user to select it explicitly.`
|
|
331
344
|
: `The catalog declares that this agent is read-only; omit confirmedSideEffects.`;
|
|
345
|
+
const callerSpawnGuidance = usesVerbatimRelay(agent)
|
|
346
|
+
? adapterCallerSpawnGuidance("Claude")
|
|
347
|
+
: null;
|
|
348
|
+
const completionGuidance = usesVerbatimRelay(agent)
|
|
349
|
+
? claudeHardCompletionGuidance()
|
|
350
|
+
: claudeSoftCompletionGuidance();
|
|
332
351
|
return [
|
|
333
352
|
`You are a thin transport adapter for the exact Impel native agent ${JSON.stringify(agent.agentId)} in tenant ${JSON.stringify(tenantId)}.`,
|
|
353
|
+
...(callerSpawnGuidance ? [callerSpawnGuidance] : []),
|
|
334
354
|
`Do not perform the assigned task yourself and do not delegate to any other agent.`,
|
|
335
355
|
`First call ${toolName(NATIVE_AGENT_LIST_TOOL)} and verify that the exact agentId is still available with sideEffects ${JSON.stringify(agent.sideEffects)}. If it is unavailable or its policy excludes the request, stop with that explicit error.`,
|
|
336
356
|
sideEffectInstruction,
|
|
337
357
|
`Call ${toolName(NATIVE_AGENT_START_TOOL)} exactly once with agentId ${JSON.stringify(agent.agentId)}, scopeParam ${JSON.stringify(agent.scopeParam)}, task set to the complete assigned task, optional context set to one string containing all supplied context (omit it when no context was supplied), contextKeys naming the context fields present in that string, confirmedSideEffects as directed above, and one stable idempotencyKey that you reuse for this logical task.${contextRequirement}`,
|
|
338
358
|
`Then call ${toolName(NATIVE_AGENT_READ_TOOL)} with the returned runId and waitSeconds 20 until the run reaches a terminal state.`,
|
|
339
|
-
|
|
359
|
+
completionGuidance,
|
|
340
360
|
].join(" ");
|
|
341
361
|
}
|
|
342
362
|
|
|
@@ -494,22 +514,36 @@ function codexAdapterInstructions(tenantId, agent) {
|
|
|
494
514
|
? `The catalog declares that this agent writes user or workspace data. Use this adapter only when the user explicitly selected this exact agent for the current request; that explicit selection is the required side-effect confirmation. If the agent was chosen automatically or the selection is ambiguous, do not run the orchestration and ask the user to select this exact agent explicitly.`
|
|
495
515
|
: `The catalog declares that this agent is read-only; the orchestration omits confirmedSideEffects.`;
|
|
496
516
|
const source = renderCodexAdapterOrchestration(tenantId, agent);
|
|
517
|
+
const callerSpawnGuidance = usesVerbatimRelay(agent)
|
|
518
|
+
? adapterCallerSpawnGuidance("Codex")
|
|
519
|
+
: null;
|
|
520
|
+
const completionGuidance = usesVerbatimRelay(agent)
|
|
521
|
+
? adapterHardCompletionGuidance()
|
|
522
|
+
: adapterSoftCompletionGuidance();
|
|
497
523
|
return [
|
|
498
524
|
`You are a thin transport adapter for the exact Impel native agent ${JSON.stringify(agent.agentId)} in tenant ${JSON.stringify(tenantId)}.`,
|
|
499
|
-
|
|
525
|
+
...(callerSpawnGuidance ? [callerSpawnGuidance] : []),
|
|
500
526
|
`Do not perform the assigned task yourself, do not delegate to any other agent, and do not independently synthesize or rewrite the result.`,
|
|
501
527
|
`Confirm that the assigned request fits the cataloged capabilities ${JSON.stringify(agent.capabilities)} and none of the exclusions ${JSON.stringify(agent.exclusions)} before starting.${contextRequirement}`,
|
|
502
528
|
sideEffectInstruction,
|
|
503
529
|
`Invoke functions.exec exactly once for the orchestration below. Do not call the MCP tools directly or select a separate MCP call for any poll. Replace ${CODEX_TASK_PLACEHOLDER} with a JSON string literal for the complete assigned task. Replace ${CODEX_CONTEXT_PLACEHOLDER} with one JSON string literal containing all supplied caller context, or with null when no context was supplied; never use an object or array. Replace ${CODEX_CONTEXT_KEYS_PLACEHOLDER} with a JSON array naming the context fields present in that string, or [] when context is absent. Replace ${CODEX_IDEMPOTENCY_KEY_PLACEHOLDER} with one new opaque idempotency key for this logical invocation: choose it exactly once, reuse it unchanged for any retry of this invocation, and never reuse it for a separate request even when task and context are identical. Then pass the raw JavaScript without Markdown fences.`,
|
|
504
530
|
`The JavaScript validates the exact tenant, agent binding, and catalog policy; passes the one stable logical-invocation idempotencyKey; starts exactly once; and polls deterministically with the compatible 20-second server wait until status is succeeded or failed. If functions.exec yields a running cell, use functions.wait with max_tokens 30000 only to resume that same orchestration; never start another orchestration or poll the MCP tool yourself.`,
|
|
505
|
-
|
|
531
|
+
completionGuidance,
|
|
506
532
|
"",
|
|
507
533
|
source,
|
|
508
534
|
].join("\n\n");
|
|
509
535
|
}
|
|
510
536
|
|
|
537
|
+
function customAgentDescription(tenantId, agent) {
|
|
538
|
+
const sideEffectsLabel = agent.sideEffects === "writes" ? " (may write user or workspace data)" : " (read-only)";
|
|
539
|
+
return (usesVerbatimRelay(agent)
|
|
540
|
+
? `${customAgentVerbatimDescriptionLead()}. Runs ${agent.title} for Impel tenant ${tenantId}${sideEffectsLabel}: ${agent.description}`
|
|
541
|
+
: `Explicitly runs ${agent.title} for Impel tenant ${tenantId}${sideEffectsLabel}: ${agent.description}`
|
|
542
|
+
).slice(0, 900);
|
|
543
|
+
}
|
|
544
|
+
|
|
511
545
|
function renderClaudeAgent({ tenantId, agent, name, invocation }) {
|
|
512
|
-
const description =
|
|
546
|
+
const description = customAgentDescription(tenantId, agent);
|
|
513
547
|
const lines = [
|
|
514
548
|
"---",
|
|
515
549
|
`name: ${JSON.stringify(name)}`,
|
|
@@ -534,7 +568,7 @@ function renderClaudeAgent({ tenantId, agent, name, invocation }) {
|
|
|
534
568
|
}
|
|
535
569
|
|
|
536
570
|
function renderCodexAgent({ tenantId, agent, name, invocation }) {
|
|
537
|
-
const description =
|
|
571
|
+
const description = customAgentDescription(tenantId, agent);
|
|
538
572
|
const envEntries = Object.entries(invocation.env || {})
|
|
539
573
|
.map(([key, value]) => `${JSON.stringify(key)} = ${JSON.stringify(value)}`)
|
|
540
574
|
.join(", ");
|
|
@@ -628,7 +662,7 @@ export function syncAgentProfile({ client, root, label, tenantId, agents, now =
|
|
|
628
662
|
const prior = readManifest(manifestPath);
|
|
629
663
|
const rendered = renderManagedAgents(client, tenantId, agents);
|
|
630
664
|
const priorFiles = new Set(prior?.files || []);
|
|
631
|
-
const priorUsesDiscoveryRoot = [2, 3, MANAGED_AGENT_MANIFEST_VERSION].includes(prior?.version);
|
|
665
|
+
const priorUsesDiscoveryRoot = [2, 3, 4, MANAGED_AGENT_MANIFEST_VERSION].includes(prior?.version);
|
|
632
666
|
|
|
633
667
|
// Native clients discover standalone definitions directly under `agents/`.
|
|
634
668
|
// Preflight every destination before writing so an unmanaged file with the
|
package/src/apps.js
CHANGED
|
@@ -16,6 +16,7 @@ import { ensureClaudeSessionHooks, ensureCodexSessionHooks } from "./sessionHook
|
|
|
16
16
|
import { ADHOC_IDENTITY, codesignIdentityArgs, desiredSigningMode, resolveSigningIdentity } from "./codesign.js";
|
|
17
17
|
import { applyImpelClaudeSandbox } from "./claudeSandbox.js";
|
|
18
18
|
import { brandedEnvironmentName, RUNTIME_BRAND } from "./runtimeBrand.js";
|
|
19
|
+
import { IMPEL_CODEX_PARENT_DELEGATION_INSTRUCTIONS } from "./commands/launch.js";
|
|
19
20
|
|
|
20
21
|
export const CLAUDE_CONFIG_ID = "1ced0000-0000-4000-8000-000000000001";
|
|
21
22
|
const CHATGPT_CONFIG_START = `# >>> ${RUNTIME_BRAND.cli.command} app managed gateway >>>`;
|
|
@@ -266,7 +267,8 @@ export function managedAppIdentity(target, tenantId = null, tenantName = null) {
|
|
|
266
267
|
// 26: remember the managed provider defaults and move legacy GPT-5.5 profiles
|
|
267
268
|
// onto GPT-5.6 Sol so ChatGPT's compact Work picker does not fall back to its
|
|
268
269
|
// unsupported-selection "Reset to default" treatment.
|
|
269
|
-
|
|
270
|
+
// 27: add managed ChatGPT parent delegation instructions, including custom-agent verbatim relay opt-in.
|
|
271
|
+
export const CURRENT_CONFIG_VERSION = 27;
|
|
270
272
|
|
|
271
273
|
// Identifies the bundle-BUILDING logic — the asar patches, plist rewrites,
|
|
272
274
|
// helper rebranding, and signing. A vendored bundle is rebuilt only when this
|
|
@@ -1269,6 +1271,9 @@ function writeChatGPTConfig(
|
|
|
1269
1271
|
`model_catalog_json = ${tomlString(paths.chatgpt.catalog)}`,
|
|
1270
1272
|
...(selectedEffort ? [`model_reasoning_effort = ${tomlString(selectedEffort)}`] : []),
|
|
1271
1273
|
...(selectedTier ? [`service_tier = ${tomlString(selectedTier)}`] : []),
|
|
1274
|
+
...(RUNTIME_BRAND.features.agents
|
|
1275
|
+
? [`developer_instructions = ${tomlString(IMPEL_CODEX_PARENT_DELEGATION_INSTRUCTIONS)}`]
|
|
1276
|
+
: []),
|
|
1272
1277
|
"",
|
|
1273
1278
|
// The built-in ChatGPT provider derives its inference endpoint from
|
|
1274
1279
|
// chatgpt.com even when chatgpt_base_url points at the gateway. Keep the
|
package/src/commands/launch.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
resolveDefaultGateway,
|
|
15
15
|
saveConfig,
|
|
16
16
|
} from "../config.js";
|
|
17
|
+
import { parentVerbatimRelayAppendix } from "../verbatimRelay.js";
|
|
17
18
|
import { impelClaudeBaseUrl, impelCrossAppClaudeBaseUrl } from "../claudeSetup.js";
|
|
18
19
|
import { withGitEnvironment } from "../skills.js";
|
|
19
20
|
import { assertProviderScopes, ensureTenantSelection, tenantCredential } from "../tenants.js";
|
|
@@ -49,10 +50,18 @@ export {
|
|
|
49
50
|
|
|
50
51
|
export const IMPEL_SPECIALIST_DELEGATION_INSTRUCTIONS = `You are running in an Impel tenant-scoped session. Before starting any non-trivial task, call the Impel MCP tool list_specialists. If exactly one available specialist clearly matches the user's request, its capabilities and its exclusions, delegate the complete request by calling start_specialist_run exactly once with a stable idempotency key, then call read_specialist_run until it reaches a terminal state. When the run succeeds, use the specialist's result as your response instead of redoing the work. If no specialist clearly matches, the tools are unavailable, or the run fails, continue normally yourself. Do not delegate trivial requests, do not call a specialist excluded from the request, and never invent a specialist result.`;
|
|
51
52
|
|
|
53
|
+
export const IMPEL_CUSTOM_AGENT_VERBATIM_RELAY_APPENDIX = parentVerbatimRelayAppendix();
|
|
54
|
+
|
|
55
|
+
export const IMPEL_CLAUDE_PARENT_DELEGATION_INSTRUCTIONS =
|
|
56
|
+
`${IMPEL_SPECIALIST_DELEGATION_INSTRUCTIONS} ${IMPEL_CUSTOM_AGENT_VERBATIM_RELAY_APPENDIX}`;
|
|
57
|
+
|
|
52
58
|
export const IMPEL_CODEX_SPECIALIST_DELEGATION_INSTRUCTIONS =
|
|
53
59
|
`${IMPEL_SPECIALIST_DELEGATION_INSTRUCTIONS} ` +
|
|
54
60
|
`Codex can defer MCP tools behind tool_search. If an Impel specialist tool is not directly visible, call tool_search for its exact name before treating it as unavailable: impel_specialists-list_specialists for discovery, impel_specialists-start_specialist_run to delegate, and impel_specialists-read_specialist_run to poll the result. Use the returned tool for the same one-run delegation flow.`;
|
|
55
61
|
|
|
62
|
+
export const IMPEL_CODEX_PARENT_DELEGATION_INSTRUCTIONS =
|
|
63
|
+
`${IMPEL_CODEX_SPECIALIST_DELEGATION_INSTRUCTIONS} ${IMPEL_CUSTOM_AGENT_VERBATIM_RELAY_APPENDIX}`;
|
|
64
|
+
|
|
56
65
|
const IMPEL_CODEX_RUNTIME_OVERRIDES = [
|
|
57
66
|
// Codex models may select code mode even when the standalone
|
|
58
67
|
// `codex-code-mode-host` companion is not present in the vendor install.
|
|
@@ -64,14 +73,14 @@ const IMPEL_CODEX_RUNTIME_OVERRIDES = [
|
|
|
64
73
|
export function impelLaunchArguments(tool, argv) {
|
|
65
74
|
if (!RUNTIME_BRAND.features.agents) return [...argv];
|
|
66
75
|
if (tool === "claude") {
|
|
67
|
-
return ["--append-system-prompt",
|
|
76
|
+
return ["--append-system-prompt", IMPEL_CLAUDE_PARENT_DELEGATION_INSTRUCTIONS, ...argv];
|
|
68
77
|
}
|
|
69
78
|
if (tool === "codex") {
|
|
70
79
|
// `-c` is a Codex global option, so it must precede subcommands such as
|
|
71
80
|
// `exec`, `resume`, and `mcp`. JSON strings are valid TOML basic strings.
|
|
72
81
|
return [
|
|
73
82
|
"-c",
|
|
74
|
-
`developer_instructions=${JSON.stringify(
|
|
83
|
+
`developer_instructions=${JSON.stringify(IMPEL_CODEX_PARENT_DELEGATION_INSTRUCTIONS)}`,
|
|
75
84
|
...IMPEL_CODEX_RUNTIME_OVERRIDES.flatMap((override) => ["-c", override]),
|
|
76
85
|
...argv,
|
|
77
86
|
];
|
package/src/remote/transfer.js
CHANGED
|
@@ -40,14 +40,6 @@ function writePrivate(filePath, contents) {
|
|
|
40
40
|
try { fs.chmodSync(filePath, 0o600); } catch { /* Best effort on Windows. */ }
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
function localTarEnvironment() {
|
|
44
|
-
// macOS libarchive serializes extended attributes into AppleDouble `._*`
|
|
45
|
-
// entries unless copyfile metadata is explicitly disabled. Those synthetic
|
|
46
|
-
// files make a clean transferred repository appear dirty on Linux even when
|
|
47
|
-
// tar's --no-xattrs option is present.
|
|
48
|
-
return { ...process.env, COPYFILE_DISABLE: "1" };
|
|
49
|
-
}
|
|
50
|
-
|
|
51
43
|
export function inspectRepository(requestedPath = process.cwd()) {
|
|
52
44
|
const requested = path.resolve(requestedPath);
|
|
53
45
|
const candidate = fs.realpathSync(requested);
|
|
@@ -106,7 +98,7 @@ export function createRepositoryTransfer(state, repository) {
|
|
|
106
98
|
"--no-xattrs",
|
|
107
99
|
"--null",
|
|
108
100
|
"-T", paths.fileList,
|
|
109
|
-
], { cwd: repository.root
|
|
101
|
+
], { cwd: repository.root });
|
|
110
102
|
return paths;
|
|
111
103
|
}
|
|
112
104
|
|
|
@@ -286,7 +278,7 @@ export function transferSessionCheckpoint(state, { provider, sessionId, tenantId
|
|
|
286
278
|
try {
|
|
287
279
|
runCapture(process.env.IMPEL_REMOTE_TAR_BIN || "tar", [
|
|
288
280
|
"-cf", checkpointArchive, "--no-xattrs", "--null", "-T", checkpointList,
|
|
289
|
-
], { cwd: localRoot
|
|
281
|
+
], { cwd: localRoot });
|
|
290
282
|
sshCapture(state, `mkdir -p ${remoteRoot}`);
|
|
291
283
|
runInteractive(process.env.IMPEL_REMOTE_SSH_BIN || "ssh", sshArgs(state, `tar -xf - -C ${remoteRoot}`), {
|
|
292
284
|
inputFile: checkpointArchive,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export const VERBATIM_RELAY_OPT_IN_MARKER = "verbatimRelay enabled";
|
|
2
|
+
|
|
3
|
+
export const VERBATIM_SPAWN_REQUIREMENT = 'fork_turns="none"';
|
|
4
|
+
|
|
5
|
+
export const VERBATIM_FINAL_TEXT_CONSTRAINTS =
|
|
6
|
+
"no preface, rewriting, Markdown changes, or independent synthesis";
|
|
7
|
+
|
|
8
|
+
export function usesVerbatimRelay(agent) {
|
|
9
|
+
return agent?.verbatimRelay === true;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function parentVerbatimRelayAppendix() {
|
|
13
|
+
return (
|
|
14
|
+
`When an explicit custom agent's catalog-derived description declares ${VERBATIM_RELAY_OPT_IN_MARKER}, ` +
|
|
15
|
+
`spawn it with ${VERBATIM_SPAWN_REQUIREMENT} and relay its finalText verbatim with ${VERBATIM_FINAL_TEXT_CONSTRAINTS}; ` +
|
|
16
|
+
"preserve Sources sections and citations exactly. " +
|
|
17
|
+
"Custom agents without that declaration keep the default delegation behavior."
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function customAgentVerbatimDescriptionLead() {
|
|
22
|
+
return (
|
|
23
|
+
`Explicit custom agent with ${VERBATIM_RELAY_OPT_IN_MARKER}: ` +
|
|
24
|
+
`callers must use ${VERBATIM_SPAWN_REQUIREMENT} and relay its result verbatim`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function adapterCallerSpawnGuidance(clientLabel) {
|
|
29
|
+
return (
|
|
30
|
+
`Callers must spawn this explicit custom ${clientLabel} agent with ${VERBATIM_SPAWN_REQUIREMENT} ` +
|
|
31
|
+
"and must relay your result verbatim; this is caller guidance and cannot enforce host spawn behavior."
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function adapterHardCompletionGuidance() {
|
|
36
|
+
return (
|
|
37
|
+
`After the orchestration completes, return its single text output verbatim with ${VERBATIM_FINAL_TEXT_CONSTRAINTS}. ` +
|
|
38
|
+
"A successful output is result.finalText exactly. A failure output preserves the durable runId, output, and error."
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function adapterSoftCompletionGuidance() {
|
|
43
|
+
return (
|
|
44
|
+
"After the orchestration completes, return its single text output as the answer. " +
|
|
45
|
+
"A successful output is result.finalText. A failure output preserves the durable runId, output, and error. " +
|
|
46
|
+
"Never invent or independently synthesize a replacement result."
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function claudeHardCompletionGuidance() {
|
|
51
|
+
return (
|
|
52
|
+
`When it succeeds, return result.finalText exactly with ${VERBATIM_FINAL_TEXT_CONSTRAINTS}. ` +
|
|
53
|
+
"When it fails, return the durable runId, preserved output, and error. " +
|
|
54
|
+
"Never invent or independently synthesize a replacement result."
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function claudeSoftCompletionGuidance() {
|
|
59
|
+
return (
|
|
60
|
+
"When it succeeds, return result.finalText faithfully as the answer. " +
|
|
61
|
+
"When it fails, return the durable runId, preserved output, and error. " +
|
|
62
|
+
"Never invent or independently synthesize a replacement result."
|
|
63
|
+
);
|
|
64
|
+
}
|