maka-agent 0.2.0-dev.3.20260830 → 0.2.0-dev.5.20260830

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.
Files changed (66) hide show
  1. package/dist/cli-core.js +1 -0
  2. package/dist/eval-bundle-path.js +1 -1
  3. package/dist/pi-tui-runner.js +3 -1
  4. package/dist/runtime-host-cli.js +37 -3
  5. package/dist/runtime-host-onboarding.js +10 -1
  6. package/dist/runtime-host-peer-mesh-management-command.js +17 -0
  7. package/dist/runtime-host-setup-command.js +33 -15
  8. package/dist/runtime-host-systemd-service.js +9 -3
  9. package/dist/runtime-host-tui-context.js +2 -6
  10. package/native/runtime-host-peer/prebuilds/darwin-arm64/maka_runtime_host_peer.node +0 -0
  11. package/native/runtime-host-peer/prebuilds/linux-arm64/maka_runtime_host_peer.node +0 -0
  12. package/native/runtime-host-peer/prebuilds/linux-x64/maka_runtime_host_peer.node +0 -0
  13. package/native/runtime-host-peer/prebuilds/win32-x64/maka_runtime_host_peer.node +0 -0
  14. package/node_modules/@maka/eval/dist/external-subject.js +1 -1
  15. package/node_modules/@maka/eval/dist/harbor-external-subject.js +2 -2
  16. package/node_modules/@maka/runtime/dist/sandbox/macos-seatbelt.js +68 -9
  17. package/node_modules/@maka/runtime-host/dist/client/peer-client.js +22 -3
  18. package/node_modules/@maka/runtime-host/dist/operator/peer-mesh-management-frame.js +14 -0
  19. package/{packages/eval/dist/index.js → node_modules/@maka/runtime-host/dist/peer-mesh/display-name.js} +12 -10
  20. package/node_modules/@maka/runtime-host/dist/peer-mesh/model.js +32 -21
  21. package/node_modules/@maka/runtime-host/dist/peer-mesh/node.js +207 -47
  22. package/node_modules/@maka/runtime-host/dist/peer-mesh/owner.js +2 -0
  23. package/node_modules/@maka/runtime-host/dist/peer-mesh/store.js +18 -5
  24. package/node_modules/@maka/runtime-host/dist/protocol/index.js +5 -1
  25. package/node_modules/@maka/runtime-host/dist/protocol/peer-mesh.js +59 -2
  26. package/node_modules/@maka/runtime-host/dist/server/access-authority.js +11 -7
  27. package/node_modules/@maka/runtime-host/dist/server/connection-session.js +3 -0
  28. package/node_modules/@maka/runtime-host/dist/server/execution-service.js +1 -0
  29. package/node_modules/@maka/runtime-host/dist/server/host-kernel.js +1 -1
  30. package/node_modules/@maka/runtime-host/dist/server/peer-mesh-authority.js +19 -0
  31. package/package.json +1 -2
  32. package/packages/eval/dist/attempt-store.js +0 -138
  33. package/packages/eval/dist/cli.js +0 -119
  34. package/packages/eval/dist/experiment-directory.js +0 -59
  35. package/packages/eval/dist/experiment.js +0 -49
  36. package/packages/eval/dist/external-subject.js +0 -488
  37. package/packages/eval/dist/harbor-external-subject.js +0 -929
  38. package/packages/eval/dist/harbor-maka-subject.js +0 -83
  39. package/packages/eval/dist/harness-environment.js +0 -80
  40. package/packages/eval/dist/harness-executor.js +0 -1013
  41. package/packages/eval/dist/install-preflight.js +0 -201
  42. package/packages/eval/dist/maka-artifacts.js +0 -126
  43. package/packages/eval/dist/maka-runtime-policy.js +0 -42
  44. package/packages/eval/dist/maka-subject.js +0 -268
  45. package/packages/eval/dist/metering-checkpoint.js +0 -80
  46. package/packages/eval/dist/provider-admission.js +0 -39
  47. package/packages/eval/dist/provider-metering.js +0 -67
  48. package/packages/eval/dist/provider-web-tool-surface.js +0 -74
  49. package/packages/eval/dist/relay-result-frame.js +0 -38
  50. package/packages/eval/dist/result.js +0 -94
  51. package/packages/eval/dist/runner.js +0 -290
  52. package/packages/eval/dist/spec.js +0 -135
  53. package/packages/eval/dist/toolchain-verification.js +0 -130
  54. package/packages/eval/harbor/deepseek-codex-models.json +0 -69
  55. package/packages/eval/harbor/deepseek-harness-profile/cordis.patch.yml +0 -140
  56. package/packages/eval/harbor/deepseek-harness-profile/cordis.yml +0 -18
  57. package/packages/eval/harbor/deepseek-harness-profile/package.json +0 -10
  58. package/packages/eval/harbor/docker-compose-egress-proxy.yaml +0 -57
  59. package/packages/eval/harbor/egress-proxy/Dockerfile +0 -25
  60. package/packages/eval/harbor/egress-proxy/entrypoint.sh +0 -62
  61. package/packages/eval/harbor/egress-proxy/network-policy +0 -148
  62. package/packages/eval/harbor/egress_filter.py +0 -435
  63. package/packages/eval/harbor/eval_framework.py +0 -40
  64. package/packages/eval/harbor/relay_agent.py +0 -686
  65. package/packages/eval/harbor/run_trial.py +0 -223
  66. package/packages/eval/package.json +0 -20
