Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ Pi sessions are stored as JSONL files in `<data>/ai-sessions/`. Pi's `SessionMan
| Package | Purpose |
| ------------------------------- | --------------------------------------------------------------------------------------- |
| `@mariozechner/pi-coding-agent` | SDK entry point: `createAgentSession`, `AuthStorage`, `ModelRegistry`, `SessionManager` |
| `@sinclair/typebox` | JSON Schema definitions for custom tool parameters (peer dependency of pi) |
| `typebox` | JSON Schema definitions for custom tool parameters (peer dependency of pi) |
| `better-sqlite3` | Synchronous SQLite driver for LiveApp collection query cache |

## Engineering Guidelines
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
"@fastify/cookie": "^11.0.2",
"@fastify/static": "^8.0.0",
"@fastify/websocket": "^11.0.0",
"@mariozechner/pi-ai": "^0.62.0",
"@mariozechner/pi-coding-agent": "^0.62.0",
"@sinclair/typebox": "^0.34.48",
"@mariozechner/pi-ai": "^0.73.1",
"@mariozechner/pi-coding-agent": "^0.73.1",
"typebox": "^1.1.38",
"ahooks": "^3.9.6",
"axios": "^1.13.6",
"bcryptjs": "^3.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/ai/action-tool.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ToolDefinition } from '@mariozechner/pi-coding-agent';
import { Type } from '@sinclair/typebox';
import { Type } from 'typebox';
import type { WindowManagerService } from '../window-manager';

const actionSchema = Type.Object({
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/ai/ask-user-tool.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ToolDefinition } from '@mariozechner/pi-coding-agent';
import { Type } from '@sinclair/typebox';
import { Type } from 'typebox';

export type AskUserQuestionType = 'text' | 'select' | 'multi_select' | 'confirm';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/ai/create-liveapp-tool.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ToolDefinition } from '@mariozechner/pi-coding-agent';
import { Type } from '@sinclair/typebox';
import { Type } from 'typebox';
import type { SendAiCommand } from './desktop-tool';
import { broadcastEvent } from '../messaging';
import { randomUUID } from 'node:crypto';
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/ai/desktop-tool.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StringEnum } from '@mariozechner/pi-ai';
import type { ToolDefinition } from '@mariozechner/pi-coding-agent';
import { Type } from '@sinclair/typebox';
import { Type } from 'typebox';
import type { MiniAppManifest } from '@desktalk/sdk';
import type { WindowManagerService } from '../window-manager';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/ai/edit-tool.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
import type { ToolDefinition } from '@mariozechner/pi-coding-agent';
import { Type } from '@sinclair/typebox';
import { Type } from 'typebox';
import { broadcastEvent } from '../messaging';
import { EditHistory, type ManagedPathResolver } from './edit-history';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/ai/generate-icon-tool.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { writeFileSync } from 'node:fs';
import { join } from 'node:path';
import type { ToolDefinition } from '@mariozechner/pi-coding-agent';
import { Type } from '@sinclair/typebox';
import { Type } from 'typebox';
import { broadcastEvent } from '../messaging';
import { ImageGenerationService } from './image-generation-service';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/ai/layout-tool.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StringEnum } from '@mariozechner/pi-ai';
import type { ToolDefinition } from '@mariozechner/pi-coding-agent';
import { Type } from '@sinclair/typebox';
import { Type } from 'typebox';
import type { SendAiCommand } from './desktop-tool';

const layoutSchema = Type.Object({
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/ai/manual-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { existsSync, readFileSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import type { ToolDefinition } from '@mariozechner/pi-coding-agent';
import { Type } from '@sinclair/typebox';
import { Type } from 'typebox';
import { MANUAL_PAGES, MANUAL_PAGE_MAP, type ManualPageMeta } from './manual-pages/index';

const readManualSchema = Type.Object({
Expand Down
13 changes: 4 additions & 9 deletions packages/core/src/services/ai/pi-session-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ import {
createAgentSession,
DefaultResourceLoader,
ModelRegistry,
readTool,
writeTool,
bashTool,
grepTool,
findTool,
lsTool,
SessionManager,
type AgentSession,
type AgentSessionEvent,
Expand Down Expand Up @@ -539,7 +533,7 @@ export class PiSessionService {
logger: pino.Logger,
): Promise<PiSessionService> {
const authStorage = AuthStorage.create(join(workspacePaths.config, 'pi-auth.json'));
const modelRegistry = new ModelRegistry(authStorage);
const modelRegistry = ModelRegistry.create(authStorage);
const sessionDir = join(workspacePaths.data, 'ai-sessions');
mkdirSync(sessionDir, { recursive: true });

Expand Down Expand Up @@ -571,6 +565,7 @@ export class PiSessionService {

const resourceLoader = new DefaultResourceLoader({
cwd: process.cwd(),
agentDir: workspacePaths.config,
additionalSkillPaths: [join(workspacePaths.data, 'skills')],
appendSystemPromptOverride: (base) => [...base, DESKTALK_SYSTEM_PROMPT],
});
Expand Down Expand Up @@ -703,7 +698,7 @@ export class PiSessionService {
modelRegistry,
model: initialModel,
sessionManager,
tools: [readTool, writeTool, bashTool, grepTool, findTool, lsTool],
tools: ['read', 'write', 'bash', 'grep', 'find', 'ls'],
customTools,
resourceLoader,
});
Expand Down Expand Up @@ -737,7 +732,7 @@ export class PiSessionService {
modelRegistry: this.modelRegistry,
model: this.session.model,
sessionManager,
tools: [readTool, writeTool, bashTool, grepTool, findTool, lsTool],
tools: ['read', 'write', 'bash', 'grep', 'find', 'ls'],
customTools: this.customTools,
resourceLoader: this.resourceLoader,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/ai/redo-edit-tool.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { writeFileSync } from 'node:fs';
import type { ToolDefinition } from '@mariozechner/pi-coding-agent';
import { Type } from '@sinclair/typebox';
import { Type } from 'typebox';
import { broadcastEvent } from '../messaging';
import { EditHistory, type ManagedPathResolver } from './edit-history';

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/ai/undo-edit-tool.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { writeFileSync } from 'node:fs';
import type { ToolDefinition } from '@mariozechner/pi-coding-agent';
import { Type } from '@sinclair/typebox';
import { Type } from 'typebox';
import { broadcastEvent } from '../messaging';
import { EditHistory, type ManagedPathResolver } from './edit-history';

Expand Down
Loading
Loading