@zogien/agent-sdk-win32-arm64 0.0.0-stage → 0.15.0-fork.1
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/LICENSE +21 -0
- package/README.md +40 -2
- package/bin/metacodes-fs-helper.exe +0 -0
- package/bin/rg.exe +0 -0
- package/bin/ripgrep-LICENSE-MIT +21 -0
- package/bindings/rust/Cargo.lock +7 -0
- package/bindings/rust/Cargo.toml +10 -0
- package/bindings/rust/build.rs +143 -0
- package/bindings/rust/examples/link_probe.rs +82 -0
- package/bindings/rust/link.cfg +3 -0
- package/bindings/rust/src/lib.rs +832 -0
- package/bindings/rust/src/raw.rs +2492 -0
- package/bindings/zig/build.zig +141 -0
- package/bindings/zig/build.zig.zon +8 -0
- package/bindings/zig/src/protocol.zig +2271 -0
- package/bindings/zig/src/root.zig +607 -0
- package/bindings/zig/src/types.zig +1731 -0
- package/include/metask/agentcore.h +1512 -0
- package/lib/metask_agentcore.dll +0 -0
- package/lib/metask_agentcore.lib +0 -0
- package/manifest.json +145 -0
- package/package.json +27 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 metask-ai and the metacodes contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# metask-agentcore 0.15.0-fork.1
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Target: `aarch64-windows-msvc`
|
|
4
|
+
Producer Zig target: `aarch64-windows.win10...win11_dt-msvc`
|
|
5
|
+
Required Cargo target: `aarch64-pc-windows-msvc`
|
|
6
|
+
Source commit: `0300c892c26ffe24fe1ceb88494bae9bbf212d55`
|
|
7
|
+
|
|
8
|
+
C and C++ consumers include `<metask/agentcore.h>` and link the static library in `lib/`.
|
|
9
|
+
Zig consumers use the package in `bindings/zig` and import `metask_agentcore`.
|
|
10
|
+
Rust consumers use the raw `metask-agentcore-sys` crate in `bindings/rust`.
|
|
11
|
+
Hosts that load a library at run time (Python `ctypes`, Node FFI, JNA, .NET P/Invoke) load
|
|
12
|
+
`lib/metask_agentcore.dll` and resolve `metask_agentcore_get_api`, its only ABI export.
|
|
13
|
+
`shared_library` in `manifest.json` records its path, load name and the system libraries it
|
|
14
|
+
needs; keep it loaded while any Runtime it created exists.
|
|
15
|
+
|
|
16
|
+
`bin/rg.exe` is the manifest-pinned ripgrep 15.2.0 runtime asset (upstream official release
|
|
17
|
+
binary, MIT OR Unlicense; MIT text at `bin/ripgrep-LICENSE-MIT`, declaration in
|
|
18
|
+
`runtime_assets` in `manifest.json`). The built-in `Glob`/`Grep` tools execute
|
|
19
|
+
through it, and Runtime creation refuses to advertise them when no ripgrep
|
|
20
|
+
resolves. Deploy it next to your Host executable — that location is probed
|
|
21
|
+
automatically — or point the `RG_BIN` environment variable at it; installations
|
|
22
|
+
on `PATH` also resolve.
|
|
23
|
+
|
|
24
|
+
`bin/metacodes-fs-helper` (`.exe` on Windows) is the trusted native filesystem
|
|
25
|
+
executor, built from this same revision and pinned in `files`. For sandboxed
|
|
26
|
+
file tools on Linux/macOS, deploy it next to the Host executable or set
|
|
27
|
+
`METACODES_SANDBOX_HELPER` to its absolute path. An enabled sandbox refuses
|
|
28
|
+
the operation if the helper or platform backend cannot run; it never opens
|
|
29
|
+
the target on the Host as a fallback. Windows has no sandbox backend.
|
|
30
|
+
|
|
31
|
+
The ABI is experimental and requires an exact revision match. Ownership, lifetime, concurrency,
|
|
32
|
+
and failure contracts are defined by `doc/AGENTCORE_BINARY_ABI.md` at the source commit above.
|
|
33
|
+
Revision 28 of ABI v1 exposes one 80-byte root plus 7 mandatory tables (`runtime`, `session`, `session_control`, `skill`, `mcp`, `goal`, `team`).
|
|
34
|
+
It has no capability negotiation and no independent public Completion client.
|
|
35
|
+
A Session may carry a prompt profile (Host edits of the named system-prompt sections, with
|
|
36
|
+
governance sections locked) and per-Run context blocks; see the ABI document.
|
|
37
|
+
The public header and bindings expose the complete Skill catalog resource contract: 16 MiB per
|
|
38
|
+
file, 32 MiB/1024 files/4096 entries per Skill, 64 MiB/16384 files/1024 slots per catalog,
|
|
39
|
+
65536 traversal entries, depth 64, 4096-byte relative paths, a 4 MiB descriptor, and
|
|
40
|
+
256 MiB of retained catalog snapshots per Runtime. `invalid_resource` issues carry a typed
|
|
41
|
+
reason; a single invalid Skill degrades the catalog without removing valid siblings.
|
|
Binary file
|
package/bin/rg.exe
ADDED
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Andrew Gallant
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
use std::env;
|
|
2
|
+
use std::fs;
|
|
3
|
+
use std::path::PathBuf;
|
|
4
|
+
|
|
5
|
+
fn main() {
|
|
6
|
+
if let Err(error) = configure() {
|
|
7
|
+
panic!("metask-agentcore-sys: {error}");
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
fn configure() -> Result<(), String> {
|
|
12
|
+
println!("cargo:rerun-if-env-changed=METASK_AGENTCORE_BUNDLE_DIR");
|
|
13
|
+
let manifest_dir = PathBuf::from(required_env("CARGO_MANIFEST_DIR")?);
|
|
14
|
+
let bundle_root = match env::var_os("METASK_AGENTCORE_BUNDLE_DIR") {
|
|
15
|
+
Some(path) => PathBuf::from(path),
|
|
16
|
+
None => manifest_dir.join("../.."),
|
|
17
|
+
};
|
|
18
|
+
let config_path = bundle_root.join("bindings/rust/link.cfg");
|
|
19
|
+
println!("cargo:rerun-if-changed={}", config_path.display());
|
|
20
|
+
let config = fs::read_to_string(&config_path)
|
|
21
|
+
.map_err(|error| format!("cannot read {}: {error}", config_path.display()))?;
|
|
22
|
+
let cargo_target = required_env("TARGET")?;
|
|
23
|
+
let link_directives = parse_link_config(&config, &cargo_target)?;
|
|
24
|
+
|
|
25
|
+
let library_file = if cargo_target.contains("windows") {
|
|
26
|
+
"metask_agentcore.lib"
|
|
27
|
+
} else {
|
|
28
|
+
"libmetask_agentcore.a"
|
|
29
|
+
};
|
|
30
|
+
let library_path = bundle_root.join("lib").join(library_file);
|
|
31
|
+
if !library_path.is_file() {
|
|
32
|
+
return Err(format!("missing static library {}", library_path.display()));
|
|
33
|
+
}
|
|
34
|
+
println!("cargo:rerun-if-changed={}", library_path.display());
|
|
35
|
+
// The bundle's lib/ also ships the shared library for FFI Hosts. Given
|
|
36
|
+
// `-lmetask_agentcore`, Apple ld picks the .dylib over the .a in the same
|
|
37
|
+
// directory, so this crate's own unit-test binary linked it dynamically
|
|
38
|
+
// and failed to load it at run time (dependents were unaffected: rustc
|
|
39
|
+
// bundles the archive into the rlib). Search a directory that holds only
|
|
40
|
+
// the archive. Windows links the exact `.lib` filename and needs no copy.
|
|
41
|
+
let search_dir = if cargo_target.contains("windows") {
|
|
42
|
+
library_path.parent().unwrap().to_path_buf()
|
|
43
|
+
} else {
|
|
44
|
+
let out_dir = PathBuf::from(required_env("OUT_DIR")?);
|
|
45
|
+
let archive = out_dir.join(library_file);
|
|
46
|
+
fs::copy(&library_path, &archive).map_err(|error| {
|
|
47
|
+
format!(
|
|
48
|
+
"cannot copy {} to {}: {error}",
|
|
49
|
+
library_path.display(),
|
|
50
|
+
archive.display()
|
|
51
|
+
)
|
|
52
|
+
})?;
|
|
53
|
+
out_dir
|
|
54
|
+
};
|
|
55
|
+
println!("cargo:rustc-link-search=native={}", search_dir.display());
|
|
56
|
+
// Unix bundles already use the conventional `lib<name>.a` spelling, so
|
|
57
|
+
// pass the logical library name. Using `+verbatim` there makes the crate's
|
|
58
|
+
// own unit-test link emit `-llibmetask_agentcore.a` on Apple ld. Windows
|
|
59
|
+
// bundles deliberately publish the exact `.lib` filename instead.
|
|
60
|
+
if cargo_target.contains("windows") {
|
|
61
|
+
println!("cargo:rustc-link-lib=static:+verbatim={library_file}");
|
|
62
|
+
} else {
|
|
63
|
+
println!("cargo:rustc-link-lib=static=metask_agentcore");
|
|
64
|
+
}
|
|
65
|
+
for (kind, name) in link_directives {
|
|
66
|
+
match kind {
|
|
67
|
+
"library" => println!("cargo:rustc-link-lib={name}"),
|
|
68
|
+
"framework" => println!("cargo:rustc-link-lib=framework={name}"),
|
|
69
|
+
_ => unreachable!(),
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
Ok(())
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
fn required_env(name: &str) -> Result<String, String> {
|
|
76
|
+
env::var(name).map_err(|_| format!("required environment variable {name} is missing"))
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
fn parse_link_config<'a>(
|
|
80
|
+
config: &'a str,
|
|
81
|
+
cargo_target: &str,
|
|
82
|
+
) -> Result<Vec<(&'a str, &'a str)>, String> {
|
|
83
|
+
let mut lines = config.lines();
|
|
84
|
+
let bundle_target = lines
|
|
85
|
+
.next()
|
|
86
|
+
.and_then(|line| line.strip_prefix("target="))
|
|
87
|
+
.filter(|target| valid_name(target))
|
|
88
|
+
.ok_or_else(|| "invalid or missing target in bindings/rust/link.cfg".to_owned())?;
|
|
89
|
+
if cargo_target != bundle_target {
|
|
90
|
+
return Err(format!(
|
|
91
|
+
"bundle target mismatch: Cargo TARGET={cargo_target}, bundle target={bundle_target}"
|
|
92
|
+
));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
let mut directives = Vec::new();
|
|
96
|
+
for (index, line) in lines.enumerate() {
|
|
97
|
+
let (kind, name) = line
|
|
98
|
+
.split_once('=')
|
|
99
|
+
.filter(|(_, name)| valid_name(name))
|
|
100
|
+
.ok_or_else(|| format!("invalid link.cfg line {}", index + 2))?;
|
|
101
|
+
match kind {
|
|
102
|
+
"library" | "framework" => directives.push((kind, name)),
|
|
103
|
+
_ => return Err(format!("unknown link.cfg directive {kind}")),
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
Ok(directives)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
fn valid_name(value: &str) -> bool {
|
|
110
|
+
!value.is_empty()
|
|
111
|
+
&& value
|
|
112
|
+
.bytes()
|
|
113
|
+
.all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'_' | b'-' | b'.'))
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
#[cfg(test)]
|
|
117
|
+
mod tests {
|
|
118
|
+
use super::*;
|
|
119
|
+
|
|
120
|
+
#[test]
|
|
121
|
+
fn accepts_target_and_link_directives() {
|
|
122
|
+
assert!(parse_link_config(
|
|
123
|
+
"target=x86_64-pc-windows-msvc\nlibrary=advapi32\nlibrary=crypt32\n",
|
|
124
|
+
"x86_64-pc-windows-msvc",
|
|
125
|
+
)
|
|
126
|
+
.is_ok());
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
#[test]
|
|
130
|
+
fn rejects_wrong_target_and_malformed_directives() {
|
|
131
|
+
assert!(parse_link_config("target=aarch64-apple-darwin\n", "x86_64-apple-darwin").is_err());
|
|
132
|
+
assert!(parse_link_config(
|
|
133
|
+
"target=x86_64-apple-darwin\nunknown=value\n",
|
|
134
|
+
"x86_64-apple-darwin"
|
|
135
|
+
)
|
|
136
|
+
.is_err());
|
|
137
|
+
assert!(parse_link_config(
|
|
138
|
+
"target=x86_64-apple-darwin\nlibrary=bad name\n",
|
|
139
|
+
"x86_64-apple-darwin"
|
|
140
|
+
)
|
|
141
|
+
.is_err());
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
fn main() {
|
|
2
|
+
let api = metask_agentcore_sys::Api::discover()
|
|
3
|
+
.expect("AgentCore Revision 28 exact discovery failed");
|
|
4
|
+
let output = api.owned_buffer();
|
|
5
|
+
assert!(output
|
|
6
|
+
.as_bytes()
|
|
7
|
+
.expect("empty output is canonical")
|
|
8
|
+
.is_empty());
|
|
9
|
+
assert_eq!(
|
|
10
|
+
unsafe { (*api.as_raw()).abi_revision },
|
|
11
|
+
metask_agentcore_sys::METASK_AGENTCORE_ABI_REVISION
|
|
12
|
+
);
|
|
13
|
+
let raw = unsafe { &*api.as_raw() };
|
|
14
|
+
let runtime = unsafe { &*raw.runtime };
|
|
15
|
+
let session = unsafe { &*raw.session };
|
|
16
|
+
let session_control = unsafe { &*raw.session_control };
|
|
17
|
+
let skill = unsafe { &*raw.skill };
|
|
18
|
+
let mcp = unsafe { &*raw.mcp };
|
|
19
|
+
let goal = unsafe { &*raw.goal };
|
|
20
|
+
let team = unsafe { &*raw.team };
|
|
21
|
+
|
|
22
|
+
macro_rules! assert_slot {
|
|
23
|
+
($safe:expr, $raw:expr) => {
|
|
24
|
+
assert_eq!($safe.unwrap() as usize, $raw.unwrap() as usize)
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
assert_slot!(api.buffer_release(), raw.buffer_release);
|
|
29
|
+
assert_slot!(api.runtime().create(), runtime.create);
|
|
30
|
+
assert_slot!(api.runtime().destroy(), runtime.destroy);
|
|
31
|
+
assert_slot!(api.session().create(), session.create);
|
|
32
|
+
assert_slot!(api.session().destroy(), session.destroy);
|
|
33
|
+
assert_slot!(api.session().run_input(), session.run_input);
|
|
34
|
+
assert_slot!(api.session().abort(), session.abort);
|
|
35
|
+
assert_slot!(api.session().submit_input(), session.submit_input);
|
|
36
|
+
assert_slot!(api.session().update_credential(), session.update_credential);
|
|
37
|
+
assert_slot!(api.session_control().restore(), session_control.restore);
|
|
38
|
+
assert_slot!(api.session_control().describe(), session_control.describe);
|
|
39
|
+
assert_slot!(api.session_control().set_model(), session_control.set_model);
|
|
40
|
+
assert_slot!(
|
|
41
|
+
api.session_control().update_permission_rules(),
|
|
42
|
+
session_control.update_permission_rules
|
|
43
|
+
);
|
|
44
|
+
assert_slot!(api.session_control().compact(), session_control.compact);
|
|
45
|
+
assert_slot!(
|
|
46
|
+
api.session_control().abort_compact(),
|
|
47
|
+
session_control.abort_compact
|
|
48
|
+
);
|
|
49
|
+
assert_slot!(
|
|
50
|
+
api.session_control().export_checkpoint(),
|
|
51
|
+
session_control.export_checkpoint
|
|
52
|
+
);
|
|
53
|
+
assert_slot!(
|
|
54
|
+
api.session_control().rewind_to_user_message(),
|
|
55
|
+
session_control.rewind_to_user_message
|
|
56
|
+
);
|
|
57
|
+
assert_slot!(api.skill().resolve_catalog(), skill.resolve_catalog);
|
|
58
|
+
assert_slot!(api.skill().release_catalog(), skill.release_catalog);
|
|
59
|
+
assert_slot!(api.skill().bind_policy(), skill.bind_policy);
|
|
60
|
+
assert_slot!(api.mcp().apply_configuration(), mcp.apply_configuration);
|
|
61
|
+
assert_slot!(api.mcp().refresh(), mcp.refresh);
|
|
62
|
+
assert_slot!(api.mcp().describe(), mcp.describe);
|
|
63
|
+
assert_slot!(api.mcp().update_selection(), mcp.update_selection);
|
|
64
|
+
assert_slot!(api.goal().get(), goal.get);
|
|
65
|
+
assert_slot!(api.goal().set(), goal.set);
|
|
66
|
+
assert_slot!(api.goal().update(), goal.update);
|
|
67
|
+
assert_slot!(api.goal().clear(), goal.clear);
|
|
68
|
+
assert_slot!(api.team().describe(), team.describe);
|
|
69
|
+
assert_slot!(api.team().poll(), team.poll);
|
|
70
|
+
assert!(unsafe {
|
|
71
|
+
metask_agentcore_sys::metask_agentcore_get_api(
|
|
72
|
+
metask_agentcore_sys::METASK_AGENTCORE_ABI_V1 + 1,
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
.is_null());
|
|
76
|
+
let mut prior_revision = unsafe { *api.as_raw() };
|
|
77
|
+
prior_revision.abi_revision = metask_agentcore_sys::METASK_AGENTCORE_ABI_REVISION - 1;
|
|
78
|
+
assert!(matches!(
|
|
79
|
+
unsafe { metask_agentcore_sys::Api::from_raw(&prior_revision) },
|
|
80
|
+
Err(metask_agentcore_sys::AbiError::UnsupportedAbi)
|
|
81
|
+
));
|
|
82
|
+
}
|