@hyperframes/share 0.9.56 → 0.9.58
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/sources/types.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export interface PathRule {
|
|
|
61
61
|
/** The fields of contract/path-policy.json this client reads. */
|
|
62
62
|
export interface PolicyDocument {
|
|
63
63
|
policy_version: string;
|
|
64
|
-
stored_manifest: {
|
|
64
|
+
stored_manifest: { legacy_rule_regexes: Record<string, string> };
|
|
65
65
|
unicode: { version: string };
|
|
66
66
|
rules: PathRule[];
|
|
67
67
|
path: {
|
package/package.json
CHANGED
|
@@ -186,6 +186,13 @@
|
|
|
186
186
|
"server_action": "reject",
|
|
187
187
|
"basis": "Operating-system metadata: it changes when a folder is browsed and would show as false edits and conflicts"
|
|
188
188
|
},
|
|
189
|
+
{
|
|
190
|
+
"id": "nested-hyperframes-state",
|
|
191
|
+
"regex": "(?:[^/]+/)+\\.hyperframes(?:/.*)?",
|
|
192
|
+
"client_action": "exclude",
|
|
193
|
+
"server_action": "reject",
|
|
194
|
+
"basis": "A .hyperframes folder below the project root, such as one inside a project copied into compositions/, holds that copy's client records; only the root folder's named portable files below travel"
|
|
195
|
+
},
|
|
189
196
|
{
|
|
190
197
|
"id": "portable-transcripts",
|
|
191
198
|
"regex": "\\.hyperframes/transcripts/(?:[^/]+/)*[^/]+\\.json",
|
|
@@ -305,7 +312,10 @@
|
|
|
305
312
|
"basis": "Desktop's podcast intake links the original camera files, which live outside the project, under assets/podcast/, and the page plays the transcodes under .hyperframes/prepared-assets/podcast/; real files there, such as the joins under assets/podcast/joins/, travel normally"
|
|
306
313
|
},
|
|
307
314
|
"stored_manifest": {
|
|
308
|
-
"
|
|
309
|
-
|
|
315
|
+
"legacy_rule_regexes": {
|
|
316
|
+
"agent-client-state": "(?:[^/]+/)*(?:\\.claude|\\.agents|\\.cursor|\\.vscode|\\.idea)(?:/.*)?",
|
|
317
|
+
"nested-hyperframes-state": "(?!)"
|
|
318
|
+
},
|
|
319
|
+
"rule": "Only stored snapshot reads use each listed rule's regex in place of its current one, to retain immutable manifest digests: agent-client-state its v3 regex, and nested-hyperframes-state, added after v4, none. New captures and uploads use the current rules. Clients never install excluded paths; the server never signs their download URLs."
|
|
310
320
|
}
|
|
311
321
|
}
|
|
@@ -51,19 +51,24 @@ function compile(document) {
|
|
|
51
51
|
limits.canonical_spelling_roots.map((root) => [comparisonKey(root), root]),
|
|
52
52
|
),
|
|
53
53
|
rules: document.rules.map((rule) => ({ rule, pattern: whole(rule.regex) })),
|
|
54
|
-
storedRules: document
|
|
55
|
-
rule,
|
|
56
|
-
pattern: whole(
|
|
57
|
-
rule.id === "agent-client-state"
|
|
58
|
-
? document.stored_manifest.legacy_agent_state_regex
|
|
59
|
-
: rule.regex,
|
|
60
|
-
),
|
|
61
|
-
})),
|
|
54
|
+
storedRules: storedRules(document),
|
|
62
55
|
prefilter: new Set(document.client_prefilter.names),
|
|
63
56
|
symlinkPrefixes: document.client_symlinks.skip_prefixes,
|
|
64
57
|
};
|
|
65
58
|
}
|
|
66
59
|
|
|
60
|
+
/** Each rule the stored manifest section lists matches by its legacy regex in a stored snapshot read.
|
|
61
|
+
* @param {PolicyDocument} document */
|
|
62
|
+
function storedRules(document) {
|
|
63
|
+
const legacy = new Map(Object.entries(document.stored_manifest.legacy_rule_regexes));
|
|
64
|
+
const unknown = [...legacy.keys()].filter((id) => !document.rules.some((rule) => rule.id === id));
|
|
65
|
+
if (unknown.length) throw new Error(`path policy's stored_manifest names no rule ${unknown}`);
|
|
66
|
+
return document.rules.map((rule) => ({
|
|
67
|
+
rule,
|
|
68
|
+
pattern: whole(legacy.get(rule.id) ?? rule.regex),
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
|
|
67
72
|
/** @type {ReturnType<typeof compile> | null} */
|
|
68
73
|
let compiled = null;
|
|
69
74
|
/** The policy, read and compiled when a path is first checked: an app that never syncs never reads it. */
|
package/src/sources/types.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export interface PathRule {
|
|
|
61
61
|
/** The fields of contract/path-policy.json this client reads. */
|
|
62
62
|
export interface PolicyDocument {
|
|
63
63
|
policy_version: string;
|
|
64
|
-
stored_manifest: {
|
|
64
|
+
stored_manifest: { legacy_rule_regexes: Record<string, string> };
|
|
65
65
|
unicode: { version: string };
|
|
66
66
|
rules: PathRule[];
|
|
67
67
|
path: {
|