@@ -1,83 +0,0 @@
1
- /*
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
- import { mkdir, writeFile } from 'node:fs/promises';
20
- import { dirname, join } from 'node:path';
21
- import { runHostedExecution } from '@maka/runtime-host/client';
22
- import { captureMakaRuntimeArtifacts, writeMakaArtifactCollectionError } from './maka-artifacts.js';
23
- import { makaEvalRuntimePolicyDocument } from './maka-runtime-policy.js';
24
- import { takeRelayResultToken, writeRelayResult } from './relay-result-frame.js';
25
- const resultToken = takeRelayResultToken();
26
- const payload = JSON.parse(Buffer.from(process.argv[2] ?? '', 'base64url').toString());
27
- const abort = new AbortController();
28
- let artifactCapture = Promise.resolve();
29
- const captureArtifacts = (reason) => {
30
- artifactCapture = artifactCapture.then(async () => {
31
- try {
32
- await captureMakaRuntimeArtifacts({
33
- stateRoot: payload.rootPath,
34
- destinationRoot: payload.artifactRoot,
35
- reason,
36
- });
37
- }
38
- catch (error) {
39
- await writeMakaArtifactCollectionError(payload.artifactRoot, error).catch(() => undefined);
40
- }
41
- });
42
- return artifactCapture;
43
- };
44
- const stop = () => {
45
- abort.abort();
46
- void captureArtifacts('signal');
47
- };
48
- process.once('SIGINT', stop);
49
- process.once('SIGTERM', stop);
50
- const runtimeHome = join(dirname(payload.rootPath), `${process.pid}-home`);
51
- await mkdir(payload.rootPath, { recursive: true });
52
- await mkdir(runtimeHome, { recursive: true, mode: 0o700 });
53
- await writeFile(join(payload.rootPath, 'runtime-policy.json'), `${JSON.stringify(makaEvalRuntimePolicyDocument(process.env.HTTPS_PROXY))}\n`, { flag: 'wx', mode: 0o600 });
54
- process.env.HOME = runtimeHome;
55
- process.env.DEEPSEEK_BASE_URL = payload.baseUrl;
56
- let result;
57
- try {
58
- result = await runHostedExecution({
59
- rootPath: payload.rootPath,
60
- baseUrl: payload.baseUrl,
61
- execution: payload.execution,
62
- signal: abort.signal,
63
- hostSettlementTimeoutMs: payload.hostSettlementTimeoutMs,
64
- });
65
- }
66
- finally {
67
- await captureArtifacts(abort.signal.aborted ? 'signal' : 'settled');
68
- process.removeListener('SIGINT', stop);
69
- process.removeListener('SIGTERM', stop);
70
- }
71
- const failureReason = result.failureReason;
72
- const framedResult = failureReason !== undefined && Buffer.byteLength(failureReason) > 768
73
- ? {
74
- ...result,
75
- failureReason: new TextDecoder().decode(Buffer.from(failureReason).subarray(0, 768)),
76
- }
77
- : result;
78
- writeRelayResult(resultToken, framedResult);
79
- // Same projection as every other wrapper: the exit code reports what this
80
- // process did, so whatever can read only the exit code reads the status the
81
- // frame carries. Nothing decides the subject's fate from it while the frame is
82
- // readable, but the two must not be able to say different things.
83
- process.exitCode = result.kind === 'settled' && result.status === 'completed' ? 0 : 1;
@@ -1,80 +0,0 @@
1
- /*
2
- * Licensed to the Apache Software Foundation (ASF) under one
3
- * or more contributor license agreements. See the NOTICE file
4
- * distributed with this work for additional information
5
- * regarding copyright ownership. The ASF licenses this file
6
- * to you under the Apache License, Version 2.0 (the
7
- * "License"); you may not use this file except in compliance
8
- * with the License. You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing,
13
- * software distributed under the License is distributed on an
14
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
- * KIND, either express or implied. See the License for the
16
- * specific language governing permissions and limitations
17
- * under the License.
18
- */
19
- import { realpath } from 'node:fs/promises';
20
- import { delimiter, dirname, isAbsolute, relative, resolve, sep } from 'node:path';
21
- import { fileURLToPath } from 'node:url';
22
- export const BUNDLED_HARNESS_RELAY_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '../harbor');
23
- export function createHarnessPreparationEnvironment(options) {
24
- const allowed = new Set([
25
- 'HOME',
26
- 'PATH',
27
- 'TMPDIR',
28
- 'TMP',
29
- 'TEMP',
30
- 'LANG',
31
- 'LC_ALL',
32
- 'SSL_CERT_FILE',
33
- 'SSL_CERT_DIR',
34
- 'REQUESTS_CA_BUNDLE',
35
- 'CURL_CA_BUNDLE',
36
- 'XDG_CACHE_HOME',
37
- ...options.declared,
38
- ]);
39
- const credentials = new Set(options.subjectCredentialNames);
40
- const inherited = Object.fromEntries([...allowed].flatMap((name) => {
41
- const value = process.env[name];
42
- return value === undefined || credentials.has(name) ? [] : [[name, value]];
43
- }));
44
- return {
45
- ...inherited,
46
- PYTHONPATH: [BUNDLED_HARNESS_RELAY_ROOT, inherited.PYTHONPATH].filter(Boolean).join(delimiter),
47
- ...(options.egress
48
- ? {
49
- MAKA_EVAL_EGRESS_REQUIRED: '1',
50
- MAKA_EVAL_EGRESS_ALLOWED_HOST: options.egress.allowedHost,
51
- MAKA_EVAL_NETWORK_POLICY_PATH: options.egress.networkPolicyPath,
52
- }
53
- : {}),
54
- };
55
- }
56
- export function resolvePathWithinRoot(root, path, label) {
57
- const resolved = resolve(root, path);
58
- assertPathWithinRoot(root, resolved, label);
59
- return resolved;
60
- }
61
- export async function resolveRealPathWithinRoot(root, path, label) {
62
- const resolved = resolvePathWithinRoot(root, path, label);
63
- let canonicalRoot;
64
- let canonicalPath;
65
- try {
66
- [canonicalRoot, canonicalPath] = await Promise.all([realpath(root), realpath(resolved)]);
67
- }
68
- catch (error) {
69
- const reason = error instanceof Error ? error.message : String(error);
70
- throw new Error(`${label} cannot be resolved: ${reason}`, { cause: error });
71
- }
72
- assertPathWithinRoot(canonicalRoot, canonicalPath, label);
73
- return canonicalPath;
74
- }
75
- function assertPathWithinRoot(root, path, label) {
76
- const fromRoot = relative(root, path);
77
- if (fromRoot === '..' || fromRoot.startsWith(`..${sep}`) || isAbsolute(fromRoot)) {
78
- throw new Error(`${label} escapes its source root`);
79
- }
80
- }