@tomflow/chatloop-extension 0.3.47 → 0.3.48
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 +8 -7
- package/bin/cli.mjs +1 -1
- package/bin/native-host.mjs +1 -5
- package/extension/actions/clean.js +4 -10
- package/extension/actions/common.js +24 -1
- package/extension/actions/continue.js +10 -64
- package/extension/actions/dom.js +2 -25
- package/extension/actions/handoff.js +11 -50
- package/extension/actions/text.js +2 -25
- package/extension/background.js +36 -446
- package/extension/loop/core.js +3 -16
- package/extension/loop/resources.js +7 -13
- package/extension/manifest.json +1 -1
- package/extension/popup.html +0 -1
- package/extension/popup.js +1 -1
- package/lib/bridge.mjs +1 -10
- package/lib/session-file.mjs +1 -1
- package/package.json +1 -1
- package/extension/acceptance.js +0 -641
- package/extension/actions/clock.js +0 -29
- package/extension/clock.html +0 -4
- package/lib/mcp-tools.json +0 -26
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// Test-only Action page. The Worker validates owned RUNNING boundary probes or an owned completed Turn before real 20m wall shortening.
|
|
2
|
-
(async () => {
|
|
3
|
-
const status = document.getElementById('status');
|
|
4
|
-
const details = document.getElementById('details');
|
|
5
|
-
try {
|
|
6
|
-
const q = new URLSearchParams(location.search);
|
|
7
|
-
if ([...q.keys()].sort().join(',') !== 'minutes,tabId') throw Error('INVALID_CLOCK_PARAMS');
|
|
8
|
-
const tabId = Number(q.get('tabId'));
|
|
9
|
-
const minutes = Number(q.get('minutes'));
|
|
10
|
-
if (!Number.isSafeInteger(tabId) || tabId <= 0
|
|
11
|
-
|| !Number.isSafeInteger(minutes) || minutes !== 20 && (minutes < 60 || minutes > 180))
|
|
12
|
-
throw Error('INVALID_CLOCK_RANGE');
|
|
13
|
-
const own = await chrome.tabs.getCurrent();
|
|
14
|
-
if (!own?.id || own.url !== location.href) throw Error('INVALID_CLOCK_ACTION_PAGE');
|
|
15
|
-
const result = await chrome.runtime.sendMessage({
|
|
16
|
-
type: 'CHAT_LOOP_ACCEPTANCE_CLOCK_ADVANCE_V1', tabId, minutes
|
|
17
|
-
});
|
|
18
|
-
if (!['ADVANCED_WHILE_RUNNING', 'SHORTENED_AFTER_REAL_20MIN'].includes(result?.status))
|
|
19
|
-
throw Error(result?.code || 'CLOCK_ADVANCE_UNVERIFIED');
|
|
20
|
-
status.textContent = 'SUCCESS';
|
|
21
|
-
details.textContent = result.status === 'SHORTENED_AFTER_REAL_20MIN'
|
|
22
|
-
? 'Owned wall-clock acceptance threshold shortened after real 20 minutes; existing Worker will release only one verified Continue.'
|
|
23
|
-
: 'Observer still RUNNING; '+minutes+'m elapsed. Await the actual finished Turn.';
|
|
24
|
-
await chrome.tabs.remove(own.id);
|
|
25
|
-
} catch (error) {
|
|
26
|
-
status.textContent = 'BLOCKED';
|
|
27
|
-
details.textContent = error?.message || 'UNKNOWN';
|
|
28
|
-
}
|
|
29
|
-
})();
|
package/extension/clock.html
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>Chat Loop · Controlled Clock Test</title>
|
|
2
|
-
<style>body{font:15px system-ui,sans-serif;margin:24px;max-width:640px}#status{font-weight:bold}#details{white-space:pre-wrap}</style></head><body>
|
|
3
|
-
<h1>Chat Loop · Acceptance Clock</h1><p id="status">VERIFYING</p><p id="details">只允许扩展拥有的验收会话:在 RUNNING 时跨越受控边界,或真实已运行20分钟后缩短墙钟测试;不直接发送消息。</p>
|
|
4
|
-
<script src="actions/clock.js"></script></body></html>
|
package/lib/mcp-tools.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"name": "chat_text",
|
|
4
|
-
"description": "Read the text of the single Chat currently owned by Chat Loop Extension. Only when the Extension has an authenticated WAITING_REPLY Owner; returns temp artifact and text, not the clipboard.",
|
|
5
|
-
"inputSchema": {"type":"object","properties":{},"additionalProperties":false},
|
|
6
|
-
"annotations": {"readOnlyHint":true}
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"name": "chat_dom",
|
|
10
|
-
"description": "Read the DOM HTML of the single Chat currently owned by Chat Loop Extension. Requires authenticated Owner; writes a private OS-temp artifact.",
|
|
11
|
-
"inputSchema": {"type":"object","properties":{},"additionalProperties":false},
|
|
12
|
-
"annotations": {"readOnlyHint":true}
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"name": "chat_screenshot",
|
|
16
|
-
"description": "Capture a PNG of the single Chat currently owned by Chat Loop Extension. The tool returns actual image content; this action activates the Chat tab.",
|
|
17
|
-
"inputSchema": {"type":"object","properties":{},"additionalProperties":false},
|
|
18
|
-
"annotations": {"readOnlyHint":false}
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "reload",
|
|
22
|
-
"description": "Request a reload of Chat Loop Extension only, not any other extension. Due to self-reload, receipt can only be ACCEPTED_UNVERIFIED.",
|
|
23
|
-
"inputSchema": {"type":"object","properties":{},"additionalProperties":false},
|
|
24
|
-
"annotations": {"readOnlyHint":false}
|
|
25
|
-
}
|
|
26
|
-
]
|