@syengup/fridaynext-hermes-channel 0.1.0-beta.3 → 0.1.0-beta.4
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 +2 -2
- package/install-config.js +67 -0
- package/install-runtime.js +17 -5
- package/install.js +6 -4
- package/package.json +2 -1
- package/plugin/README.md +2 -2
- package/plugin/fridaynext_plugin/__init__.py +10 -0
- package/plugin/fridaynext_plugin/adapter.py +221 -12
- package/plugin/fridaynext_plugin/agent_management.py +158 -0
- package/plugin/fridaynext_plugin/canonical_control.py +12 -4
- package/plugin/fridaynext_plugin/compat_v0225.py +1174 -4
- package/plugin/fridaynext_plugin/continuations.py +271 -0
- package/plugin/fridaynext_plugin/device-tools-v1.json +302 -0
- package/plugin/fridaynext_plugin/device_tools.py +144 -0
- package/plugin/fridaynext_plugin/history.py +25 -3
- package/plugin/fridaynext_plugin/host.py +7 -4
- package/plugin/fridaynext_plugin/media_input.py +56 -9
- package/plugin/fridaynext_plugin/multi_agent.py +221 -0
- package/plugin/fridaynext_plugin/reply_context.py +39 -0
- package/plugin/fridaynext_plugin/runtime_port.py +23 -1
- package/plugin/fridaynext_plugin/scheduled_tasks.py +229 -0
- package/plugin/fridaynext_plugin/settings.py +7 -3
- package/plugin/fridaynext_plugin/slash_commands.py +163 -0
- package/plugin/fridaynext_plugin/stream_bridge.py +83 -26
- package/plugin/fridaynext_plugin/stream_projection.py +30 -6
- package/plugin/fridaynext_plugin/subagents.py +228 -0
- package/plugin/plugin.yaml +11 -0
- package/plugin/runtime/dist/commands-routes.js +94 -0
- package/plugin/runtime/dist/device-tools-v1.json +302 -0
- package/plugin/runtime/dist/hosted-backend.js +250 -25
- package/plugin/runtime/dist/hosted-continuations.js +41 -0
- package/plugin/runtime/dist/hosted-device-tools.js +82 -0
- package/plugin/runtime/dist/hosted-media.js +54 -13
- package/plugin/runtime/dist/hosted-stream.js +124 -14
- package/plugin/runtime/dist/hosted-subagents.js +78 -0
- package/plugin/runtime/dist/platform-service.js +4 -0
- package/plugin/runtime/dist/plugin-control.js +10 -6
- package/plugin/runtime/dist/scheduled-routes.js +63 -0
- package/plugin/runtime/dist/service-host.js +27 -3
- package/plugin/runtime/dist/tool-presentation.js +399 -0
- package/plugin/runtime/node_modules/.package-lock.json +6 -6
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/API.md +125 -5
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/README.md +21 -1
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/history.d.ts +1 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/history.js +3 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/operations.d.ts +136 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/operations.js +105 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/settings-schema.d.ts +3 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/settings-schema.js +45 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/tool-presentation.d.ts +10 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/tool-presentation.js +2 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/types.d.ts +27 -2
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/types.js +1 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/work-context.d.ts +56 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/work-context.js +60 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/device-request/pending-store.js +3 -3
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/index.d.ts +5 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/index.js +5 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/canonical-update-batcher.d.ts +26 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/canonical-update-batcher.js +112 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/channel-kernel.d.ts +4 -1
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/channel-kernel.js +30 -5
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/durable-run-store.d.ts +18 -1
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/durable-run-store.js +187 -51
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/runner.d.ts +1 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/runner.js +52 -2
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/work-context.d.ts +13 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/work-context.js +73 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/service/channel-service.js +1 -1
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/command-lifecycle.d.ts +47 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/command-lifecycle.js +184 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/controls.d.ts +1 -1
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/controls.js +11 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/messages.js +12 -6
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/operations.d.ts +13 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/operations.js +336 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/runtime.d.ts +1 -0
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/runtime.js +52 -10
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/session-settings.js +38 -6
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/sessions.js +8 -8
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/package.json +6 -7
- package/plugin/runtime/node_modules/tslib/README.md +3 -8
- package/plugin/runtime/node_modules/tslib/package.json +1 -1
- package/plugin/runtime/node_modules/tslib/tslib.d.ts +4 -2
- package/plugin/runtime/node_modules/tslib/tslib.es6.js +10 -1
- package/plugin/runtime/node_modules/tslib/tslib.es6.mjs +10 -1
- package/plugin/runtime/node_modules/tslib/tslib.js +10 -1
- package/plugin/runtime/package-lock.json +7 -7
- package/plugin/runtime/package.json +1 -1
- package/plugin/tools.py +3 -0
|
@@ -64,6 +64,8 @@ class NativeControlError(RuntimeError):
|
|
|
64
64
|
class CanonicalControlClient:
|
|
65
65
|
def __init__(self, profile, timeout=8):
|
|
66
66
|
self.profile = str(Path(profile).resolve())
|
|
67
|
+
# 原生multiplex只有启动Profile拥有控制socket;目标身份仍由下方票据/describe逐次校验。
|
|
68
|
+
self.control_profile = self.profile
|
|
67
69
|
self.timeout = timeout
|
|
68
70
|
self.socket = None
|
|
69
71
|
self.reader = None
|
|
@@ -78,12 +80,12 @@ class CanonicalControlClient:
|
|
|
78
80
|
# 只同步通知原会话需要重读;不保存请求/参数,也不是原生创建游标。
|
|
79
81
|
|
|
80
82
|
async def _control(self, verb, params=None):
|
|
81
|
-
pointer = Path(self.
|
|
83
|
+
pointer = Path(self.control_profile) / "gateway.sock.path"
|
|
82
84
|
try:
|
|
83
85
|
file = (
|
|
84
86
|
Path(pointer.read_text().strip())
|
|
85
87
|
if pointer.exists()
|
|
86
|
-
else Path(self.
|
|
88
|
+
else Path(self.control_profile) / "gateway.sock"
|
|
87
89
|
)
|
|
88
90
|
info = file.stat()
|
|
89
91
|
if (
|
|
@@ -218,10 +220,15 @@ class CanonicalControlClient:
|
|
|
218
220
|
):
|
|
219
221
|
raise NativeControlError("CONTROL_AUTHORITY_REQUIRED")
|
|
220
222
|
description = await self._request(socket, "runtime.describe", {})
|
|
223
|
+
target_epoch = description.get("authority_epoch")
|
|
221
224
|
if (
|
|
222
225
|
description.get("profile_id") != self.profile
|
|
223
226
|
or description.get("instance_id") != instance
|
|
224
|
-
or
|
|
227
|
+
or type(target_epoch) is not int
|
|
228
|
+
or target_epoch < 1
|
|
229
|
+
# identify的epoch属于控制socket的启动Profile;multiplex中的各Profile独立递增。
|
|
230
|
+
# 子Profile以绑定该Profile的票据及同实例describe建立自己的epoch,后续围栏沿用它。
|
|
231
|
+
or self.control_profile == self.profile and target_epoch != epoch
|
|
225
232
|
or "durable-admission-v1" not in description.get("capabilities", [])
|
|
226
233
|
):
|
|
227
234
|
raise NativeControlError("CONTROL_IDENTITY_MISMATCH")
|
|
@@ -359,7 +366,7 @@ class CanonicalControlClient:
|
|
|
359
366
|
self.calls["image.attach_bytes.shared"] += 1
|
|
360
367
|
return await self._request(self.socket, "image.attach_bytes", {"session_id": conversation_id, "content_base64": data_url, "filename": filename})
|
|
361
368
|
|
|
362
|
-
async def submit_selected(self, conversation_id, input_id, text, *, attachments=None, expected_connection_id=None):
|
|
369
|
+
async def submit_selected(self, conversation_id, input_id, text, *, attachments=None, expected_connection_id=None, api_text=None):
|
|
363
370
|
"""仅由已持久选中的共享会话端口调用;普通平台输入仍不开放此动词。"""
|
|
364
371
|
await self.connect()
|
|
365
372
|
socket = self.socket
|
|
@@ -374,6 +381,7 @@ class CanonicalControlClient:
|
|
|
374
381
|
"text": text,
|
|
375
382
|
"queued": True,
|
|
376
383
|
**({"attachments": attachments} if attachments else {}),
|
|
384
|
+
**({"api_text": api_text} if api_text is not None else {}),
|
|
377
385
|
},
|
|
378
386
|
)
|
|
379
387
|
|