service-bridge 2.0.0-alpha → 2.0.0-alpha.2
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 +16 -0
- package/dist/http/express/index.d.ts +1 -1
- package/dist/http/fastify/index.d.ts +1 -1
- package/dist/http/hono/index.d.ts +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.js +1585 -1587
- package/dist/index.js.map +1 -1
- package/dist/{service-bridge-CPmirNES.d.ts → service-bridge-B1sZmWdS.d.ts} +0 -1
- package/package.json +2 -1
- package/skill/SKILL.md +114 -0
- package/skill/reference/configuration.md +93 -0
- package/skill/reference/events.md +102 -0
- package/skill/reference/http-integrations.md +87 -0
- package/skill/reference/jobs.md +90 -0
- package/skill/reference/rpc.md +150 -0
- package/skill/reference/workflows.md +150 -0
package/README.md
CHANGED
|
@@ -87,6 +87,22 @@ const sb = new ServiceBridge(
|
|
|
87
87
|
|
|
88
88
|
The third constructor argument is an [options](#configuration) object. The SDK reads **no environment variables** — every knob is a constructor option, so you stay in control of where config comes from.
|
|
89
89
|
|
|
90
|
+
### Using an AI coding agent?
|
|
91
|
+
|
|
92
|
+
This package ships an official skill so your agent (Claude Code, etc.) writes correct ServiceBridge code on the first try — RPC, events, workflows, jobs and HTTP integration, grounded in this exact SDK. It comes with the install; copy it into your agent's skills directory:
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
cp -r node_modules/service-bridge/skill .claude/skills/servicebridge-node
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Not installed yet? Pull it straight from the repo:
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
npx degit service-bridge/sdk/node/skill .claude/skills/servicebridge-node
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Source: [`node/skill/`](https://github.com/service-bridge/sdk/tree/main/node/skill).
|
|
105
|
+
|
|
90
106
|
---
|
|
91
107
|
|
|
92
108
|
## Why ServiceBridge
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FastifyPluginAsync } from 'fastify';
|
|
2
|
-
import { v as OpHandle, p as ServiceBridge } from '../../service-bridge-
|
|
2
|
+
import { v as OpHandle, p as ServiceBridge } from '../../service-bridge-B1sZmWdS.js';
|
|
3
3
|
import '@grpc/grpc-js';
|
|
4
4
|
import '@bufbuild/protobuf/wire';
|
|
5
5
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AdvertiseConfig, C as CallOpts, a as CatchupPolicy, b as ConnectedEvent, c as CronTrigger, D as DeclaredDep, d as DelayedTrigger, e as DisconnectedEvent, E as EventDomain, I as Identity, f as IntervalTrigger, J as JobDomain, g as JobHandler, h as JobHandlerCtx, i as JobOpts, M as MethodDescriptor, j as MethodType, O as OverlapPolicy, P as PolicyViolationEvent, k as PublishOpts, R as ReconnectingEvent, l as RetryOpts, m as RetryPolicy, n as RpcDomain, o as RpcHandlerOpts, S as SchemaSpec, p as ServiceBridge, q as ServiceBridgeError, r as ServiceBridgeOptions, s as ServiceDeps, T as Trigger, t as TypedClient, W as WorkflowDomain, u as WorkflowHandlerOpts } from './service-bridge-
|
|
1
|
+
export { A as AdvertiseConfig, C as CallOpts, a as CatchupPolicy, b as ConnectedEvent, c as CronTrigger, D as DeclaredDep, d as DelayedTrigger, e as DisconnectedEvent, E as EventDomain, I as Identity, f as IntervalTrigger, J as JobDomain, g as JobHandler, h as JobHandlerCtx, i as JobOpts, M as MethodDescriptor, j as MethodType, O as OverlapPolicy, P as PolicyViolationEvent, k as PublishOpts, R as ReconnectingEvent, l as RetryOpts, m as RetryPolicy, n as RpcDomain, o as RpcHandlerOpts, S as SchemaSpec, p as ServiceBridge, q as ServiceBridgeError, r as ServiceBridgeOptions, s as ServiceDeps, T as Trigger, t as TypedClient, W as WorkflowDomain, u as WorkflowHandlerOpts } from './service-bridge-B1sZmWdS.js';
|
|
2
2
|
import '@grpc/grpc-js';
|
|
3
3
|
import '@bufbuild/protobuf/wire';
|
|
4
4
|
|
|
@@ -23,5 +23,14 @@ declare class WorkflowAccessDeniedError extends Error {
|
|
|
23
23
|
readonly reason: string;
|
|
24
24
|
constructor(workflowName: string, reason: string);
|
|
25
25
|
}
|
|
26
|
+
declare class WorkflowNotFoundError extends Error {
|
|
27
|
+
readonly workflowName: string;
|
|
28
|
+
constructor(workflowName: string);
|
|
29
|
+
}
|
|
30
|
+
declare class WorkflowTerminalError extends Error {
|
|
31
|
+
readonly runId: string;
|
|
32
|
+
readonly status: string;
|
|
33
|
+
constructor(runId: string, status: string);
|
|
34
|
+
}
|
|
26
35
|
|
|
27
|
-
export { InvalidEventNameError, OutboxFullError, RpcAccessDeniedError, WorkflowAccessDeniedError };
|
|
36
|
+
export { InvalidEventNameError, OutboxFullError, RpcAccessDeniedError, WorkflowAccessDeniedError, WorkflowNotFoundError, WorkflowTerminalError };
|