Skip to content
Merged
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 packages/persona-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"lint": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"@relayfile/adapter-core": "^0.3.59",
"@relayfile/adapter-core": "^0.3.60",
"@relayfile/local-mount": "^0.7.24"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@agent-assistant/proactive": "^0.4.32",
"@agent-relay/events": "^6.3.3",
"@agentworkforce/persona-kit": "workspace:*",
"@relayfile/adapter-core": "^0.3.59",
"@relayfile/adapter-core": "^0.3.60",
"agent-trajectories": "^0.5.3"
}
}
104 changes: 6 additions & 98 deletions packages/runtime/src/clients/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import * as adapterVfsClient from '@relayfile/adapter-core/vfs-client';
import {
writeJsonFile as coreWriteJsonFile,
RelayfileWritebackError,
normalizeWritebackStatus,
WritebackError,
Comment on lines +3 to +4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore the writeback shim until core exports exist

In the bumped @relayfile/adapter-core 0.3.60 source for vfs-client, these new named exports are not present, so this import (and the matching re-exports below) makes the runtime package fail to compile with missing-export errors before any tests can run. This affects every consumer installing this commit's lockfile/package range, so the wrapper needs to keep the local shim or wait for a core version that actually publishes normalizeWritebackStatus, WritebackError, and the normalized status types.

Useful? React with 👍 / 👎.

type IntegrationClientOptions,
type WritebackReceipt,
type WritebackResult
} from '@relayfile/adapter-core/vfs-client';

Expand All @@ -25,8 +24,12 @@ export {
readTextFile,
resolveMountRoot,
RelayfileWritebackError,
WritebackError,
normalizeWritebackStatus,
type RelayfileWritebackErrorOptions,
type IntegrationClientOptions,
type NormalizedWritebackState,
type NormalizedWritebackStatus,
type WritebackReceipt,
type WritebackResult
} from '@relayfile/adapter-core/vfs-client';
Expand All @@ -37,101 +40,6 @@ export {
SandboxNotAvailableError
} from '../errors.js';

export type NormalizedWritebackState =
| 'succeeded'
| 'no_receipt'
| 'validation_failed'
| 'readonly_rejected'
| 'adapter_error'
| 'ok';

export interface NormalizedWritebackStatus {
state: NormalizedWritebackState;
path: string;
op?: 'create' | 'patch' | 'delete';
id?: string;
error?: string;
field?: string;
receipt?: WritebackReceipt;
timestamp?: string;
entry?: unknown;
}

type AdapterVfsClientExtensions = {
normalizeWritebackStatus?: (
result?: WritebackResult,
entry?: unknown
) => NormalizedWritebackStatus;
WritebackError?: new (normalized: NormalizedWritebackStatus) => RelayfileWritebackError &
NormalizedWritebackStatus;
};

class FallbackWritebackError extends RelayfileWritebackError {
readonly state: NormalizedWritebackState;
readonly path: string;
readonly op?: 'create' | 'patch' | 'delete';
readonly id?: string;
readonly receipt?: WritebackReceipt;
readonly error?: string;
readonly field?: string;
readonly timestamp?: string;

constructor(normalized: NormalizedWritebackStatus) {
super({
provider: 'writeback',
operation: normalized.state,
cause: normalized.error ? new Error(normalized.error) : undefined,
retryable: false
});
this.name = 'WritebackError';
this.message = `writeback ${normalized.state} ${normalized.path}${
normalized.error ? `: ${normalized.error}` : ''
}`;
this.state = normalized.state;
this.path = normalized.path;
this.op = normalized.op;
this.id = normalized.id;
this.receipt = normalized.receipt;
this.error = normalized.error;
this.field = normalized.field;
this.timestamp = normalized.timestamp;
}
}

const adapterExtensions = adapterVfsClient as AdapterVfsClientExtensions;

export const WritebackError = adapterExtensions.WritebackError ?? FallbackWritebackError;

export function normalizeWritebackStatus(
result?: WritebackResult,
entry?: unknown
): NormalizedWritebackStatus {
const normalize = adapterExtensions.normalizeWritebackStatus;
if (normalize) return normalize(result, entry);

if (!result?.receipt) {
return {
state: 'no_receipt',
path: result?.path ?? '',
error: 'writeback produced no receipt'
};
}

const receipt = result.receipt;
const id =
receipt.id !== undefined
? String(receipt.id)
: receipt.created !== undefined
? String(receipt.created)
: undefined;
return {
state: 'succeeded',
path: result.path,
...(id ? { id } : {}),
receipt
};
}

export async function writeJsonFile(
client: IntegrationClientOptions,
provider: string,
Expand Down
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading