@synap-core/workspace-templates 0.48.0 → 0.49.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/README.md
CHANGED
|
@@ -98,6 +98,12 @@ visibility go in `meta`; the definition goes in `spec`.
|
|
|
98
98
|
reading a link is the pod's built-in `web.read` verb (Synap Core), not a catalog capability: the old
|
|
99
99
|
`web.read` pack is retired.
|
|
100
100
|
|
|
101
|
+
- **A verb that must always ask** (it deletes, destroys or publishes) declares `metadata.proposeOnly: true`:
|
|
102
|
+
no auto grant and no "runs on its own" rule ever runs it, whatever its name. Adding it later only
|
|
103
|
+
tightens (it reaches installed pods without a re-approval); setting it back to `false` re-earns the
|
|
104
|
+
owner's approval. Never beside `readOnly: true`. Reference: `postiz`'s four post verbs.
|
|
105
|
+
`synap catalog validate` enforces the shape (`skill-propose-only`).
|
|
106
|
+
|
|
101
107
|
**Skill.** Either a manifest `skills/<slug>/<slug>.skill.json` (`kind: skill`,
|
|
102
108
|
`spec` = the CP's `definition.skill`), or an Agent-Skills folder
|
|
103
109
|
`skills/<slug>/SKILL.md`. A folder stays in the shape `synap bridge-setup` reads; to
|
|
@@ -78,7 +78,8 @@
|
|
|
78
78
|
"executionMode": "sync",
|
|
79
79
|
"timeoutSeconds": 60,
|
|
80
80
|
"metadata": {
|
|
81
|
-
"verbType": "write"
|
|
81
|
+
"verbType": "write",
|
|
82
|
+
"proposeOnly": true
|
|
82
83
|
},
|
|
83
84
|
"parameters": {
|
|
84
85
|
"content": "string",
|
|
@@ -148,7 +149,8 @@
|
|
|
148
149
|
"executionMode": "sync",
|
|
149
150
|
"timeoutSeconds": 60,
|
|
150
151
|
"metadata": {
|
|
151
|
-
"verbType": "write"
|
|
152
|
+
"verbType": "write",
|
|
153
|
+
"proposeOnly": true
|
|
152
154
|
},
|
|
153
155
|
"parameters": {
|
|
154
156
|
"content": "string",
|
|
@@ -232,7 +234,8 @@
|
|
|
232
234
|
"executionMode": "sync",
|
|
233
235
|
"timeoutSeconds": 60,
|
|
234
236
|
"metadata": {
|
|
235
|
-
"verbType": "write"
|
|
237
|
+
"verbType": "write",
|
|
238
|
+
"proposeOnly": true
|
|
236
239
|
},
|
|
237
240
|
"parameters": {
|
|
238
241
|
"content": "string",
|
|
@@ -448,7 +451,8 @@
|
|
|
448
451
|
"properties": {
|
|
449
452
|
"postiz-post-id": "postId"
|
|
450
453
|
}
|
|
451
|
-
}
|
|
454
|
+
},
|
|
455
|
+
"proposeOnly": true
|
|
452
456
|
},
|
|
453
457
|
"parameters": {
|
|
454
458
|
"content": "string",
|
package/package.json
CHANGED
|
@@ -65,11 +65,13 @@ describe("Postiz contract — the keys the webhook and the capability share", ()
|
|
|
65
65
|
const verb = capability.spec.skills.find((s) => s.name === "postiz_schedule_post");
|
|
66
66
|
expect(verb?.intent).toBe("publish_post");
|
|
67
67
|
expect(verb?.kind).toBe("code");
|
|
68
|
-
// A write: an agent's run is a proposal (never metadata.readOnly)
|
|
69
|
-
// post
|
|
70
|
-
// `
|
|
68
|
+
// A write: an agent's run is a proposal (never metadata.readOnly), and a
|
|
69
|
+
// public post always asks (`proposeOnly`). The pod's post-gate runner
|
|
70
|
+
// writes `result.postId` onto the post named by the `postEntityId` param
|
|
71
|
+
// (backend `metadata.writeBack` hook, lane pz-be).
|
|
71
72
|
expect(verb?.metadata).toEqual({
|
|
72
73
|
verbType: "write",
|
|
74
|
+
proposeOnly: true,
|
|
73
75
|
writeBack: { entityParam: "postEntityId", kind: "post", properties: { "postiz-post-id": "postId" } },
|
|
74
76
|
});
|
|
75
77
|
for (const p of ["content", "integrationId", "provider", "postEntityId"]) expect(Object.keys(verb?.parameters ?? {})).toContain(p);
|
|
@@ -133,3 +135,20 @@ describe("Postiz — what a pod app may ask it to publish", () => {
|
|
|
133
135
|
expect(skill(name).inputMap, name).toBeUndefined();
|
|
134
136
|
});
|
|
135
137
|
});
|
|
138
|
+
|
|
139
|
+
// A public post always asks (231020d4): the four verbs that send one declare
|
|
140
|
+
// `metadata.proposeOnly`, so no auto grant and no auto rule runs them on any
|
|
141
|
+
// pod. The upload stores a file and publishes nothing: a person may widen it.
|
|
142
|
+
describe("Postiz — every public post is declared propose-only", () => {
|
|
143
|
+
const skill = (name: string) => capability.spec.skills.find((s) => s.name === name)!;
|
|
144
|
+
|
|
145
|
+
it.each(["postiz_draft", "postiz_schedule", "postiz_publish", "postiz_schedule_post"])("%s declares metadata.proposeOnly: true", (name) => {
|
|
146
|
+
expect(skill(name).metadata?.proposeOnly).toBe(true);
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it("every verb serving publish_post declares it; the upload does not", () => {
|
|
150
|
+
for (const s of capability.spec.skills.filter((s) => s.intent === "publish_post"))
|
|
151
|
+
expect(s.metadata?.proposeOnly, s.name).toBe(true);
|
|
152
|
+
expect(skill("postiz_upload_from_url").metadata?.proposeOnly).toBeUndefined();
|
|
153
|
+
});
|
|
154
|
+
});
|