@clowder-ai/plugin-contract 0.1.0-beta.2 → 0.1.0-beta.21
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/codegen/generate-contract.d.ts +10 -0
- package/dist/codegen/generate-contract.d.ts.map +1 -1
- package/dist/codegen/generate-contract.js +201 -19
- package/dist/codegen/generate-contract.js.map +1 -1
- package/dist/conformance/fixtures.d.ts +11 -0
- package/dist/conformance/fixtures.d.ts.map +1 -0
- package/dist/conformance/fixtures.js +9 -0
- package/dist/conformance/fixtures.js.map +1 -0
- package/dist/conformance/index.d.ts +4 -0
- package/dist/conformance/index.d.ts.map +1 -1
- package/dist/conformance/index.js +3 -0
- package/dist/conformance/index.js.map +1 -1
- package/dist/conformance/messaging-behavior-fixture.d.ts +12 -0
- package/dist/conformance/messaging-behavior-fixture.d.ts.map +1 -0
- package/dist/conformance/messaging-behavior-fixture.js +30 -0
- package/dist/conformance/messaging-behavior-fixture.js.map +1 -0
- package/dist/conformance/runner.d.ts.map +1 -1
- package/dist/conformance/runner.js +22 -2
- package/dist/conformance/runner.js.map +1 -1
- package/dist/conformance/stdio-harness/child-process-harness.d.ts +65 -0
- package/dist/conformance/stdio-harness/child-process-harness.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/child-process-harness.js +296 -0
- package/dist/conformance/stdio-harness/child-process-harness.js.map +1 -0
- package/dist/conformance/stdio-harness/dual-transport-oracle.d.ts +26 -0
- package/dist/conformance/stdio-harness/dual-transport-oracle.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/dual-transport-oracle.js +32 -0
- package/dist/conformance/stdio-harness/dual-transport-oracle.js.map +1 -0
- package/dist/conformance/stdio-harness/harness-process-spawn.d.ts +27 -0
- package/dist/conformance/stdio-harness/harness-process-spawn.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/harness-process-spawn.js +43 -0
- package/dist/conformance/stdio-harness/harness-process-spawn.js.map +1 -0
- package/dist/conformance/stdio-harness/index.d.ts +5 -0
- package/dist/conformance/stdio-harness/index.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/index.js +4 -0
- package/dist/conformance/stdio-harness/index.js.map +1 -0
- package/dist/conformance/stdio-harness/ndjson-frame.d.ts +31 -0
- package/dist/conformance/stdio-harness/ndjson-frame.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/ndjson-frame.js +125 -0
- package/dist/conformance/stdio-harness/ndjson-frame.js.map +1 -0
- package/dist/conformance/stdio-harness/node-process-tree-runtime.d.ts +15 -0
- package/dist/conformance/stdio-harness/node-process-tree-runtime.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/node-process-tree-runtime.js +78 -0
- package/dist/conformance/stdio-harness/node-process-tree-runtime.js.map +1 -0
- package/dist/conformance/stdio-harness/process-tree-controller.d.ts +51 -0
- package/dist/conformance/stdio-harness/process-tree-controller.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/process-tree-controller.js +162 -0
- package/dist/conformance/stdio-harness/process-tree-controller.js.map +1 -0
- package/dist/conformance/stdio-harness/windows-sentinel.d.ts +15 -0
- package/dist/conformance/stdio-harness/windows-sentinel.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/windows-sentinel.js +160 -0
- package/dist/conformance/stdio-harness/windows-sentinel.js.map +1 -0
- package/dist/conformance/stdio-harness/wire-shape.d.ts +18 -0
- package/dist/conformance/stdio-harness/wire-shape.d.ts.map +1 -0
- package/dist/conformance/stdio-harness/wire-shape.js +2 -0
- package/dist/conformance/stdio-harness/wire-shape.js.map +1 -0
- package/dist/docx-materialization.d.ts +8 -0
- package/dist/docx-materialization.d.ts.map +1 -0
- package/dist/docx-materialization.js +19 -0
- package/dist/docx-materialization.js.map +1 -0
- package/dist/generated/contract.generated.d.ts +984 -12
- package/dist/generated/contract.generated.d.ts.map +1 -1
- package/dist/generated/contract.generated.js +9 -1
- package/dist/generated/contract.generated.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/validation/catalog.d.ts +21 -0
- package/dist/validation/catalog.d.ts.map +1 -0
- package/dist/validation/catalog.js +140 -0
- package/dist/validation/catalog.js.map +1 -0
- package/dist/validation/companion-bridge.d.ts +6 -0
- package/dist/validation/companion-bridge.d.ts.map +1 -0
- package/dist/validation/companion-bridge.js +70 -0
- package/dist/validation/companion-bridge.js.map +1 -0
- package/dist/validation/docx-materialization.d.ts +6 -0
- package/dist/validation/docx-materialization.d.ts.map +1 -0
- package/dist/validation/docx-materialization.js +36 -0
- package/dist/validation/docx-materialization.js.map +1 -0
- package/dist/validation/index.d.ts +6 -0
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +6 -0
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/manifest.d.ts +23 -0
- package/dist/validation/manifest.d.ts.map +1 -0
- package/dist/validation/manifest.js +160 -0
- package/dist/validation/manifest.js.map +1 -0
- package/dist/validation/messaging-semantic.d.ts.map +1 -1
- package/dist/validation/messaging-semantic.js +49 -0
- package/dist/validation/messaging-semantic.js.map +1 -1
- package/dist/validation/messaging-wire.d.ts +38 -0
- package/dist/validation/messaging-wire.d.ts.map +1 -0
- package/dist/validation/messaging-wire.js +164 -0
- package/dist/validation/messaging-wire.js.map +1 -0
- package/dist/validation/signals.d.ts +26 -0
- package/dist/validation/signals.d.ts.map +1 -0
- package/dist/validation/signals.js +206 -0
- package/dist/validation/signals.js.map +1 -0
- package/dist/wire/constants.d.ts +36 -0
- package/dist/wire/constants.d.ts.map +1 -0
- package/dist/wire/constants.js +36 -0
- package/dist/wire/constants.js.map +1 -0
- package/dist/wire/disposition-fixtures.d.ts +118 -0
- package/dist/wire/disposition-fixtures.d.ts.map +1 -0
- package/dist/wire/disposition-fixtures.js +1881 -0
- package/dist/wire/disposition-fixtures.js.map +1 -0
- package/dist/wire/disposition.d.ts +102 -0
- package/dist/wire/disposition.d.ts.map +1 -0
- package/dist/wire/disposition.js +217 -0
- package/dist/wire/disposition.js.map +1 -0
- package/dist/wire/envelope.d.ts +253 -0
- package/dist/wire/envelope.d.ts.map +1 -0
- package/dist/wire/envelope.js +19 -0
- package/dist/wire/envelope.js.map +1 -0
- package/dist/wire/errors.d.ts +222 -0
- package/dist/wire/errors.d.ts.map +1 -0
- package/dist/wire/errors.js +153 -0
- package/dist/wire/errors.js.map +1 -0
- package/dist/wire/grants.d.ts +57 -0
- package/dist/wire/grants.d.ts.map +1 -0
- package/dist/wire/grants.js +59 -0
- package/dist/wire/grants.js.map +1 -0
- package/dist/wire/handshake-byte-bounds.d.ts +69 -0
- package/dist/wire/handshake-byte-bounds.d.ts.map +1 -0
- package/dist/wire/handshake-byte-bounds.js +173 -0
- package/dist/wire/handshake-byte-bounds.js.map +1 -0
- package/dist/wire/handshake.d.ts +146 -0
- package/dist/wire/handshake.d.ts.map +1 -0
- package/dist/wire/handshake.js +189 -0
- package/dist/wire/handshake.js.map +1 -0
- package/dist/wire/index.d.ts +37 -0
- package/dist/wire/index.d.ts.map +1 -0
- package/dist/wire/index.js +61 -0
- package/dist/wire/index.js.map +1 -0
- package/dist/wire/lifecycle-byte-bounds.d.ts +55 -0
- package/dist/wire/lifecycle-byte-bounds.d.ts.map +1 -0
- package/dist/wire/lifecycle-byte-bounds.js +209 -0
- package/dist/wire/lifecycle-byte-bounds.js.map +1 -0
- package/dist/wire/messaging-byte-bounds.d.ts +61 -0
- package/dist/wire/messaging-byte-bounds.d.ts.map +1 -0
- package/dist/wire/messaging-byte-bounds.js +459 -0
- package/dist/wire/messaging-byte-bounds.js.map +1 -0
- package/dist/wire/registry.d.ts +294 -0
- package/dist/wire/registry.d.ts.map +1 -0
- package/dist/wire/registry.js +256 -0
- package/dist/wire/registry.js.map +1 -0
- package/dist/wire/request-id.d.ts +34 -0
- package/dist/wire/request-id.d.ts.map +1 -0
- package/dist/wire/request-id.js +40 -0
- package/dist/wire/request-id.js.map +1 -0
- package/dist/wire/row-shapes.d.ts +217 -0
- package/dist/wire/row-shapes.d.ts.map +1 -0
- package/dist/wire/row-shapes.js +75 -0
- package/dist/wire/row-shapes.js.map +1 -0
- package/dist/wire/signal-byte-bounds.d.ts +97 -0
- package/dist/wire/signal-byte-bounds.d.ts.map +1 -0
- package/dist/wire/signal-byte-bounds.js +229 -0
- package/dist/wire/signal-byte-bounds.js.map +1 -0
- package/dist/wire/wire-uint53.d.ts +26 -0
- package/dist/wire/wire-uint53.d.ts.map +1 -0
- package/dist/wire/wire-uint53.js +32 -0
- package/dist/wire/wire-uint53.js.map +1 -0
- package/fixtures/behavior/messaging/adversarial-invariants.json +85 -0
- package/fixtures/manifest/invalid/duplicate-signal-type.json +33 -0
- package/fixtures/manifest/invalid/icon-package-escape.json +22 -0
- package/fixtures/manifest/valid/localized-product-metadata.json +27 -0
- package/fixtures/messaging/valid/subscription-delivery.json +1 -1
- package/fixtures/signals/invalid/destination-injection.json +15 -0
- package/fixtures/signals/invalid/dynamic-schema-url.json +10 -0
- package/fixtures/signals/invalid/forbidden-raw-privacy.json +10 -0
- package/fixtures/signals/invalid/non-utc-occurred-at.json +12 -0
- package/fixtures/signals/valid/feishu-meeting-artifact.json +18 -0
- package/fixtures/signals/valid/remote-service-declaration.json +10 -0
- package/package.json +19 -6
- package/src/schemas/behavior-fixture.schema.json +262 -2
- package/src/schemas/catalog.schema.json +91 -0
- package/src/schemas/companion-bridge.schema.json +1011 -0
- package/src/schemas/docx-materialization.schema.json +302 -0
- package/src/schemas/manifest.schema.json +490 -4
- package/src/schemas/messaging.schema.json +209 -32
- package/src/schemas/physical-limb.schema.json +319 -0
- package/src/schemas/plugin-metadata.schema.json +62 -0
- package/src/schemas/signal.schema.json +129 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { spawn, } from 'node:child_process';
|
|
2
|
+
const WINDOWS_SENTINEL_SOURCE = String.raw `
|
|
3
|
+
const { spawn } = require('node:child_process');
|
|
4
|
+
|
|
5
|
+
let target;
|
|
6
|
+
let targetExitSent = false;
|
|
7
|
+
const keepAlive = setInterval(() => {}, 0x3fffffff);
|
|
8
|
+
|
|
9
|
+
function send(message) {
|
|
10
|
+
if (process.connected) {
|
|
11
|
+
process.send(message, () => {});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function sendError(error) {
|
|
16
|
+
send({
|
|
17
|
+
type: 'target-error',
|
|
18
|
+
name: error && error.name ? String(error.name) : 'Error',
|
|
19
|
+
message: error && error.message ? String(error.message) : String(error),
|
|
20
|
+
code: error && error.code !== undefined ? String(error.code) : undefined,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function sendExit(code, signal) {
|
|
25
|
+
if (!targetExitSent) {
|
|
26
|
+
targetExitSent = true;
|
|
27
|
+
send({ type: 'target-exit', code, signal });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
process.on('message', (message) => {
|
|
32
|
+
if (!message || typeof message !== 'object') return;
|
|
33
|
+
if (message.type === 'launch' && target === undefined) {
|
|
34
|
+
try {
|
|
35
|
+
target = spawn(message.command, message.args, {
|
|
36
|
+
stdio: ['inherit', 'inherit', 'inherit'],
|
|
37
|
+
});
|
|
38
|
+
target.once('error', (error) => {
|
|
39
|
+
sendError(error);
|
|
40
|
+
sendExit(null, null);
|
|
41
|
+
});
|
|
42
|
+
target.once('exit', sendExit);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
sendError(error);
|
|
45
|
+
sendExit(null, null);
|
|
46
|
+
}
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (message.type === 'signal' && target !== undefined) {
|
|
50
|
+
try {
|
|
51
|
+
target.kill(message.signal);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
sendError(error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
process.on('disconnect', () => {
|
|
59
|
+
clearInterval(keepAlive);
|
|
60
|
+
if (process.platform === 'win32') {
|
|
61
|
+
const cleanup = spawn(
|
|
62
|
+
'taskkill',
|
|
63
|
+
['/pid', String(process.pid), '/t', '/f'],
|
|
64
|
+
{ detached: true, stdio: 'ignore', windowsHide: true },
|
|
65
|
+
);
|
|
66
|
+
cleanup.unref();
|
|
67
|
+
} else if (target !== undefined) {
|
|
68
|
+
target.kill('SIGKILL');
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
`;
|
|
72
|
+
export function spawnWindowsSentinel(options) {
|
|
73
|
+
const root = spawn(process.execPath, ['-e', WINDOWS_SENTINEL_SOURCE], {
|
|
74
|
+
cwd: options.cwd,
|
|
75
|
+
env: options.env,
|
|
76
|
+
stdio: ['pipe', 'pipe', 'pipe', 'ipc'],
|
|
77
|
+
windowsHide: true,
|
|
78
|
+
});
|
|
79
|
+
let targetExit;
|
|
80
|
+
let targetError;
|
|
81
|
+
const exitListeners = [];
|
|
82
|
+
const errorListeners = [];
|
|
83
|
+
const publishTargetError = (error) => {
|
|
84
|
+
targetError ??= error;
|
|
85
|
+
for (const listener of errorListeners.splice(0)) {
|
|
86
|
+
listener(targetError);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const publishTargetExit = (code, signal) => {
|
|
90
|
+
if (targetExit !== undefined) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
targetExit = { code, signal };
|
|
94
|
+
for (const listener of exitListeners.splice(0)) {
|
|
95
|
+
listener(code, signal);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
root.on('message', (message) => {
|
|
99
|
+
if (!isSentinelMessage(message)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (message.type === 'target-error') {
|
|
103
|
+
const error = new Error(message.message ?? 'Windows sentinel target failed');
|
|
104
|
+
error.name = message.name ?? 'Error';
|
|
105
|
+
if (message.code !== undefined) {
|
|
106
|
+
Object.assign(error, { code: message.code });
|
|
107
|
+
}
|
|
108
|
+
publishTargetError(error);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
publishTargetExit(typeof message.code === 'number' ? message.code : null, message.signal ?? null);
|
|
112
|
+
});
|
|
113
|
+
root.once('error', publishTargetError);
|
|
114
|
+
root.once('close', (code, signal) => publishTargetExit(code, signal));
|
|
115
|
+
root.once('spawn', () => {
|
|
116
|
+
root.send({ type: 'launch', command: options.command, args: [...options.args] }, (error) => {
|
|
117
|
+
if (error !== null) {
|
|
118
|
+
publishTargetError(error);
|
|
119
|
+
publishTargetExit(null, null);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
return {
|
|
124
|
+
root,
|
|
125
|
+
onTargetError: (listener) => {
|
|
126
|
+
if (targetError === undefined) {
|
|
127
|
+
errorListeners.push(listener);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const error = targetError;
|
|
131
|
+
queueMicrotask(() => listener(error));
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
onTargetExit: (listener) => {
|
|
135
|
+
if (targetExit === undefined) {
|
|
136
|
+
exitListeners.push(listener);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
const exit = targetExit;
|
|
140
|
+
queueMicrotask(() => listener(exit.code, exit.signal));
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
signalTarget: (signal) => {
|
|
144
|
+
if (root.connected) {
|
|
145
|
+
root.send({ type: 'signal', signal }, (error) => {
|
|
146
|
+
if (error !== null) {
|
|
147
|
+
publishTargetError(error);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function isSentinelMessage(message) {
|
|
155
|
+
return (typeof message === 'object' &&
|
|
156
|
+
message !== null &&
|
|
157
|
+
'type' in message &&
|
|
158
|
+
(message.type === 'target-error' || message.type === 'target-exit'));
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=windows-sentinel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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AAED,SAAS,iBAAiB,CAAC,OAAgB;IACzC,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,KAAK,IAAI;QAChB,MAAM,IAAI,OAAO;QACjB,CAAC,OAAO,CAAC,IAAI,KAAK,cAAc,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa,CAAC,CACpE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HarnessChild } from './child-process-harness.js';
|
|
2
|
+
import type { DecodedNdjsonFrame, JsonObject } from './ndjson-frame.js';
|
|
3
|
+
/**
|
|
4
|
+
* Deliberate seam for the P-1a contract output.
|
|
5
|
+
*
|
|
6
|
+
* This skeleton owns process and frame transport only. The #1165 frozen
|
|
7
|
+
* shape (rev11) is now shape-approved; the wire module mechanizes its
|
|
8
|
+
* 13-row registry, disposition table, and closed error envelopes. This
|
|
9
|
+
* seam will be replaced by a concrete codec backed by those wire types
|
|
10
|
+
* when the handshake rows (1, 2) reach CLOSED leaf closure.
|
|
11
|
+
*/
|
|
12
|
+
export interface HarnessWireShape<Outbound, Inbound> {
|
|
13
|
+
readonly status: 'shape-approved';
|
|
14
|
+
encode(message: Outbound): JsonObject;
|
|
15
|
+
decode(frame: DecodedNdjsonFrame): Inbound;
|
|
16
|
+
performHelloReady(child: HarnessChild): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=wire-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-shape.d.ts","sourceRoot":"","sources":["../../../src/conformance/stdio-harness/wire-shape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAExE;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB,CAAC,QAAQ,EAAE,OAAO;IACjD,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,MAAM,CAAC,OAAO,EAAE,QAAQ,GAAG,UAAU,CAAC;IACtC,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC;IAC3C,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire-shape.js","sourceRoot":"","sources":["../../../src/conformance/stdio-harness/wire-shape.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Browser-safe policy and generated types for the closed materializer boundary. */
|
|
2
|
+
import { type DocxMaterializationOperation } from './generated/contract.generated.js';
|
|
3
|
+
/** Defensive pre-parse worker check, derived from the same public schema as Host validation. */
|
|
4
|
+
export declare function hasLosslessDocxOperationText(operation: DocxMaterializationOperation): boolean;
|
|
5
|
+
export declare const DOCX_MATERIALIZATION_MAX_BYTES: number;
|
|
6
|
+
export declare const DOCX_MATERIALIZATION_MAX_WIRE_BYTES: number;
|
|
7
|
+
export type { DocxMaterializationAnchor, DocxMaterializationAttribution, DocxMaterializationOperation, DocxMaterializationRequest, DocxMaterializationResponse, DocxMaterializationResult, } from './generated/contract.generated.js';
|
|
8
|
+
//# sourceMappingURL=docx-materialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docx-materialization.d.ts","sourceRoot":"","sources":["../src/docx-materialization.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,mCAAmC,CAAC;AAK3C,gGAAgG;AAChG,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,4BAA4B,GAAG,OAAO,CAQ7F;AAED,eAAO,MAAM,8BAA8B,QAAkB,CAAC;AAC9D,eAAO,MAAM,mCAAmC,QAAmB,CAAC;AACpE,YAAY,EACV,yBAAyB,EACzB,8BAA8B,EAC9B,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Browser-safe policy and generated types for the closed materializer boundary. */
|
|
2
|
+
import { DOCX_MATERIALIZATION_AUTHOR_PATTERN, DOCX_MATERIALIZATION_TEXT_PATTERN, } from './generated/contract.generated.js';
|
|
3
|
+
const text = new RegExp(DOCX_MATERIALIZATION_TEXT_PATTERN, 'u');
|
|
4
|
+
const author = new RegExp(DOCX_MATERIALIZATION_AUTHOR_PATTERN, 'u');
|
|
5
|
+
/** Defensive pre-parse worker check, derived from the same public schema as Host validation. */
|
|
6
|
+
export function hasLosslessDocxOperationText(operation) {
|
|
7
|
+
if (operation?.kind === 'inspect')
|
|
8
|
+
return true;
|
|
9
|
+
if (operation?.kind !== 'tracked-change' && operation?.kind !== 'comment')
|
|
10
|
+
return false;
|
|
11
|
+
const value = operation.kind === 'tracked-change' ? operation.replacement : operation.body;
|
|
12
|
+
const attribution = operation.attribution;
|
|
13
|
+
return typeof value === 'string' && text.test(value)
|
|
14
|
+
&& typeof attribution?.author === 'string' && author.test(attribution.author)
|
|
15
|
+
&& typeof attribution.timestamp === 'string' && author.test(attribution.timestamp);
|
|
16
|
+
}
|
|
17
|
+
export const DOCX_MATERIALIZATION_MAX_BYTES = 8 * 1024 * 1024;
|
|
18
|
+
export const DOCX_MATERIALIZATION_MAX_WIRE_BYTES = 12 * 1024 * 1024;
|
|
19
|
+
//# sourceMappingURL=docx-materialization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docx-materialization.js","sourceRoot":"","sources":["../src/docx-materialization.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,OAAO,EACL,mCAAmC,EACnC,iCAAiC,GAElC,MAAM,mCAAmC,CAAC;AAE3C,MAAM,IAAI,GAAG,IAAI,MAAM,CAAC,iCAAiC,EAAE,GAAG,CAAC,CAAC;AAChE,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,mCAAmC,EAAE,GAAG,CAAC,CAAC;AAEpE,gGAAgG;AAChG,MAAM,UAAU,4BAA4B,CAAC,SAAuC;IAClF,IAAI,SAAS,EAAE,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC/C,IAAI,SAAS,EAAE,IAAI,KAAK,gBAAgB,IAAI,SAAS,EAAE,IAAI,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACxF,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC;IAC3F,MAAM,WAAW,GAAG,SAAS,CAAC,WAAW,CAAC;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;WAC/C,OAAO,WAAW,EAAE,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;WAC1E,OAAO,WAAW,CAAC,SAAS,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;AACvF,CAAC;AAED,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9D,MAAM,CAAC,MAAM,mCAAmC,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC"}
|