@studio-foundation/contracts 0.13.0 → 0.14.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
@@ -67,7 +67,7 @@ Nothing imports upward. If you find yourself adding a dep here, you're solving t
67
67
  | `tool-plugin.ts` | `ToolPluginDef`, `ToolCommandDef`, `ShellExecute`, `BuiltinExecute`, `ParameterDef` |
68
68
  | `runner-events.ts` | `RunnerCallbacks`, `ToolCallStartEvent`, `ToolCallCompleteEvent`, `AgentThinkingEvent`, `AgentProgressEvent`, `AgentTokenEvent` |
69
69
  | `spawner.ts` | `RunSpawner`, `SpawnConfig`, `SpawnResult` |
70
- | `integration-plugin.ts` | `IntegrationPluginDef` |
70
+ | `trigger.ts` | `TriggerDef` |
71
71
 
72
72
  ## Key types
73
73
 
package/dist/index.d.ts CHANGED
@@ -10,5 +10,5 @@ export * from './context-pack.js';
10
10
  export * from './tool-plugin.js';
11
11
  export * from './runner-events.js';
12
12
  export * from './spawner.js';
13
- export * from './integration-plugin.js';
13
+ export * from './trigger.js';
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -12,5 +12,5 @@ export * from './context-pack.js';
12
12
  export * from './tool-plugin.js';
13
13
  export * from './runner-events.js';
14
14
  export * from './spawner.js';
15
- export * from './integration-plugin.js';
15
+ export * from './trigger.js';
16
16
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,oDAAoD;AAEpD,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,oDAAoD;AAEpD,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AAEjC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,38 @@
1
+ export interface TriggerDef {
2
+ name: string;
3
+ version: number;
4
+ description?: string;
5
+ /** Pipeline to launch when the webhook matches. */
6
+ pipeline: string;
7
+ /** Omitted entirely, every signed-or-not delivery matches — same as an empty block. */
8
+ webhook?: {
9
+ hmac?: {
10
+ /** Request header carrying the hex signature, e.g. 'x-hub-signature-256'. */
11
+ header: string;
12
+ /** Shared secret; `${VAR}` is resolved from the environment at load. */
13
+ secret: string;
14
+ };
15
+ /** Conditions over `payload.<path>`, same syntax as a stage `when:`. All must hold. */
16
+ when?: string[];
17
+ };
18
+ /** Pipeline input, with `{{payload.<path>}}` references. */
19
+ input?: Record<string, unknown>;
20
+ /** Run metadata, with `{{payload.<path>}}` references. */
21
+ meta?: Record<string, unknown>;
22
+ /** What to show in the trigger log, with `{{payload.<path>}}` references. */
23
+ log?: {
24
+ external_id?: string;
25
+ external_label?: string;
26
+ external_url?: string;
27
+ };
28
+ /**
29
+ * Command run when a triggered run does not succeed. Values reach it through
30
+ * the environment (`STUDIO_RUN_ID`, `STUDIO_META`, …), never interpolated into
31
+ * the command string — the payload that produced them is untrusted.
32
+ */
33
+ on_failure?: {
34
+ command: string;
35
+ timeout_ms?: number;
36
+ };
37
+ }
38
+ //# sourceMappingURL=trigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../src/trigger.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,uFAAuF;IACvF,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE;YACL,6EAA6E;YAC7E,MAAM,EAAE,MAAM,CAAC;YACf,wEAAwE;YACxE,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC;QACF,uFAAuF;QACvF,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IACF,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,6EAA6E;IAC7E,GAAG,CAAC,EAAE;QACJ,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF;;;;OAIG;IACH,UAAU,CAAC,EAAE;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;CACH"}
@@ -0,0 +1,6 @@
1
+ // A `.trigger.yaml` — an inbound webhook that launches a pipeline run.
2
+ //
3
+ // Triggers cover the one thing tools and MCP servers cannot: an external system
4
+ // pushing to Studio. Everything a trigger does *outbound* belongs in a tool.
5
+ export {};
6
+ //# sourceMappingURL=trigger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trigger.js","sourceRoot":"","sources":["../src/trigger.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,gFAAgF;AAChF,6EAA6E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studio-foundation/contracts",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Shared TypeScript types and interfaces for Studio packages",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,35 +0,0 @@
1
- export interface IntegrationPluginDef {
2
- name: string;
3
- version: number;
4
- description?: string;
5
- config?: {
6
- required?: string[];
7
- optional?: Record<string, unknown>;
8
- };
9
- events?: {
10
- consumes?: string[];
11
- emits?: string[];
12
- };
13
- test?: {
14
- type: 'http';
15
- endpoint: string;
16
- method?: 'GET' | 'POST';
17
- /** e.g. "bearer:${LINEAR_API_KEY}" — resolved before use */
18
- auth?: string;
19
- body?: string;
20
- expect?: {
21
- status?: number;
22
- };
23
- };
24
- webhook?: {
25
- hmac?: {
26
- header: string;
27
- secret_env: string;
28
- };
29
- handler: string;
30
- };
31
- on_failure?: {
32
- handler: string;
33
- };
34
- }
35
- //# sourceMappingURL=integration-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-plugin.d.ts","sourceRoot":"","sources":["../src/integration-plugin.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,CAAC;IACF,MAAM,CAAC,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;IACF,IAAI,CAAC,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QACxB,4DAA4D;QAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE;YAAE,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9B,CAAC;IACF,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE;YACL,MAAM,EAAE,MAAM,CAAC;YACf,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;QACF,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,CAAC,EAAE;QACX,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH"}
@@ -1,3 +0,0 @@
1
- // contracts/src/integration-plugin.ts
2
- export {};
3
- //# sourceMappingURL=integration-plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integration-plugin.js","sourceRoot":"","sources":["../src/integration-plugin.ts"],"names":[],"mappings":"AAAA,sCAAsC"}