@undefineds.co/xpod 0.3.22 → 0.3.24
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/api/runs/PiAgentRuntimeDriver.d.ts +1 -0
- package/dist/api/runs/PiAgentRuntimeDriver.js +4 -1
- package/dist/api/runs/PiAgentRuntimeDriver.js.map +1 -1
- package/dist/identity/drizzle/PodLookupRepository.d.ts +8 -0
- package/dist/identity/drizzle/PodLookupRepository.js +22 -8
- package/dist/identity/drizzle/PodLookupRepository.js.map +1 -1
- package/dist/identity/oidc/ScopedPickWebIdHandler.d.ts +1 -0
- package/dist/identity/oidc/ScopedPickWebIdHandler.js +4 -2
- package/dist/identity/oidc/ScopedPickWebIdHandler.js.map +1 -1
- package/dist/solidfs/LocalSolidFS.js +31 -124
- package/dist/solidfs/LocalSolidFS.js.map +1 -1
- package/dist/solidfs/SolidFsPathUtils.d.ts +13 -0
- package/dist/solidfs/SolidFsPathUtils.js +114 -0
- package/dist/solidfs/SolidFsPathUtils.js.map +1 -0
- package/dist/solidfs/SolidFsSyncJournal.d.ts +117 -0
- package/dist/solidfs/SolidFsSyncJournal.js +553 -0
- package/dist/solidfs/SolidFsSyncJournal.js.map +1 -0
- package/dist/solidfs/index.d.ts +1 -0
- package/dist/solidfs/index.js +1 -0
- package/dist/solidfs/index.js.map +1 -1
- package/dist/solidfs/types.d.ts +1 -0
- package/dist/solidfs/types.js.map +1 -1
- package/package.json +1 -1
- package/static/app/assets/main.js +32 -31
- package/templates/identity/account/create-pod.html.ejs +2 -4
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.contentTypeForPath = contentTypeForPath;
|
|
7
|
+
exports.sourceForProjection = sourceForProjection;
|
|
8
|
+
exports.resolveWorkspaceResource = resolveWorkspaceResource;
|
|
9
|
+
exports.safeRelativePath = safeRelativePath;
|
|
10
|
+
exports.maybeFileVersion = maybeFileVersion;
|
|
11
|
+
exports.fileVersion = fileVersion;
|
|
12
|
+
exports.snapshotDirectory = snapshotDirectory;
|
|
13
|
+
const node_crypto_1 = require("node:crypto");
|
|
14
|
+
const node_fs_1 = require("node:fs");
|
|
15
|
+
const promises_1 = require("node:fs/promises");
|
|
16
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
17
|
+
const node_url_1 = require("node:url");
|
|
18
|
+
const RdfContentTypes_1 = require("../storage/rdf/RdfContentTypes");
|
|
19
|
+
function contentTypeForPath(filePath) {
|
|
20
|
+
const lower = filePath.toLowerCase();
|
|
21
|
+
const rdfContentType = (0, RdfContentTypes_1.rdfContentTypeForPath)(lower);
|
|
22
|
+
if (rdfContentType) {
|
|
23
|
+
return rdfContentType;
|
|
24
|
+
}
|
|
25
|
+
if (lower.endsWith('.md') || lower.endsWith('.markdown') || lower.endsWith('.mdown')) {
|
|
26
|
+
return 'text/markdown';
|
|
27
|
+
}
|
|
28
|
+
if (lower.endsWith('.txt') || lower.endsWith('.log')) {
|
|
29
|
+
return 'text/plain';
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
function sourceForProjection(projection, workspace) {
|
|
34
|
+
if (projection === 'hydrated-object') {
|
|
35
|
+
return 'object';
|
|
36
|
+
}
|
|
37
|
+
if (/^https?:/u.test(workspace)) {
|
|
38
|
+
return 'pod-http';
|
|
39
|
+
}
|
|
40
|
+
return 'filesystem';
|
|
41
|
+
}
|
|
42
|
+
function resolveWorkspaceResource(workspace, relativePath) {
|
|
43
|
+
if (node_path_1.default.isAbsolute(workspace)) {
|
|
44
|
+
return (0, node_url_1.pathToFileURL)(node_path_1.default.join(workspace, relativePath)).href;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const base = new URL(workspace.endsWith('/') ? workspace : `${workspace}/`);
|
|
48
|
+
const normalized = relativePath.split(node_path_1.default.sep).join('/');
|
|
49
|
+
return new URL(normalized, base).href;
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function safeRelativePath(input) {
|
|
56
|
+
const normalized = input.split(/[\\/]+/u).filter((part) => part.length > 0).join(node_path_1.default.sep);
|
|
57
|
+
if (!normalized || node_path_1.default.isAbsolute(input) || normalized.split(node_path_1.default.sep).includes('..')) {
|
|
58
|
+
throw new Error(`Invalid SolidFS relative path: ${input}`);
|
|
59
|
+
}
|
|
60
|
+
return normalized;
|
|
61
|
+
}
|
|
62
|
+
async function maybeFileVersion(filePath) {
|
|
63
|
+
try {
|
|
64
|
+
return await fileVersion(filePath);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async function fileVersion(filePath) {
|
|
71
|
+
const fileStat = await (0, promises_1.stat)(filePath);
|
|
72
|
+
const hash = (0, node_crypto_1.createHash)('sha256');
|
|
73
|
+
await new Promise((resolve, reject) => {
|
|
74
|
+
const stream = (0, node_fs_1.createReadStream)(filePath);
|
|
75
|
+
stream.on('data', (chunk) => hash.update(chunk));
|
|
76
|
+
stream.on('error', reject);
|
|
77
|
+
stream.on('end', resolve);
|
|
78
|
+
});
|
|
79
|
+
return `${fileStat.size}:${fileStat.mtimeMs}:${hash.digest('hex')}`;
|
|
80
|
+
}
|
|
81
|
+
async function snapshotDirectory(root, filter) {
|
|
82
|
+
const snapshots = [];
|
|
83
|
+
async function walk(current) {
|
|
84
|
+
let entries;
|
|
85
|
+
try {
|
|
86
|
+
entries = await (0, promises_1.readdir)(current, { withFileTypes: true });
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
for (const entry of entries) {
|
|
92
|
+
const absolute = node_path_1.default.join(current, entry.name);
|
|
93
|
+
const relative = node_path_1.default.relative(root, absolute);
|
|
94
|
+
if (entry.isDirectory()) {
|
|
95
|
+
await walk(absolute);
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (!entry.isFile()) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (filter && !filter(relative)) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
snapshots.push({
|
|
105
|
+
relativePath: relative,
|
|
106
|
+
absolutePath: absolute,
|
|
107
|
+
version: await fileVersion(absolute),
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
await walk(root);
|
|
112
|
+
return snapshots.sort((left, right) => left.relativePath.localeCompare(right.relativePath));
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=SolidFsPathUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolidFsPathUtils.js","sourceRoot":"","sources":["../../src/solidfs/SolidFsPathUtils.ts"],"names":[],"mappings":";;;;;AAqBA,gDAaC;AAED,kDAQC;AAED,4DAYC;AAED,4CAMC;AAED,4CAMC;AAED,kCAUC;AAED,8CAqCC;AA7HD,6CAAyC;AACzC,qCAA2C;AAC3C,+CAG0B;AAC1B,0DAA6B;AAC7B,uCAAyC;AAMzC,oEAAuE;AAQvE,SAAgB,kBAAkB,CAAC,QAAgB;IACjD,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACrC,MAAM,cAAc,GAAG,IAAA,uCAAqB,EAAC,KAAK,CAAC,CAAC;IACpD,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACrF,OAAO,eAAe,CAAC;IACzB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} from 'node:crypto';\nimport { createReadStream } from 'node:fs';\nimport {\n readdir,\n stat,\n} from 'node:fs/promises';\nimport path from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport type {\n SolidFsEntrySource,\n SolidFsProjection,\n} from './types';\nimport { rdfContentTypeForPath } from '../storage/rdf/RdfContentTypes';\n\nexport interface SolidFsFileSnapshot {\n relativePath: string;\n absolutePath: string;\n version: string;\n}\n\nexport function contentTypeForPath(filePath: string): string | undefined {\n const lower = filePath.toLowerCase();\n const rdfContentType = rdfContentTypeForPath(lower);\n if (rdfContentType) {\n return rdfContentType;\n }\n if (lower.endsWith('.md') || lower.endsWith('.markdown') || lower.endsWith('.mdown')) {\n return 'text/markdown';\n }\n if (lower.endsWith('.txt') || lower.endsWith('.log')) {\n return 'text/plain';\n }\n return undefined;\n}\n\nexport function sourceForProjection(projection: SolidFsProjection, workspace: string): SolidFsEntrySource {\n if (projection === 'hydrated-object') {\n return 'object';\n }\n if (/^https?:/u.test(workspace)) {\n return 'pod-http';\n }\n return 'filesystem';\n}\n\nexport function resolveWorkspaceResource(workspace: string, relativePath: string): string | undefined {\n if (path.isAbsolute(workspace)) {\n return pathToFileURL(path.join(workspace, relativePath)).href;\n }\n\n try {\n const base = new URL(workspace.endsWith('/') ? workspace : `${workspace}/`);\n const normalized = relativePath.split(path.sep).join('/');\n return new URL(normalized, base).href;\n } catch {\n return undefined;\n }\n}\n\nexport function safeRelativePath(input: string): string {\n const normalized = input.split(/[\\\\/]+/u).filter((part) => part.length > 0).join(path.sep);\n if (!normalized || path.isAbsolute(input) || normalized.split(path.sep).includes('..')) {\n throw new Error(`Invalid SolidFS relative path: ${input}`);\n }\n return normalized;\n}\n\nexport async function maybeFileVersion(filePath: string): Promise<string | undefined> {\n try {\n return await fileVersion(filePath);\n } catch {\n return undefined;\n }\n}\n\nexport async function fileVersion(filePath: string): Promise<string> {\n const fileStat = await stat(filePath);\n const hash = createHash('sha256');\n await new Promise<void>((resolve, reject) => {\n const stream = createReadStream(filePath);\n stream.on('data', (chunk) => hash.update(chunk));\n stream.on('error', reject);\n stream.on('end', resolve);\n });\n return `${fileStat.size}:${fileStat.mtimeMs}:${hash.digest('hex')}`;\n}\n\nexport async function snapshotDirectory(\n root: string,\n filter?: (relativePath: string) => boolean,\n): Promise<SolidFsFileSnapshot[]> {\n const snapshots: SolidFsFileSnapshot[] = [];\n\n async function walk(current: string): Promise<void> {\n let entries;\n try {\n entries = await readdir(current, { withFileTypes: true });\n } catch {\n return;\n }\n\n for (const entry of entries) {\n const absolute = path.join(current, entry.name);\n const relative = path.relative(root, absolute);\n if (entry.isDirectory()) {\n await walk(absolute);\n continue;\n }\n if (!entry.isFile()) {\n continue;\n }\n if (filter && !filter(relative)) {\n continue;\n }\n snapshots.push({\n relativePath: relative,\n absolutePath: absolute,\n version: await fileVersion(absolute),\n });\n }\n }\n\n await walk(root);\n return snapshots.sort((left, right) => left.relativePath.localeCompare(right.relativePath));\n}\n"]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { SolidFsChange, SolidFsEntrySource, SolidFsManifest, SolidFsPrepareInput, SolidFsProjection, SolidFsSyncer } from './types';
|
|
2
|
+
export type SolidFsSyncJournalStage = 'local_committed' | 'failed_retryable' | 'failed_permanent' | 'reconcile_required' | 'done';
|
|
3
|
+
export interface SolidFsSyncJournalOptions {
|
|
4
|
+
path: string;
|
|
5
|
+
now?: () => number;
|
|
6
|
+
doneRetentionMs?: number;
|
|
7
|
+
tombstoneRetentionMs?: number;
|
|
8
|
+
failedPermanentRetentionMs?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface SolidFsSyncJournalOperation {
|
|
11
|
+
id: string;
|
|
12
|
+
txId?: string;
|
|
13
|
+
workspace: SolidFsManifest;
|
|
14
|
+
change: SolidFsChange;
|
|
15
|
+
stage: SolidFsSyncJournalStage;
|
|
16
|
+
afterHash?: string;
|
|
17
|
+
retryCount: number;
|
|
18
|
+
lastError?: string;
|
|
19
|
+
createdAt: number;
|
|
20
|
+
updatedAt: number;
|
|
21
|
+
doneAt?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface SolidFsJournalBootstrapInput {
|
|
24
|
+
workspace: string;
|
|
25
|
+
cwd: string;
|
|
26
|
+
projection?: SolidFsProjection;
|
|
27
|
+
source?: SolidFsEntrySource;
|
|
28
|
+
shouldTrackPath?: (relativePath: string) => boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface SolidFsJournalBootstrapResult {
|
|
31
|
+
scanned: number;
|
|
32
|
+
enqueued: number;
|
|
33
|
+
skipped: number;
|
|
34
|
+
}
|
|
35
|
+
export interface SolidFsJournalReplayResult {
|
|
36
|
+
attempted: number;
|
|
37
|
+
completed: number;
|
|
38
|
+
failed: number;
|
|
39
|
+
reconcileRequired: number;
|
|
40
|
+
}
|
|
41
|
+
export interface SolidFsJournalCompactResult {
|
|
42
|
+
deletedOps: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Per-Pod SolidFS recovery journal.
|
|
46
|
+
*
|
|
47
|
+
* This is an outbox for derived work after the authority file is already
|
|
48
|
+
* committed. It stores enough metadata to replay index/remote refreshes, but
|
|
49
|
+
* never stores file bodies.
|
|
50
|
+
*/
|
|
51
|
+
export declare class SqliteSolidFsSyncJournal {
|
|
52
|
+
private readonly db;
|
|
53
|
+
private readonly now;
|
|
54
|
+
private readonly doneRetentionMs;
|
|
55
|
+
private readonly tombstoneRetentionMs;
|
|
56
|
+
private readonly failedPermanentRetentionMs;
|
|
57
|
+
constructor(options: SolidFsSyncJournalOptions);
|
|
58
|
+
close(): void;
|
|
59
|
+
recordLocalCommitted(change: SolidFsChange, workspace: SolidFsManifest, txId?: string): Promise<SolidFsSyncJournalOperation>;
|
|
60
|
+
getOperation(id: string): SolidFsSyncJournalOperation | undefined;
|
|
61
|
+
listOperations(stages?: SolidFsSyncJournalStage[]): SolidFsSyncJournalOperation[];
|
|
62
|
+
listPending(): SolidFsSyncJournalOperation[];
|
|
63
|
+
markDone(id: string): Promise<void>;
|
|
64
|
+
markRetryableFailure(id: string, error: unknown): Promise<void>;
|
|
65
|
+
markReconcileRequired(id: string, reason: string): Promise<void>;
|
|
66
|
+
markFailedPermanent(id: string, error: unknown): Promise<void>;
|
|
67
|
+
replayPending(syncer: SolidFsSyncer, context?: unknown): Promise<SolidFsJournalReplayResult>;
|
|
68
|
+
bootstrapWorkspace(input: SolidFsJournalBootstrapInput): Promise<SolidFsJournalBootstrapResult>;
|
|
69
|
+
compact(): Promise<SolidFsJournalCompactResult>;
|
|
70
|
+
private validateOperationForReplay;
|
|
71
|
+
private getCheckpoint;
|
|
72
|
+
private listCheckpoints;
|
|
73
|
+
private upsertCheckpoint;
|
|
74
|
+
private initializeSchema;
|
|
75
|
+
}
|
|
76
|
+
export interface JournaledSolidFsSyncerOptions {
|
|
77
|
+
syncer: SolidFsSyncer;
|
|
78
|
+
journal: SqliteSolidFsSyncJournal;
|
|
79
|
+
}
|
|
80
|
+
export interface WorkspaceJournaledSolidFsSyncerOptions {
|
|
81
|
+
syncer: SolidFsSyncer;
|
|
82
|
+
journalRoot?: string;
|
|
83
|
+
resolveJournalPath?: (workspace: SolidFsManifest) => string;
|
|
84
|
+
now?: () => number;
|
|
85
|
+
doneRetentionMs?: number;
|
|
86
|
+
tombstoneRetentionMs?: number;
|
|
87
|
+
failedPermanentRetentionMs?: number;
|
|
88
|
+
}
|
|
89
|
+
export declare class JournaledSolidFsSyncer implements SolidFsSyncer {
|
|
90
|
+
private readonly syncer;
|
|
91
|
+
private readonly journal;
|
|
92
|
+
constructor(options: JournaledSolidFsSyncerOptions);
|
|
93
|
+
shouldTrack(input: SolidFsPrepareInput): boolean;
|
|
94
|
+
shouldTrackPath(relativePath: string): boolean;
|
|
95
|
+
sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown): Promise<void>;
|
|
96
|
+
replayPending(context?: unknown): Promise<SolidFsJournalReplayResult>;
|
|
97
|
+
compact(): Promise<SolidFsJournalCompactResult>;
|
|
98
|
+
bootstrapWorkspace(input: Omit<SolidFsJournalBootstrapInput, 'shouldTrackPath'> & {
|
|
99
|
+
shouldTrackPath?: (relativePath: string) => boolean;
|
|
100
|
+
}): Promise<SolidFsJournalBootstrapResult>;
|
|
101
|
+
}
|
|
102
|
+
export declare class WorkspaceJournaledSolidFsSyncer implements SolidFsSyncer {
|
|
103
|
+
private readonly options;
|
|
104
|
+
private readonly syncer;
|
|
105
|
+
private readonly journals;
|
|
106
|
+
constructor(options: WorkspaceJournaledSolidFsSyncerOptions);
|
|
107
|
+
shouldTrack(input: SolidFsPrepareInput): boolean;
|
|
108
|
+
shouldTrackPath(relativePath: string): boolean;
|
|
109
|
+
initializeWorkspace(workspace: SolidFsManifest, context?: unknown): Promise<void>;
|
|
110
|
+
sync(change: SolidFsChange, workspace: SolidFsManifest, context?: unknown): Promise<void>;
|
|
111
|
+
replayPending(workspace: SolidFsManifest, context?: unknown): Promise<SolidFsJournalReplayResult>;
|
|
112
|
+
compact(workspace: SolidFsManifest): Promise<SolidFsJournalCompactResult>;
|
|
113
|
+
journalPathFor(workspace: SolidFsManifest): string;
|
|
114
|
+
close(): void;
|
|
115
|
+
private journalFor;
|
|
116
|
+
}
|
|
117
|
+
export declare function resolveSolidFsJournalPath(workspace: SolidFsManifest, journalRoot?: string): string;
|