rpg-engine 0.23.1 → 0.24.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/README.md +2 -2
- package/dist/campaign/create-campaign.d.ts +1 -1
- package/dist/campaign/create-campaign.js +1 -1
- package/dist/campaign/find-campaign.js +11 -1
- package/dist/campaign/host-files.d.ts +5 -6
- package/dist/campaign/host-files.js +100 -60
- package/dist/campaign/settings.d.ts +3 -3
- package/dist/campaign/settings.js +5 -4
- package/dist/cli/cli.js +11 -2
- package/dist/commands/config/config.js +1 -1
- package/dist/commands/config/dashboard.js +23 -6
- package/dist/commands/config/words.js +1 -0
- package/dist/commands/image.js +3 -3
- package/dist/commands/import/import.d.ts +3 -1
- package/dist/commands/import/import.js +13 -5
- package/dist/commands/instructions.js +1 -1
- package/dist/commands/shared/campaign/images.js +3 -2
- package/dist/commands/shared/campaign/mode.js +1 -1
- package/dist/commands/shared/characters/voices.d.ts +2 -2
- package/dist/commands/shared/characters/voices.js +9 -9
- package/dist/commands/shared/sheet/sheet.d.ts +2 -2
- package/dist/commands/shared/sheet/sheet.js +3 -3
- package/dist/core/context.d.ts +8 -2
- package/dist/dashboard/acts/acts.js +39 -11
- package/dist/dashboard/acts/head.js +7 -0
- package/dist/dashboard/acts/names.js +4 -2
- package/dist/dashboard/acts/sending.js +23 -22
- package/dist/dashboard/acts/sheet.js +7 -149
- package/dist/dashboard/acts/strip.js +10 -14
- package/dist/dashboard/acts/talk.js +51 -0
- package/dist/dashboard/acts/thing.js +169 -0
- package/dist/dashboard/app.js +3 -3
- package/dist/dashboard/guide/ar.md +13 -13
- package/dist/dashboard/guide/cs.md +12 -12
- package/dist/dashboard/guide/da.md +12 -12
- package/dist/dashboard/guide/de.md +11 -11
- package/dist/dashboard/guide/el.md +11 -11
- package/dist/dashboard/guide/en.md +10 -10
- package/dist/dashboard/guide/es.md +11 -11
- package/dist/dashboard/guide/fi.md +11 -11
- package/dist/dashboard/guide/fr.md +12 -12
- package/dist/dashboard/guide/he.md +11 -11
- package/dist/dashboard/guide/hi.md +11 -11
- package/dist/dashboard/guide/hu.md +11 -11
- package/dist/dashboard/guide/is.md +11 -11
- package/dist/dashboard/guide/it.md +38 -38
- package/dist/dashboard/guide/ja.md +11 -11
- package/dist/dashboard/guide/ko.md +12 -12
- package/dist/dashboard/guide/nb.md +11 -11
- package/dist/dashboard/guide/nl.md +11 -11
- package/dist/dashboard/guide/pl.md +11 -11
- package/dist/dashboard/guide/pt.md +11 -11
- package/dist/dashboard/guide/ro.md +12 -12
- package/dist/dashboard/guide/ru.md +12 -12
- package/dist/dashboard/guide/sv.md +12 -12
- package/dist/dashboard/guide/tr.md +12 -12
- package/dist/dashboard/guide/uk.md +11 -11
- package/dist/dashboard/guide/zh.md +12 -12
- package/dist/dashboard/i18n/ar.json +24 -10
- package/dist/dashboard/i18n/cs.json +24 -10
- package/dist/dashboard/i18n/da.json +24 -10
- package/dist/dashboard/i18n/de.json +24 -10
- package/dist/dashboard/i18n/el.json +24 -10
- package/dist/dashboard/i18n/es.json +24 -10
- package/dist/dashboard/i18n/fi.json +24 -10
- package/dist/dashboard/i18n/fr.json +24 -10
- package/dist/dashboard/i18n/he.json +24 -10
- package/dist/dashboard/i18n/hi.json +24 -10
- package/dist/dashboard/i18n/hu.json +24 -10
- package/dist/dashboard/i18n/is.json +24 -10
- package/dist/dashboard/i18n/it.json +102 -88
- package/dist/dashboard/i18n/ja.json +24 -10
- package/dist/dashboard/i18n/ko.json +24 -10
- package/dist/dashboard/i18n/nb.json +24 -10
- package/dist/dashboard/i18n/nl.json +24 -10
- package/dist/dashboard/i18n/pl.json +24 -10
- package/dist/dashboard/i18n/pt.json +24 -10
- package/dist/dashboard/i18n/ro.json +24 -10
- package/dist/dashboard/i18n/ru.json +24 -10
- package/dist/dashboard/i18n/sv.json +24 -10
- package/dist/dashboard/i18n/tr.json +24 -10
- package/dist/dashboard/i18n/uk.json +24 -10
- package/dist/dashboard/i18n/zh.json +24 -10
- package/dist/dashboard/packages/packages.js +1 -1
- package/dist/dashboard/parts/icons.js +2 -0
- package/dist/dashboard/parts/labels.js +1 -0
- package/dist/dashboard/parts/layout.js +34 -0
- package/dist/dashboard/parts/widgets.js +6 -2
- package/dist/dashboard/settings/language-choice.js +1 -1
- package/dist/dashboard/settings/settings.js +61 -36
- package/dist/dashboard/settings/tabs.js +14 -0
- package/dist/dashboard/sheet/sheet.js +54 -33
- package/dist/dashboard/shell/notices.js +2 -2
- package/dist/dashboard/style.css +122 -47
- package/dist/helpers/antigravity.d.ts +47 -0
- package/dist/helpers/antigravity.js +434 -0
- package/dist/helpers/chosen.d.ts +11 -7
- package/dist/helpers/chosen.js +64 -37
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +2 -1
- package/dist/helpers/opencode.js +117 -24
- package/dist/helpers/programs.d.ts +8 -0
- package/dist/helpers/programs.js +35 -2
- package/dist/helpers/stop.d.ts +2 -0
- package/dist/helpers/stop.js +20 -1
- package/dist/helpers/svg.d.ts +4 -1
- package/dist/helpers/svg.js +16 -4
- package/dist/instructions/index.d.ts +4 -2
- package/dist/instructions/index.js +6 -3
- package/dist/server/bell/antigravity.d.ts +7 -2
- package/dist/server/bell/antigravity.js +24 -6
- package/dist/server/bell/index.d.ts +1 -1
- package/dist/server/bell/index.js +1 -1
- package/dist/server/bell/listener.js +6 -1
- package/dist/server/fence.d.ts +21 -0
- package/dist/server/fence.js +69 -0
- package/dist/server/mcp.js +26 -0
- package/dist/server/player-acts.js +1 -1
- package/dist/server/subagent.d.ts +4 -0
- package/dist/server/subagent.js +30 -0
- package/instructions/voices-antigravity.md +1 -0
- package/instructions/voices-codex.md +1 -0
- package/instructions/voices-opencode.md +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ An AI is a wonderful storyteller, but a storyteller tends to make the world fit
|
|
|
25
25
|
- **Save**, as in a video game: at the end of every scene, to go back or start over as you choose.
|
|
26
26
|
- **Choose how you play**: difficulty, lethality, how much the master teaches the rules, its style, your lines and veils.
|
|
27
27
|
- **Play in your language**: the dashboard speaks 26, and any other is translated for you.
|
|
28
|
-
- **See where you are**: pictures of the places you reach, the quests you take and the people you meet. Painted ones, as the inn above, come from **Codex** signed in with your ChatGPT account, even when your master is Claude Code; Antigravity paints its own. Install Codex with `npm install -g @openai/codex` and sign in once with `codex login`. With Claude Code alone, Claude draws simpler vector ones; in OpenCode, and in Antigravity when its tool fails, the master draws them itself, the same way.
|
|
28
|
+
- **See where you are**: pictures of the places you reach, the quests you take and the people you meet. Painted ones, as the inn above, come from **Codex** signed in with your ChatGPT account, even when your master is Claude Code; Antigravity paints its own with a paid Google plan, and can paint for another master too. Install Codex with `npm install -g @openai/codex` and sign in once with `codex login`. With Claude Code alone, Claude draws simpler vector ones; in OpenCode, and in Antigravity when its tool fails, the master draws them itself, the same way.
|
|
29
29
|
|
|
30
30
|
## The game
|
|
31
31
|
|
|
@@ -45,7 +45,7 @@ A game comes as a game system, a package the master installs when you set up a c
|
|
|
45
45
|
|
|
46
46
|
**Node.js 24** or newer, a web browser, and an AI agent to be the master: an AI app that can work with the files on your computer, such as Claude Code, Codex, Antigravity or OpenCode. A plain chat such as claude.ai or ChatGPT, or a phone app, is not enough: the master needs to reach the campaign's files on your computer.
|
|
47
47
|
|
|
48
|
-
RPG Engine is tied to no AI company: any agent that supports MCP tools can be the master, local ones included. We play and test it with **Claude Code**; **Codex**, **Antigravity** and **OpenCode** are connected and checked, from the terminal and from their desktop apps, but no whole campaign has been played with them yet; [the guide](https://github.com/stefanocaronia/rpg-engine/blob/main/src/dashboard/guide/en.md#24-connect-your-ai) says how to connect any other agent. Give the master the largest model you have: a small one is easier to talk into revealing secrets or bending the rules.
|
|
48
|
+
RPG Engine is tied to no AI company: any agent that supports MCP tools can be the master, local ones included. We play and test it with **Claude Code**; **Codex**, **Antigravity** and **OpenCode** are connected and checked, from the terminal and from their desktop apps, but no whole campaign has been played with them yet: [what works in each](https://github.com/stefanocaronia/rpg-engine/blob/main/docs/hosts.md) is a table of its own; [the guide](https://github.com/stefanocaronia/rpg-engine/blob/main/src/dashboard/guide/en.md#24-connect-your-ai) says how to connect any other agent. Give the master the largest model you have: a small one is easier to talk into revealing secrets or bending the rules.
|
|
49
49
|
|
|
50
50
|
RPG Engine is free: the master runs on your agent's own plan (for Claude Code, a paid Claude plan; for Codex, a ChatGPT account; for Antigravity, a Google account; for OpenCode, the model you choose in it), or on your computer with a local model. RPG Engine itself never asks for an API key nor keeps one: where your agent lets you choose, sign it in with your account rather than with a key, which is paid by the call. You do not need to know how to program, and once your agent is installed, you are playing in a few minutes.
|
|
51
51
|
|
|
@@ -2,7 +2,7 @@ import { type HostInstructions } from "./host-files.ts";
|
|
|
2
2
|
import { type CampaignSettings } from "./settings.ts";
|
|
3
3
|
/**
|
|
4
4
|
* Creates a campaign in `folder`: campaign.yaml, state.yaml, the sessions folder, the inbox for the player's pictures, the .mcp.json through which AI hosts such as Claude Code find the rpg tools,
|
|
5
|
-
* and the host files that send them to the start lines and give
|
|
5
|
+
* and the host files that send them to the start lines and give each AI app with subagents the character agent (D-97, D-242, D-490, D-580). `platform` is the operating system, as Node names it. Returns the campaign's full path.
|
|
6
6
|
*/
|
|
7
7
|
export declare function createCampaign(folder: string, settings: CampaignSettings, platform: string, instructions: HostInstructions): string;
|
|
8
8
|
/**
|
|
@@ -8,7 +8,7 @@ import { hostFileChanges, rpgServer, writeHostFile } from "./host-files.js";
|
|
|
8
8
|
import { settingsSchema } from "./settings.js";
|
|
9
9
|
/**
|
|
10
10
|
* Creates a campaign in `folder`: campaign.yaml, state.yaml, the sessions folder, the inbox for the player's pictures, the .mcp.json through which AI hosts such as Claude Code find the rpg tools,
|
|
11
|
-
* and the host files that send them to the start lines and give
|
|
11
|
+
* and the host files that send them to the start lines and give each AI app with subagents the character agent (D-97, D-242, D-490, D-580). `platform` is the operating system, as Node names it. Returns the campaign's full path.
|
|
12
12
|
*/
|
|
13
13
|
export function createCampaign(folder, settings, platform, instructions) {
|
|
14
14
|
const root = resolve(folder);
|
|
@@ -39,7 +39,17 @@ const layersFolder = "layers";
|
|
|
39
39
|
// that is a link the store refuses as it writes it.
|
|
40
40
|
const writtenFolders = ["world", "images", "rules", sessionsFolderName, bookFolderName, ".saves", "exports", ".player", ".imports", layersFolder];
|
|
41
41
|
// The hosts' folders, where the engine writes only its own files, beside the player's: these alone are looked at, never what the player keeps in them.
|
|
42
|
-
const hostFolders = [
|
|
42
|
+
const hostFolders = [
|
|
43
|
+
".claude",
|
|
44
|
+
join(".claude", "agents"),
|
|
45
|
+
".codex",
|
|
46
|
+
join(".codex", "agents"),
|
|
47
|
+
".agents",
|
|
48
|
+
join(".agents", "agents"),
|
|
49
|
+
".opencode",
|
|
50
|
+
join(".opencode", "plugins"),
|
|
51
|
+
join(".opencode", "agents"),
|
|
52
|
+
];
|
|
43
53
|
/**
|
|
44
54
|
* Throws when a folder the engine writes in, or one in it two levels deep, three for the layers, is a link: a symbolic link or a junction; in the hosts' folders,
|
|
45
55
|
* only those where it writes. Before the hosts' files are written, as by init, and at each command.
|
|
@@ -30,16 +30,15 @@ export declare function refreshHostFiles(root: string, instructions: HostInstruc
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function writeEffortFiles(root: string, platform: string, cleared?: boolean): string[];
|
|
32
32
|
/**
|
|
33
|
-
* Whether the campaign has the character agent
|
|
34
|
-
*
|
|
33
|
+
* Whether the campaign has the character agent in each host that has agents (D-490, D-580): looked at as the MCP server starts, before it writes its host
|
|
34
|
+
* files, it says whether the chat found the agent, as the hosts read their agents only when a chat starts.
|
|
35
35
|
*/
|
|
36
|
-
export declare function hasCharacterAgent(root: string):
|
|
37
|
-
claudeCode: boolean;
|
|
38
|
-
openCode: boolean;
|
|
39
|
-
};
|
|
36
|
+
export declare function hasCharacterAgent(root: string): Record<AgentHost, boolean>;
|
|
40
37
|
/**
|
|
41
38
|
* Brings up to date the engine's files outside any campaign, in the player's home: Antigravity's own servers, which its app reads for every folder (D-578),
|
|
42
39
|
* when Antigravity is installed. What could not be written, with how to fix it; undefined when all is in order.
|
|
43
40
|
*/
|
|
44
41
|
export declare function refreshUserHostFiles(userHome: string, platform: string): string | undefined;
|
|
42
|
+
/** The hosts whose campaign has the character agent as one of its agents (D-490, D-580). */
|
|
43
|
+
export type AgentHost = "claudeCode" | "openCode" | "codex" | "antigravity";
|
|
45
44
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// What an AI host reads in a campaign besides .mcp.json: AGENTS.md, opening with the start lines (D-97); CLAUDE.md, which imports it; Claude Code's settings,
|
|
2
2
|
// with its auto memory off, so that the master keeps nothing outside the campaign (D-242), the rpg server approved with its tools allowed (D-412) and no tasks in
|
|
3
3
|
// the background, so that the character agent answers within the master's turn (D-490), and the doorbell of the player's sentences (D-495); Codex's, with
|
|
4
|
-
// the rpg server and its memories off (D-362);
|
|
5
|
-
// OpenCode's, each with the rpg server and the doorbell (D-578). Gemini CLI is no longer set up (D-493): a campaign's .gemini/ stays as it is.
|
|
4
|
+
// the rpg server and its memories off (D-362); the character agent, the agent the master calls to voice a character, in each host that has agents (D-490,
|
|
5
|
+
// D-580); Antigravity's and OpenCode's, each with the rpg server and the doorbell (D-578). Gemini CLI is no longer set up (D-493): a campaign's .gemini/ stays as it is.
|
|
6
6
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
import { files } from "../core/store.js";
|
|
@@ -74,19 +74,18 @@ export function writeEffortFiles(root, platform, cleared = false) {
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
|
-
* Whether the campaign has the character agent
|
|
78
|
-
*
|
|
77
|
+
* Whether the campaign has the character agent in each host that has agents (D-490, D-580): looked at as the MCP server starts, before it writes its host
|
|
78
|
+
* files, it says whether the chat found the agent, as the hosts read their agents only when a chat starts.
|
|
79
79
|
*/
|
|
80
80
|
export function hasCharacterAgent(root) {
|
|
81
|
-
return
|
|
81
|
+
return Object.fromEntries(agentHosts.map((host) => [host, files().fresh(characterAgentPath(root, host)) !== undefined]));
|
|
82
82
|
}
|
|
83
83
|
function hostFiles(root, instructions, platform) {
|
|
84
84
|
return [
|
|
85
85
|
() => agentsFile(root, instructions.start),
|
|
86
86
|
() => claudeFile(root),
|
|
87
87
|
() => claudeSettingsFile(root),
|
|
88
|
-
() => characterAgentFile(root, instructions.character),
|
|
89
|
-
() => openCodeAgentFile(root, instructions.character),
|
|
88
|
+
...agentHosts.map((host) => () => characterAgentFile(root, host, instructions.character)),
|
|
90
89
|
() => codexConfigFile(root, platform),
|
|
91
90
|
() => antigravityServerFile(root, platform),
|
|
92
91
|
() => antigravityHooksFile(root),
|
|
@@ -203,63 +202,104 @@ function agentsFile(root, startLines) {
|
|
|
203
202
|
const updated = markedBlock.test(lines) ? lines.replace(markedBlock, () => block) : `${block}\n\n${lines}`;
|
|
204
203
|
return updated === lines ? undefined : { path, text: text.includes("\r\n") ? updated.replace(/\n/g, "\r\n") : updated };
|
|
205
204
|
}
|
|
206
|
-
|
|
207
|
-
|
|
205
|
+
// What every host's file of the character agent says of itself.
|
|
206
|
+
const agentHeader = "# Written by rpg, which writes it again as the game starts: a change made here does not last.";
|
|
207
|
+
const agentDescription = "Voices one character of the campaign at a key moment, knowing only what they know. Begin with their name, then the moment, as Voices says.";
|
|
208
|
+
/** Each host's file of the character agent: where it goes in a campaign, and its text with the agent's instructions. */
|
|
209
|
+
const characterAgents = {
|
|
210
|
+
// Claude Code's: it reads only its character's view, and not the campaign's CLAUDE.md, the master's instructions.
|
|
211
|
+
claudeCode: {
|
|
212
|
+
path: [".claude", "agents", "rpg-character.md"],
|
|
213
|
+
text: (instructions) => [
|
|
214
|
+
"---",
|
|
215
|
+
agentHeader,
|
|
216
|
+
"name: rpg-character",
|
|
217
|
+
`description: ${agentDescription}`,
|
|
218
|
+
"tools: mcp__rpg__view",
|
|
219
|
+
"model: inherit",
|
|
220
|
+
"omitClaudeMd: true",
|
|
221
|
+
"---",
|
|
222
|
+
"",
|
|
223
|
+
instructions,
|
|
224
|
+
"",
|
|
225
|
+
].join("\n"),
|
|
226
|
+
},
|
|
227
|
+
// OpenCode's: every tool denied but execute and the rpg server's view, which OpenCode's subagents reach through execute.
|
|
228
|
+
openCode: {
|
|
229
|
+
path: [".opencode", "agents", "rpg-character.md"],
|
|
230
|
+
text: (instructions) => {
|
|
231
|
+
const rule = (action, effect) => [` - action: "${action}"`, ' resource: "*"', ` effect: ${effect}`];
|
|
232
|
+
return [
|
|
233
|
+
"---",
|
|
234
|
+
agentHeader,
|
|
235
|
+
`description: ${agentDescription}`,
|
|
236
|
+
"mode: subagent",
|
|
237
|
+
"permissions:",
|
|
238
|
+
...rule("*", "deny"),
|
|
239
|
+
...rule("execute", "allow"),
|
|
240
|
+
...rule("rpg_view", "allow"),
|
|
241
|
+
"---",
|
|
242
|
+
"",
|
|
243
|
+
instructions,
|
|
244
|
+
"",
|
|
245
|
+
'Your tool: tools.rpg.view, called through execute, as await tools.rpg.view({ as: "your name" }).',
|
|
246
|
+
"",
|
|
247
|
+
].join("\n");
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
// Codex's role, without its shell, apps, plugins and skills; an unknown key drops the whole role, and the server lets it only look (D-580).
|
|
251
|
+
codex: {
|
|
252
|
+
path: [".codex", "agents", "rpg-character.toml"],
|
|
253
|
+
text: (instructions) => [
|
|
254
|
+
agentHeader,
|
|
255
|
+
'name = "rpg-character"',
|
|
256
|
+
`description = "${agentDescription}"`,
|
|
257
|
+
'developer_instructions = """',
|
|
258
|
+
instructions,
|
|
259
|
+
'"""',
|
|
260
|
+
"",
|
|
261
|
+
"[features]",
|
|
262
|
+
"shell_tool = false",
|
|
263
|
+
"apps = false",
|
|
264
|
+
"plugins = false",
|
|
265
|
+
"",
|
|
266
|
+
"[skills]",
|
|
267
|
+
"include_instructions = false",
|
|
268
|
+
"",
|
|
269
|
+
"[skills.bundled]",
|
|
270
|
+
"enabled = false",
|
|
271
|
+
"",
|
|
272
|
+
].join("\n"),
|
|
273
|
+
},
|
|
274
|
+
// Antigravity's subagent, which the player cannot pick as the main agent; the server lets it only look (D-580).
|
|
275
|
+
antigravity: {
|
|
276
|
+
path: [".agents", "agents", "rpg-character.md"],
|
|
277
|
+
text: (instructions) => [
|
|
278
|
+
"---",
|
|
279
|
+
agentHeader,
|
|
280
|
+
"name: rpg-character",
|
|
281
|
+
`description: ${agentDescription}`,
|
|
282
|
+
"mainAgent: false",
|
|
283
|
+
"subagent: true",
|
|
284
|
+
"model: inherit",
|
|
285
|
+
"---",
|
|
286
|
+
"",
|
|
287
|
+
instructions,
|
|
288
|
+
"",
|
|
289
|
+
].join("\n"),
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
const agentHosts = Object.keys(characterAgents);
|
|
293
|
+
function characterAgentPath(root, host) {
|
|
294
|
+
return join(root, ...characterAgents[host].path);
|
|
208
295
|
}
|
|
209
|
-
/**
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
*/
|
|
213
|
-
function characterAgentFile(root, instructions) {
|
|
214
|
-
const path = characterAgentPath(root);
|
|
215
|
-
// The player wants the master to voice every character.
|
|
216
|
-
if (readTextSetting(root, "voices") === "master") {
|
|
217
|
-
return files().fresh(path) === undefined ? undefined : { path };
|
|
218
|
-
}
|
|
219
|
-
const text = [
|
|
220
|
-
"---",
|
|
221
|
-
"# Written by rpg, which writes it again as the game starts: a change made here does not last.",
|
|
222
|
-
"name: rpg-character",
|
|
223
|
-
"description: Voices one character of the campaign at a key moment, knowing only what they know. Begin with their name, then the moment, as Voices says.",
|
|
224
|
-
"tools: mcp__rpg__view",
|
|
225
|
-
"model: inherit",
|
|
226
|
-
"omitClaudeMd: true",
|
|
227
|
-
"---",
|
|
228
|
-
"",
|
|
229
|
-
instructions,
|
|
230
|
-
"",
|
|
231
|
-
].join("\n");
|
|
232
|
-
return files().fresh(path)?.replace(/\r\n/g, "\n") === text ? undefined : { path, text };
|
|
233
|
-
}
|
|
234
|
-
function openCodeAgentPath(root) {
|
|
235
|
-
return join(root, ".opencode", "agents", "rpg-character.md");
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* The character agent as an OpenCode subagent (D-490), as Claude Code's is written and taken away: every tool denied but execute and the rpg server's view,
|
|
239
|
-
* which OpenCode's subagents reach through execute, as Elena's probe proved it.
|
|
240
|
-
*/
|
|
241
|
-
function openCodeAgentFile(root, instructions) {
|
|
242
|
-
const path = openCodeAgentPath(root);
|
|
296
|
+
/** The character agent in a host's format (D-490): the engine's, rewritten when it changed, and taken away when the player wants the master to voice every character. */
|
|
297
|
+
function characterAgentFile(root, host, instructions) {
|
|
298
|
+
const path = characterAgentPath(root, host);
|
|
243
299
|
if (readTextSetting(root, "voices") === "master") {
|
|
244
300
|
return files().fresh(path) === undefined ? undefined : { path };
|
|
245
301
|
}
|
|
246
|
-
const
|
|
247
|
-
const text = [
|
|
248
|
-
"---",
|
|
249
|
-
"# Written by rpg, which writes it again as the game starts: a change made here does not last.",
|
|
250
|
-
"description: Voices one character of the campaign at a key moment, knowing only what they know. Begin with their name, then the moment, as Voices says.",
|
|
251
|
-
"mode: subagent",
|
|
252
|
-
"permissions:",
|
|
253
|
-
...rule("*", "deny"),
|
|
254
|
-
...rule("execute", "allow"),
|
|
255
|
-
...rule("rpg_view", "allow"),
|
|
256
|
-
"---",
|
|
257
|
-
"",
|
|
258
|
-
instructions,
|
|
259
|
-
"",
|
|
260
|
-
'Your tool: tools.rpg.view, called through execute, as await tools.rpg.view({ as: "your name" }).',
|
|
261
|
-
"",
|
|
262
|
-
].join("\n");
|
|
302
|
+
const text = characterAgents[host].text(instructions);
|
|
263
303
|
return files().fresh(path)?.replace(/\r\n/g, "\n") === text ? undefined : { path, text };
|
|
264
304
|
}
|
|
265
305
|
/** CLAUDE.md, which Claude Code reads, importing AGENTS.md: added first to one that does not. */
|
|
@@ -85,10 +85,10 @@ export { unitSystems };
|
|
|
85
85
|
/** Which pictures the engine has made, where it can (D-308, D-388, D-420): none, only those the player asks for, or one for each new place, quest and one met. */
|
|
86
86
|
export declare const pictureWays: readonly ["none", "on request", "new elements"];
|
|
87
87
|
/**
|
|
88
|
-
* Who makes the pictures (D-572): the chat in use by its own means, as when unset, Codex, the master with ElevenLabs's image tool, or
|
|
89
|
-
* names in the chat; any other value is that tool's name.
|
|
88
|
+
* Who makes the pictures (D-572): the chat in use by its own means, as when unset, Codex, Antigravity (T-251), the master with ElevenLabs's image tool, or
|
|
89
|
+
* another tool the player names in the chat; any other value is that tool's name.
|
|
90
90
|
*/
|
|
91
|
-
export declare const pictureMakers: readonly ["chat", "codex", "elevenlabs", "other"];
|
|
91
|
+
export declare const pictureMakers: readonly ["chat", "codex", "antigravity", "elevenlabs", "other"];
|
|
92
92
|
/** Who makes the pictures of the campaign of a folder, as its pictures-by setting says; undefined when unset, or with no campaign that reads. */
|
|
93
93
|
export declare function chosenPictureMaker(folder: string): string | undefined;
|
|
94
94
|
/** How much the master thinks before each answer, written for each AI app in the campaign's folder (D-462). */
|
|
@@ -280,14 +280,15 @@ export { unitSystems };
|
|
|
280
280
|
/** Which pictures the engine has made, where it can (D-308, D-388, D-420): none, only those the player asks for, or one for each new place, quest and one met. */
|
|
281
281
|
export const pictureWays = ["none", "on request", "new elements"];
|
|
282
282
|
/**
|
|
283
|
-
* Who makes the pictures (D-572): the chat in use by its own means, as when unset, Codex, the master with ElevenLabs's image tool, or
|
|
284
|
-
* names in the chat; any other value is that tool's name.
|
|
283
|
+
* Who makes the pictures (D-572): the chat in use by its own means, as when unset, Codex, Antigravity (T-251), the master with ElevenLabs's image tool, or
|
|
284
|
+
* another tool the player names in the chat; any other value is that tool's name.
|
|
285
285
|
*/
|
|
286
|
-
export const pictureMakers = ["chat", "codex", "elevenlabs", "other"];
|
|
286
|
+
export const pictureMakers = ["chat", "codex", "antigravity", "elevenlabs", "other"];
|
|
287
287
|
/** What each way of making the pictures means to the master, which config gives for the chosen one, and the player's change of it on the dashboard (D-572). */
|
|
288
288
|
const pictureMakerMeanings = {
|
|
289
289
|
chat: "you make them by this chat's own means, as image gives them",
|
|
290
290
|
codex: "Codex makes them on this computer; where it cannot, this chat does, and you hear why",
|
|
291
|
+
antigravity: "Antigravity paints them on this computer, started apart from its own chats, from the player's Google plan; where it cannot, this chat makes them",
|
|
291
292
|
elevenlabs: "you make them with ElevenLabs's image tool, from the brief image gives you",
|
|
292
293
|
other: "another image tool of yours, not named yet: ask the player which, then set its name with config pictures-by",
|
|
293
294
|
};
|
|
@@ -398,7 +399,7 @@ export const settingsSchema = z.object({
|
|
|
398
399
|
pictures: z.preprocess((value) => (value === "new places" || value === "new places and quests" ? "new elements" : value), z.enum(pictureWays)).optional().describe("the pictures of places, quests and those met the engine has made on this computer, which spend the player's plan, Codex's or Claude's: none, on request (those the player asks for) "
|
|
399
400
|
+ "or new elements (one for each new place and quest, and for each character and kind of creature the character meets)"),
|
|
400
401
|
"pictures-by": z.string().trim().min(1).optional().describe("who makes the pictures, the player's to choose: chat (the default: this chat by its own means), codex (Codex, from the player's ChatGPT plan, Plus or higher; "
|
|
401
|
-
+ "where it cannot, this chat makes them), elevenlabs (you, with ElevenLabs's image tool), other (another tool of yours the player names: ask which) or that tool's name"),
|
|
402
|
+
+ "where it cannot, this chat makes them), antigravity (Antigravity, from the player's Google plan, a paid one; where it cannot, this chat makes them), elevenlabs (you, with ElevenLabs's image tool), other (another tool of yours the player names: ask which) or that tool's name"),
|
|
402
403
|
effort: z.enum(efforts).optional().describe("how much the master thinks before each answer, the player's to choose: low, medium or high, written where Claude Code and Codex read it in the campaign's folder; "
|
|
403
404
|
+ "unset, each app keeps its own"),
|
|
404
405
|
lines: listSetting.describe("what never appears in the game"),
|
package/dist/cli/cli.js
CHANGED
|
@@ -3,8 +3,13 @@ import { runCommandLine } from "./command-line.js";
|
|
|
3
3
|
const args = process.argv.slice(2);
|
|
4
4
|
// "rpg mcp" turns the process into a server for an AI host; "rpg --read-library" reads the player's books apart, as rules starts it (LIB-3); "rpg --listen"
|
|
5
5
|
// is the doorbell for the player's sentences on the dashboard (D-495), Claude Code's, or with its host's name another's (D-578); "rpg --approve" is
|
|
6
|
-
// Antigravity's hook that lets the rpg tools run; everything else is a command.
|
|
7
|
-
if (args.length === 1 && args[0] === "mcp") {
|
|
6
|
+
// Antigravity's hook that lets the rpg tools run, "rpg --fence" the hook that fences Antigravity's importer; everything else is a command.
|
|
7
|
+
if (args.length === 1 && args[0] === "mcp" && process.env.RPG_HELPER === "1") {
|
|
8
|
+
// A run of the engine's helper gets no rpg server, not even one with no tools, which would empty its host's tool cache (D-579 (1)).
|
|
9
|
+
console.error("rpg mcp: not started, this is a run of RPG Engine's own helper (RPG_HELPER=1)");
|
|
10
|
+
process.exitCode = 0;
|
|
11
|
+
}
|
|
12
|
+
else if (args.length === 1 && args[0] === "mcp") {
|
|
8
13
|
// The server and its SDK load only here: every other command starts faster without them (D-194).
|
|
9
14
|
const { startMcpServer } = await import("../server/mcp.js");
|
|
10
15
|
const { serverInput } = await import("../server/route/index.js");
|
|
@@ -33,6 +38,10 @@ else if (args.length === 1 && args[0] === "--approve") {
|
|
|
33
38
|
const { approveHere } = await import("../server/approver.js");
|
|
34
39
|
await approveHere();
|
|
35
40
|
}
|
|
41
|
+
else if (args.length === 2 && args[0] === "--fence") {
|
|
42
|
+
const { fenceHere } = await import("../server/fence.js");
|
|
43
|
+
await fenceHere(args[1]);
|
|
44
|
+
}
|
|
36
45
|
else {
|
|
37
46
|
const { output, exitCode } = await runCommandLine(args);
|
|
38
47
|
if (exitCode === 0) {
|
|
@@ -218,7 +218,7 @@ function configure(input, context) {
|
|
|
218
218
|
// The character agent written or taken away at once, not when the server starts again (D-490).
|
|
219
219
|
if (input.setting?.trim() === "voices" && input.value !== undefined) {
|
|
220
220
|
refreshHostFiles(root, hostInstructions(), context.platform);
|
|
221
|
-
replaced = [...replaced, "
|
|
221
|
+
replaced = [...replaced, "An AI app with subagents finds the character agent, or finds it gone, from the next chat."];
|
|
222
222
|
}
|
|
223
223
|
// New months may leave the day the story starts on without its month (TIM-8): said at once, not at the next date.
|
|
224
224
|
if (input.setting?.trim() === "calendar" && input.value !== undefined) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The player's settings and the setup's questions as the dashboard shows them (D-341, D-370)
|
|
2
2
|
import { customLevel, customLevels, customSettings, lastChoices, listSettingNames, readOneSetting, readSettings, setupSettingNames } from "../../campaign/index.js";
|
|
3
3
|
import { comparableText } from "../../core/text.js";
|
|
4
|
-
import { claudeSays, codexClient, codexSays } from "../../helpers/index.js";
|
|
4
|
+
import { antigravityClient, antigravitySays, claudeSays, codexClient, codexSays } from "../../helpers/index.js";
|
|
5
5
|
import { readBetweenSessions } from "../../time/index.js";
|
|
6
6
|
import { gitProblem, isCampaignRepository, isInLargerRepository } from "../shared/campaign/git.js";
|
|
7
7
|
import { heldSystemSettings, isLeading, offeredValues, playedEngineSetting } from "../shared/campaign/offers.js";
|
|
@@ -162,12 +162,16 @@ function mentorQuestion(question, game) {
|
|
|
162
162
|
}
|
|
163
163
|
// The engine's own game system, free play, without rules of its own.
|
|
164
164
|
const freePlay = "free";
|
|
165
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* Who makes the pictures as the chat in use offers it (D-572, T-251): in Codex, Codex is the chat itself, as Antigravity in Antigravity, so it is not offered,
|
|
167
|
+
* and a campaign that chose it plays chat.
|
|
168
|
+
*/
|
|
166
169
|
function makersInChat(context, setting) {
|
|
167
|
-
|
|
170
|
+
const own = { [codexClient]: "codex", [antigravityClient]: "antigravity" }[context.host?.() ?? ""];
|
|
171
|
+
if (own === undefined) {
|
|
168
172
|
return setting;
|
|
169
173
|
}
|
|
170
|
-
return { ...setting, ...(setting.value ===
|
|
174
|
+
return { ...setting, ...(setting.value === own ? { value: "chat" } : {}), choices: setting.choices?.filter((choice) => choice.value !== own) };
|
|
171
175
|
}
|
|
172
176
|
/** A player's setting as the game offers it (DAT-16): none where it plays one value alone; only the values it offers, and no value written that it does not. */
|
|
173
177
|
function offeredSetting(root, context, setting) {
|
|
@@ -187,6 +191,8 @@ const madeBy = {
|
|
|
187
191
|
Codex: "Codex makes them on this computer, from your ChatGPT plan.",
|
|
188
192
|
Claude: "Claude draws them on this computer, as vector pictures, from your Claude plan.",
|
|
189
193
|
Antigravity: "Antigravity makes them in your chat, from your Google plan.",
|
|
194
|
+
// Antigravity's agy, started apart from the chat in use (T-251).
|
|
195
|
+
AntigravityApart: "Antigravity paints them on this computer, from your Google plan.",
|
|
190
196
|
};
|
|
191
197
|
// The chat in use draws them itself, as OpenCode (D-572).
|
|
192
198
|
const drawnInChat = "{maker} draws them in your chat, as simple vector pictures, from your plan.";
|
|
@@ -199,7 +205,16 @@ const madeMeanwhile = "{by} makes them meanwhile.";
|
|
|
199
205
|
// Whoever makes them, the player may give a page a picture of their own (D-572 (3)).
|
|
200
206
|
const ownPicture = "You can also give a page you see a picture of your own: with its picture button, or dropped in the campaign's inbox folder for the master.";
|
|
201
207
|
/** Every note the pictures' setting may have, which the dashboard writes in its language (D-394). */
|
|
202
|
-
export const picturesNotes = [
|
|
208
|
+
export const picturesNotes = [
|
|
209
|
+
...Object.values(madeBy),
|
|
210
|
+
drawnInChat,
|
|
211
|
+
madeWithTool,
|
|
212
|
+
toolAsked,
|
|
213
|
+
refusedNote,
|
|
214
|
+
madeMeanwhile,
|
|
215
|
+
ownPicture,
|
|
216
|
+
...[...Object.values(codexSays), ...Object.values(claudeSays), ...Object.values(antigravitySays)].map(notReadyText),
|
|
217
|
+
];
|
|
203
218
|
/**
|
|
204
219
|
* Whether this computer makes pictures, and with whose plan, in the player's words (D-308, D-390); why not and how to have them; where the maker the player
|
|
205
220
|
* chose made none and the chat in use makes them, why (D-572); nothing where no maker is asked.
|
|
@@ -227,7 +242,9 @@ function picturesReadyNote(context) {
|
|
|
227
242
|
if (ready.draws === true) {
|
|
228
243
|
return { note: { text: drawnInChat, values: { maker: ready.maker ?? "" } } };
|
|
229
244
|
}
|
|
230
|
-
|
|
245
|
+
// Antigravity makes them in its own chat, and paints them apart from any other.
|
|
246
|
+
const antigravity = context.host?.() === antigravityClient ? "Antigravity" : "AntigravityApart";
|
|
247
|
+
return { note: { text: madeBy[ready.maker === "Claude" ? "Claude" : ready.maker === "Antigravity" ? antigravity : "Codex"] } };
|
|
231
248
|
}
|
|
232
249
|
/** The pictures' note with the line that the player may give a picture of their own after it. */
|
|
233
250
|
function withOwnPicture(note) {
|
|
@@ -155,6 +155,7 @@ export const playerWords = {
|
|
|
155
155
|
means: {
|
|
156
156
|
chat: "your AI app, by its own means: Claude draws them as vector pictures, Codex and Antigravity paint them, OpenCode and the other apps draw simple vector pictures in the chat, each from your plan",
|
|
157
157
|
codex: "Codex paints them on this computer, from your ChatGPT plan (Plus or higher)",
|
|
158
|
+
antigravity: "Antigravity paints them on this computer, from your Google plan (a paid one: on the free plan its image tool fails)",
|
|
158
159
|
elevenlabs: "the master makes them with ElevenLabs, connected to your AI app, from your ElevenLabs plan",
|
|
159
160
|
other: "another image tool connected to your AI app: the master asks you which in the chat",
|
|
160
161
|
},
|
package/dist/commands/image.js
CHANGED
|
@@ -117,8 +117,8 @@ function drawnImage(root, context, world, page, code) {
|
|
|
117
117
|
const drawn = svgIn(code);
|
|
118
118
|
const clean = drawn === undefined ? undefined : cleanSvg(drawn);
|
|
119
119
|
if (clean === undefined) {
|
|
120
|
-
throw new Error("svg takes the picture's SVG code, and this is none the engine can use: give one <svg> root that closes, under 100 KB, with
|
|
121
|
-
+ "no text, script, style or image; draw it again so, or go on without. Nothing changed.");
|
|
120
|
+
throw new Error("svg takes the picture's SVG code, and this is none the engine can use, or nothing in it could be kept: give one <svg> root that closes, under 100 KB, with at least one shape "
|
|
121
|
+
+ "and only shapes, groups, gradients, masks and blur, no text, script, style or image; draw it again so, or go on without. Nothing changed.");
|
|
122
122
|
}
|
|
123
123
|
return placeImage(root, context, world, page, imageOfBytes(Buffer.from(clean), "The SVG"));
|
|
124
124
|
}
|
|
@@ -200,7 +200,7 @@ function madePicture(root, context, world, page, seen) {
|
|
|
200
200
|
try {
|
|
201
201
|
const world = campaignWorld(root, context);
|
|
202
202
|
const now = world.pages.find((candidate) => candidate.path === page.path) ?? page;
|
|
203
|
-
//
|
|
203
|
+
// The maker's own copy goes once copied, by its real format's extension: the picture is the campaign's.
|
|
204
204
|
return { ...setImage(root, context, world, now, made.file), from: undefined, ...(made.instead === undefined ? {} : { instead: insteadText(page.name, made.instead, true) }) };
|
|
205
205
|
}
|
|
206
206
|
finally {
|
|
@@ -22,7 +22,9 @@ interface ImportResult {
|
|
|
22
22
|
/** How many of the document's pages were read from their pictures, as it started (LIB-4). */
|
|
23
23
|
recognized?: number;
|
|
24
24
|
/** Begun now by a helper, named when known: the player hears whose plan reads the document, and under whose terms (D-493). */
|
|
25
|
-
helper?: "Claude Code" | "Codex" | "OpenCode" | "a helper";
|
|
25
|
+
helper?: "Claude Code" | "Codex" | "OpenCode" | "Antigravity" | "a helper";
|
|
26
|
+
/** The model the helper reads with, where the player chose it in it, as in OpenCode, which may be paid by the call. */
|
|
27
|
+
helperModel?: string;
|
|
26
28
|
}
|
|
27
29
|
export declare const importCommand: import("../../core/registry.ts").Command<z.ZodObject<{
|
|
28
30
|
document: z.ZodOptional<z.ZodString>;
|
|
@@ -47,6 +47,8 @@ export const importCommand = defineCommand({
|
|
|
47
47
|
}
|
|
48
48
|
await stopRunner(open.folder);
|
|
49
49
|
await stopImport(open.folder);
|
|
50
|
+
// The runner killed left its helper's leftovers, which no finally of its took away.
|
|
51
|
+
context.reader?.clean?.();
|
|
50
52
|
dropImport(open.folder);
|
|
51
53
|
appendLogEntry(root, newDatedLogEntry(root, context, "import-cancelled", "hidden", { title: open.state.title }));
|
|
52
54
|
return { ...resultOf(root, open.folder, open.state), cancelled: true };
|
|
@@ -81,7 +83,7 @@ export const importCommand = defineCommand({
|
|
|
81
83
|
return resultOf(root, open.folder, readImportState(open.folder) ?? open.state);
|
|
82
84
|
},
|
|
83
85
|
// A document read from its pictures is told first, for the master to tell the player before anything else (LIB-4).
|
|
84
|
-
format: (result) => [recognizedText(result.recognized), helperText(result.helper), importText(result)].filter((part) => part !== "").join("\n\n"),
|
|
86
|
+
format: (result) => [recognizedText(result.recognized), helperText(result.helper, result.helperModel), importText(result)].filter((part) => part !== "").join("\n\n"),
|
|
85
87
|
});
|
|
86
88
|
/** The import under way as the dashboard tells it, if one is: from the document being opened to the world being written. */
|
|
87
89
|
export function importShown(root) {
|
|
@@ -221,11 +223,12 @@ async function startImport(root, context, document, title) {
|
|
|
221
223
|
}
|
|
222
224
|
// Asked before the reading, which a program that stops being ready would change.
|
|
223
225
|
const program = context.reader?.program?.() ?? "a helper";
|
|
226
|
+
const model = context.reader?.model?.();
|
|
224
227
|
const going = goOn(root, context, folder);
|
|
225
228
|
if (context.files === undefined) {
|
|
226
229
|
await going;
|
|
227
230
|
}
|
|
228
|
-
return { ...resultOf(root, folder, readImportState(folder) ?? state), pictures: text.pictures.length, ...recognized, helper: program };
|
|
231
|
+
return { ...resultOf(root, folder, readImportState(folder) ?? state), pictures: text.pictures.length, ...recognized, helper: program, ...(model === undefined ? {} : { helperModel: model }) };
|
|
229
232
|
}
|
|
230
233
|
/** Whether what was given as a document is an adventure made already: a folder with adventure.yaml, or a .zip that holds one, which package install reads and checks. */
|
|
231
234
|
function isAdventure(path, found) {
|
|
@@ -370,15 +373,20 @@ function recognizedText(recognized) {
|
|
|
370
373
|
+ "selected, reads better.";
|
|
371
374
|
}
|
|
372
375
|
/** Whose plan reads the document, and under whose terms it goes out (D-493): said once, as a helper begins it. */
|
|
373
|
-
function helperText(helper) {
|
|
376
|
+
function helperText(helper, model) {
|
|
374
377
|
if (helper === undefined) {
|
|
375
378
|
return "";
|
|
376
379
|
}
|
|
377
|
-
// OpenCode reads with the model the player chose in it, whose maker is the one the document goes to.
|
|
380
|
+
// OpenCode reads with the model the player chose in it, whose maker is the one the document goes to; named, as it may be paid by the call.
|
|
378
381
|
if (helper === "OpenCode") {
|
|
379
|
-
|
|
382
|
+
const which = model === undefined ? "with the model they last chose in it" : `with its model ${model}`;
|
|
383
|
+
return `Tell the player in a few words that their own OpenCode reads it, ${which} and on its plan or price, and that the whole document `
|
|
380
384
|
+ "goes to that model's provider, or stays on their computer with a local model, under the terms of their account, its choice on training included.";
|
|
381
385
|
}
|
|
386
|
+
if (helper === "Antigravity") {
|
|
387
|
+
return "Tell the player in a few words that their own Antigravity reads it, on their Google account's plan, whose quota it uses, and that the whole document "
|
|
388
|
+
+ "goes to Google under the terms of that account.";
|
|
389
|
+
}
|
|
382
390
|
const [program, company] = helper === "Codex" ? ["Codex", "OpenAI"] : helper === "Claude Code" ? ["Claude Code", "Anthropic"] : ["Claude Code or Codex", "Anthropic or OpenAI"];
|
|
383
391
|
return `Tell the player in a few words that their own ${program} reads it, on their plan and its limits, and that the whole document goes to ${company} `
|
|
384
392
|
+ "under the terms of their account, its choice on training included.";
|
|
@@ -85,7 +85,7 @@ function partyText(folder, context) {
|
|
|
85
85
|
return "";
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
/** When and how to call the character agent (D-490): in play, in
|
|
88
|
+
/** When and how to call the character agent (D-490): in play, in an AI app with subagents, when the chat has it as an agent of the campaign; none elsewhere. */
|
|
89
89
|
function voicesText(folder, context) {
|
|
90
90
|
const root = findCampaign(folder);
|
|
91
91
|
try {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { basename } from "node:path";
|
|
3
3
|
import { readSettings } from "../../../campaign/index.js";
|
|
4
4
|
import { files } from "../../../core/store.js";
|
|
5
|
+
import { antigravityClient } from "../../../helpers/index.js";
|
|
5
6
|
import { findImage, imageFileName } from "../../../images/index.js";
|
|
6
7
|
import { baseChain, isPartyMember, ownField } from "../../../pages/index.js";
|
|
7
8
|
import { systemContentFolders } from "../../../systems/index.js";
|
|
@@ -23,9 +24,9 @@ export function picturesNote(root, context, world, place) {
|
|
|
23
24
|
? "you can make the pictures of places, quests and those met with the image tool the player names"
|
|
24
25
|
: ready.draws === true
|
|
25
26
|
? "you can draw the pictures of places, quests and those met yourself, as simple vector pictures"
|
|
26
|
-
: ready.maker === "Antigravity"
|
|
27
|
+
: ready.maker === "Antigravity" && context.host?.() === antigravityClient
|
|
27
28
|
? "you can make the pictures of places, quests and those met with your own image tool"
|
|
28
|
-
: `this computer can make the pictures of places, quests and those met with the player's ${ready.maker === "Claude" ? "Claude Code" : "Codex"}`}, which spends their plan: ask them once whether they want one for each new place, quest and one met, only those they ask for, or none; then config pictures (new elements, on request or none).`
|
|
29
|
+
: `this computer can make the pictures of places, quests and those met with the player's ${ready.maker === "Claude" ? "Claude Code" : ready.maker === "Antigravity" ? "Antigravity" : "Codex"}`}, which spends their plan: ask them once whether they want one for each new place, quest and one met, only those they ask for, or none; then config pictures (new elements, on request or none).`
|
|
29
30
|
: undefined;
|
|
30
31
|
}
|
|
31
32
|
if (setting !== "new elements" || place === undefined || place.type !== "place" || shownImage(root, context, world, place) !== undefined) {
|
|
@@ -29,7 +29,7 @@ const settingLabels = {
|
|
|
29
29
|
companions: `companions (${companionWays.join(", ")})`,
|
|
30
30
|
"calendar-start": "calendar-start (when the story starts: day 1 to count only the days, or a day of the world, such as 14 April 1491)",
|
|
31
31
|
pictures: "pictures (of places, quests and those met: none; on request; new elements, one for each)",
|
|
32
|
-
"pictures-by": "pictures-by (who makes them: chat, your app by its own means; codex; elevenlabs; other, a tool the player names, written by its name; suggest chat)",
|
|
32
|
+
"pictures-by": "pictures-by (who makes them: chat, your app by its own means; codex; antigravity; elevenlabs; other, a tool the player names, written by its name; suggest chat)",
|
|
33
33
|
lines: 'lines ("none" is an answer)',
|
|
34
34
|
veils: 'veils ("none" is an answer)',
|
|
35
35
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from "../../../core/context.ts";
|
|
2
|
-
/** Whether the character agent voices the characters (D-490): in
|
|
2
|
+
/** Whether the character agent voices the characters (D-490, D-580): in a host that has agents, in a chat that has it, unless the master voices every character. */
|
|
3
3
|
export declare function agentVoices(root: string, context: Context): boolean;
|
|
4
|
-
/** The part Voices, when and how to call the character agent, for a campaign in play, with
|
|
4
|
+
/** The part Voices, when and how to call the character agent, for a campaign in play, with the host's own way of calling it; none where the agent does not voice the characters. */
|
|
5
5
|
export declare function voicesPart(root: string, context: Context): string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// Who voices the characters (D-490): the character agent, where the chat has it, or the master.
|
|
2
2
|
import { readSettings } from "../../../campaign/index.js";
|
|
3
|
+
import { antigravityClient, codexClient, openCodeClient } from "../../../helpers/index.js";
|
|
3
4
|
import { voicesInstructions } from "../../../instructions/index.js";
|
|
4
|
-
// The
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
/** Whether the character agent voices the characters (D-490): in Claude Code or OpenCode, in a chat that has it, unless the master voices every character. */
|
|
5
|
+
// The hosts whose campaign has the character agent as an agent (D-490, D-580), by the names they give themselves to the MCP server.
|
|
6
|
+
const agentHosts = { "claude-code": "claudeCode", [openCodeClient]: "openCode", [codexClient]: "codex", [antigravityClient]: "antigravity" };
|
|
7
|
+
/** Whether the character agent voices the characters (D-490, D-580): in a host that has agents, in a chat that has it, unless the master voices every character. */
|
|
8
8
|
export function agentVoices(root, context) {
|
|
9
|
-
const host = context.host?.();
|
|
10
|
-
|
|
11
|
-
return has === true && readSettings(root).voices !== "master";
|
|
9
|
+
const host = agentHosts[context.host?.() ?? ""];
|
|
10
|
+
return host !== undefined && context.characterAgents?.[host] === true && readSettings(root).voices !== "master";
|
|
12
11
|
}
|
|
13
|
-
/** The part Voices, when and how to call the character agent, for a campaign in play, with
|
|
12
|
+
/** The part Voices, when and how to call the character agent, for a campaign in play, with the host's own way of calling it; none where the agent does not voice the characters. */
|
|
14
13
|
export function voicesPart(root, context) {
|
|
15
|
-
|
|
14
|
+
const host = agentHosts[context.host?.() ?? ""];
|
|
15
|
+
return host !== undefined && agentVoices(root, context) ? voicesInstructions(readSettings(root).voices ?? "auto", host) : "";
|
|
16
16
|
}
|