mirror of
https://github.com/basketikun/infinite-canvas.git
synced 2026-08-05 17:04:27 +08:00
feat(agent): enhance canvas agent functionality with new Codex permissions, improved task progress display, and streamlined user interactions
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "@basketikun/canvas-agent",
|
"name": "@basketikun/canvas-agent",
|
||||||
"version": "0.2.0",
|
"version": "0.3.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"bin": {
|
"bin": {
|
||||||
"canvas-agent": "./dist/index.js"
|
"canvas-agent": "dist/index.js"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist",
|
"dist",
|
||||||
|
|||||||
@@ -103,8 +103,9 @@ export class CanvasSession {
|
|||||||
updateState(body: unknown, clientId?: string) {
|
updateState(body: unknown, clientId?: string) {
|
||||||
const targetClientId = clientId || this.activeClientId;
|
const targetClientId = clientId || this.activeClientId;
|
||||||
if (!targetClientId) return;
|
if (!targetClientId) return;
|
||||||
this.canvasStates.set(targetClientId, { ...((body && typeof body === "object" && !Array.isArray(body) ? body : {}) as Record<string, unknown>), clientId: targetClientId } as CanvasSnapshot);
|
const state = { ...((body && typeof body === "object" && !Array.isArray(body) ? body : {}) as Record<string, unknown>), clientId: targetClientId } as CanvasSnapshot;
|
||||||
logger.debug("Canvas state updated", { clientId: targetClientId, nodes: Array.isArray((body as CanvasSnapshot | null)?.nodes) ? (body as CanvasSnapshot).nodes.length : 0, connections: Array.isArray((body as CanvasSnapshot | null)?.connections) ? (body as CanvasSnapshot).connections.length : 0 });
|
this.canvasStates.set(targetClientId, state);
|
||||||
|
logger.debug("Canvas state updated", { clientId: targetClientId, nodes: state.nodes?.length || 0, connections: state.connections?.length || 0 });
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 将指定网页设为最近激活的工具目标。 */
|
/** 将指定网页设为最近激活的工具目标。 */
|
||||||
|
|||||||
Reference in New Issue
Block a user