pi-roundtable 0.23.2 → 0.24.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.
- package/CHANGELOG.md +30 -0
- package/docs/plugins.md +39 -6
- package/package.json +1 -1
- package/src/characters/compose.ts +18 -3
- package/src/characters/index.ts +1 -0
- package/src/characters/parts-hats.ts +12 -12
- package/src/characters/parts-outfits.ts +12 -12
- package/src/characters/parts-props.ts +3 -3
- package/src/characters/skins.ts +36 -0
- package/src/cli/checks/discord.ts +4 -1
- package/src/core/agents/agent-store.ts +22 -0
- package/src/core/agents/agent-team.ts +5 -0
- package/src/core/agents/avatar-refresh.ts +77 -0
- package/src/core/agents/avatar-studio.ts +13 -2
- package/src/core/agents/team-lifecycle.ts +27 -2
- package/src/core/agents/team-options.ts +6 -0
- package/src/core/builtin/agent-server.ts +14 -0
- package/src/core/config/adapters.ts +8 -5
- package/src/core/config/agent-team.ts +36 -0
- package/src/core/config/config-schema.ts +138 -0
- package/src/core/config/config.ts +64 -133
- package/src/core/config/schema.ts +18 -0
- package/src/core/define-roundtable.ts +15 -7
- package/src/core/host-registration.ts +25 -0
- package/src/core/host.ts +3 -0
- package/src/core/plugin-removed.ts +85 -0
- package/src/core/plugin.ts +14 -77
- package/src/core/services.ts +21 -2
- package/src/core/shared/workspace-files.ts +7 -4
- package/src/index.ts +1 -0
- package/src/kit/index.ts +1 -0
- package/src/kit/workspace.ts +3 -0
- package/src/testing.ts +2 -0
package/src/core/services.ts
CHANGED
|
@@ -91,8 +91,13 @@ export const MODES: ServiceKey<ConversationModes> =
|
|
|
91
91
|
export const THREADS: ServiceKey<DispatchThreads> =
|
|
92
92
|
serviceKey<DispatchThreads>("roundtable.threads");
|
|
93
93
|
/** The agent server: its team, its directory, the runtime that runs every agent turn. Provided by the agent-server plugin. */
|
|
94
|
-
export const AGENTS: ServiceKey<AgentServer> =
|
|
95
|
-
|
|
94
|
+
export const AGENTS: ServiceKey<AgentServer> = serviceKey<AgentServer>(
|
|
95
|
+
"roundtable.agents",
|
|
96
|
+
{
|
|
97
|
+
absent:
|
|
98
|
+
"This host has no agent server: its configuration says agentServer: false, or it has neither discord nor agents. Remove agentServer: false and configure discord or agents, or drop the plugin that needs the agent server.",
|
|
99
|
+
},
|
|
100
|
+
);
|
|
96
101
|
/** Scheduled turns, stored. Provided by the `schedule-store` plugin. */
|
|
97
102
|
export const SCHEDULES: ServiceKey<ScheduleStore> = serviceKey<ScheduleStore>(
|
|
98
103
|
"roundtable.schedules",
|
|
@@ -153,6 +158,20 @@ export interface AgentServer {
|
|
|
153
158
|
};
|
|
154
159
|
/** Agents' pictures. */
|
|
155
160
|
avatars: AvatarStudio;
|
|
161
|
+
/** Where the agents' files are: the directories their shell and file tools run in. */
|
|
162
|
+
workspace: AgentWorkspace;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* The directories the agents work in, as configured. Every agent shares them: the core has no
|
|
167
|
+
* workspace per agent. Read-only data, so a plugin that shows or serves the files can find them;
|
|
168
|
+
* the directories may not exist yet.
|
|
169
|
+
*/
|
|
170
|
+
export interface AgentWorkspace {
|
|
171
|
+
/** The shell's shared working directory (`config.workDir`), where agents write without a hold. */
|
|
172
|
+
readonly workDir: string;
|
|
173
|
+
/** The agents' scratch dir (TMPDIR), when the host sets one; writes there are unheld too. */
|
|
174
|
+
readonly scratchDir?: string;
|
|
156
175
|
}
|
|
157
176
|
|
|
158
177
|
/** Agent pictures: rendered from the agent's character, kept and served by content hash. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readFile, realpath, stat } from "node:fs/promises";
|
|
2
|
-
import { basename, isAbsolute, relative, resolve } from "node:path";
|
|
2
|
+
import { basename, isAbsolute, relative, resolve, sep } from "node:path";
|
|
3
3
|
|
|
4
4
|
/** Where a session may read files by path: its shared workspace and its scratch dir. */
|
|
5
5
|
export interface WorkspaceRoots {
|
|
@@ -23,10 +23,13 @@ export interface WorkspaceFile {
|
|
|
23
23
|
size: number;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
/** Whether `child` is `parent` or inside it. */
|
|
27
|
-
function within(parent: string, child: string): boolean {
|
|
26
|
+
/** Whether `child` is `parent` or inside it, judged by the paths alone (resolve symlinks first). */
|
|
27
|
+
export function within(parent: string, child: string): boolean {
|
|
28
28
|
const rel = relative(parent, child);
|
|
29
|
-
return
|
|
29
|
+
return (
|
|
30
|
+
rel === "" ||
|
|
31
|
+
(rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel))
|
|
32
|
+
);
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
async function realRoot(root: string): Promise<string | undefined> {
|
package/src/index.ts
CHANGED
package/src/kit/index.ts
CHANGED
package/src/testing.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { mkdtempSync } from "node:fs";
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import type { SQL } from "bun";
|
|
5
|
+
import { CATALOG } from "./characters/index.ts";
|
|
5
6
|
import { agentClaim } from "./core/agents/agent-claim.ts";
|
|
6
7
|
import { ownerAttachmentDir } from "./core/attachments/attachment-dir.ts";
|
|
7
8
|
import { attachmentPort } from "./core/attachments/attachment-port.ts";
|
|
@@ -453,6 +454,7 @@ export async function testPlugin(
|
|
|
453
454
|
locale: "en",
|
|
454
455
|
timeZone: "UTC",
|
|
455
456
|
now: () => new Date(),
|
|
457
|
+
characterSkins: CATALOG.skins,
|
|
456
458
|
...options.env,
|
|
457
459
|
};
|
|
458
460
|
// What the agent server does with the slot: the provider's runtime serves `context.turns`.
|