@intentic/extension-manifest 1.431.0 → 1.432.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 +46 -2
- package/dist/manifest.d.ts +294 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +96 -1
- package/dist/manifest.js.map +1 -1
- package/dist/permissions.d.ts +23 -0
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +28 -1
- package/dist/permissions.js.map +1 -1
- package/dist/points/automation-templates.d.ts +68 -0
- package/dist/points/automation-templates.d.ts.map +1 -1
- package/dist/points/automation-templates.js +29 -1
- package/dist/points/automation-templates.js.map +1 -1
- package/dist/points/capabilities.d.ts +357 -50
- package/dist/points/capabilities.d.ts.map +1 -1
- package/dist/points/capabilities.js +22 -51
- package/dist/points/capabilities.js.map +1 -1
- package/dist/points/capability-broker.d.ts +110 -0
- package/dist/points/capability-broker.d.ts.map +1 -0
- package/dist/points/capability-broker.js +125 -0
- package/dist/points/capability-broker.js.map +1 -0
- package/dist/points/channel-facts.d.ts +46 -0
- package/dist/points/channel-facts.d.ts.map +1 -0
- package/dist/points/channel-facts.js +80 -0
- package/dist/points/channel-facts.js.map +1 -0
- package/dist/points/index.d.ts +585 -0
- package/dist/points/index.d.ts.map +1 -1
- package/dist/points/index.js +12 -0
- package/dist/points/index.js.map +1 -1
- package/dist/points/listener.d.ts +10 -0
- package/dist/points/listener.d.ts.map +1 -1
- package/dist/points/listener.js +6 -0
- package/dist/points/listener.js.map +1 -1
- package/dist/points/model-roles.d.ts +31 -0
- package/dist/points/model-roles.d.ts.map +1 -0
- package/dist/points/model-roles.js +27 -0
- package/dist/points/model-roles.js.map +1 -0
- package/dist/points/public-routes.d.ts +91 -0
- package/dist/points/public-routes.d.ts.map +1 -0
- package/dist/points/public-routes.js +140 -0
- package/dist/points/public-routes.js.map +1 -0
- package/dist/points/sleep-watch.d.ts +15 -0
- package/dist/points/sleep-watch.d.ts.map +1 -0
- package/dist/points/sleep-watch.js +30 -0
- package/dist/points/sleep-watch.js.map +1 -0
- package/dist/points/watch-kinds.d.ts +102 -0
- package/dist/points/watch-kinds.d.ts.map +1 -0
- package/dist/points/watch-kinds.js +118 -0
- package/dist/points/watch-kinds.js.map +1 -0
- package/intentic-extension.schema.json +1387 -36
- package/package.json +2 -2
- package/src/manifest.ts +130 -1
- package/src/permissions.test.ts +39 -1
- package/src/permissions.ts +84 -4
- package/src/points/automation-templates.ts +43 -5
- package/src/points/capabilities.ts +37 -80
- package/src/points/capability-broker.ts +203 -0
- package/src/points/channel-facts.test.ts +38 -0
- package/src/points/channel-facts.ts +119 -0
- package/src/points/index.ts +12 -0
- package/src/points/listener.ts +14 -0
- package/src/points/model-roles.ts +44 -0
- package/src/points/public-routes.test.ts +132 -0
- package/src/points/public-routes.ts +198 -0
- package/src/points/sleep-watch.ts +54 -0
- package/src/points/watch-kinds.test.ts +73 -0
- package/src/points/watch-kinds.ts +172 -0
- package/src/powers.test.ts +97 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/points/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/points/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,cAAc,YAAY,CAAC;AAC3B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE7B,CAAC"}
|
package/dist/points/index.js
CHANGED
|
@@ -8,28 +8,37 @@ import { documentsPoint } from "./documents.js";
|
|
|
8
8
|
import { environmentPoint } from "./environment.js";
|
|
9
9
|
import { filesPoint } from "./files.js";
|
|
10
10
|
import { listenerPoint } from "./listener.js";
|
|
11
|
+
import { modelRolesPoint } from "./model-roles.js";
|
|
11
12
|
import { processesPoint } from "./processes.js";
|
|
13
|
+
import { publicRoutesPoint } from "./public-routes.js";
|
|
12
14
|
import { settingsPoint } from "./settings.js";
|
|
13
15
|
import { sideViewsPoint } from "./side-views.js";
|
|
14
16
|
import { toolsPoint } from "./tools.js";
|
|
15
17
|
import { viewersPoint } from "./viewers.js";
|
|
16
18
|
import { viewsPoint } from "./views.js";
|
|
19
|
+
import { watchKindsPoint } from "./watch-kinds.js";
|
|
17
20
|
export * from "./agent.js";
|
|
18
21
|
export * from "./automation-templates.js";
|
|
19
22
|
export * from "./bin.js";
|
|
20
23
|
export * from "./capabilities.js";
|
|
24
|
+
export * from "./capability-broker.js";
|
|
21
25
|
export * from "./capability-field-shapes.js";
|
|
26
|
+
export * from "./channel-facts.js";
|
|
27
|
+
export * from "./sleep-watch.js";
|
|
22
28
|
export * from "./commands.js";
|
|
23
29
|
export * from "./documents.js";
|
|
24
30
|
export * from "./environment.js";
|
|
25
31
|
export * from "./files.js";
|
|
26
32
|
export * from "./listener.js";
|
|
33
|
+
export * from "./model-roles.js";
|
|
27
34
|
export * from "./processes.js";
|
|
35
|
+
export * from "./public-routes.js";
|
|
28
36
|
export * from "./settings.js";
|
|
29
37
|
export * from "./side-views.js";
|
|
30
38
|
export * from "./tools.js";
|
|
31
39
|
export * from "./viewers.js";
|
|
32
40
|
export * from "./views.js";
|
|
41
|
+
export * from "./watch-kinds.js";
|
|
33
42
|
export const CONTRIBUTION_POINTS = [
|
|
34
43
|
viewsPoint,
|
|
35
44
|
filesPoint,
|
|
@@ -44,8 +53,11 @@ export const CONTRIBUTION_POINTS = [
|
|
|
44
53
|
capabilitiesPoint,
|
|
45
54
|
listenerPoint,
|
|
46
55
|
automationTemplatesPoint,
|
|
56
|
+
watchKindsPoint,
|
|
57
|
+
modelRolesPoint,
|
|
47
58
|
binPoint,
|
|
48
59
|
toolsPoint,
|
|
60
|
+
publicRoutesPoint,
|
|
49
61
|
];
|
|
50
62
|
export const contributesSchema = z.object(Object.fromEntries(CONTRIBUTION_POINTS.map((point) => [point.name, point.schema.describe(point.description).optional()])));
|
|
51
63
|
//# sourceMappingURL=index.js.map
|
package/dist/points/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/points/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,YA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;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AAKjC,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAC/B,UAAU;IACV,UAAU;IACV,YAAY;IACZ,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,cAAc;IACd,UAAU;IACV,gBAAgB;IAChB,iBAAiB;IACjB,aAAa;IACb,wBAAwB;IACxB,eAAe;IACf,eAAe;IACf,QAAQ;IACR,UAAU;IACV,iBAAiB;CAC4B,CAAC;AAUlD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CACrC,MAAM,CAAC,WAAW,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAqB,CAChJ,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const LISTENER_STRANGERS: readonly ["visitor", "report"];
|
|
3
|
+
export type ListenerStrangers = (typeof LISTENER_STRANGERS)[number];
|
|
2
4
|
export declare const ListenerContributionSchema: z.ZodObject<{
|
|
3
5
|
provider: z.ZodString;
|
|
4
6
|
events: z.ZodArray<z.ZodObject<{
|
|
5
7
|
type: z.ZodString;
|
|
6
8
|
label: z.ZodString;
|
|
7
9
|
}, z.core.$strip>>;
|
|
10
|
+
strangers: z.ZodOptional<z.ZodEnum<{
|
|
11
|
+
report: "report";
|
|
12
|
+
visitor: "visitor";
|
|
13
|
+
}>>;
|
|
8
14
|
automation: z.ZodObject<{
|
|
9
15
|
label: z.ZodString;
|
|
10
16
|
mentionLabel: z.ZodOptional<z.ZodString>;
|
|
@@ -41,6 +47,10 @@ export declare const listenerPoint: {
|
|
|
41
47
|
type: z.ZodString;
|
|
42
48
|
label: z.ZodString;
|
|
43
49
|
}, z.core.$strip>>;
|
|
50
|
+
strangers: z.ZodOptional<z.ZodEnum<{
|
|
51
|
+
report: "report";
|
|
52
|
+
visitor: "visitor";
|
|
53
|
+
}>>;
|
|
44
54
|
automation: z.ZodObject<{
|
|
45
55
|
label: z.ZodString;
|
|
46
56
|
mentionLabel: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../src/points/listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"listener.d.ts","sourceRoot":"","sources":["../../src/points/listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,kBAAkB,YAAI,SAAS,EAAE,QAAQ,CAAU,CAAC;AACjE,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAepE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA4DsE,CAAC;AAC9G,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,aAAa;mBAChB,UAAU;0BAEZ,+WAA+W;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEjV,CAAC"}
|
package/dist/points/listener.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export const LISTENER_STRANGERS = ["visitor", "report"];
|
|
2
3
|
const TriggerFieldContributionSchema = z.object({
|
|
3
4
|
label: z.string().min(1),
|
|
4
5
|
placeholder: z.string().min(1),
|
|
@@ -19,6 +20,11 @@ export const ListenerContributionSchema = z.object({
|
|
|
19
20
|
message: "listener event types must be unique",
|
|
20
21
|
})
|
|
21
22
|
.describe("The event types this source can fire, with the wording the automation editor offers them under. The daemon accepts no others."),
|
|
23
|
+
strangers: z
|
|
24
|
+
.enum(LISTENER_STRANGERS)
|
|
25
|
+
.meta({ power: { key: "listener-strangers:${provider}", sentence: 'anyone on the internet can wake an agent through its "${provider}" listener' } })
|
|
26
|
+
.optional()
|
|
27
|
+
.describe("Set when anyone on the internet can reach this source without the owner adding them (a chat on a public page, a crash reporter), which holds its wakes to the owner's floor for strangers: `visitor`, someone talking with an assistant; `report`, a stranger's report setting work going, held for approval unless the owner says otherwise. Absent: its senders are people the owner connected, held to the floor for a team chat message."),
|
|
22
28
|
automation: z
|
|
23
29
|
.object({
|
|
24
30
|
label: z.string().min(1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listener.js","sourceRoot":"","sources":["../../src/points/listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"listener.js","sourceRoot":"","sources":["../../src/points/listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAC;AAIjE,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAA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,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAGxB,YAAY,EAAE,CAAC;aACV,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CACL,6KAA6K,CAChL;QACL,OAAO,EAAE,8BAA8B,CAAC,QAAQ,CAAC,0DAA0D,CAAC;QAG5G,WAAW,EAAE,8BAA8B,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC3D,+KAA+K,CAClL;QAGD,MAAM,EAAE,8BAA8B,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACtD,0OAA0O,CAC7O;QACD,WAAW,EAAE,8BAA8B,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAC3D,4IAA4I,CAC/I;QAED,aAAa,EAAE,CAAC;aACX,MAAM,EAAE;aACR,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,CACL,6IAA6I,CAChJ;KACR,CAAC;SACD,QAAQ,CAAC,oHAAoH,CAAC;CACtI,CAAC;KACG,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,sBAAsB,EAAE,QAAQ,EAAE,4CAA4C,EAAE,EAAE,CAAC,CAAC;AAG9G,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,IAAI,EAAE,UAAU;IAChB,WAAW,EACP,+WAA+W;IACnX,MAAM,EAAE,0BAA0B;CACA,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const MODEL_ROLE_ID: RegExp;
|
|
3
|
+
export declare const MODEL_ROLE_ID_MAX = 40;
|
|
4
|
+
export declare const ModelRoleContributionSchema: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
label: z.ZodString;
|
|
7
|
+
explanation: z.ZodString;
|
|
8
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
9
|
+
setup: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
high: "high";
|
|
11
|
+
low: "low";
|
|
12
|
+
medium: "medium";
|
|
13
|
+
}>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
export type ModelRoleContribution = z.infer<typeof ModelRoleContributionSchema>;
|
|
16
|
+
export declare const modelRolesPoint: {
|
|
17
|
+
readonly name: "modelRoles";
|
|
18
|
+
readonly description: "The jobs this extension starts agent runs for, each of which the owner puts on a model setup in Sandbox ▸ Agent ▸ Models beside the sandbox's own: a run you start through `POST /agent` names its job as `job`, and runs on that setup's model when it names none of its own (an id the sandbox's own table held until 2026-11-26 may ride as `runRole`, which a sandbox from before reads too). Switching the extension off hides its jobs on that page and keeps the owner's choices for them.";
|
|
19
|
+
readonly schema: z.ZodArray<z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
label: z.ZodString;
|
|
22
|
+
explanation: z.ZodString;
|
|
23
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
24
|
+
setup: z.ZodOptional<z.ZodEnum<{
|
|
25
|
+
high: "high";
|
|
26
|
+
low: "low";
|
|
27
|
+
medium: "medium";
|
|
28
|
+
}>>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=model-roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-roles.d.ts","sourceRoot":"","sources":["../../src/points/model-roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,aAAa,QAAqC,CAAC;AAChE,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,eAAO,MAAM,2BAA2B;;;;;;;;;;iBAqBtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,eAAe;mBAClB,YAAY;0BAEd,meAAme;;;;;;;;;;;;CAErc,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const MODEL_ROLE_ID = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
|
|
3
|
+
export const MODEL_ROLE_ID_MAX = 40;
|
|
4
|
+
export const ModelRoleContributionSchema = z.object({
|
|
5
|
+
id: z
|
|
6
|
+
.string()
|
|
7
|
+
.max(MODEL_ROLE_ID_MAX)
|
|
8
|
+
.regex(MODEL_ROLE_ID, "a model role's id is lowercase words joined by dashes")
|
|
9
|
+
.describe("The job's id: what the owner's choice of setup is stored under, and what a run this extension starts names as `job` on POST /agent. Keep it once shipped: a stored choice names it. An id the sandbox's own jobs or an earlier extension already use is not taken."),
|
|
10
|
+
label: z.string().min(1).max(40).describe("What the settings page calls the job, in the owner's words: `Pipeline fixes`."),
|
|
11
|
+
explanation: z
|
|
12
|
+
.string()
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(300)
|
|
15
|
+
.describe("One sentence under the label on what starts the job, saying more than the label does: `The agent started by Fix on a failed pipeline.`"),
|
|
16
|
+
icon: z.string().min(1).optional().describe("A name from the host's icon set for the job's chip. Absent draws a wrench."),
|
|
17
|
+
setup: z
|
|
18
|
+
.enum(["low", "medium", "high"])
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("The setup the job is suggested: where a sandbox that never placed its jobs runs it, and where the settings page puts it when the owner places it again. What the work needs, not what it costs today. Absent is `medium`."),
|
|
21
|
+
});
|
|
22
|
+
export const modelRolesPoint = {
|
|
23
|
+
name: "modelRoles",
|
|
24
|
+
description: "The jobs this extension starts agent runs for, each of which the owner puts on a model setup in Sandbox ▸ Agent ▸ Models beside the sandbox's own: a run you start through `POST /agent` names its job as `job`, and runs on that setup's model when it names none of its own (an id the sandbox's own table held until 2026-11-26 may ride as `runRole`, which a sandbox from before reads too). Switching the extension off hides its jobs on that page and keeps the owner's choices for them.",
|
|
25
|
+
schema: z.array(ModelRoleContributionSchema),
|
|
26
|
+
};
|
|
27
|
+
//# sour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+
import { z } from "zod";
|
|
2
|
+
export declare const PUBLIC_ROUTE_BODY_MAX: number;
|
|
3
|
+
export declare const PUBLIC_ROUTE_BODY_DEFAULT: number;
|
|
4
|
+
export declare const PUBLIC_ROUTE_RATE_DEFAULT = 30;
|
|
5
|
+
export declare const PUBLIC_ROUTE_RATE_MAX = 600;
|
|
6
|
+
export declare const PUBLIC_ROUTE_DAILY_DEFAULT = 1000;
|
|
7
|
+
export declare const PUBLIC_ROUTE_DAILY_MAX = 100000;
|
|
8
|
+
export declare const PUBLIC_ROUTE_NO_DAILY_MAX = "none";
|
|
9
|
+
export declare const PUBLIC_ROUTE_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
10
|
+
export type PublicRouteMethod = (typeof PUBLIC_ROUTE_METHODS)[number];
|
|
11
|
+
export declare const PUBLIC_ROUTE_SIGNATURE_SCHEMES: readonly ["github", "linear", "sentry", "stripe", "standard-webhooks"];
|
|
12
|
+
export declare const PUBLIC_ROUTE_TURNSTILE_HEADER = "x-intentic-turnstile";
|
|
13
|
+
export declare const publicRoutePathProblem: (path: string) => string | undefined;
|
|
14
|
+
export declare const PublicRouteContributionSchema: z.ZodObject<{
|
|
15
|
+
path: z.ZodString;
|
|
16
|
+
methods: z.ZodArray<z.ZodEnum<{
|
|
17
|
+
DELETE: "DELETE";
|
|
18
|
+
GET: "GET";
|
|
19
|
+
PATCH: "PATCH";
|
|
20
|
+
POST: "POST";
|
|
21
|
+
PUT: "PUT";
|
|
22
|
+
}>>;
|
|
23
|
+
automation: z.ZodOptional<z.ZodLiteral<true>>;
|
|
24
|
+
origins: z.ZodOptional<z.ZodEnum<{
|
|
25
|
+
any: "any";
|
|
26
|
+
listed: "listed";
|
|
27
|
+
}>>;
|
|
28
|
+
key: z.ZodOptional<z.ZodLiteral<true>>;
|
|
29
|
+
keyFromBrowsers: z.ZodOptional<z.ZodLiteral<true>>;
|
|
30
|
+
signature: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
scheme: z.ZodEnum<{
|
|
32
|
+
github: "github";
|
|
33
|
+
linear: "linear";
|
|
34
|
+
sentry: "sentry";
|
|
35
|
+
"standard-webhooks": "standard-webhooks";
|
|
36
|
+
stripe: "stripe";
|
|
37
|
+
}>;
|
|
38
|
+
secret: z.ZodString;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
turnstile: z.ZodOptional<z.ZodObject<{
|
|
41
|
+
secret: z.ZodString;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
proofOfWork: z.ZodOptional<z.ZodLiteral<true>>;
|
|
44
|
+
rate: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
dailyMax: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>>;
|
|
46
|
+
bodyMax: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
wakes: z.ZodOptional<z.ZodLiteral<true>>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export type PublicRouteContribution = z.infer<typeof PublicRouteContributionSchema>;
|
|
50
|
+
export declare const publicRouteFor: <Route extends Pick<PublicRouteContribution, "path" | "methods">>(routes: readonly Route[], method: string, segments: readonly string[]) => Route | undefined;
|
|
51
|
+
export declare const publicRouteAutomationOf: (route: Pick<PublicRouteContribution, "path" | "automation">, segments: readonly string[]) => string | undefined;
|
|
52
|
+
export declare const publicRoutesPoint: {
|
|
53
|
+
readonly name: "publicRoutes";
|
|
54
|
+
readonly description: "Routes anyone on the internet may call without signing in, served at /door/<id>/<path> and handed to your backend's `api.publicRoutes.serve` handler only after the sandbox's own protections passed the call: its size, a per-minute window and a daily ceiling, an automation's allowed origins or its door key, a proof-of-work challenge, a Cloudflare Turnstile token, a provider's signature, the last two checked against secrets you never see. Each is a power the owner approves.";
|
|
55
|
+
readonly schema: z.ZodArray<z.ZodObject<{
|
|
56
|
+
path: z.ZodString;
|
|
57
|
+
methods: z.ZodArray<z.ZodEnum<{
|
|
58
|
+
DELETE: "DELETE";
|
|
59
|
+
GET: "GET";
|
|
60
|
+
PATCH: "PATCH";
|
|
61
|
+
POST: "POST";
|
|
62
|
+
PUT: "PUT";
|
|
63
|
+
}>>;
|
|
64
|
+
automation: z.ZodOptional<z.ZodLiteral<true>>;
|
|
65
|
+
origins: z.ZodOptional<z.ZodEnum<{
|
|
66
|
+
any: "any";
|
|
67
|
+
listed: "listed";
|
|
68
|
+
}>>;
|
|
69
|
+
key: z.ZodOptional<z.ZodLiteral<true>>;
|
|
70
|
+
keyFromBrowsers: z.ZodOptional<z.ZodLiteral<true>>;
|
|
71
|
+
signature: z.ZodOptional<z.ZodObject<{
|
|
72
|
+
scheme: z.ZodEnum<{
|
|
73
|
+
github: "github";
|
|
74
|
+
linear: "linear";
|
|
75
|
+
sentry: "sentry";
|
|
76
|
+
"standard-webhooks": "standard-webhooks";
|
|
77
|
+
stripe: "stripe";
|
|
78
|
+
}>;
|
|
79
|
+
secret: z.ZodString;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
turnstile: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
secret: z.ZodString;
|
|
83
|
+
}, z.core.$strip>>;
|
|
84
|
+
proofOfWork: z.ZodOptional<z.ZodLiteral<true>>;
|
|
85
|
+
rate: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
dailyMax: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"none">]>>;
|
|
87
|
+
bodyMax: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
wakes: z.ZodOptional<z.ZodLiteral<true>>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=public-routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-routes.d.ts","sourceRoot":"","sources":["../../src/points/public-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,eAAO,MAAM,qBAAqB,QAAc,CAAC;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AAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const PUBLIC_ROUTE_BODY_MAX = 1024 * 1024;
|
|
3
|
+
export const PUBLIC_ROUTE_BODY_DEFAULT = 64 * 1024;
|
|
4
|
+
export const PUBLIC_ROUTE_RATE_DEFAULT = 30;
|
|
5
|
+
export const PUBLIC_ROUTE_RATE_MAX = 600;
|
|
6
|
+
export const PUBLIC_ROUTE_DAILY_DEFAULT = 1_000;
|
|
7
|
+
export const PUBLIC_ROUTE_DAILY_MAX = 100_000;
|
|
8
|
+
export const PUBLIC_ROUTE_NO_DAILY_MAX = "none";
|
|
9
|
+
export const PUBLIC_ROUTE_METHODS = ["GET", "POST", "PUT", "PATCH", "DELETE"];
|
|
10
|
+
export const PUBLIC_ROUTE_SIGNATURE_SCHEMES = ["github", "linear", "sentry", "stripe", "standard-webhooks"];
|
|
11
|
+
export const PUBLIC_ROUTE_TURNSTILE_HEADER = "x-intentic-turnstile";
|
|
12
|
+
const SEGMENT = /^(?:\*|[a-z0-9][a-z0-9._-]{0,63})$/u;
|
|
13
|
+
const SEGMENTS_MAX = 8;
|
|
14
|
+
export const publicRoutePathProblem = (path) => {
|
|
15
|
+
const segments = path.split("/");
|
|
16
|
+
if (path === "" || segments.length > SEGMENTS_MAX) {
|
|
17
|
+
return `a public route's path is 1 to ${SEGMENTS_MAX} segments joined by "/", with no leading slash`;
|
|
18
|
+
}
|
|
19
|
+
const bad = segments.find((segment) => !SEGMENT.test(segment));
|
|
20
|
+
return bad === undefined ? undefined : `"${bad}" is not a segment: a lowercase word (letters, digits, ".", "_", "-"), or a lone "*" for any one segment`;
|
|
21
|
+
};
|
|
22
|
+
export const PublicRouteContributionSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
path: z
|
|
25
|
+
.string()
|
|
26
|
+
.superRefine((path, ctx) => {
|
|
27
|
+
const problem = publicRoutePathProblem(path);
|
|
28
|
+
if (problem !== undefined) {
|
|
29
|
+
ctx.addIssue({ code: "custom", message: problem });
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
.describe('Where it answers, under /door/<id>/: segments joined by "/", each a lowercase word or a lone `*` for any one segment, e.g. "hook", "*/report".'),
|
|
33
|
+
methods: z.array(z.enum(PUBLIC_ROUTE_METHODS)).min(1).describe("The methods it answers; anything else is refused before your backend hears of it."),
|
|
34
|
+
automation: z
|
|
35
|
+
.literal(true)
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("The path's first `*` names an automation listening on this extension's own listener provider: one that is not there answers 404 and one switched off 409, its `allowedOrigins` are the list `origins` checks, its door key is what `key` admits, and the day's ceiling is counted per automation."),
|
|
38
|
+
origins: z
|
|
39
|
+
.enum(["listed", "any"])
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("`listed`: a browser's Origin must be on the automation's allowed origins, or the call is refused (403); needs `automation`. `any` or absent: no Origin is checked, as for a provider's webhook."),
|
|
42
|
+
key: z
|
|
43
|
+
.literal(true)
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("A caller with no Origin to check (an app, a server) may present the automation's door key instead, as `?key=` or `Authorization: Bearer`; needs `automation` and `origins: \"listed\"`. The key itself never reaches your backend."),
|
|
46
|
+
keyFromBrowsers: z
|
|
47
|
+
.literal(true)
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("(2026-11-26) An automation that opts in (its trigger's `keyFromBrowsers`) lets its door key admit a browser whose Origin is not on its list too; needs `key`. The owner opts each automation in, off by default, since a key in a public page is anyone's to copy: the minute's window and the day's ceiling are then what bound it."),
|
|
50
|
+
signature: z
|
|
51
|
+
.object({
|
|
52
|
+
scheme: z.enum(PUBLIC_ROUTE_SIGNATURE_SCHEMES).describe("Which provider's signing scheme the sender uses."),
|
|
53
|
+
secret: z
|
|
54
|
+
.string()
|
|
55
|
+
.regex(/^[A-Za-z_][A-Za-z0-9_]{0,127}$/)
|
|
56
|
+
.describe("The name of the sandbox secret holding the signing secret, which the owner sets; its value never reaches your backend."),
|
|
57
|
+
})
|
|
58
|
+
.optional()
|
|
59
|
+
.describe("Refuse anything not signed by the sender with the named secret (and, for a timestamped scheme, sent within five minutes); a redelivery of a call already taken is answered without reaching your backend."),
|
|
60
|
+
turnstile: z
|
|
61
|
+
.object({
|
|
62
|
+
secret: z
|
|
63
|
+
.string()
|
|
64
|
+
.regex(/^[A-Za-z_][A-Za-z0-9_]{0,127}$/)
|
|
65
|
+
.describe("The name of the sandbox secret holding the Cloudflare Turnstile secret key, which the owner sets; its value never reaches your backend."),
|
|
66
|
+
})
|
|
67
|
+
.optional()
|
|
68
|
+
.describe(`Refuse a call without a Cloudflare Turnstile token the sandbox verifies with Cloudflare under the named secret: the page renders the widget with its site key (public, yours to serve) and sends the token it gets as \`${PUBLIC_ROUTE_TURNSTILE_HEADER}\`. A token is good once.`),
|
|
69
|
+
proofOfWork: z
|
|
70
|
+
.literal(true)
|
|
71
|
+
.optional()
|
|
72
|
+
.describe("Refuse a call without a solved challenge: the caller fetches one at GET /door/<id>/~challenge?caller=<its id> and sends `x-intentic-pow: <salt>:<nonce>` and `x-intentic-pow-caller: <its id>`."),
|
|
73
|
+
rate: z
|
|
74
|
+
.number()
|
|
75
|
+
.int()
|
|
76
|
+
.min(1)
|
|
77
|
+
.max(PUBLIC_ROUTE_RATE_MAX)
|
|
78
|
+
.optional()
|
|
79
|
+
.describe(`Calls a minute one caller (by address) may make before 429; ${PUBLIC_ROUTE_RATE_DEFAULT} when absent.`),
|
|
80
|
+
dailyMax: z
|
|
81
|
+
.union([z.number().int().min(1).max(PUBLIC_ROUTE_DAILY_MAX), z.literal(PUBLIC_ROUTE_NO_DAILY_MAX)])
|
|
82
|
+
.optional()
|
|
83
|
+
.describe(`Calls a day it takes in all (per automation, for an automation's route) before 429; ${PUBLIC_ROUTE_DAILY_DEFAULT} when absent. \`"none"\` (2026-11-26) counts no day at all, for a route that only serves what a page loads (a script, its settings), so a busy site's page views cannot shut it; only a GET-only route may say it, and its minute's window and size still hold.`),
|
|
84
|
+
bodyMax: z
|
|
85
|
+
.number()
|
|
86
|
+
.int()
|
|
87
|
+
.min(0)
|
|
88
|
+
.max(PUBLIC_ROUTE_BODY_MAX)
|
|
89
|
+
.optional()
|
|
90
|
+
.describe(`The largest body it takes, in bytes; ${PUBLIC_ROUTE_BODY_DEFAULT} when absent, at most ${PUBLIC_ROUTE_BODY_MAX}.`),
|
|
91
|
+
wakes: z
|
|
92
|
+
.literal(true)
|
|
93
|
+
.meta({ power: { key: "wakes:${path}", sentence: "a call to /${path} wakes the sandbox while it sleeps, which spends its awake hours" } })
|
|
94
|
+
.optional()
|
|
95
|
+
.describe("(2026-11-27) A call here may wake a sandbox the platform hosts while it sleeps, when it reaches the route at the URL `api.sleep.wakeUrl(path, { automationId })` hands out (a wake secret rides in its query) and an automation on this extension's listener provider is switched on (the one the path names, for an automation's route). The sender is answered 503 with `Retry-After` while the machine boots, so it must retry; one that never retries loses what it sent. Its only `*` is the automation's."),
|
|
96
|
+
})
|
|
97
|
+
.superRefine((route, ctx) => {
|
|
98
|
+
if (route.origins === "listed" && route.automation !== true) {
|
|
99
|
+
ctx.addIssue({ code: "custom", path: ["origins"], message: "`origins: \"listed\"` checks an automation's allowed origins, so it needs `automation: true`" });
|
|
100
|
+
}
|
|
101
|
+
if (route.key === true && route.origins !== "listed") {
|
|
102
|
+
ctx.addIssue({ code: "custom", path: ["key"], message: "`key` admits a caller in place of a listed Origin, so it needs `origins: \"listed\"`" });
|
|
103
|
+
}
|
|
104
|
+
if (route.keyFromBrowsers === true && route.key !== true) {
|
|
105
|
+
ctx.addIssue({ code: "custom", path: ["keyFromBrowsers"], message: "`keyFromBrowsers` lets the key stand in for an unlisted browser, so it needs `key: true`" });
|
|
106
|
+
}
|
|
107
|
+
if (route.dailyMax === PUBLIC_ROUTE_NO_DAILY_MAX && route.methods.some((method) => method !== "GET")) {
|
|
108
|
+
ctx.addIssue({ code: "custom", path: ["dailyMax"], message: '`dailyMax: "none"` is for a route that only serves what a page loads, so its methods must be GET alone' });
|
|
109
|
+
}
|
|
110
|
+
if (route.automation === true && !route.path.split("/").includes("*")) {
|
|
111
|
+
ctx.addIssue({ code: "custom", path: ["automation"], message: "`automation` reads the automation's id from the path's first `*`, which this path has none of" });
|
|
112
|
+
}
|
|
113
|
+
if (route.wakes === true && route.path.split("/").filter((segment) => segment === "*").length > (route.automation === true ? 1 : 0)) {
|
|
114
|
+
ctx.addIssue({ code: "custom", path: ["wakes"], message: "a route that wakes the sandbox names one path: its only `*` is an automation's, with `automation: true`" });
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
.meta({
|
|
118
|
+
power: {
|
|
119
|
+
key: "public:${path}",
|
|
120
|
+
sentence: "anyone on the internet can call its backend at ${methods|, } /${path}${signature? when signed with your secret ${signature.secret}:}",
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
export const publicRouteFor = (routes, method, segments) => routes.find((route) => {
|
|
124
|
+
const declared = route.path.split("/");
|
|
125
|
+
return (route.methods.some((each) => each === method.toUpperCase()) &&
|
|
126
|
+
declared.length === segments.length &&
|
|
127
|
+
declared.every((glob, index) => {
|
|
128
|
+
const segment = segments[index] ?? "";
|
|
129
|
+
return glob === "*" ? segment !== "" && segment !== "." && segment !== ".." && !segment.includes("\\") : glob === segment;
|
|
130
|
+
}));
|
|
131
|
+
});
|
|
132
|
+
export const publicRouteAutomationOf = (route, segments) => route.automation === true ? segments[route.path.split("/").indexOf("*")] : undefined;
|
|
133
|
+
export const publicRoutesPoint = {
|
|
134
|
+
name: "publicRoutes",
|
|
135
|
+
description: "Routes anyone on the internet may call without signing in, served at /door/<id>/<path> and handed to your backend's `api.publicRoutes.serve` handler only after the sandbox's own protections passed the call: its size, a per-minute window and a daily ceiling, an automation's allowed origins or its door key, a proof-of-work challenge, a Cloudflare Turnstile token, a provider's signature, the last two checked against secrets you never see. Each is a power the owner approves.",
|
|
136
|
+
schema: z
|
|
137
|
+
.array(PublicRouteContributionSchema)
|
|
138
|
+
.refine((routes) => new Set(routes.map((route) => route.path)).size === routes.length, { message: "public route paths must be unique" }),
|
|
139
|
+
};
|
|
140
|
+
//# sourceMappingURL=public-routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-routes.js","sourceRoot":"","sources":["../../src/points/public-routes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAAC;AACjD,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,GAAG,IAAI,CAAC;AACnD,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAC5C,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,MAAM,CAAC,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAChD,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAE9C,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAEhD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAKvF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,mBAAmB,CAAU,CAAC;AAIrH,MAAM,CAAC,MAAM,6BAA6B,GAAG,sBAAsB,CAAC;AAIpE,MAAM,OAAO,GAAG,qCAAqC,CAAC;AACtD,MAAM,YAAY,GAAG,CAAC,CAAC;AAGvB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,IAAY,EAAsB,EAAE;IACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,IAAI,KAAK,EAAE,IAAI,QAAQ,CAAC,MAAM,GAAG,YAAY,EAAE,CAAC;QAChD,OAAO,iCAAiC,YAAY,gDAAg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AAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { CapabilityField } from "./capabilities.js";
|
|
3
|
+
export declare const SLEEP_WATCH_SERVICES: readonly ["discord"];
|
|
4
|
+
export type SleepWatchService = (typeof SLEEP_WATCH_SERVICES)[number];
|
|
5
|
+
export declare const SleepWatchSchema: z.ZodObject<{
|
|
6
|
+
service: z.ZodEnum<{
|
|
7
|
+
discord: "discord";
|
|
8
|
+
}>;
|
|
9
|
+
credential: z.ZodString;
|
|
10
|
+
consent: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type SleepWatch = z.infer<typeof SleepWatchSchema>;
|
|
13
|
+
export declare const sleepWatchProblems: (watch: SleepWatch, fields: readonly CapabilityField[]) => string[];
|
|
14
|
+
export declare const sleepWatchConsented: (watch: SleepWatch, config: Readonly<Record<string, string | number | boolean | undefined>>) => boolean;
|
|
15
|
+
//# sourceMappingURL=sleep-watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep-watch.d.ts","sourceRoot":"","sources":["../../src/points/sleep-watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAWzD,eAAO,MAAM,oBAAoB,YAAI,SAAS,CAAU,CAAC;AACzD,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,eAAO,MAAM,gBAAgB;;;;;;iBAcxB,CAAC;AACN,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAI1D,eAAO,MAAM,kBAAkB,UAAW,UAAU,UAAU,SAAS,eAAe,EAAE,KAAG,MAAM,EAahG,CAAC;AAGF,eAAO,MAAM,mBAAmB,UAAW,UAAU,UAAU,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC,KAAG,OAGhI,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const SLEEP_WATCH_SERVICES = ["discord"];
|
|
3
|
+
export const SleepWatchSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
service: z
|
|
6
|
+
.enum(SLEEP_WATCH_SERVICES)
|
|
7
|
+
.describe("The connection Intentic's servers hold for it while the sandbox sleeps: `discord`, the bot's gateway connection, the only one they speak."),
|
|
8
|
+
credential: z.string().describe("The secret field holding the credential they hold (a bot token)."),
|
|
9
|
+
consent: z
|
|
10
|
+
.string()
|
|
11
|
+
.describe("The switch (`boolean: true`, `hosted: true`, off by default) that is the owner's yes for one connection. Off, or on a sandbox on the owner's own computer, nothing leaves the sandbox. Its label or hint must say exactly what happens."),
|
|
12
|
+
})
|
|
13
|
+
.describe("Lets Intentic's servers hold this card's credential while a hosted sandbox sleeps, to notice what the service delivers only over a live connection and wake the sandbox for it: only for a connection whose owner turned the `consent` switch on, only while an automation listens on this card's provider, and only until the sandbox wakes, when it is deleted. The one exception to credentials staying in the sandbox.");
|
|
14
|
+
export const sleepWatchProblems = (watch, fields) => {
|
|
15
|
+
const declared = new Map(fields.map((field) => [field.key, field]));
|
|
16
|
+
const problems = [];
|
|
17
|
+
if (declared.get(watch.credential)?.secret !== true) {
|
|
18
|
+
problems.push(`sleepWatch.credential "${watch.credential}" must name a secret field`);
|
|
19
|
+
}
|
|
20
|
+
const consent = declared.get(watch.consent);
|
|
21
|
+
if (consent?.boolean !== true || consent.hosted !== true || (consent.default ?? "off") !== "off") {
|
|
22
|
+
problems.push(`sleepWatch.consent "${watch.consent}" must name a switch (\`boolean: true\`) drawn only on hosted sandboxes (\`hosted: true\`) and off by default`);
|
|
23
|
+
}
|
|
24
|
+
return problems;
|
|
25
|
+
};
|
|
26
|
+
export const sleepWatchConsented = (watch, config) => {
|
|
27
|
+
const answer = config[watch.consent];
|
|
28
|
+
return answer === "on" || answer === true;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=sleep-watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep-watch.js","sourceRoot":"","sources":["../../src/points/sleep-watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,SAAS,CAAU,CAAC;AAGzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC5B,MAAM,CAAC;IACJ,OAAO,EAAE,CAAC;SACL,IAAI,CAAC,oBAAoB,CAAC;SAC1B,QAAQ,CAAC,2IAA2I,CAAC;IAC1J,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kEAAkE,CAAC;IACnG,OAAO,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,CACL,yOAAyO,CAC5O;CACR,CAAC;KACD,QAAQ,CACL,4ZAA4Z,CAC/Z,CAAC;AAKN,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAiB,EAAE,MAAkC,EAAY,EAAE;IAClG,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACpE,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,IAAI,EAAE,CAAC;QAClD,QAAQ,CAAC,IAAI,CAAC,0BAA0B,KAAK,CAAC,UAAU,4BAA4B,CAAC,CAAC;IAC1F,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,OAAO,EAAE,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,KAAK,KAAK,EAAE,CAAC;QAC/F,QAAQ,CAAC,IAAI,CACT,uBAAuB,KAAK,CAAC,OAAO,+GAA+G,CACtJ,CAAC;IACN,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAC;AAGF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAiB,EAAE,MAAuE,EAAW,EAAE;IACvI,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACrC,OAAO,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,IAAI,CAAC;AAC9C,CAAC,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const WATCH_KIND_ID: RegExp;
|
|
3
|
+
export declare const WATCH_PARAM_KEY: RegExp;
|
|
4
|
+
export type WatchParamValue = string | boolean;
|
|
5
|
+
export type WatchParams = Readonly<Record<string, WatchParamValue | undefined>>;
|
|
6
|
+
export declare const WatchKindFieldSchema: z.ZodObject<{
|
|
7
|
+
key: z.ZodString;
|
|
8
|
+
label: z.ZodString;
|
|
9
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
switch: "switch";
|
|
11
|
+
text: "text";
|
|
12
|
+
}>>;
|
|
13
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
15
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
16
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
17
|
+
patternHint: z.ZodOptional<z.ZodString>;
|
|
18
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type WatchKindField = z.infer<typeof WatchKindFieldSchema>;
|
|
21
|
+
export declare const sentenceKeys: (sentence: string) => string[];
|
|
22
|
+
export declare const WatchKindDeclarationSchema: z.ZodObject<{
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
label: z.ZodString;
|
|
25
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
26
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
27
|
+
description: z.ZodString;
|
|
28
|
+
sentence: z.ZodString;
|
|
29
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
30
|
+
key: z.ZodString;
|
|
31
|
+
label: z.ZodString;
|
|
32
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
switch: "switch";
|
|
34
|
+
text: "text";
|
|
35
|
+
}>>;
|
|
36
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
38
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
39
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
40
|
+
patternHint: z.ZodOptional<z.ZodString>;
|
|
41
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const WatchKindContributionSchema: z.ZodObject<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
label: z.ZodString;
|
|
48
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
49
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
50
|
+
description: z.ZodString;
|
|
51
|
+
sentence: z.ZodString;
|
|
52
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
53
|
+
key: z.ZodString;
|
|
54
|
+
label: z.ZodString;
|
|
55
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
56
|
+
switch: "switch";
|
|
57
|
+
text: "text";
|
|
58
|
+
}>>;
|
|
59
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
61
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
62
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
63
|
+
patternHint: z.ZodOptional<z.ZodString>;
|
|
64
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export type WatchKindContribution = z.infer<typeof WatchKindContributionSchema>;
|
|
69
|
+
export type DeclaredWatchKind = Pick<WatchKindContribution, "id" | "sentence" | "fields">;
|
|
70
|
+
export declare const watchSentence: (kind: DeclaredWatchKind | undefined, params: WatchParams & {
|
|
71
|
+
readonly kind: string;
|
|
72
|
+
}) => string;
|
|
73
|
+
export declare const watchParamsSchema: (kind: DeclaredWatchKind) => z.ZodType<Readonly<Record<string, WatchParamValue | undefined>>>;
|
|
74
|
+
export declare const watchParamsProblem: (kind: DeclaredWatchKind, params: WatchParams) => string | undefined;
|
|
75
|
+
export declare const watchKindsPoint: {
|
|
76
|
+
readonly name: "watchKinds";
|
|
77
|
+
readonly description: "Ready-made checks an automation can name instead of a guard command: a package's version, a service's newest release. Your backend answers each check (`api.checks.serve(id, handler)`), and the sandbox runs it on the automation's schedule with no shell and no model, firing only when it passes or when what it saw changed. The composer, the `automations` command and the approval card draw each kind from this declaration. Needs a `server` bundle.";
|
|
78
|
+
readonly schema: z.ZodArray<z.ZodObject<{
|
|
79
|
+
id: z.ZodString;
|
|
80
|
+
label: z.ZodString;
|
|
81
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
82
|
+
logo: z.ZodOptional<z.ZodString>;
|
|
83
|
+
description: z.ZodString;
|
|
84
|
+
sentence: z.ZodString;
|
|
85
|
+
fields: z.ZodArray<z.ZodObject<{
|
|
86
|
+
key: z.ZodString;
|
|
87
|
+
label: z.ZodString;
|
|
88
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
89
|
+
switch: "switch";
|
|
90
|
+
text: "text";
|
|
91
|
+
}>>;
|
|
92
|
+
required: z.ZodOptional<z.ZodBoolean>;
|
|
93
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
94
|
+
hint: z.ZodOptional<z.ZodString>;
|
|
95
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
96
|
+
patternHint: z.ZodOptional<z.ZodString>;
|
|
97
|
+
maxLength: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
}, z.core.$strip>>;
|
|
99
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
100
|
+
}, z.core.$strip>>;
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=watch-kinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-kinds.d.ts","sourceRoot":"","sources":["../../src/points/watch-kinds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,aAAa,QAAoC,CAAC;AAE/D,eAAO,MAAM,eAAe,QAAuC,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAC;AAC/C,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC,CAAC,CAAC;AAehF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;iBAsB/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAOlE,eAAO,MAAM,YAAY,aAAc,MAAM,KAAG,MAAM,EAAwE,CAAC;AAI/H,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;iBAuBrC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;iBAiB2F,CAAC;AACpI,MAAM,MAAM,qBAAq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