qlogicagent 2.14.8 → 2.14.10
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/dist/cli.js +314 -314
- package/dist/index.js +313 -313
- package/dist/types/runtime/infra/acp-detector.d.ts +3 -9
- package/dist/types/runtime/infra/agent-paths.d.ts +0 -6
- package/dist/types/runtime/infra/checkpoint-backend.d.ts +3 -2
- package/dist/types/runtime/infra/default-path-service.d.ts +1 -1
- package/dist/types/runtime/infra/project-data-gc.d.ts +7 -0
- package/dist/types/runtime/infra/project-data-paths.d.ts +28 -0
- package/dist/types/runtime/infra/project-store.d.ts +6 -0
- package/dist/types/runtime/session/inbound-upload-persistence.d.ts +24 -0
- package/dist/types/runtime/session/session-paths.d.ts +0 -1
- package/package.json +2 -2
|
@@ -18,16 +18,10 @@ export declare function getNpmInstallPackageName(command: string | undefined): s
|
|
|
18
18
|
export declare function compareSemverVersions(a: string, b: string): number;
|
|
19
19
|
export declare function isVersionNewer(latest: string | null | undefined, current: string | null | undefined): boolean;
|
|
20
20
|
export declare function readGlobalNpmPackageVersion(packageName: string | null | undefined): string | null;
|
|
21
|
-
export declare function fetchNpmLatestPackageVersion(packageName: string | null | undefined): string | null;
|
|
22
21
|
export declare function resolveInstalledNpmPackageVersionFromInstall(install: AcpBackendConfig["install"] | undefined): string | null;
|
|
23
|
-
export declare function
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
latestVersion?: string;
|
|
27
|
-
updateAvailable: boolean;
|
|
28
|
-
};
|
|
29
|
-
/** Async, parallel-safe variant of fetchNpmLatestPackageVersion — used by the background update check
|
|
30
|
-
* so N agents resolve concurrently (one `npm view` each) instead of blocking sequentially. */
|
|
22
|
+
export declare function getCatalogInstalledVersion(entry: AcpBackendConfig, detectedVersion?: string): string | undefined;
|
|
23
|
+
/** Resolve a package's latest published version via `npm view` (async + cached). Used by the background
|
|
24
|
+
* update check so N agents resolve concurrently (one `npm view` each) instead of blocking sequentially. */
|
|
31
25
|
export declare function fetchNpmLatestPackageVersionAsync(packageName: string | null | undefined): Promise<string | null>;
|
|
32
26
|
export interface CatalogUpdateInfo {
|
|
33
27
|
id: string;
|
|
@@ -57,11 +57,5 @@ export declare function getProjectSettingsPath(cwd: string): string;
|
|
|
57
57
|
export declare function getProjectInstructionsPath(cwd: string): string;
|
|
58
58
|
/** `<cwd>/.qlogicagent/rules/` — unified rules + instructions directory */
|
|
59
59
|
export declare function getProjectRulesDir(cwd: string): string;
|
|
60
|
-
/** `<cwd>/.qlogicagent/sessions/` */
|
|
61
|
-
export declare function getProjectSessionsRoot(cwd: string): string;
|
|
62
|
-
/** `<cwd>/.qlogicagent/sessions/{sessionId}` */
|
|
63
|
-
export declare function getProjectSessionDir(cwd: string, sessionId: string): string;
|
|
64
|
-
/** `<cwd>/.qlogicagent/checkpoints/` or `<cwd>/.qlogicagent/checkpoints/{sessionId}` */
|
|
65
|
-
export declare function getProjectCheckpointsDir(cwd: string, sessionId?: string): string;
|
|
66
60
|
/** `<gitRoot>/.qlogicagent/hooks/` */
|
|
67
61
|
export declare function getGitRootHooksDir(gitRoot: string): string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Local Checkpoint Backend — git-based shadow repo implementation.
|
|
3
3
|
*
|
|
4
|
-
* Creates and manages checkpoint snapshots in
|
|
5
|
-
*
|
|
4
|
+
* Creates and manages checkpoint snapshots in the centralized companion store
|
|
5
|
+
* `~/.qlogicagent/profiles/<owner>/projectData/<projectId>/checkpoints/<sessionId>/`
|
|
6
|
+
* (NOT inside the user's workspace) using a shadow git repository independent of the user's .git.
|
|
6
7
|
*/
|
|
7
8
|
import type { CheckpointBackend } from "../ports/checkpoint-contracts.js";
|
|
8
9
|
export declare function createLocalCheckpointBackend(projectRoot: string, sessionId: string): CheckpointBackend;
|
|
@@ -28,6 +28,6 @@ export declare class DefaultPathService implements PathService {
|
|
|
28
28
|
getProjectInstructionsPath(projectRoot?: string): string;
|
|
29
29
|
getProjectPluginsDir(projectRoot?: string): string;
|
|
30
30
|
getProjectRulesDir(projectRoot?: string): string;
|
|
31
|
-
getProjectSessionsRoot(
|
|
31
|
+
getProjectSessionsRoot(projectKey?: string): string;
|
|
32
32
|
}
|
|
33
33
|
export declare function getDefaultPathService(): PathService;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Data GC — best-effort startup reclamation of the companion-data tree, mirroring VS Code's
|
|
3
|
+
* UnusedWorkspaceStorageDataCleaner: it only removes data that is clearly unowned (a projectData/<id>
|
|
4
|
+
* dir whose projectId has no projects.json entry — orphaned by a crash or an incomplete delete) and
|
|
5
|
+
* prunes stale deletion tombstones. It NEVER touches live projects' data or the user's workspace.
|
|
6
|
+
*/
|
|
7
|
+
export declare function gcOrphanProjectData(): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project Data Paths — centralized location for our per-project COMPANION data (the "account
|
|
3
|
+
* book"): session transcripts/metadata, checkpoint shadow repos, uploaded attachments, deletion
|
|
4
|
+
* tombstones. Mirrors VS Code's workspaceStorage: this data is OURS and lives in a centralized,
|
|
5
|
+
* per-project-id, physically-isolated dir under the owner profile — NEVER inside the user's
|
|
6
|
+
* workspace folder. The workspace folder holds only user work product (code/docs/generated media).
|
|
7
|
+
*
|
|
8
|
+
* ~/.qlogicagent/profiles/<owner>/projectData/<projectId>/{sessions,checkpoints,uploads}/
|
|
9
|
+
*
|
|
10
|
+
* Keying by projectId (not workspaceDir) decouples bookkeeping from the user's folder, so:
|
|
11
|
+
* - deleting a project = `rm` projectData/<id>/ (always safe; never touches the user's files);
|
|
12
|
+
* - sessions/checkpoints can never leak into, or orphan inside, an external user folder.
|
|
13
|
+
*
|
|
14
|
+
* This module is the ONE place that imports project-store for the workspaceDir→projectId reverse
|
|
15
|
+
* lookup; the low-level agent-paths stays dependency-free (no project-store cycle).
|
|
16
|
+
*/
|
|
17
|
+
/** `~/.qlogicagent/profiles/<owner>/projectData/<projectId>/` (key = projectId or workspaceDir). */
|
|
18
|
+
export declare function getProjectDataDir(key: string): string;
|
|
19
|
+
/** Direct projectData dir for a known projectId (no reverse lookup) — used by project delete/GC. */
|
|
20
|
+
export declare function getProjectDataDirById(projectId: string): string;
|
|
21
|
+
/** Root of the project-data tree for the current owner (for orphan GC). */
|
|
22
|
+
export declare function getProjectDataRoot(): string;
|
|
23
|
+
/** `projectData/<id>/sessions/` */
|
|
24
|
+
export declare function getProjectDataSessionsRoot(key: string): string;
|
|
25
|
+
/** `projectData/<id>/checkpoints/` or `.../checkpoints/<sessionId>` */
|
|
26
|
+
export declare function getProjectDataCheckpointsDir(key: string, sessionId?: string): string;
|
|
27
|
+
/** `projectData/<id>/uploads/` or `.../uploads/<sessionId>` */
|
|
28
|
+
export declare function getProjectDataUploadsDir(key: string, sessionId?: string): string;
|
|
@@ -48,6 +48,12 @@ export declare function findByGroupId(groupId: string): ProjectInfo | null;
|
|
|
48
48
|
* a cwd that maps to no project is ignored rather than silently leaking files outside any project.
|
|
49
49
|
*/
|
|
50
50
|
export declare function findByWorkspaceDir(dir: string): ProjectInfo | null;
|
|
51
|
+
/**
|
|
52
|
+
* Reverse-lookup a workspaceDir to its owning projectId across ALL projects (active + archived).
|
|
53
|
+
* Used for projectData storage keying so a session/checkpoint dir resolves correctly even for an
|
|
54
|
+
* archived project (findByWorkspaceDir matches active-only and would miss it).
|
|
55
|
+
*/
|
|
56
|
+
export declare function findProjectIdByWorkspaceDirAnyStatus(dir: string): string | undefined;
|
|
51
57
|
export declare function archiveByGroupId(groupId: string): {
|
|
52
58
|
archived: boolean;
|
|
53
59
|
projectId?: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inbound Upload Persistence (decision A) — the agent owns its companion data, so user-uploaded
|
|
3
|
+
* attachments are persisted by the AGENT (not the gateway) into the session's projectData uploads
|
|
4
|
+
* dir, where they become part of the session record and are cleaned up on session/project delete.
|
|
5
|
+
*
|
|
6
|
+
* The gateway puts an inbound attachment in its short-lived transport cache and hands the agent a
|
|
7
|
+
* `http://127.0.0.1:<port>/media/<id>` URL. We fetch those bytes once, write them under
|
|
8
|
+
* projectData/<projectId>/uploads/<sessionId>/, and rewrite the reference to a gateway local-media
|
|
9
|
+
* proxy URL pointing at the persisted file (same `/api/media/local?src=file://…` shape the gateway
|
|
10
|
+
* used before — provider-core still sees a 127.0.0.1 local URL for cloud upload, and the frontend
|
|
11
|
+
* still GETs it). Any failure degrades gracefully to the original URL (the turn still works off the
|
|
12
|
+
* transport cache; only long-term persistence is skipped).
|
|
13
|
+
*/
|
|
14
|
+
import type { ChatMessage } from "../../protocol/wire/index.js";
|
|
15
|
+
/**
|
|
16
|
+
* Persist a single inbound upload URL to projectData uploads and return the rewritten proxy URL.
|
|
17
|
+
* Non-transport URLs (already-persisted, remote, file://) and any failure return the input unchanged.
|
|
18
|
+
*/
|
|
19
|
+
export declare function persistInboundUploadUrl(url: string, projectId: string, sessionId: string): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Persist + rewrite the inbound uploads on the LAST user message of a turn (the new message;
|
|
22
|
+
* resumed history already carries persisted local URLs). Mutates and returns the message array.
|
|
23
|
+
*/
|
|
24
|
+
export declare function persistInboundUploadsForTurn(messages: ChatMessage[], projectId: string | undefined, sessionId: string | undefined): Promise<ChatMessage[]>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const TRANSCRIPT_FILE = "transcript.jsonl";
|
|
2
2
|
export declare const METADATA_FILE = "metadata.json";
|
|
3
|
-
export declare const LEGACY_STATE_FILE = "state.json";
|
|
4
3
|
export declare function sanitizeSessionId(sessionId: string): string;
|
|
5
4
|
export declare function getSessionsRoot(projectRoot: string): string;
|
|
6
5
|
export declare function getSessionDir(sessionId: string, projectRoot: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qlogicagent",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.10",
|
|
4
4
|
"description": "XiaozhiClaw Agent CLI — subprocess architecture (JSON-RPC over stdio)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"@agentclientprotocol/sdk": "^0.25.0",
|
|
91
91
|
"@napi-rs/canvas": "0.1.100",
|
|
92
92
|
"@xiaozhiclaw/pet-core": "0.1.2",
|
|
93
|
-
"@xiaozhiclaw/provider-core": "^0.1.
|
|
93
|
+
"@xiaozhiclaw/provider-core": "^0.1.18",
|
|
94
94
|
"better-sqlite3": "^12.10.0",
|
|
95
95
|
"dotenv": "^17.3.1",
|
|
96
96
|
"ioredis": "^5.11.1",
|