@punica/editor 1.50.2 → 1.52.0
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/index.bundle.esm.js +2 -2
- package/dist/index.bundle.esm.js.map +1 -1
- package/dist/index.bundle.umd.js +2 -2
- package/dist/index.bundle.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/punica.module.flow.api.d.ts +19 -0
- package/types/punica.module.flow.primitives.d.ts +11 -1
- package/types/punica.module.runtime.host.d.ts +7 -0
- package/types/punica.module.test.d.ts +15 -0
- package/types/vendor/monaco-editor.d.ts +109 -0
package/package.json
CHANGED
|
@@ -109,6 +109,25 @@ declare module 'punica' {
|
|
|
109
109
|
nodeId: CapabilityId,
|
|
110
110
|
options?: { manifest?: unknown }
|
|
111
111
|
): Promise<TestReport>;
|
|
112
|
+
/**
|
|
113
|
+
* Run the tests, grade them, and keep the record beside the manifest
|
|
114
|
+
* (`<stem>.verification.json`) when every case that ran passed and at
|
|
115
|
+
* least one ran. A red run removes an earlier record of the file. The
|
|
116
|
+
* marketplace refuses a publish without this record (substrate 1.51.0).
|
|
117
|
+
*/
|
|
118
|
+
verify(
|
|
119
|
+
id: CapabilityId,
|
|
120
|
+
options?: { manifest?: unknown; producedBy?: string }
|
|
121
|
+
): Promise<{
|
|
122
|
+
color: 'green' | 'yellow' | 'red';
|
|
123
|
+
verified: boolean;
|
|
124
|
+
reason: string;
|
|
125
|
+
ran: number;
|
|
126
|
+
passed: number;
|
|
127
|
+
skipped: number;
|
|
128
|
+
record: Record<string, unknown> | null;
|
|
129
|
+
path: string | null;
|
|
130
|
+
}>;
|
|
112
131
|
}
|
|
113
132
|
|
|
114
133
|
export interface FlowApi {
|
|
@@ -308,7 +308,17 @@ declare module 'punica' {
|
|
|
308
308
|
*/
|
|
309
309
|
export interface ForEachPrimitiveData {
|
|
310
310
|
collection: PrimitiveValueRef;
|
|
311
|
-
|
|
311
|
+
/** Decision-only body reference (no dispatch). One of this or `bodyCapabilityId`. */
|
|
312
|
+
bodyFlowId?: CapabilityId;
|
|
313
|
+
/**
|
|
314
|
+
* A capability called once per item through the gateway (substrate
|
|
315
|
+
* 1.51.0) — an IvyNode, an IvyAgent or any extension capability. Its
|
|
316
|
+
* input is `bodyInput` with the item bound at `itemBinding`; the node's
|
|
317
|
+
* output is `{ results, count, truncated }`.
|
|
318
|
+
*/
|
|
319
|
+
bodyCapabilityId?: CapabilityId;
|
|
320
|
+
/** Fixed input fields for every call of `bodyCapabilityId`. */
|
|
321
|
+
bodyInput?: JSONObject;
|
|
312
322
|
maxIterations: number;
|
|
313
323
|
itemBinding?: string;
|
|
314
324
|
}
|
|
@@ -251,6 +251,13 @@ declare module 'punica' {
|
|
|
251
251
|
* and packaged builds; omitted when the host cannot resolve it.
|
|
252
252
|
*/
|
|
253
253
|
bridgePath?: string;
|
|
254
|
+
/**
|
|
255
|
+
* The bearer token the listener requires on every JSON-RPC and SSE
|
|
256
|
+
* request (`Authorization: Bearer <token>`; the stdio bridge takes
|
|
257
|
+
* `--token`). Minted once per installation. Omitted by a host whose
|
|
258
|
+
* listener takes no token.
|
|
259
|
+
*/
|
|
260
|
+
token?: string;
|
|
254
261
|
}
|
|
255
262
|
|
|
256
263
|
/** An inbound MCP JSON-RPC request forwarded from the transport. */
|
|
@@ -263,6 +263,13 @@ declare module 'punica' {
|
|
|
263
263
|
sideEffects?: SideEffectCheck;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
/**
|
|
267
|
+
* How a test case builds one non-JSON input (see `TestCase.fixture`).
|
|
268
|
+
*/
|
|
269
|
+
export interface TestFixture {
|
|
270
|
+
python: string;
|
|
271
|
+
}
|
|
272
|
+
|
|
266
273
|
/**
|
|
267
274
|
* Test Case
|
|
268
275
|
*/
|
|
@@ -279,6 +286,14 @@ declare module 'punica' {
|
|
|
279
286
|
* Test input data
|
|
280
287
|
*/
|
|
281
288
|
input: JSONValue | JSONObject | null;
|
|
289
|
+
/**
|
|
290
|
+
* Values the case builds in the node's own session before it runs, one
|
|
291
|
+
* per input field, for inputs that are not JSON — a client, a model, a
|
|
292
|
+
* buffer an upstream node would hand over as a handle. `python` is an
|
|
293
|
+
* expression, or a block that assigns `value`. A fixture key replaces
|
|
294
|
+
* the same key in `input`.
|
|
295
|
+
*/
|
|
296
|
+
fixture?: Record<string, TestFixture>;
|
|
282
297
|
/**
|
|
283
298
|
* Test assertions
|
|
284
299
|
*/
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Monaco surface the hosts ship, for extensions that do not install it.
|
|
3
|
+
*
|
|
4
|
+
* `monaco-editor` is the product's, not an extension's: both hosts map the
|
|
5
|
+
* bare specifier to one shared `monaco-editor.bundle.js` through the renderer
|
|
6
|
+
* import map (punica-editor-browser/vendor/monaco-vendor.ts, monaco-editor
|
|
7
|
+
* ^0.53.0 in both hosts' package.json), and an extension keeps it `external`
|
|
8
|
+
* in rollup. Installing the package only for its types puts ~70 MB in every
|
|
9
|
+
* extension's node_modules and lets an extension compile against API the
|
|
10
|
+
* host's core-only bundle does not carry.
|
|
11
|
+
*
|
|
12
|
+
* **Opt in through tsconfig `paths`**, the way `punica` is mapped:
|
|
13
|
+
*
|
|
14
|
+
* "paths": {
|
|
15
|
+
* "punica": ["node_modules/@punica/editor/types"],
|
|
16
|
+
* "monaco-editor": ["node_modules/@punica/editor/types/vendor/monaco-editor"]
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* It is a module, not an ambient `declare module`, and it is deliberately not
|
|
20
|
+
* referenced from `types/index.d.ts`: an extension that does install the real
|
|
21
|
+
* package (extension-code-editor uses far more of it) must keep resolving to
|
|
22
|
+
* that one.
|
|
23
|
+
*
|
|
24
|
+
* Only what an extension in the fleet calls is declared. Widen it when a
|
|
25
|
+
* caller needs more — and check the member exists in the host's bundle,
|
|
26
|
+
* which is the core editor plus the python, markdown, sql, typescript and
|
|
27
|
+
* javascript tokenizers, no language services and no workers.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
export interface IDisposable {
|
|
31
|
+
dispose(): void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface IPosition {
|
|
35
|
+
lineNumber: number;
|
|
36
|
+
column: number;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface IRange {
|
|
40
|
+
startLineNumber: number;
|
|
41
|
+
startColumn: number;
|
|
42
|
+
endLineNumber: number;
|
|
43
|
+
endColumn: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export enum MarkerSeverity {
|
|
47
|
+
Hint = 1,
|
|
48
|
+
Info = 2,
|
|
49
|
+
Warning = 4,
|
|
50
|
+
Error = 8,
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export namespace editor {
|
|
54
|
+
interface IMarkerData extends IRange {
|
|
55
|
+
severity: MarkerSeverity;
|
|
56
|
+
message: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface ITextModel {
|
|
60
|
+
getValue(): string;
|
|
61
|
+
getFullModelRange(): IRange;
|
|
62
|
+
getPositionAt(offset: number): IPosition;
|
|
63
|
+
getOffsetAt(position: IPosition): number;
|
|
64
|
+
pushEditOperations(
|
|
65
|
+
beforeCursorState: unknown[] | null,
|
|
66
|
+
editOperations: { range: IRange; text: string }[],
|
|
67
|
+
cursorStateComputer: () => unknown[] | null
|
|
68
|
+
): unknown;
|
|
69
|
+
pushStackElement(): void;
|
|
70
|
+
dispose(): void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface IStandaloneCodeEditor {
|
|
74
|
+
getValue(): string;
|
|
75
|
+
setValue(value: string): void;
|
|
76
|
+
getModel(): ITextModel | null;
|
|
77
|
+
focus(): void;
|
|
78
|
+
dispose(): void;
|
|
79
|
+
layout(): void;
|
|
80
|
+
setSelection(range: IRange): void;
|
|
81
|
+
revealRangeInCenterIfOutsideViewport(range: IRange): void;
|
|
82
|
+
onDidChangeModelContent(listener: () => void): IDisposable;
|
|
83
|
+
updateOptions(options: Record<string, unknown>): void;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function create(
|
|
87
|
+
host: HTMLElement,
|
|
88
|
+
options: Record<string, unknown>
|
|
89
|
+
): IStandaloneCodeEditor;
|
|
90
|
+
function setTheme(theme: string): void;
|
|
91
|
+
function setModelMarkers(
|
|
92
|
+
model: ITextModel,
|
|
93
|
+
owner: string,
|
|
94
|
+
markers: IMarkerData[]
|
|
95
|
+
): void;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export namespace languages {
|
|
99
|
+
function register(language: { id: string; extensions?: string[] }): void;
|
|
100
|
+
function getLanguages(): { id: string }[];
|
|
101
|
+
function setMonarchTokensProvider(
|
|
102
|
+
languageId: string,
|
|
103
|
+
language: Record<string, unknown>
|
|
104
|
+
): IDisposable;
|
|
105
|
+
function setLanguageConfiguration(
|
|
106
|
+
languageId: string,
|
|
107
|
+
configuration: Record<string, unknown>
|
|
108
|
+
): IDisposable;
|
|
109
|
+
}
|