@centralu/win32-x64 0.1.0-beta.9
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/Centralu/centralu.exe +0 -0
- package/Centralu/resources/host/app-template/AGENTS.md +87 -0
- package/Centralu/resources/host/app-template/CLAUDE.md +1 -0
- package/Centralu/resources/host/app-template/centralu.app.json +9 -0
- package/Centralu/resources/host/app-template/gitattributes +2 -0
- package/Centralu/resources/host/app-template/runtime/THIRD_PARTY_LICENSES.txt +950 -0
- package/Centralu/resources/host/app-template/runtime/centralu-app-runtime.mjs +82 -0
- package/Centralu/resources/host/app-template/runtime/centralu-app-runtime.mjs.map +1 -0
- package/Centralu/resources/host/app-template/runtime/mcp-app.js +104 -0
- package/Centralu/resources/host/app-template/server.mjs +71 -0
- package/Centralu/resources/host/app-template/ui/index.html +74 -0
- package/Centralu/resources/host/bundle-info.json +8 -0
- package/Centralu/resources/host/codex-orchestrator-bridge.mjs +3858 -0
- package/Centralu/resources/host/main.mjs +111374 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/binding.js +62 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/darwin-arm64.js +3 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/darwin-x64.js +3 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/database.js +109 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/index.js +3 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/linux-arm64.js +3 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/linux-x64.js +3 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/linuxmusl-arm64.js +4 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/linuxmusl-x64.js +4 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/methods/aggregate.js +43 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/methods/backup.js +67 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/methods/explain.js +9 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/methods/function.js +31 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/methods/inspect.js +7 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/methods/pragma.js +12 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/methods/serialize.js +16 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/methods/table.js +195 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/methods/transaction.js +78 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/methods/wrappers.js +54 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/sqlite-error.js +25 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/util.js +12 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/win32-arm64.js +3 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/lib/win32-x64.js +3 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/package.json +67 -0
- package/Centralu/resources/host/node_modules/better-sqlite3/prebuilds/win32-x64.node +0 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/conpty_console_list_agent.js +16 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/conpty_console_list_agent.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/eventEmitter2.js +47 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/eventEmitter2.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/eventEmitter2.test.js +30 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/eventEmitter2.test.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/index.js +52 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/index.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/interfaces.js +7 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/interfaces.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/shared/conout.js +11 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/shared/conout.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/terminal.js +190 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/terminal.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/terminal.test.js +139 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/terminal.test.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/testUtils.test.js +28 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/testUtils.test.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/types.js +7 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/types.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/unixTerminal.js +346 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/unixTerminal.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/unixTerminal.test.js +351 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/unixTerminal.test.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/utils.js +39 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/utils.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/windowsConoutConnection.js +125 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/windowsConoutConnection.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/windowsPtyAgent.js +320 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/windowsPtyAgent.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/windowsPtyAgent.test.js +90 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/windowsPtyAgent.test.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/windowsTerminal.js +199 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/windowsTerminal.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/windowsTerminal.test.js +219 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/windowsTerminal.test.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/worker/conoutSocketWorker.js +22 -0
- package/Centralu/resources/host/node_modules/node-pty/lib/worker/conoutSocketWorker.js.map +1 -0
- package/Centralu/resources/host/node_modules/node-pty/package.json +64 -0
- package/Centralu/resources/host/node_modules/node-pty/prebuilds/win32-x64/conpty.node +0 -0
- package/Centralu/resources/host/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
- package/Centralu/resources/host/node_modules/node-pty/prebuilds/win32-x64/pty.node +0 -0
- package/Centralu/resources/host/schema.sql +94 -0
- package/README.md +12 -0
- package/package.json +21 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// {{APP_NAME}} — this app's MCP server. Centralu starts it (`node server.mjs`, stdio) when it is first
|
|
2
|
+
// needed and restarts it after the builder's turn when this folder changed.
|
|
3
|
+
// Edit this file and ui/index.html freely. Never edit runtime/ (generated by Centralu).
|
|
4
|
+
// Read AGENTS.md for the rules.
|
|
5
|
+
import { McpServer, serveStdio, z, centralu } from './runtime/centralu-app-runtime.mjs'
|
|
6
|
+
|
|
7
|
+
const UI = 'ui://{{APP_ID}}/index.html'
|
|
8
|
+
|
|
9
|
+
// State lives in the server, and is saved in the app's data folder (outside this folder, so it is
|
|
10
|
+
// never committed). The screen only shows it. It survives restarts because it is read back here.
|
|
11
|
+
const state = await centralu.readJson('state.json', { count: 0 })
|
|
12
|
+
const save = () => centralu.writeJson('state.json', state)
|
|
13
|
+
const current = () => ({ content: [{ type: 'text', text: `count = ${state.count}` }], structuredContent: { count: state.count } })
|
|
14
|
+
|
|
15
|
+
serveStdio(() => {
|
|
16
|
+
const server = new McpServer({ name: '{{APP_ID}}', version: '0.1.0' }, { capabilities: { tools: {}, resources: {} } })
|
|
17
|
+
|
|
18
|
+
centralu.uiResource(server, 'main-screen', UI, new URL('./ui/index.html', import.meta.url))
|
|
19
|
+
|
|
20
|
+
// The home tool (centralu.app.json "home"): Centralu calls it to open the app's screen. It only reads,
|
|
21
|
+
// so it says readOnlyHint: true — the screen calls it on every refresh, and a read must not trigger one.
|
|
22
|
+
centralu.tool(
|
|
23
|
+
server,
|
|
24
|
+
'show',
|
|
25
|
+
{
|
|
26
|
+
title: 'Show the count',
|
|
27
|
+
description: 'Open the screen and return the current count.',
|
|
28
|
+
inputSchema: z.object({}),
|
|
29
|
+
annotations: { readOnlyHint: true },
|
|
30
|
+
_meta: { ui: { resourceUri: UI } },
|
|
31
|
+
},
|
|
32
|
+
async () => current(),
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
// Changes state, so it says readOnlyHint: false. Agents and the screen can both call it.
|
|
36
|
+
centralu.tool(
|
|
37
|
+
server,
|
|
38
|
+
'increment',
|
|
39
|
+
{
|
|
40
|
+
title: 'Increment',
|
|
41
|
+
description: 'Add to the count (default 1) and return the new count.',
|
|
42
|
+
inputSchema: z.object({ by: z.number().int().default(1).describe('How much to add') }),
|
|
43
|
+
annotations: { readOnlyHint: false },
|
|
44
|
+
},
|
|
45
|
+
async ({ by }) => {
|
|
46
|
+
state.count += by
|
|
47
|
+
await save()
|
|
48
|
+
return current()
|
|
49
|
+
},
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
// Only the screen may call this one (visibility: ['app']); agents never see it.
|
|
53
|
+
centralu.tool(
|
|
54
|
+
server,
|
|
55
|
+
'reset',
|
|
56
|
+
{
|
|
57
|
+
title: 'Reset',
|
|
58
|
+
description: 'Set the count back to 0.',
|
|
59
|
+
inputSchema: z.object({}),
|
|
60
|
+
annotations: { readOnlyHint: false, destructiveHint: true },
|
|
61
|
+
_meta: { ui: { visibility: ['app'] } },
|
|
62
|
+
},
|
|
63
|
+
async () => {
|
|
64
|
+
state.count = 0
|
|
65
|
+
await save()
|
|
66
|
+
return current()
|
|
67
|
+
},
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
return server
|
|
71
|
+
})
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>{{APP_NAME}}</title>
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
margin: 16px;
|
|
9
|
+
font: 14px var(--font-sans, system-ui, sans-serif);
|
|
10
|
+
color: var(--color-text-primary, #e8e8e8);
|
|
11
|
+
background: transparent;
|
|
12
|
+
}
|
|
13
|
+
.count { font-size: 32px; font-variant-numeric: tabular-nums; margin-bottom: 12px; }
|
|
14
|
+
button {
|
|
15
|
+
font: inherit;
|
|
16
|
+
color: inherit;
|
|
17
|
+
background: var(--color-background-tertiary, #2a2a2a);
|
|
18
|
+
border: 1px solid var(--color-border-primary, #3a3a3a);
|
|
19
|
+
border-radius: 6px;
|
|
20
|
+
padding: 4px 12px;
|
|
21
|
+
cursor: pointer;
|
|
22
|
+
}
|
|
23
|
+
.error { color: #e06c6c; margin-top: 8px; white-space: pre-wrap; }
|
|
24
|
+
</style>
|
|
25
|
+
</head>
|
|
26
|
+
<body>
|
|
27
|
+
<div class="count" id="count">…</div>
|
|
28
|
+
<button id="increment">+1</button>
|
|
29
|
+
<button id="reset">Reset</button>
|
|
30
|
+
<div class="error" id="error"></div>
|
|
31
|
+
|
|
32
|
+
<!-- Centralu replaces this tag with the MCP App bridge (runtime/mcp-app.js). Keep it. -->
|
|
33
|
+
<script src="centralu:mcp-app.js"></script>
|
|
34
|
+
<script>
|
|
35
|
+
// The screen holds no state of its own: it shows what the server says, and asks again when
|
|
36
|
+
// Centralu says the app's state changed (someone — the person or an agent — called a tool).
|
|
37
|
+
const app = new McpApp.App({ name: '{{APP_ID}}', version: '0.1.0' })
|
|
38
|
+
const $ = (id) => document.getElementById(id)
|
|
39
|
+
|
|
40
|
+
function show(result) {
|
|
41
|
+
$('error').textContent = result?.isError ? (result.content ?? []).map((c) => c.text ?? '').join('\n') : ''
|
|
42
|
+
const count = result?.structuredContent?.count
|
|
43
|
+
if (count !== undefined) $('count').textContent = String(count)
|
|
44
|
+
}
|
|
45
|
+
async function call(name, args = {}) {
|
|
46
|
+
try {
|
|
47
|
+
show(await app.callServerTool({ name, arguments: args }))
|
|
48
|
+
} catch (e) {
|
|
49
|
+
$('error').textContent = String(e?.message ?? e)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const reread = () => call('show')
|
|
53
|
+
|
|
54
|
+
// Match the host's theme (MCP Apps host context). The page's colors, and the backdrop a browser
|
|
55
|
+
// paints behind a frame whose color scheme differs from its host's, then agree with Centralu's.
|
|
56
|
+
const theme = (ctx) => {
|
|
57
|
+
if (ctx?.theme) document.documentElement.style.colorScheme = ctx.theme
|
|
58
|
+
}
|
|
59
|
+
app.onhostcontextchanged = theme
|
|
60
|
+
|
|
61
|
+
app.ontoolresult = (params) => show(params)
|
|
62
|
+
// Centralu's own notification (not part of the MCP Apps standard): the app's state changed.
|
|
63
|
+
app.fallbackNotificationHandler = async (n) => {
|
|
64
|
+
if (n.method === 'centralu/notifications/changed') await reread()
|
|
65
|
+
}
|
|
66
|
+
$('increment').onclick = () => call('increment', { by: 1 })
|
|
67
|
+
$('reset').onclick = () => call('reset')
|
|
68
|
+
app.connect().then(() => {
|
|
69
|
+
theme(app.getHostContext())
|
|
70
|
+
return reread()
|
|
71
|
+
})
|
|
72
|
+
</script>
|
|
73
|
+
</body>
|
|
74
|
+
</html>
|