@metapages/metapage 1.9.0 → 1.9.1

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/README.md CHANGED
@@ -137,6 +137,41 @@ A metapage is defined using JSON that specifies which metaframes to load and how
137
137
 
138
138
  This creates a pipeline: `input` → `processor` → `output`
139
139
 
140
+
141
+ ### Metaframe Definition
142
+
143
+ See [code](https://github.com/metapages/metapage/blob/73549f9f3e27da7a2aef5a935ec112c5bdb130db/app/libs/src/metapage/v2/metaframe.ts#L40)
144
+
145
+ This is provided either by:
146
+
147
+ - `https://<your metaframe>/metaframe.json`
148
+ - `https://<your metaframe>/#?definition=<json encoded hash param>`
149
+
150
+ The definition describes inputs, outputs, security, and the types of hash parameters (so AI tools can correctly modify)
151
+
152
+ ```typescript
153
+ export interface MetaframeDefinitionV2 {
154
+ version: VersionsMetaframe;
155
+ inputs?: {
156
+ [key: string]: MetaframePipeDefinition;
157
+ }; // <MetaframePipeId, MetaframePipeDefinition>
158
+ outputs?: {
159
+ [key: string]: MetaframePipeDefinition;
160
+ }; // <MetaframePipeId, MetaframePipeDefinition>
161
+ metadata: MetaframeMetadataV2;
162
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Feature_Policy/Using_Feature_Policy#the_iframe_allow_attribute
163
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Feature-Policy#directives
164
+ allow?: string;
165
+ // Set or override allowed features for the iframe
166
+ // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox
167
+ sandbox?: string;
168
+ // Hash parameters configuration.
169
+ // Accepts both legacy array format (string[]) and new object format (HashParamsObject).
170
+ // When fetched via helper methods, array format is normalized to object format.
171
+ hashParams?: HashParamsRaw;
172
+ }
173
+ ```
174
+
140
175
  ### Data Pipes
141
176
 
142
177
  Pipes connect metaframe outputs to other metaframe inputs:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@metapages/metapage",
3
3
  "public": true,
4
- "version": "1.9.0",
4
+ "version": "1.9.1",
5
5
  "description": "Connect web pages together",
6
6
  "repository": "https://github.com/metapages/metapage",
7
7
  "homepage": "https://metapage.io/",
@@ -31,7 +31,7 @@
31
31
  "fetch-retry": "^6.0.0",
32
32
  "mutative": "^1.0.11",
33
33
  "object-hash": "^3.0.0",
34
- "picomatch-browser": "^2.2.6"
34
+ "picomatch": "^4.0.2"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@rollup/plugin-typescript": "^11.1.5",
@@ -53,6 +53,7 @@
53
53
  ],
54
54
  "author": "Dion Whitehead <dion@metapage.io>",
55
55
  "scripts": {
56
+ "build": "just build",
56
57
  "format": "npx prettier . --write",
57
58
  "test": "vitest run",
58
59
  "test-watch": "vitest",
@@ -1 +1,4 @@
1
- declare module "picomatch-browser";
1
+ declare module "picomatch/posix" {
2
+ import picomatch from "picomatch";
3
+ export = picomatch;
4
+ }
@@ -1,6 +1,6 @@
1
1
  import { ListenerFn } from "eventemitter3";
2
2
  import { create } from "mutative";
3
- import picomatch from "picomatch-browser";
3
+ import picomatch from "picomatch/posix";
4
4
 
5
5
  import { VERSION_METAPAGE } from "./Constants";
6
6
  import {