@relayfile/relay-helpers 0.4.4 → 0.4.6

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.
Files changed (46) hide show
  1. package/README.md +36 -0
  2. package/dist/generated/clients.d.ts +33 -33
  3. package/dist/generated/clients.d.ts.map +1 -1
  4. package/dist/generated/clients.js.map +1 -1
  5. package/dist/generic.d.ts +4 -3
  6. package/dist/generic.d.ts.map +1 -1
  7. package/dist/generic.js +30 -0
  8. package/dist/generic.js.map +1 -1
  9. package/dist/github.d.ts +2 -2
  10. package/dist/github.d.ts.map +1 -1
  11. package/dist/github.js +18 -2
  12. package/dist/github.js.map +1 -1
  13. package/dist/index.d.ts +2 -0
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +1 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/linear.d.ts +2 -2
  18. package/dist/linear.d.ts.map +1 -1
  19. package/dist/linear.js +24 -4
  20. package/dist/linear.js.map +1 -1
  21. package/dist/preview-transport.test.d.ts +2 -0
  22. package/dist/preview-transport.test.d.ts.map +1 -0
  23. package/dist/preview-transport.test.js +182 -0
  24. package/dist/preview-transport.test.js.map +1 -0
  25. package/dist/provider-client.d.ts +3 -2
  26. package/dist/provider-client.d.ts.map +1 -1
  27. package/dist/provider-client.js.map +1 -1
  28. package/dist/reddit.d.ts +2 -2
  29. package/dist/reddit.d.ts.map +1 -1
  30. package/dist/reddit.js.map +1 -1
  31. package/dist/slack.d.ts +2 -2
  32. package/dist/slack.d.ts.map +1 -1
  33. package/dist/slack.js +4 -1
  34. package/dist/slack.js.map +1 -1
  35. package/dist/telegram.d.ts +3 -2
  36. package/dist/telegram.d.ts.map +1 -1
  37. package/dist/telegram.js.map +1 -1
  38. package/dist/transport.d.ts +86 -0
  39. package/dist/transport.d.ts.map +1 -0
  40. package/dist/transport.js +192 -0
  41. package/dist/transport.js.map +1 -0
  42. package/dist/types.d.ts +51 -0
  43. package/dist/types.d.ts.map +1 -0
  44. package/dist/types.js +4 -0
  45. package/dist/types.js.map +1 -0
  46. package/package.json +14 -4
