@nettee/beacon 0.3.6 → 0.4.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 +16 -1
- package/dist/cli-app.d.ts +31 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +11 -8
- package/dist/daemon/config/channels.d.ts +11 -0
- package/dist/daemon/config/event-credentials.d.ts +6 -0
- package/dist/daemon/config/global.d.ts +40 -0
- package/dist/daemon/config/profile.d.ts +38 -0
- package/dist/daemon/config/registry.d.ts +3 -0
- package/dist/daemon/config/runtime-environment.d.ts +2 -0
- package/dist/daemon/config/secrets.d.ts +5 -0
- package/dist/daemon/config/yaml.d.ts +1 -0
- package/dist/daemon/dashboard/export.d.ts +11 -0
- package/dist/daemon/dashboard/profiles.d.ts +5 -0
- package/dist/daemon/dashboard/records.d.ts +25 -0
- package/dist/daemon/dashboard/server.d.ts +15 -0
- package/dist/daemon/dashboard/session-prompt.d.ts +4 -0
- package/dist/daemon/dashboard/static.d.ts +2 -0
- package/dist/daemon/doctor.d.ts +1 -0
- package/dist/daemon/domain/types.d.ts +137 -0
- package/dist/daemon/events/cloudevent.d.ts +25 -0
- package/dist/daemon/events/pipeline.d.ts +35 -0
- package/dist/daemon/events/server.d.ts +15 -0
- package/dist/daemon/events/store.d.ts +58 -0
- package/dist/daemon/feishu/doctor.d.ts +2 -0
- package/dist/daemon/feishu/final-outcome-card.d.ts +20 -0
- package/dist/daemon/feishu/gateway.d.ts +46 -0
- package/dist/daemon/feishu/intake.d.ts +37 -0
- package/dist/daemon/feishu/mentions.d.ts +37 -0
- package/dist/daemon/feishu/message-gateway.d.ts +4 -0
- package/dist/daemon/feishu/message-pipeline.d.ts +13 -0
- package/dist/daemon/feishu/reply-experiment.d.ts +3 -0
- package/dist/daemon/feishu/trigger-input.d.ts +36 -0
- package/dist/daemon/index.d.ts +6 -0
- package/dist/daemon/index.js +5 -0
- package/dist/daemon/manual-trigger.d.ts +2 -0
- package/dist/{manual-trigger.js → daemon/manual-trigger.js} +2 -1
- package/dist/daemon/message/gateway.d.ts +9 -0
- package/dist/daemon/outcome/content.d.ts +68 -0
- package/dist/daemon/outcome/doctor.d.ts +2 -0
- package/dist/{outcome → daemon/outcome}/doctor.js +2 -3
- package/dist/daemon/outcome/instructions.d.ts +3 -0
- package/dist/daemon/outcome/server.d.ts +20 -0
- package/dist/daemon/outcome/submit.d.ts +5 -0
- package/dist/daemon/run/create-pi-orchestrator.d.ts +17 -0
- package/dist/{run → daemon/run}/create-pi-orchestrator.js +1 -2
- package/dist/daemon/run/orchestrator.d.ts +61 -0
- package/dist/daemon/run/profile-runner.d.ts +9 -0
- package/dist/daemon/run/queue.d.ts +20 -0
- package/dist/daemon/runtime/pi-doctor.d.ts +1 -0
- package/dist/daemon/runtime/pi-outcome-extension.d.ts +43 -0
- package/dist/daemon/runtime/pi-rpc.d.ts +42 -0
- package/dist/{runtime → daemon/runtime}/pi-rpc.js +3 -1
- package/dist/daemon/runtime/system-prompt.d.ts +10 -0
- package/dist/daemon/runtime-options.d.ts +4 -0
- package/dist/daemon/runtime-options.js +1 -0
- package/dist/daemon/schedule/cron.d.ts +2 -0
- package/dist/daemon/schedule/cursor-store.d.ts +18 -0
- package/dist/daemon/schedule/loop.d.ts +17 -0
- package/dist/daemon/schedule/reconciler.d.ts +16 -0
- package/dist/daemon/schedule-trigger.d.ts +18 -0
- package/dist/{schedule-trigger.js → daemon/schedule-trigger.js} +2 -1
- package/dist/daemon/service.d.ts +4 -0
- package/dist/{service.js → daemon/service.js} +3 -1
- package/dist/daemon/state/trigger-store.d.ts +30 -0
- package/dist/version.d.ts +1 -0
- package/package.json +13 -25
- /package/dist/{config → daemon/config}/channels.js +0 -0
- /package/dist/{config → daemon/config}/event-credentials.js +0 -0
- /package/dist/{config → daemon/config}/global.js +0 -0
- /package/dist/{config → daemon/config}/profile.js +0 -0
- /package/dist/{config → daemon/config}/registry.js +0 -0
- /package/dist/{config → daemon/config}/runtime-environment.js +0 -0
- /package/dist/{config → daemon/config}/secrets.js +0 -0
- /package/dist/{config → daemon/config}/yaml.js +0 -0
- /package/dist/{dashboard → daemon/dashboard}/export.js +0 -0
- /package/dist/{dashboard → daemon/dashboard}/profiles.js +0 -0
- /package/dist/{dashboard → daemon/dashboard}/records.js +0 -0
- /package/dist/{dashboard → daemon/dashboard}/server.js +0 -0
- /package/dist/{dashboard → daemon/dashboard}/session-prompt.js +0 -0
- /package/dist/{dashboard → daemon/dashboard}/static.js +0 -0
- /package/dist/{doctor.js → daemon/doctor.js} +0 -0
- /package/dist/{domain → daemon/domain}/types.js +0 -0
- /package/dist/{events → daemon/events}/cloudevent.js +0 -0
- /package/dist/{events → daemon/events}/pipeline.js +0 -0
- /package/dist/{events → daemon/events}/server.js +0 -0
- /package/dist/{events → daemon/events}/store.js +0 -0
- /package/dist/{feishu → daemon/feishu}/doctor.js +0 -0
- /package/dist/{feishu → daemon/feishu}/final-outcome-card.js +0 -0
- /package/dist/{feishu → daemon/feishu}/gateway.js +0 -0
- /package/dist/{feishu → daemon/feishu}/intake.js +0 -0
- /package/dist/{feishu → daemon/feishu}/mentions.js +0 -0
- /package/dist/{feishu → daemon/feishu}/message-gateway.js +0 -0
- /package/dist/{feishu → daemon/feishu}/message-pipeline.js +0 -0
- /package/dist/{feishu → daemon/feishu}/reply-experiment.js +0 -0
- /package/dist/{feishu → daemon/feishu}/trigger-input.js +0 -0
- /package/dist/{message → daemon/message}/gateway.js +0 -0
- /package/dist/{outcome → daemon/outcome}/content.js +0 -0
- /package/dist/{outcome → daemon/outcome}/instructions.js +0 -0
- /package/dist/{outcome → daemon/outcome}/server.js +0 -0
- /package/dist/{outcome → daemon/outcome}/submit.js +0 -0
- /package/dist/{run → daemon/run}/orchestrator.js +0 -0
- /package/dist/{run → daemon/run}/profile-runner.js +0 -0
- /package/dist/{run → daemon/run}/queue.js +0 -0
- /package/dist/{runtime → daemon/runtime}/pi-doctor.js +0 -0
- /package/dist/{runtime → daemon/runtime}/pi-outcome-extension.js +0 -0
- /package/dist/{runtime → daemon/runtime}/system-prompt.js +0 -0
- /package/dist/{schedule → daemon/schedule}/cron.js +0 -0
- /package/dist/{schedule → daemon/schedule}/cursor-store.js +0 -0
- /package/dist/{schedule → daemon/schedule}/loop.js +0 -0
- /package/dist/{schedule → daemon/schedule}/reconciler.js +0 -0
- /package/dist/{state → daemon/state}/trigger-store.js +0 -0
- /package/dist/{dashboard/ui → web}/assets/index-BP5xd2Iv.js +0 -0
- /package/dist/{dashboard/ui → web}/assets/index-D3C6sw_J.css +0 -0
- /package/dist/{dashboard/ui → web}/index.html +0 -0
|
@@ -55,7 +55,7 @@ export async function triggerScheduleOnce(options) {
|
|
|
55
55
|
}
|
|
56
56
|
return record;
|
|
57
57
|
}
|
|
58
|
-
export async function runScheduleTrigger(configPath, profileId, scheduleId) {
|
|
58
|
+
export async function runScheduleTrigger(configPath, profileId, scheduleId, options) {
|
|
59
59
|
const global = await loadGlobalConfig(configPath);
|
|
60
60
|
const runtimeEnvironment = await loadRuntimeEnvironment(global.runtimeEnvironmentPath);
|
|
61
61
|
const channels = await loadChannelRegistry(global.channelsPath);
|
|
@@ -69,6 +69,7 @@ export async function runScheduleTrigger(configPath, profileId, scheduleId) {
|
|
|
69
69
|
try {
|
|
70
70
|
const store = new TriggerStore(profile.directory, profile.id);
|
|
71
71
|
const orchestrator = createPiRunOrchestrator({
|
|
72
|
+
beaconCliPath: options.beaconCliPath,
|
|
72
73
|
config: global,
|
|
73
74
|
runtimeEnvironment,
|
|
74
75
|
profile,
|
|
@@ -35,7 +35,7 @@ function shutdownController() {
|
|
|
35
35
|
},
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
export async function runBeacon(configPath) {
|
|
38
|
+
export async function runBeacon(configPath, options) {
|
|
39
39
|
const global = await loadGlobalConfig(configPath);
|
|
40
40
|
const runtimeEnvironment = await loadRuntimeEnvironment(global.runtimeEnvironmentPath);
|
|
41
41
|
const channels = await loadChannelRegistry(global.channelsPath);
|
|
@@ -50,6 +50,7 @@ export async function runBeacon(configPath) {
|
|
|
50
50
|
try {
|
|
51
51
|
if (global.dashboard.enabled) {
|
|
52
52
|
dashboard = await startDashboard({
|
|
53
|
+
uiDirectory: options.uiDirectory,
|
|
53
54
|
listen: global.dashboard.listen,
|
|
54
55
|
port: global.dashboard.port,
|
|
55
56
|
profilesDirectory: global.profilesDirectory,
|
|
@@ -81,6 +82,7 @@ export async function runBeacon(configPath) {
|
|
|
81
82
|
const gateway = createFeishuGateway(profileCredentials);
|
|
82
83
|
const store = new TriggerStore(profile.directory, profile.id);
|
|
83
84
|
const orchestrator = createPiRunOrchestrator({
|
|
85
|
+
beaconCliPath: options.beaconCliPath,
|
|
84
86
|
config: global,
|
|
85
87
|
runtimeEnvironment,
|
|
86
88
|
profile,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type DeliveryTarget, type TriggerInput, type TriggerRecord } from "../domain/types.js";
|
|
2
|
+
export type TriggerClaim = {
|
|
3
|
+
input?: TriggerInput | undefined;
|
|
4
|
+
sourceKey: string[];
|
|
5
|
+
target: DeliveryTarget;
|
|
6
|
+
notifyTarget?: DeliveryTarget | undefined;
|
|
7
|
+
ingress?: Record<string, unknown> | undefined;
|
|
8
|
+
acceptedAt?: Date | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare class TriggerStore {
|
|
11
|
+
private readonly profileId;
|
|
12
|
+
readonly root: string;
|
|
13
|
+
constructor(profileDirectory: string, profileId: string);
|
|
14
|
+
recordPath(triggerKey: string): string;
|
|
15
|
+
private prepare;
|
|
16
|
+
private read;
|
|
17
|
+
private syncDirectory;
|
|
18
|
+
private write;
|
|
19
|
+
claim(request: TriggerClaim): Promise<{
|
|
20
|
+
created: boolean;
|
|
21
|
+
record: TriggerRecord;
|
|
22
|
+
}>;
|
|
23
|
+
update(triggerKey: string, transform: (record: TriggerRecord) => TriggerRecord): Promise<TriggerRecord>;
|
|
24
|
+
list(): Promise<TriggerRecord[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Locate the Trigger whose reply or notify Delivery produced this Feishu
|
|
27
|
+
* outbound `message_id`. Newest accepted Trigger wins on collision.
|
|
28
|
+
*/
|
|
29
|
+
findByDeliveredMessageId(messageId: string): Promise<TriggerRecord | undefined>;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const packageVersion: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nettee/beacon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A single-host bridge from messaging and schedules to isolated agent runs",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"dist/",
|
|
26
|
-
"deploy/
|
|
26
|
+
"deploy/",
|
|
27
27
|
"examples/",
|
|
28
28
|
"README.md",
|
|
29
29
|
"LICENSE"
|
|
@@ -31,19 +31,6 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"scripts": {
|
|
35
|
-
"build": "tsc -p tsconfig.json && vite build --config dashboard-ui/vite.config.ts",
|
|
36
|
-
"bump-version": "node scripts/bump-version.mjs",
|
|
37
|
-
"check": "biome check .",
|
|
38
|
-
"dev": "tsx src/cli.ts",
|
|
39
|
-
"e2e:message": "tsc -p tsconfig.e2e.json --noEmit && pnpm build && tsx --test e2e/message/*.e2e.test.ts",
|
|
40
|
-
"prebuild": "node scripts/clean-dist.mjs",
|
|
41
|
-
"prepack": "pnpm build",
|
|
42
|
-
"test": "tsx --test src/*.test.ts src/**/*.test.ts scripts/*.test.mjs",
|
|
43
|
-
"test:package": "node scripts/test-package.mjs",
|
|
44
|
-
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p dashboard-ui/tsconfig.json --noEmit"
|
|
45
|
-
},
|
|
46
|
-
"packageManager": "pnpm@10.33.2",
|
|
47
34
|
"engines": {
|
|
48
35
|
"node": ">=22"
|
|
49
36
|
},
|
|
@@ -53,18 +40,19 @@
|
|
|
53
40
|
"yaml": "^2.9.1",
|
|
54
41
|
"zod": "^4.1.8"
|
|
55
42
|
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "tsc -p tsconfig.json && node ../../scripts/assemble-cli.mjs",
|
|
45
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
46
|
+
"test": "tsx --test src/*.test.ts",
|
|
47
|
+
"dev": "pnpm --dir ../.. build && node dist/cli.js",
|
|
48
|
+
"prepack": "pnpm --dir ../.. build",
|
|
49
|
+
"prebuild": "node ../../scripts/clean-dist.mjs"
|
|
50
|
+
},
|
|
56
51
|
"devDependencies": {
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
52
|
+
"@nettee/beacon-daemon": "workspace:*",
|
|
53
|
+
"@nettee/beacon-web": "workspace:*",
|
|
59
54
|
"@types/node": "^24.3.0",
|
|
60
|
-
"@types/react": "^19.3.0",
|
|
61
|
-
"@types/react-dom": "^19.3.0",
|
|
62
|
-
"@vitejs/plugin-react": "^6.1.1",
|
|
63
|
-
"react": "^19.3.0",
|
|
64
|
-
"react-dom": "^19.3.0",
|
|
65
|
-
"tailwindcss": "^4.3.3",
|
|
66
55
|
"tsx": "^4.20.5",
|
|
67
|
-
"typescript": "^5.9.2"
|
|
68
|
-
"vite": "^8.3.0"
|
|
56
|
+
"typescript": "^5.9.2"
|
|
69
57
|
}
|
|
70
58
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|