@parel/steering-immediate 0.0.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.
@@ -0,0 +1,5 @@
1
+ import * as _parel_core from '@parel/core';
2
+
3
+ declare const _default: _parel_core.ParelPlugin;
4
+
5
+ export { _default as default };
package/dist/index.js ADDED
@@ -0,0 +1,40 @@
1
+ // src/index.ts
2
+ import { definePlugin, LifecycleEvent } from "@parel/plugin-sdk";
3
+ var index_default = definePlugin({
4
+ name: "@parel/steering-immediate",
5
+ version: "0.0.1",
6
+ async setup(ctx) {
7
+ ctx.hook(LifecycleEvent.ContextBuild, async (hookCtx) => {
8
+ const steers = hookCtx.inputs.drain("steer");
9
+ if (steers.length === 0) return;
10
+ return {
11
+ action: "continue",
12
+ mutations: {
13
+ messages: [
14
+ ...hookCtx.messages,
15
+ ...steers.map((steer) => ({
16
+ role: "user",
17
+ parts: [
18
+ {
19
+ type: "text",
20
+ text: `[Steering] ${steer.payload.message}`,
21
+ visibility: "chat"
22
+ }
23
+ ]
24
+ }))
25
+ ]
26
+ }
27
+ };
28
+ });
29
+ ctx.hook(LifecycleEvent.StepStart, async (hookCtx) => {
30
+ const interrupts = hookCtx.inputs.peek("interrupt");
31
+ if (interrupts.length > 0) {
32
+ hookCtx.inputs.drain("interrupt");
33
+ ctx.interrupt();
34
+ }
35
+ });
36
+ }
37
+ });
38
+ export {
39
+ index_default as default
40
+ };
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@parel/steering-immediate",
3
+ "version": "0.0.3",
4
+ "description": "PAREL plugin for immediate steering and interruption inputs.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/parall-hq/parel-opensource.git",
9
+ "directory": "js/plugins/steering-immediate"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/parall-hq/parel-opensource/issues"
13
+ },
14
+ "homepage": "https://github.com/parall-hq/parel-opensource#readme",
15
+ "type": "module",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js"
20
+ }
21
+ },
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "dependencies": {
26
+ "@parel/plugin-sdk": "0.1.0"
27
+ },
28
+ "devDependencies": {
29
+ "tsup": "^8.0.0",
30
+ "typescript": "^5.8.0",
31
+ "vitest": "^3.0.0"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
36
+ "scripts": {
37
+ "build": "tsup",
38
+ "test": "vitest run --passWithNoTests",
39
+ "lint": "biome check src/"
40
+ }
41
+ }