@@ -0,0 +1,192 @@
1
+ function isRecord(value) {
2
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
3
+ }
4
+ function stablePart(value) {
5
+ const normalized = value.toLowerCase().replace(/[^a-z0-9]+/gu, '-').replace(/^-|-$/gu, '');
6
+ return normalized || 'action';
7
+ }
8
+ function defaultId(request, sequence) {
9
+ return `preview-${stablePart(request.provider)}-${stablePart(request.resource)}-${String(sequence).padStart(4, '0')}`;
10
+ }
11
+ function defaultTimestamp(sequence) {
12
+ return new Date(Date.UTC(2000, 0, 1) + sequence - 1).toISOString();
13
+ }
14
+ function collectionRecordPath(path, id) {
15
+ return path.endsWith('.json') ? path : `${path.replace(/\/+$/u, '')}/${encodeURIComponent(id)}.json`;
16
+ }
17
+ /**
18
+ * Side-effect-free provider transport used by local preview and test runs.
19
+ * It never inspects environment variables and never delegates to fetch or the
20
+ * filesystem. Writes are recorded and receive deterministic simulated IDs so
21
+ * later writes can safely refer to earlier ones.
22
+ */
23
+ export class PreviewTransport {
24
+ actions = [];
25
+ accesses = [];
26
+ sequence = 0;
27
+ data = new Map();
28
+ writtenPaths = new Set();
29
+ receiptsByReference = new Map();
30
+ idFactory;
31
+ timestampFactory;
32
+ constructor(options = {}) {
33
+ const fixtures = options.fixtures;
34
+ if (fixtures instanceof Map) {
35
+ for (const [fixturePath, value] of fixtures)
36
+ this.data.set(fixturePath, value);
37
+ }
38
+ else if (fixtures) {
39
+ for (const [fixturePath, value] of Object.entries(fixtures))
40
+ this.data.set(fixturePath, value);
41
+ }
42
+ this.idFactory = options.idFactory ?? defaultId;
43
+ this.timestampFactory = options.timestampFactory ?? defaultTimestamp;
44
+ }
45
+ seed(path, value) {
46
+ this.data.set(path, value);
47
+ return this;
48
+ }
49
+ async read(request) {
50
+ const parameters = { ...request.parameters };
51
+ const action = {
52
+ ...request,
53
+ kind: 'provider.read',
54
+ status: 'previewed',
55
+ data: { operation: 'read', parameters, path: request.path },
56
+ parameters,
57
+ method: 'read',
58
+ };
59
+ this.accesses.push(action);
60
+ this.actions.push(action);
61
+ return this.data.get(request.path);
62
+ }
63
+ async list(request) {
64
+ const parameters = { ...request.parameters };
65
+ const action = {
66
+ ...request,
67
+ kind: 'provider.read',
68
+ status: 'previewed',
69
+ data: { operation: 'list', parameters, path: request.path },
70
+ parameters,
71
+ method: 'list',
72
+ };
73
+ this.accesses.push(action);
74
+ this.actions.push(action);
75
+ const fixture = this.data.get(request.path);
76
+ if (Array.isArray(fixture))
77
+ return [...fixture];
78
+ const prefix = `${request.path.replace(/\/+$/u, '')}/`;
79
+ const records = [];
80
+ for (const [recordPath, value] of this.data) {
81
+ if (!recordPath.startsWith(prefix))
82
+ continue;
83
+ const remainder = recordPath.slice(prefix.length);
84
+ if (remainder && !remainder.includes('/') && remainder.endsWith('.json'))
85
+ records.push(value);
86
+ }
87
+ return records;
88
+ }
89
+ async write(request) {
90
+ this.sequence += 1;
91
+ const simulatedReceipt = {
92
+ id: this.idFactory(request, this.sequence),
93
+ timestamp: this.timestampFactory(this.sequence),
94
+ };
95
+ const path = collectionRecordPath(request.path, simulatedReceipt.id);
96
+ const body = this.resolveParentReference(request.body);
97
+ const parameters = { ...request.parameters };
98
+ const action = {
99
+ ...request,
100
+ id: simulatedReceipt.id,
101
+ kind: 'provider.write',
102
+ status: 'previewed',
103
+ data: { operation: 'write', parameters, path, body, simulatedReceipt },
104
+ method: 'write',
105
+ parameters,
106
+ path,
107
+ body,
108
+ simulatedReceipt,
109
+ };
110
+ this.actions.push(action);
111
+ this.data.set(path, body);
112
+ this.writtenPaths.add(path);
113
+ this.receiptsByReference.set(path, simulatedReceipt);
114
+ this.receiptsByReference.set(simulatedReceipt.id, simulatedReceipt);
115
+ return {
116
+ path,
117
+ absolutePath: path,
118
+ receipt: {
119
+ id: simulatedReceipt.id,
120
+ created: simulatedReceipt.id,
121
+ externalId: simulatedReceipt.id,
122
+ ts: simulatedReceipt.id,
123
+ timestamp: simulatedReceipt.timestamp,
124
+ path,
125
+ ok: true,
126
+ },
127
+ };
128
+ }
129
+ clear() {
130
+ for (const path of this.writtenPaths)
131
+ this.data.delete(path);
132
+ this.writtenPaths.clear();
133
+ this.actions.length = 0;
134
+ this.accesses.length = 0;
135
+ this.sequence = 0;
136
+ this.receiptsByReference.clear();
137
+ }
138
+ resolveParentReference(body) {
139
+ if (!isRecord(body) || typeof body.parentRef !== 'string')
140
+ return body;
141
+ const parent = this.receiptsByReference.get(body.parentRef);
142
+ return parent ? { ...body, thread_ts: parent.id } : { ...body };
143
+ }
144
+ }
145
+ const PROCESS_TRANSPORT_KEY = Symbol.for('agentworkforce.preview-transport');
146
+ function processTransportRegistry() {
147
+ return globalThis;
148
+ }
149
+ /** Return the process-scoped transport used by legacy no-argument clients. */
150
+ export function getProcessRelayTransport() {
151
+ return processTransportRegistry()[PROCESS_TRANSPORT_KEY];
152
+ }
153
+ /** Set or clear the process-scoped transport used by legacy no-argument clients. */
154
+ export function setProcessRelayTransport(transport) {
155
+ processTransportRegistry()[PROCESS_TRANSPORT_KEY] = transport;
156
+ }
157
+ /** Compatibility name used by the preview runtime integration. */
158
+ export function setPreviewTransport(transport) {
159
+ setProcessRelayTransport(transport);
160
+ }
161
+ /** Clear the process-scoped preview transport. */
162
+ export function clearPreviewTransport() {
163
+ setProcessRelayTransport(undefined);
164
+ }
165
+ /**
166
+ * Bind a process transport and return a restoration callback. Nested bindings
167
+ * restore correctly; the callback will not overwrite a newer binding.
168
+ */
169
+ export function bindRelayTransport(transport) {
170
+ const previous = getProcessRelayTransport();
171
+ setProcessRelayTransport(transport);
172
+ return () => {
173
+ if (getProcessRelayTransport() === transport)
174
+ setProcessRelayTransport(previous);
175
+ };
176
+ }
177
+ /** Convenience name for the common process-scoped preview binding. */
178
+ export const bindPreviewTransport = bindRelayTransport;
179
+ /** Explicit constructor injection always wins over the process binding. */
180
+ export function resolveRelayTransport(options) {
181
+ return options.transport ?? getProcessRelayTransport();
182
+ }
183
+ /**
184
+ * Capture explicit constructor injection while resolving the process binding
185
+ * lazily for every operation. The lazy half is essential for handlers that
186
+ * construct a no-argument client at module load before a Run binds preview.
187
+ */
188
+ export function createRelayTransportResolver(options) {
189
+ const explicitTransport = options.transport;
190
+ return () => explicitTransport ?? getProcessRelayTransport();
191
+ }
192
+ //# sourceMappingURL=transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AA8DA,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAC3F,OAAO,UAAU,IAAI,QAAQ,CAAC;AAChC,CAAC;AAED,SAAS,SAAS,CAAC,OAAmC,EAAE,QAAgB;IACtE,OAAO,WAAW,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AACxH,CAAC;AAED,SAAS,gBAAgB,CAAC,QAAgB;IACxC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AACrE,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAY,EAAE,EAAU;IACpD,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CA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MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEvD,2EAA2E;AAC3E,MAAM,UAAU,qBAAqB,CAAC,OAA2B;IAC/D,OAAO,OAAO,CAAC,SAAS,IAAI,wBAAwB,EAAE,CAAC;AACzD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAC1C,OAA2B;IAE3B,MAAM,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC;IAC5C,OAAO,GAAG,EAAE,CAAC,iBAAiB,IAAI,wBAAwB,EAAE,CAAC;AAC/D,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @deprecated Import EffectPolicyV1 from `@agentworkforce/runtime` instead.
3
+ * Retained only for compatibility with `@relayfile/relay-helpers@0.4.5`.
4
+ */
5
+ export interface EffectPolicyV1 {
6
+ reads: 'deny' | 'fixtures' | 'live';
7
+ writes: 'deny' | 'preview' | 'sandbox' | 'live';
8
+ model: 'stub' | 'fixture' | 'live';
9
+ shell: 'deny' | 'simulate' | 'sandbox' | 'live';
10
+ compose: 'deny' | 'preview' | 'sandbox' | 'live';
11
+ allowedHttp: Array<{
12
+ method: string;
13
+ urlGlob: string;
14
+ }>;
15
+ allowedProviders?: string[];
16
+ }
17
+ export interface PreviewSimulatedReceipt {
18
+ id: string;
19
+ timestamp: string;
20
+ }
21
+ export type PreviewParameters = Record<string, string | number>;
22
+ /**
23
+ * Rich provider-operation record owned by relay-helpers. Consumers may map it
24
+ * structurally to the provider-neutral PreviewAction from @agentworkforce/runtime.
25
+ */
26
+ export interface TransportPreviewAction {
27
+ id?: string;
28
+ kind: 'provider.read' | 'provider.write';
29
+ provider: string;
30
+ resource: string;
31
+ status: 'previewed';
32
+ data: Record<string, unknown>;
33
+ extensions?: Record<string, unknown>;
34
+ method: 'read' | 'list' | 'write';
35
+ path: string;
36
+ parameters?: PreviewParameters;
37
+ body?: unknown;
38
+ simulatedReceipt?: PreviewSimulatedReceipt;
39
+ }
40
+ /**
41
+ * @deprecated Use TransportPreviewAction. This relay-helpers compatibility
42
+ * alias is not the provider-neutral PreviewAction owned by @agentworkforce/runtime.
43
+ */
44
+ export type PreviewAction = TransportPreviewAction;
45
+ export type PreviewAccess = TransportPreviewAction & {
46
+ kind: 'provider.read';
47
+ method: 'read' | 'list';
48
+ body?: never;
49
+ simulatedReceipt?: never;
50
+ };
51
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IAChD,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IACnC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;IAChD,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IACjD,WAAW,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,eAAe,GAAG,gBAAgB,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;CAC5C;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG,sBAAsB,GAAG;IACnD,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,gBAAgB,CAAC,EAAE,KAAK,CAAC;CAC1B,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,4 @@
1
+ // relay-helpers owns TransportPreviewAction; @agentworkforce/runtime owns and
2
+ // maps its provider-neutral PreviewAction projection when consuming.
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,qEAAqE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relayfile/relay-helpers",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "Ergonomic, catalog-backed provider clients for Relayfile integration handlers",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -17,6 +17,16 @@
17
17
  "import": "./dist/index.js",
18
18
  "default": "./dist/index.js"
19
19
  },
20
+ "./transport": {
21
+ "types": "./dist/transport.d.ts",
22
+ "import": "./dist/transport.js",
23
+ "default": "./dist/transport.js"
24
+ },
25
+ "./types": {
26
+ "types": "./dist/types.d.ts",
27
+ "import": "./dist/types.js",
28
+ "default": "./dist/types.js"
29
+ },
20
30
  "./package.json": "./package.json"
21
31
  },
22
32
  "files": [
@@ -31,8 +41,8 @@
31
41
  "prepublishOnly": "npm run build"
32
42
  },
33
43
  "dependencies": {
34
- "@relayfile/adapter-core": "^0.5.1",
35
- "@relayfile/adapter-linear": "^0.4.3",
36
- "@relayfile/adapter-reddit": "^0.2.1"
44
+ "@relayfile/adapter-core": "^0.5.4",
45
+ "@relayfile/adapter-linear": "^0.4.5",
46
+ "@relayfile/adapter-reddit": "^0.2.4"
37
47
  }
38
48
  }