mirror of
https://github.com/apache/maka.git
synced 2026-10-28 08:54:38 +08:00
chore(release): prepare 0.2.2 and correct source packaging (#6148)
Prepare 0.2.2 release metadata and address the source-package review from 0.2.1: keep QuickJS WASM out of the source patch, correct source license references and mixed-origin cursor headers, clarify DISCLAIMER-WIP, and register the installer regression in CI selection. Runtime behavior is unchanged. Desktop, CLI and remote Hosts upgrade together at compatibility epoch 224; the Rust/GPUI preview remains separate. Generated-by: Codex
This commit is contained in:
1 parent
39615e2834
commit
2ddaa74c3a
19 files changed
+223
-62
No files matched your search
@@ -21,6 +21,41 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
## 0.2.2 - Unreleased
|
||||
|
||||
### Added
|
||||
|
||||
- A personal assistant with indexed memory, durable tasks and an inbox bot for coordinating work (#6004, #6124), and durable observation of event waits (#6113).
|
||||
- Import Cursor sessions through their SQLite history adapter (#6039).
|
||||
- Configured external agents in the model picker, alongside unified model and effort options (#6103, #5789).
|
||||
- Automatic rendering and archiving of chat images, and clearer project, task and execution-location controls (#5969, #6088).
|
||||
|
||||
### Fixed
|
||||
|
||||
- Preserve cached replies, new Side Chat sessions and question forms across session switches (#6129, #6111, #5854).
|
||||
- Recover failed message delivery and workspace Skill deletion, retain client tool outcomes, and release settled external executions whose results were rejected (#5058, #6009, #5458, #5823).
|
||||
- Render imported Codex user context without raw envelopes, scope WorkHub tool lookups to the owning turn, and include tool and human evidence in Goal context (#6117, #6096, #6087).
|
||||
- Keep fullscreen editing usable on short terminals, mask fine-grained GitHub tokens, and align connection URL validation with the Host (#6085, #6062, #6098).
|
||||
- Restore image attachments in Codex imports and preserve running tool state when reconnecting (#6118, #6145).
|
||||
- Invalidate deleted Artifact previews, allow new projects without a custom name, and keep conversations centered with classic scrollbars (#5394, #6073, #6102).
|
||||
- Resolve linked-worktree read boundaries through the common Git directory, and initialize vacuum mode when databases are created concurrently (#6105, #6136).
|
||||
- Preserve Windows browser launcher paths and SSH operator arguments, and validate project roots for the target platform (#6121, #6123, #6122).
|
||||
- Source patches no longer include the unchanged QuickJS WebAssembly binary; installation reuses it from the pinned npm dependency. Source verification also rejects Base64-encoded WASM.
|
||||
- Correct stale source-license component and dependency references, preserve the cursor files' upstream MIT scope, and identify the historical 0.2.0 RC1 in DISCLAIMER-WIP.
|
||||
|
||||
### Changed
|
||||
|
||||
- Bound transcript work on session switches and Read line-index memory; allow providers to own reasoning defaults (#5712, #5461, #6092).
|
||||
- Use dedicated directories for projectless tasks and preserve distinct titles for branched sessions (#5966, #4994).
|
||||
- Improve Computer Use cursor positioning and visibility; recover interrupted macOS notarization and validation requests and native Windows PTY exit codes (#5051, #5052, #6125, #6101, #6097, #6094).
|
||||
- Guard packaged dependency contents with a reviewed ledger and document the Linux support baseline (#5455, #6099).
|
||||
|
||||
### Upgrade notes
|
||||
|
||||
- Update Desktop, CLI and remote Runtime Hosts together. The Runtime Host compatibility epoch is 224 (217 in 0.2.1); mismatched peers cannot connect.
|
||||
- Back up configuration and workspace data before upgrading if rollback is needed. This release adds durable assistant and event-wait state; older releases must not reuse data written by a newer Host without a verified downgrade path.
|
||||
- This release continues the TypeScript Runtime Host and Electron desktop. The Rust Host and GPUI desktop remain on the separate `rust-preview` development branch.
|
||||
|
||||
## 0.2.1 - Unreleased
|
||||
|
||||
### Added
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ conditions. What follows is a list of issues the project is currently aware of
|
||||
(this list is likely to be incomplete):
|
||||
|
||||
* The initial-code authorization review remains open at
|
||||
https://github.com/apache/maka/issues/3268. Since RC1, the ASF has recorded
|
||||
https://github.com/apache/maka/issues/3268. Since 0.2.0 RC1, the ASF has recorded
|
||||
the ICLA of contributor Mingqwqqaq, and the Deep Research implementation
|
||||
has been removed. The review still needs to record the authorization basis
|
||||
for the retained initial code; these changes do not establish that an SGA
|
||||
|
||||
@@ -218,7 +218,9 @@ License: Apache-2.0
|
||||
These patches modify the execution time policy and its SDK forwarding. The
|
||||
Apache License, Version 2.0 above applies. The generated run Worker includes
|
||||
embedded third-party code; its upstream notices and license texts are retained
|
||||
in patches/run-2.1.4-notices.md.
|
||||
in patches/run-2.1.4-notices.md. The patch carries no WebAssembly binary:
|
||||
postinstall substitutes the unchanged payload from the installed run package
|
||||
for `__MAKA_RUN_WASM_BASE64__` before applying the patch.
|
||||
|
||||
Vercel AI SDK
|
||||
|
||||
@@ -240,7 +242,7 @@ License, Version 2.0 above applies to the adapted material.
|
||||
The pinned versions are the ones present when the adaptation was made. The
|
||||
adapted declarations are unchanged through @ai-sdk/provider-utils 5.0.25 and
|
||||
@ai-sdk/provider 4.0.7, the versions recorded by the code origin audit. Maka
|
||||
also redistributes a patch against @ai-sdk/provider-utils 5.0.40; that patch
|
||||
also redistributes a patch against @ai-sdk/provider-utils 5.0.51; that patch
|
||||
modifies Apache-2.0 source and is covered by the license reproduced above.
|
||||
|
||||
Astryx
|
||||
@@ -622,6 +624,9 @@ License: MIT
|
||||
adaptations of this component.
|
||||
The following MIT License applies to that material:
|
||||
|
||||
Maka-authored modifications are licensed under the Apache License, Version 2.0
|
||||
reproduced above; the upstream portions retain the MIT terms below.
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 Cua AI, Inc.
|
||||
@@ -809,8 +814,7 @@ Desktop renderer vendored source assets
|
||||
|
||||
The source archive includes third-party SVG paths and source assets from
|
||||
Lobe Icons (MIT), LocalAI (MIT), Simple Icons (CC0-1.0), TDesign Icons (MIT),
|
||||
MingCute (Apache-2.0), Allogo (MIT), Ant Design Icons (MIT), and Semi Design
|
||||
(MIT), used by the desktop renderer. Their file-by-file inventory, immutable upstream revisions,
|
||||
MingCute (Apache-2.0), and Allogo (MIT), used by the desktop renderer. Their file-by-file inventory, immutable upstream revisions,
|
||||
copyright notices, and license texts are in:
|
||||
|
||||
apps/desktop/src/renderer/public/THIRD_PARTY_LICENSES.txt
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "@maka/desktop",
|
||||
"productName": "Maka",
|
||||
"description": "A local-first agent workspace built for real work.",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"author": "The Maka Authors",
|
||||
"license": "Apache-2.0",
|
||||
"homepage": "https://github.com/apache/maka",
|
||||
|
||||
@@ -1,20 +1,8 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
* Portions Copyright (c) 2025 Cua AI, Inc.
|
||||
* Adapted from trycua/cua cursor-overlay under the MIT License.
|
||||
* Maka modifications are licensed under Apache-2.0.
|
||||
* See the repository-root LICENSE for both license texts.
|
||||
*/
|
||||
|
||||
// Maka's agent-cursor renderer.
|
||||
|
||||
@@ -1,26 +1,12 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
* Portions Copyright (c) 2025 Cua AI, Inc.
|
||||
* Adapted from trycua/cua cursor-overlay under the MIT License.
|
||||
* Maka modifications are licensed under Apache-2.0.
|
||||
* See the repository-root LICENSE for both license texts.
|
||||
*/
|
||||
|
||||
// Agent-cursor colour palettes — faithful 1:1 port of trycua/cua's
|
||||
// cursor-overlay/src/palette.rs (itself a port of AgentCursorPalette.cs).
|
||||
// Colours are [R,G,B] 0-255. The overlay picks a palette from the session id so
|
||||
// distinct agent runs are visually distinct but a given id is stable.
|
||||
// Palette shape adapted from cursor-overlay/src/palette.rs.
|
||||
// Maka uses one brand palette; colours are [R,G,B] in 0-255.
|
||||
export type Rgb = readonly [number, number, number];
|
||||
|
||||
export interface Palette {
|
||||
|
||||
Generated
+4
-4
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "maka",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "maka",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"workspaces": [
|
||||
@@ -44,7 +44,7 @@
|
||||
},
|
||||
"apps/desktop": {
|
||||
"name": "@maka/desktop",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@jackwener/opencli": "1.8.8",
|
||||
@@ -17261,7 +17261,7 @@
|
||||
},
|
||||
"packages/cli": {
|
||||
"name": "maka-agent",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "1.5.0",
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "maka",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"license": "Apache-2.0",
|
||||
"private": true,
|
||||
"engines": {
|
||||
@@ -72,7 +72,7 @@
|
||||
"release:asf:source": "node scripts/asf-source-release.mjs create",
|
||||
"release:asf:verify": "node scripts/asf-source-release.mjs verify",
|
||||
"release:asf:sign": "node scripts/asf-source-release.mjs sign",
|
||||
"check:asf-source": "npm run check:model-metadata && node --test scripts/asf-source-release.test.mjs scripts/asf-source-workflow-policy.test.mjs scripts/asf-license-headers.test.mjs scripts/model-metadata-upkeep-workflow-policy.test.mjs scripts/source-legal-inventory.test.mjs scripts/sync-model-metadata.test.mjs",
|
||||
"check:asf-source": "npm run check:model-metadata && node --test scripts/apply-dependency-patches.test.mjs scripts/asf-source-release.test.mjs scripts/asf-source-workflow-policy.test.mjs scripts/asf-license-headers.test.mjs scripts/model-metadata-upkeep-workflow-policy.test.mjs scripts/source-legal-inventory.test.mjs scripts/sync-model-metadata.test.mjs",
|
||||
"check:asf-npm": "node --test scripts/asf-npm-workflow-policy.test.mjs",
|
||||
"check:product-release-identity": "node scripts/product-release-identity.mjs",
|
||||
"package:cli:macos-arm64": "node scripts/package-macos-arm64-cli.mjs",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "maka-agent",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"license": "Apache-2.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
|
||||
+1
-2
@@ -73,8 +73,7 @@ To rebuild, check out upstream `vercel-labs/run` tag `run@2.1.4`
|
||||
package and regenerate with `node node_modules/patch-package/index.js run`.
|
||||
Copy the patched package manifest as well, and pass `--exclude '^$'` when
|
||||
regenerating so patch-package includes that manifest change.
|
||||
The large generated hunk is the inline Worker with unchanged embedded WASM;
|
||||
`run-2.1.4-notices.md` retains its embedded dependency notices.
|
||||
Before committing the regenerated patch, replace the unchanged Base64 WASM payload in both inline Worker diff lines with `__MAKA_RUN_WASM_BASE64__`. `scripts/apply-dependency-patches.mjs` restores that payload from the installed `run@2.1.4` package into a temporary patch directory during postinstall. Run `npm run check:asf-source` to verify the source-only patch and installation; the source verifier rejects embedded WASM. `run-2.1.4-notices.md` retains its embedded dependency notices.
|
||||
|
||||
Remove both patches and the run override when published versions support the
|
||||
same execution budget semantics. Regression coverage lives in
|
||||
|
||||
@@ -138,8 +138,8 @@ index df1fc01..254a45b 100644
|
||||
+++ b/node_modules/run/dist/runtime/worker-source.js
|
||||
@@ -1,2 +1,2 @@
|
||||
// This file is generated by scripts/embed-inline-worker.mjs.
|
||||
-export const INLINE_RUN_WORKER_SOURCE = "globalThis.__RUN_QUICKJS_WASM_BASE64__ = \"AGFzbQEAAAAB8QZuYAN/f38Bf2AEf35/fwF+YAJ/fwBgAn9/AX9gAX8Bf2ADf39/AGAFf35/f38BfmAEf39/fwF/YAJ/fgF+YAF/AGABfAF8YAJ/fgBgAn9+AX9gAn9/AX5gA39/fwF+YAN/f34Bf2AGf35/f39/AX5gAX4Bf2ADf35/AGADf35/AX5gBX9/f39/AX9gA39+fwF/YAABf2AEf39/fwF+YAN/fn4BfmAGf35+f39/AX5gA39+fgF/YAZ/f39/f38Bf2AEf39/fwBgBH9/fn8Bf2ABfwF+YAJ8fAF8YAR/f39+AX9gBX9/f39/AX5gBX9+fn9/AX5gAABgBX9/f39/AGAFf35/fn8Bf2ACfn8Bf2AEf35/fwF/YAd/fn9+fn5/AX9gBX9+fn5/AX9gBn9+f35+fwF/YAF+AX5gBX9/fn5/AGAIf39/f39/f38Bf2ACfn8AYAN/f34AYAZ/f39/f38BfmAEf35+fgF+YAJ+fgF/YAR/fn9/AGAIf35/f39/f38BfmAHf39/f39/fwF+YAF/AXxgBH9+f34Bf2AEf35+fgF/YAJ8fwF8YAV/f35/fwF/YAR/f35/AGAHf39/f39/fwF/YAJ/fAF+YAR/fn9+AX5gBH9+fn8Bf2ADfn5/AX9gA39/fgF+YAV/f35+fwF/YAF8AX9gBH9/fn4Bf2AFf35+f38AYAV/f39+fwF/YAZ/fn5+fn8Bf2AAAX5gBX9+f39/AX9gAn9/AXxgCX9/f39/f39/fwF/YAd/f39/f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NfdXNhYmxlX3NpemUA9wIKanNfc3RybmR1cACJBAlqc19zdHJkdXAAhAQGc3RybGVuAIUCDkpTX05ld1J1bnRpbWUyAKYEEUpTX1VwZGF0ZVN0YWNrVG9wAN4EDkpTX0ZyZWVSdW50aW1lAK8EE0pTX0dldFJ1bnRpbWVPcGFxdWUA3wQTSlNfU2V0UnVudGltZU9wYXF1ZQDgBBZKU19BZGRSdW50aW1lRmluYWxpemVyAOEEDUpTX05ld1J1bnRpbWUA4gQRSlNfU2V0TWVtb3J5TGltaXQA6wQPSlNfU2V0RHVtcEZsYWdzAOwED0pTX0dldER1bXBGbGFncwDtBBFKU19HZXRHQ1RocmVzaG9sZADuBBFKU19TZXRHQ1RocmVzaG9sZADvBBZKU19TZXRJbnRlcnJ1cHRIYW5kbGVyAPAEDkpTX1NldENhbkJsb2NrAPEEIEpTX1NldFNoYXJlZEFycmF5Qn
Line truncated
|
||||
-export const INLINE_RUN_WORKER_SOURCE = "globalThis.__RUN_QUICKJS_WASM_BASE64__ = \"__MAKA_RUN_WASM_BASE64__\";\n\nimport{writeSync as ot}from\"node:fs\";import{formatWithOptions as it}from\"node:util\";import{parentPort as M}from\"node:worker_threads\";function Ie(t){return{clock_time_get(i,a,l){let u=t(),c=new DataView(u.buffer);if(i===0||i===1){let f=BigInt(Date.now())*1000000n;return c.setBigUint64(l,f,!0),0}return 52},fd_write(i,a,l,u){let c=t(),f=new DataView(c.buffer),d=new Uint8Array(c.buffer),_=0;if(i!==1&&i!==2)return 8;for(let m=0;m<l;m++){let g=f.getUint32(a+m*8,!0),b=f.getUint32(a+m*8+4,!0),E=d.slice(g,g+b),y=new TextDecoder().decode(E);i===1?typeof process<\"u\"&&process.stdout?process.stdout.write(y):console.log(y):typeof process<\"u\"&&process.stderr?process.stderr.write(y):console.error(y),_+=b}return f.setUint32(u,_,!0),0},fd_close(i){return 52},fd_fdstat_get(i,a){let l=t(),u=new DataView(l.buffer);return i===1||i===2?(u.setUint8(a,2),u.setUint16(a+2,0,!0),u.setBigUint64(a+8,0n,!0),u.setBigUint64(a+16,0n,!0),0):8},fd_seek(i,a,l,u){return 52},random_get(i,a){let l=t(),u=new Uint8Array(l.buffer,i,a);if(typeof crypto<\"u\"&&crypto.getRandomValues)crypto.getRandomValues(u);else for(let c=0;c<a;c++)u[c]=Math.floor(Math.random()*256);return 0}}}var ct=new TextDecoder;function ut(t,e){let r=new Uint8Array(t.buffer),n=e;for(;r[n]!==0;)n++;if(n===e)return{};let s=ct.decode(r.slice(e,n)),o={};for(let i of s.split(`\n`)){let a=i.indexOf(\"=\");a>0&&(o[i.slice(0,a)]=i.slice(a+1))}return o}function lt(t,e){let r=`qjs_ext_${t.name.replace(/-/g,\"_\")}_versions`,n=t.instance.exports[r];if(typeof n!=\"function\")return;let s=n();if(s!==0)return ut(e,s)}function T(t,e){let r=0,n=0;for(;e.value<t.length;){let s=t[e.value++];if(r|=(s&127)<<n,(s&128)===0)break;n+=7}return r}function ft(t){let e=WebAssembly.Module.customSections(t,\"dylink.0\");if(e.length===0)return null;let r=new Uint8Array(e[0]),n={value:0},s={memorySize:0,memoryAlignment:0,tableSize:0,tableAlignment:0,needed:[]};for(;n.value<r.length;){let o=T(r,n),i=T(r,n),a=n.value+i;if(o===1)s.memorySize=T(r,n),s.memoryAlignment=T(r,n),s.tableSize=T(r,n),s.tableAlignment=T(r,n);else if(o===2){let l=T(r,n);for(let u=0;u<l;u++){let c=T(r,n),f=new TextDecoder().decode(r.slice(n.value,n.value+c));n.value+=c,s.needed.push(f)}}n.value=a}return s}async function ye(t,e,r,n,s,o){let i;t.wasm instanceof WebAssembly.Module?i=t.wasm:i=await WebAssembly.compile(t.wasm);let a=ft(i);if(!a)throw new Error(`Extension \"${t.name}\" is not a WASM shared library (missing dylink.0 section)`);let l=e.memory,u=e.__indirect_function_table,c=e.__stack_pointer,f=e.malloc;if(!l)throw new Error(\"Main module does not export memory\");if(!u)throw new Error(\"Main module does not export __indirect_function_table\");if(!f)throw new Error(\"Main module does not export malloc\");let d,_;if(o)d=o.memoryBase,_=o.tableBase;else if(a.memorySize>0){if(d=f(a.memorySize),d===0)throw new Error(`Failed to allocate ${a.memorySize} bytes for extension \"${t.name}\"`);new Uint8Array(l.buffer,d,a.memorySize).fill(0)}else d=0;o?(_=o.tableBase,_+a.tableSize>u.length&&u.grow(_+a.tableSize-u.length)):(_=u.length,a.tableSize>0&&u.grow(a.tableSize));let m=WebAssembly.Module.imports(i),g={env:{},\"GOT.mem\":{},\"GOT.func\":{}};if(m.some(h=>h.module===\"wasi_snapshot_preview1\")){let h=t.wasi&&s?t.wasi(s):void 0;g.wasi_snapshot_preview1={...r,...h,...n}}let E=new Set(WebAssembly.Module.exports(i).filter(h=>h.kind===\"function\").map(h=>h.name)),y=new Set;for(let h of m)if(h.module===\"env\"){if(h.name===\"memory\"&&h.kind===\"memory\")g.env.memory=l;else if(h.name===\"__indirect_function_table\"&&h.kind===\"table\")g.env.__indirect_function_table=u;else if(h.name===\"__memory_base\"&&h.kind===\"global\")g.env.__memory_base=new WebAssembly.Global({value:\"i32\",mutable:!1},d);else if(h.name===\"__table_base\"&&h.kind===\"global\")g.env.__table_base=new WebAssembly.Global({value:\"i32\",mutable:!1},_);else if(h.name===\"__stack_pointer\"&&h.kind===\"global\")g.env.__stack_pointer=c;else if(h.kind===\"function\"){let v=e[h.name];v&&typeof v==\"function\"?g.env[h.name]=v:(y.add(h.name),g.env[h.name]=()=>{throw new Error(`Extension \"${t.name}\" called unresolved symbol: env.${h.name}`)})}else if(h.kind===\"global\"){let v=e[h.name];v instanceof WebAssembly.Global?g.env[h.name]=v:g.env[h.name]=new WebAssembly.Global({value:\"i32\",mutable:!0},0)}}else if(h.module===\"GOT.mem\"&&h.kind===\"global\")g[\"GOT.mem\"][h.name]=new WebAssembly.Global({value:\"i32\",mutable:!0},0);else if(h.module===\"GOT.func\"&&h.kind===\"global\"){let v=e[h.name];if(v&&typeof v==\"function\"){let ee=u.length;u.grow(1),u.set(ee,v),g[\"GOT.func\"][h.name]=new WebAssembly.Global({value:\"i32\",mutable:!0},ee)}else g[\"GOT.func\"][h.name]=new WebAssembly.Global({value:\"i32\",mutable:!0},0)}let w=[...y].filter(h=>E.has(h)),O={};for(let h of w){let v={target:null};O[h]=v,g.env[h]=(...ee)=>{if(!v.target)throw new Error(`Extension \"${t.n
Line truncated
|
||||
+export const INLINE_RUN_WORKER_SOURCE = "globalThis.__RUN_QUICKJS_WASM_BASE64__ = \"__MAKA_RUN_WASM_BASE64__\";\n\nimport{writeSync as it}from\"node:fs\";import{formatWithOptions as at}from\"node:util\";import{parentPort as J}from\"node:worker_threads\";function ke(t){return{clock_time_get(i,a,u){let l=t(),c=new DataView(l.buffer);if(i===0||i===1){let f=BigInt(Date.now())*1000000n;return c.setBigUint64(u,f,!0),0}return 52},fd_write(i,a,u,l){let c=t(),f=new DataView(c.buffer),d=new Uint8Array(c.buffer),_=0;if(i!==1&&i!==2)return 8;for(let m=0;m<u;m++){let g=f.getUint32(a+m*8,!0),R=f.getUint32(a+m*8+4,!0),j=d.slice(g,g+R),w=new TextDecoder().decode(j);i===1?typeof process<\"u\"&&process.stdout?process.stdout.write(w):console.log(w):typeof process<\"u\"&&process.stderr?process.stderr.write(w):console.error(w),_+=R}return f.setUint32(l,_,!0),0},fd_close(i){return 52},fd_fdstat_get(i,a){let u=t(),l=new DataView(u.buffer);return i===1||i===2?(l.setUint8(a,2),l.setUint16(a+2,0,!0),l.setBigUint64(a+8,0n,!0),l.setBigUint64(a+16,0n,!0),0):8},fd_seek(i,a,u,l){return 52},random_get(i,a){let u=t(),l=new Uint8Array(u.buffer,i,a);if(typeof crypto<\"u\"&&crypto.getRandomValues)crypto.getRandomValues(l);else for(let c=0;c<a;c++)l[c]=Math.floor(Math.random()*256);return 0}}}var lt=new TextDecoder;function ft(t,e){let r=new Uint8Array(t.buffer),n=e;for(;r[n]!==0;)n++;if(n===e)return{};let s=lt.decode(r.slice(e,n)),o={};for(let i of s.split(`\n`)){let a=i.indexOf(\"=\");a>0&&(o[i.slice(0,a)]=i.slice(a+1))}return o}function dt(t,e){let r=`qjs_ext_${t.name.replace(/-/g,\"_\")}_versions`,n=t.instance.exports[r];if(typeof n!=\"function\")return;let s=n();if(s!==0)return ft(e,s)}function U(t,e){let r=0,n=0;for(;e.value<t.length;){let s=t[e.value++];if(r|=(s&127)<<n,(s&128)===0)break;n+=7}return r}function pt(t){let e=WebAssembly.Module.customSections(t,\"dylink.0\");if(e.length===0)return null;let r=new Uint8Array(e[0]),n={value:0},s={memorySize:0,memoryAlignment:0,tableSize:0,tableAlignment:0,needed:[]};for(;n.value<r.length;){let o=U(r,n),i=U(r,n),a=n.value+i;if(o===1)s.memorySize=U(r,n),s.memoryAlignment=U(r,n),s.tableSize=U(r,n),s.tableAlignment=U(r,n);else if(o===2){let u=U(r,n);for(let l=0;l<u;l++){let c=U(r,n),f=new TextDecoder().decode(r.slice(n.value,n.value+c));n.value+=c,s.needed.push(f)}}n.value=a}return s}async function ye(t,e,r,n,s,o){let i;t.wasm instanceof WebAssembly.Module?i=t.wasm:i=await WebAssembly.compile(t.wasm);let a=pt(i);if(!a)throw new Error(`Extension \"${t.name}\" is not a WASM shared library (missing dylink.0 section)`);let u=e.memory,l=e.__indirect_function_table,c=e.__stack_pointer,f=e.malloc;if(!u)throw new Error(\"Main module does not export memory\");if(!l)throw new Error(\"Main module does not export __indirect_function_table\");if(!f)throw new Error(\"Main module does not export malloc\");let d,_;if(o)d=o.memoryBase,_=o.tableBase;else if(a.memorySize>0){if(d=f(a.memorySize),d===0)throw new Error(`Failed to allocate ${a.memorySize} bytes for extension \"${t.name}\"`);new Uint8Array(u.buffer,d,a.memorySize).fill(0)}else d=0;o?(_=o.tableBase,_+a.tableSize>l.length&&l.grow(_+a.tableSize-l.length)):(_=l.length,a.tableSize>0&&l.grow(a.tableSize));let m=WebAssembly.Module.imports(i),g={env:{},\"GOT.mem\":{},\"GOT.func\":{}};if(m.some(p=>p.module===\"wasi_snapshot_preview1\")){let p=t.wasi&&s?t.wasi(s):void 0;g.wasi_snapshot_preview1={...r,...p,...n}}let j=new Set(WebAssembly.Module.exports(i).filter(p=>p.kind===\"function\").map(p=>p.name)),w=new Set;for(let p of m)if(p.module===\"env\"){if(p.name===\"memory\"&&p.kind===\"memory\")g.env.memory=u;else if(p.name===\"__indirect_function_table\"&&p.kind===\"table\")g.env.__indirect_function_table=l;else if(p.name===\"__memory_base\"&&p.kind===\"global\")g.env.__memory_base=new WebAssembly.Global({value:\"i32\",mutable:!1},d);else if(p.name===\"__table_base\"&&p.kind===\"global\")g.env.__table_base=new WebAssembly.Global({value:\"i32\",mutable:!1},_);else if(p.name===\"__stack_pointer\"&&p.kind===\"global\")g.env.__stack_pointer=c;else if(p.kind===\"function\"){let x=e[p.name];x&&typeof x==\"function\"?g.env[p.name]=x:(w.add(p.name),g.env[p.name]=()=>{throw new Error(`Extension \"${t.name}\" called unresolved symbol: env.${p.name}`)})}else if(p.kind===\"global\"){let x=e[p.name];x instanceof WebAssembly.Global?g.env[p.name]=x:g.env[p.name]=new WebAssembly.Global({value:\"i32\",mutable:!0},0)}}else if(p.module===\"GOT.mem\"&&p.kind===\"global\")g[\"GOT.mem\"][p.name]=new WebAssembly.Global({value:\"i32\",mutable:!0},0);else if(p.module===\"GOT.func\"&&p.kind===\"global\"){let x=e[p.name];if(x&&typeof x==\"function\"){let v=l.length;l.grow(1),l.set(v,x),g[\"GOT.func\"][p.name]=new WebAssembly.Global({value:\"i32\",mutable:!0},v)}else g[\"GOT.func\"][p.name]=new WebAssembly.Global({value:\"i32\",mutable:!0},0)}let E=[...w].filter(p=>j.has(p)),y={};for(let p of E){let x={target:null};y[p]=x,g.env[p]=(...v)=>{if(!x.target)throw new Error(`Extension \"${t.name}
Line truncated
|
||||
diff --git a/node_modules/run/dist/utils/options.js b/node_modules/run/dist/utils/options.js
|
||||
index f6f32a5..436849c 100644
|
||||
--- a/node_modules/run/dist/utils/options.js
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
`run` embeds the `devalue` serializer and a QuickJS WebAssembly runtime built by the
|
||||
[`quickjs-wasi`](https://github.com/vercel-labs/quickjs-wasi) project.
|
||||
The following packages are used to build the published JavaScript and embedded
|
||||
WebAssembly artifact:
|
||||
The source patch includes the generated JavaScript changes, but no WebAssembly
|
||||
binary. During postinstall, `scripts/apply-dependency-patches.mjs` replaces
|
||||
`__MAKA_RUN_WASM_BASE64__` with the unchanged payload from the installed `run`
|
||||
package. The following packages build that dependency's JavaScript and runtime:
|
||||
|
||||
| Package | Version | License |
|
||||
| -------------- | ------- | ------- |
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
// lane runs a plain root `npm ci`, and an unpatched tree turns
|
||||
// packages/runtime/src/__tests__/model-factory-tool-call-index.test.ts red.
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import { existsSync, readdirSync } from 'node:fs';
|
||||
import { existsSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
|
||||
import { createRequire } from 'node:module';
|
||||
import { dirname, join } from 'node:path';
|
||||
import { dirname, join, relative } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const repoRoot = dirname(dirname(fileURLToPath(import.meta.url)));
|
||||
@@ -55,8 +55,34 @@ try {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const result = spawnSync(process.execPath, [patchPackageEntry, '--error-on-fail'], {
|
||||
cwd: repoRoot,
|
||||
stdio: 'inherit',
|
||||
});
|
||||
process.exit(result.status ?? 1);
|
||||
let temporaryPatches;
|
||||
try {
|
||||
const runPatchName = 'run+2.1.4.patch';
|
||||
const runPatchPath = join(patchesDirectory, runPatchName);
|
||||
const runPatch = existsSync(runPatchPath) ? readFileSync(runPatchPath, 'utf8') : '';
|
||||
const marker = '__MAKA_RUN_WASM_BASE64__';
|
||||
if (runPatch.includes(marker)) {
|
||||
// The patch changes worker code, not WASM. Reuse the npm package's binary
|
||||
// during installation so the source distribution carries only the changes.
|
||||
const worker = readFileSync(
|
||||
join(repoRoot, 'node_modules/run/dist/runtime/worker-source.js'),
|
||||
'utf8',
|
||||
);
|
||||
const wasm = /__RUN_QUICKJS_WASM_BASE64__ = \\"([A-Za-z0-9+/=]+)\\";/u.exec(worker)?.[1];
|
||||
if (!wasm) throw new Error('Cannot find the installed run 2.1.4 QuickJS payload');
|
||||
temporaryPatches = mkdtempSync(join(repoRoot, 'node_modules/.maka-patches-'));
|
||||
for (const name of readdirSync(patchesDirectory).filter((name) => name.endsWith('.patch'))) {
|
||||
const contents =
|
||||
name === runPatchName
|
||||
? runPatch.replaceAll(marker, wasm)
|
||||
: readFileSync(join(patchesDirectory, name), 'utf8');
|
||||
writeFileSync(join(temporaryPatches, name), contents);
|
||||
}
|
||||
}
|
||||
const arguments_ = [patchPackageEntry, '--error-on-fail'];
|
||||
if (temporaryPatches) arguments_.push('--patch-dir', relative(repoRoot, temporaryPatches));
|
||||
const result = spawnSync(process.execPath, arguments_, { cwd: repoRoot, stdio: 'inherit' });
|
||||
process.exitCode = result.status ?? 1;
|
||||
} finally {
|
||||
if (temporaryPatches) rmSync(temporaryPatches, { recursive: true, force: true });
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
import assert from 'node:assert/strict';
|
||||
import { spawnSync } from 'node:child_process';
|
||||
import {
|
||||
cpSync,
|
||||
mkdirSync,
|
||||
mkdtempSync,
|
||||
readFileSync,
|
||||
rmSync,
|
||||
symlinkSync,
|
||||
writeFileSync,
|
||||
} from 'node:fs';
|
||||
import { createRequire } from 'node:module';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { dirname, join } from 'node:path';
|
||||
import { test } from 'node:test';
|
||||
|
||||
test('postinstall reuses installed WASM while applying source-only patches, including a repeat', () => {
|
||||
const root = mkdtempSync(join(tmpdir(), 'maka-patches-'));
|
||||
try {
|
||||
mkdirSync(join(root, 'scripts'));
|
||||
mkdirSync(join(root, 'patches'));
|
||||
mkdirSync(join(root, 'node_modules/run/dist/runtime'), { recursive: true });
|
||||
cpSync(
|
||||
join(import.meta.dirname, 'apply-dependency-patches.mjs'),
|
||||
join(root, 'scripts/apply-dependency-patches.mjs'),
|
||||
);
|
||||
symlinkSync(
|
||||
dirname(createRequire(import.meta.url).resolve('patch-package/package.json')),
|
||||
join(root, 'node_modules/patch-package'),
|
||||
'dir',
|
||||
);
|
||||
writeFileSync(join(root, 'package.json'), '{"name":"patch-fixture","version":"1.0.0"}');
|
||||
writeFileSync(join(root, 'node_modules/run/package.json'), '{"name":"run","version":"2.1.4"}');
|
||||
const wasm = Buffer.from([0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00]).toString('base64');
|
||||
const source = (payload, code) =>
|
||||
`export const INLINE_RUN_WORKER_SOURCE = ${JSON.stringify(`globalThis.__RUN_QUICKJS_WASM_BASE64__ = "${payload}";\n${code}`)};\n`;
|
||||
const workerPath = join(root, 'node_modules/run/dist/runtime/worker-source.js');
|
||||
writeFileSync(workerPath, source(wasm, 'original'));
|
||||
const patch = [
|
||||
'diff --git a/node_modules/run/dist/runtime/worker-source.js b/node_modules/run/dist/runtime/worker-source.js',
|
||||
'--- a/node_modules/run/dist/runtime/worker-source.js',
|
||||
'+++ b/node_modules/run/dist/runtime/worker-source.js',
|
||||
'@@ -1 +1 @@',
|
||||
`-${source('__MAKA_RUN_WASM_BASE64__', 'original').trimEnd()}`,
|
||||
`+${source('__MAKA_RUN_WASM_BASE64__', 'patched').trimEnd()}`,
|
||||
'',
|
||||
].join('\n');
|
||||
const patchPath = join(root, 'patches/run+2.1.4.patch');
|
||||
writeFileSync(patchPath, patch);
|
||||
for (let attempt = 0; attempt < 2; attempt++) {
|
||||
const result = spawnSync(process.execPath, ['scripts/apply-dependency-patches.mjs'], {
|
||||
cwd: root,
|
||||
encoding: 'utf8',
|
||||
});
|
||||
assert.equal(result.status, 0, result.stdout + result.stderr);
|
||||
assert.equal(readFileSync(workerPath, 'utf8'), source(wasm, 'patched'));
|
||||
assert.equal(readFileSync(patchPath, 'utf8'), patch);
|
||||
}
|
||||
} finally {
|
||||
rmSync(root, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
@@ -212,6 +212,8 @@ export const exclusionRules = [
|
||||
'packages/runtime/src/model-protocol.ts',
|
||||
'packages/eval/harbor/deepseek-harness-profile/cordis.patch.yml',
|
||||
'packages/ui/src/astryx-chat-reasoning.tsx',
|
||||
'apps/desktop/src/renderer/computer-use-overlay/engine/palette.ts',
|
||||
'apps/desktop/src/renderer/computer-use-overlay/engine/cursor-engine.ts',
|
||||
)(path) ||
|
||||
isUnder('apps/desktop/src/renderer/assets/provider-brands', '.svg')(path) ||
|
||||
isUnder('patches', '.patch')(path),
|
||||
@@ -354,6 +356,10 @@ const reviewedProvenance = new Map([
|
||||
'scripts/generate-runtime-host-peer-notices.mjs',
|
||||
'Maka-authored generator that emits upstream copyright lines into the Runtime Host peer notices. The copyright it names is its output, not its own.',
|
||||
],
|
||||
[
|
||||
'scripts/source-legal-inventory.test.mjs',
|
||||
'Legal inventory tests quote upstream copyright and license notices to check their preservation.',
|
||||
],
|
||||
[
|
||||
'scripts/sync-model-metadata.mjs',
|
||||
'Maka-authored generator that writes the models.dev attribution into the header of the catalog it generates. The copyright it names is its output, not its own.',
|
||||
|
||||
@@ -626,6 +626,11 @@ function validateNonTextInputs(candidateRoot, identity, entries) {
|
||||
if (compiledFormat) {
|
||||
throw new Error(`Compiled artifact ${entry} has forbidden ${compiledFormat} content`);
|
||||
}
|
||||
for (const match of contents.toString('utf8').matchAll(/\bAGFzbQ[A-Za-z0-9+/]{4,}={0,2}/gu)) {
|
||||
if (compiledArtifactFormat(Buffer.from(match[0], 'base64')) === 'WASM') {
|
||||
throw new Error(`Compiled artifact ${entry} has forbidden Base64 WASM content`);
|
||||
}
|
||||
}
|
||||
try {
|
||||
const text = decoder.decode(contents);
|
||||
const basename = entry.slice(entry.lastIndexOf('/') + 1);
|
||||
|
||||
@@ -191,6 +191,21 @@ describe('ASF source release verification', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('rejects WASM encoded inside a textual dependency patch', async () => {
|
||||
const wasm = Buffer.from([0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00]);
|
||||
const fixture = createFixtureCandidate({
|
||||
'patches/worker.patch': `+const wasm = "${wasm.toString('base64')}";\n`,
|
||||
});
|
||||
try {
|
||||
await assert.rejects(
|
||||
() => verifySourceCandidate({ archivePath: fixture.archivePath }),
|
||||
/Compiled artifact.*worker\.patch.*Base64 WASM/,
|
||||
);
|
||||
} finally {
|
||||
fixture.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('rejects compiled artifacts regardless of their file extension', async () => {
|
||||
const formats = new Map([
|
||||
['ELF', Buffer.from([0x7f, 0x45, 0x4c, 0x46])],
|
||||
|
||||
@@ -159,6 +159,8 @@ const ASF_SOURCE_FILES = new Set([
|
||||
'docs/code-origin-audit.md',
|
||||
'package.json',
|
||||
'packages/eval/harbor/deepseek-harness-profile/cordis.patch.yml',
|
||||
'scripts/apply-dependency-patches.mjs',
|
||||
'scripts/apply-dependency-patches.test.mjs',
|
||||
'scripts/asf-license-headers.mjs',
|
||||
'scripts/asf-license-headers.test.mjs',
|
||||
'scripts/asf-source-release.mjs',
|
||||
|
||||
@@ -52,6 +52,18 @@ test('mixed-origin DeepSeek profile carries both scopes without a whole-file ASF
|
||||
assert.doesNotMatch(profile, /Licensed to the Apache Software Foundation \(ASF\)/);
|
||||
});
|
||||
|
||||
test('mixed-origin cursor files retain the upstream MIT scope without a whole-file ASF claim', async () => {
|
||||
for (const name of ['palette.ts', 'cursor-engine.ts']) {
|
||||
const contents = await readFile(
|
||||
join(root, 'apps/desktop/src/renderer/computer-use-overlay/engine', name),
|
||||
'utf8',
|
||||
);
|
||||
assert.match(contents, /Copyright \(c\) 2025 Cua AI, Inc\./);
|
||||
assert.match(contents, /MIT License/);
|
||||
assert.doesNotMatch(contents, /Licensed to the Apache Software Foundation \(ASF\)/);
|
||||
}
|
||||
});
|
||||
|
||||
test('PawWork browser provenance is pinned to the confirmed transfer boundary', async () => {
|
||||
const audit = await readFile(join(root, 'docs/code-origin-audit.md'), 'utf8');
|
||||
const section = audit
|
||||
|
||||
Reference in new issue
Block a user