@frockbot/plugin-flock 0.3.1 → 0.3.3
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/package.json +7 -7
- package/src/backend.ts +14 -0
- package/src/bot.ts +24 -0
- package/src/client/index.ts +11 -0
- package/src/user.ts +24 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frockbot/plugin-flock",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -27,16 +27,16 @@
|
|
|
27
27
|
"typecheck": "vue-tsc --noEmit -p tsconfig.json"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@frockbot/client-core": "0.3.
|
|
31
|
-
"@frockbot/client-ui": "0.3.
|
|
32
|
-
"@frockbot/configuration-core": "0.3.
|
|
33
|
-
"@frockbot/kernel-contracts": "0.3.
|
|
34
|
-
"@frockbot/plugin-shell": "0.3.
|
|
30
|
+
"@frockbot/client-core": "0.3.3",
|
|
31
|
+
"@frockbot/client-ui": "0.3.3",
|
|
32
|
+
"@frockbot/configuration-core": "0.3.3",
|
|
33
|
+
"@frockbot/kernel-contracts": "0.3.3",
|
|
34
|
+
"@frockbot/plugin-shell": "0.3.3",
|
|
35
35
|
"cordis": "4.0.0-rc.8",
|
|
36
36
|
"vue": "3.5.41"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@frockbot/plugin-testkit": "0.3.
|
|
39
|
+
"@frockbot/plugin-testkit": "0.3.3",
|
|
40
40
|
"@types/bun": "1.4.0",
|
|
41
41
|
"@vitejs/plugin-vue": "6.0.8",
|
|
42
42
|
"css-tree": "2.3.1",
|
package/src/backend.ts
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
type BotUnreadDirectoryViewV1,
|
|
26
26
|
type BotUnreadReceiptV1,
|
|
27
27
|
} from "@frockbot/plugin-shell/unread";
|
|
28
|
+
import { defineGatewayContribution } from "@frockbot/kernel-contracts/contributions";
|
|
28
29
|
|
|
29
30
|
export interface FlockGatewayHost {
|
|
30
31
|
listBots(userId: string): Promise<BotDirectoryViewV1>;
|
|
@@ -281,3 +282,16 @@ export namespace createFlockBackendContribution {
|
|
|
281
282
|
return () => lifecycle.mount(createFlockBackendContribution(host));
|
|
282
283
|
}
|
|
283
284
|
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* The manifest's gateway `backend` entry, resolved by specifier. The
|
|
288
|
+
* application looks this descriptor up in its Contribution table; it never
|
|
289
|
+
* branches on which Package it belongs to.
|
|
290
|
+
*/
|
|
291
|
+
export const backendContribution = defineGatewayContribution<
|
|
292
|
+
FlockGatewayHost,
|
|
293
|
+
FlockBackendRouteContribution
|
|
294
|
+
>({
|
|
295
|
+
specifier: "@frockbot/plugin-flock/backend",
|
|
296
|
+
create: createFlockBackendContribution.plugin,
|
|
297
|
+
});
|
package/src/bot.ts
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
type SheepIdentityViewV1,
|
|
19
19
|
type UpdateSheepCommandV1,
|
|
20
20
|
} from "./shared.js";
|
|
21
|
+
import { defineBotBackendContribution } from "@frockbot/kernel-contracts/contributions";
|
|
21
22
|
|
|
22
23
|
const IDENTITY_KEY = "flock:sheep:v1";
|
|
23
24
|
const RECEIPT_PREFIX = "flock:sheep-receipt:";
|
|
@@ -253,3 +254,26 @@ export function createFlockBotBackendPlugin(
|
|
|
253
254
|
): Plugin {
|
|
254
255
|
return () => lifecycle.mount(createFlockBotBackendContribution(host));
|
|
255
256
|
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* What an application hands this Contribution: the Bot's own lifecycle state, under the
|
|
260
|
+
* Package's own key so one wide host object can satisfy every Package's slice
|
|
261
|
+
* without their fields colliding.
|
|
262
|
+
*/
|
|
263
|
+
export interface FlockBotApplicationHostV1 {
|
|
264
|
+
flock: FlockBotBackendHost;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* The manifest's `bot` entry, resolved by specifier. The
|
|
269
|
+
* application looks this descriptor up in its Contribution table; it never
|
|
270
|
+
* branches on which Package it belongs to.
|
|
271
|
+
*/
|
|
272
|
+
export const botContribution = defineBotBackendContribution<
|
|
273
|
+
FlockBotApplicationHostV1,
|
|
274
|
+
FlockBotBackendContribution
|
|
275
|
+
>({
|
|
276
|
+
specifier: "@frockbot/plugin-flock/bot",
|
|
277
|
+
create: (host, lifecycle) =>
|
|
278
|
+
createFlockBotBackendPlugin(host.flock, lifecycle),
|
|
279
|
+
});
|
package/src/client/index.ts
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
import { flockWebDataKey, type FlockWebData } from "./state.js";
|
|
39
39
|
import "../../assets/layers.css";
|
|
40
40
|
import "./styles.css";
|
|
41
|
+
import { defineClientContribution } from "@frockbot/kernel-contracts/contributions";
|
|
41
42
|
|
|
42
43
|
function slug(name: string): string {
|
|
43
44
|
const base =
|
|
@@ -617,3 +618,13 @@ export const flockClientPlugin: ClientPlugin = (ctx) => {
|
|
|
617
618
|
];
|
|
618
619
|
};
|
|
619
620
|
export default flockClientPlugin;
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* The manifest's `client` entry, resolved by specifier. The application looks
|
|
624
|
+
* this descriptor up in its Contribution table; it never branches on which
|
|
625
|
+
* Package it belongs to.
|
|
626
|
+
*/
|
|
627
|
+
export const clientContribution = defineClientContribution<ClientPlugin>({
|
|
628
|
+
specifier: "@frockbot/plugin-flock/client",
|
|
629
|
+
plugin: flockClientPlugin,
|
|
630
|
+
});
|
package/src/user.ts
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
type CreateBotCommandV1,
|
|
23
23
|
type FlockReceiptV1,
|
|
24
24
|
} from "./shared.js";
|
|
25
|
+
import { defineUserBackendContribution } from "@frockbot/kernel-contracts/contributions";
|
|
25
26
|
|
|
26
27
|
const DIRECTORY_KEY = "flock:directory:v1";
|
|
27
28
|
const RECEIPT_PREFIX = "flock:create-receipt:";
|
|
@@ -410,3 +411,26 @@ export function createFlockUserBackendPlugin(
|
|
|
410
411
|
): Plugin {
|
|
411
412
|
return () => lifecycle.mount(createFlockUserBackendContribution(host));
|
|
412
413
|
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* What an application hands this Contribution: the User's Bot directory, under the
|
|
417
|
+
* Package's own key so one wide host object can satisfy every Package's slice
|
|
418
|
+
* without their fields colliding.
|
|
419
|
+
*/
|
|
420
|
+
export interface FlockUserApplicationHostV1 {
|
|
421
|
+
flock: FlockUserBackendHost;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* The manifest's `user` entry, resolved by specifier. The
|
|
426
|
+
* application looks this descriptor up in its Contribution table; it never
|
|
427
|
+
* branches on which Package it belongs to.
|
|
428
|
+
*/
|
|
429
|
+
export const userContribution = defineUserBackendContribution<
|
|
430
|
+
FlockUserApplicationHostV1,
|
|
431
|
+
FlockUserBackendContribution
|
|
432
|
+
>({
|
|
433
|
+
specifier: "@frockbot/plugin-flock/user",
|
|
434
|
+
create: (host, lifecycle) =>
|
|
435
|
+
createFlockUserBackendPlugin(host.flock, lifecycle),
|
|
436
|
+
});
|