@alisio/core 0.1.0-alpha.10
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 +25 -0
- package/dist/application.d.ts +225 -0
- package/dist/application.js +950 -0
- package/dist/config.d.ts +481 -0
- package/dist/config.js +592 -0
- package/dist/core/compaction.d.ts +136 -0
- package/dist/core/compaction.js +404 -0
- package/dist/core/contracts.d.ts +147 -0
- package/dist/core/contracts.js +1 -0
- package/dist/core/registry.d.ts +8 -0
- package/dist/core/registry.js +54 -0
- package/dist/core/runner.d.ts +160 -0
- package/dist/core/runner.js +625 -0
- package/dist/extensions/registry.d.ts +28 -0
- package/dist/extensions/registry.js +58 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +28 -0
- package/dist/integrations/herdr.d.ts +34 -0
- package/dist/integrations/herdr.js +174 -0
- package/dist/mcp/connector.d.ts +65 -0
- package/dist/mcp/connector.js +423 -0
- package/dist/plugins/host.d.ts +169 -0
- package/dist/plugins/host.js +585 -0
- package/dist/plugins/install.d.ts +100 -0
- package/dist/plugins/install.js +322 -0
- package/dist/providers/openai-compatible.d.ts +14 -0
- package/dist/providers/openai-compatible.js +228 -0
- package/dist/providers/registry.d.ts +35 -0
- package/dist/providers/registry.js +74 -0
- package/dist/providers/routing.d.ts +11 -0
- package/dist/providers/routing.js +41 -0
- package/dist/providers/settings.d.ts +30 -0
- package/dist/providers/settings.js +80 -0
- package/dist/resources/context.d.ts +44 -0
- package/dist/resources/context.js +171 -0
- package/dist/resources/prompts.d.ts +77 -0
- package/dist/resources/prompts.js +182 -0
- package/dist/resources/skills.d.ts +82 -0
- package/dist/resources/skills.js +214 -0
- package/dist/runtime/fs.d.ts +9 -0
- package/dist/runtime/fs.js +73 -0
- package/dist/runtime/modules.d.ts +16 -0
- package/dist/runtime/modules.js +83 -0
- package/dist/runtime/paths.d.ts +4 -0
- package/dist/runtime/paths.js +42 -0
- package/dist/runtime/process.d.ts +25 -0
- package/dist/runtime/process.js +122 -0
- package/dist/runtime/sqlite.d.ts +3 -0
- package/dist/runtime/sqlite.js +85 -0
- package/dist/runtime/store.d.ts +38 -0
- package/dist/runtime/store.js +259 -0
- package/dist/sessions/children.d.ts +55 -0
- package/dist/sessions/children.js +233 -0
- package/dist/startup/index.d.ts +41 -0
- package/dist/startup/index.js +105 -0
- package/dist/startup/mascot.d.ts +6 -0
- package/dist/startup/mascot.js +30 -0
- package/dist/startup/screen.d.ts +18 -0
- package/dist/startup/screen.js +117 -0
- package/dist/startup/text.d.ts +19 -0
- package/dist/startup/text.js +68 -0
- package/dist/tools/execute.d.ts +16 -0
- package/dist/tools/execute.js +96 -0
- package/dist/tools/search.d.ts +69 -0
- package/dist/tools/search.js +232 -0
- package/dist/tools/standard.d.ts +22 -0
- package/dist/tools/standard.js +419 -0
- package/dist/tools/webfetch.d.ts +26 -0
- package/dist/tools/webfetch.js +119 -0
- package/dist/trust.d.ts +34 -0
- package/dist/trust.js +113 -0
- package/dist/version.d.ts +7 -0
- package/dist/version.js +26 -0
- package/package.json +62 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type WebfetchFormat = "markdown" | "text" | "html";
|
|
2
|
+
export declare const MAX_RESPONSE_BYTES: number;
|
|
3
|
+
export declare const MAX_TIMEOUT_SECONDS = 120;
|
|
4
|
+
export declare const DEFAULT_TIMEOUT_SECONDS = 30;
|
|
5
|
+
/** Characters embedded directly in the tool result before the rest is only available via `read_file`. */
|
|
6
|
+
export declare const MAX_EMBEDDED_CHARS = 20000;
|
|
7
|
+
export declare function isTextualContentType(contentType: string): boolean;
|
|
8
|
+
export interface WebfetchResult {
|
|
9
|
+
url: string;
|
|
10
|
+
status: number;
|
|
11
|
+
contentType: string;
|
|
12
|
+
format: WebfetchFormat;
|
|
13
|
+
content: string;
|
|
14
|
+
truncated: boolean;
|
|
15
|
+
/** Present only when `truncated`: a workspace-relative path with the full converted text, readable via `read_file`. */
|
|
16
|
+
fullTextPath?: string;
|
|
17
|
+
bytes: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetches `url` and returns it as text/markdown/html. Redirects are followed by `fetch` itself
|
|
21
|
+
* (capped at the runtime's own default, ~20 hops). Non-textual responses (images, binaries) are
|
|
22
|
+
* refused with a clear error rather than returned as garbage. When the converted text is larger
|
|
23
|
+
* than `MAX_EMBEDDED_CHARS`, the full text is written to a workspace-scoped cache file
|
|
24
|
+
* (`.alisio/cache/webfetch/<hash>.<ext>`) so a follow-up `read_file` is never lossy.
|
|
25
|
+
*/
|
|
26
|
+
export declare function webfetch(workspace: string, url: string, format: WebfetchFormat | undefined, timeoutSeconds: number | undefined, signal: AbortSignal): Promise<WebfetchResult>;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `webfetch`: read a URL as text/markdown/html. Node-native `fetch` only (no extra HTTP client
|
|
3
|
+
* dependency); HTML conversion uses `turndown` (a small, widely used converter whose only runtime
|
|
4
|
+
* dependency is `@mixmark-io/domino`, a pure-JS DOM implementation — no jsdom, no headless
|
|
5
|
+
* browser). This mirrors the vetted approach opencode itself uses for the same job.
|
|
6
|
+
*/
|
|
7
|
+
import { createHash } from "node:crypto";
|
|
8
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
|
+
import domino from "@mixmark-io/domino";
|
|
11
|
+
import TurndownService from "turndown";
|
|
12
|
+
import { safePath } from "../runtime/paths.js";
|
|
13
|
+
export const MAX_RESPONSE_BYTES = 5 * 1024 * 1024; // 5 MiB, matching the size cap other well-known fetch tools use.
|
|
14
|
+
export const MAX_TIMEOUT_SECONDS = 120;
|
|
15
|
+
export const DEFAULT_TIMEOUT_SECONDS = 30;
|
|
16
|
+
/** Characters embedded directly in the tool result before the rest is only available via `read_file`. */
|
|
17
|
+
export const MAX_EMBEDDED_CHARS = 20_000;
|
|
18
|
+
const TEXTUAL_TYPES = new Set([
|
|
19
|
+
"application/json",
|
|
20
|
+
"application/xml",
|
|
21
|
+
"application/xhtml+xml",
|
|
22
|
+
"application/javascript",
|
|
23
|
+
"application/atom+xml",
|
|
24
|
+
"application/rss+xml",
|
|
25
|
+
]);
|
|
26
|
+
export function isTextualContentType(contentType) {
|
|
27
|
+
const type = contentType.split(";")[0]?.trim().toLowerCase() ?? "";
|
|
28
|
+
return type.startsWith("text/") || TEXTUAL_TYPES.has(type);
|
|
29
|
+
}
|
|
30
|
+
function htmlToMarkdown(html) {
|
|
31
|
+
const turndown = new TurndownService({
|
|
32
|
+
headingStyle: "atx",
|
|
33
|
+
bulletListMarker: "-",
|
|
34
|
+
codeBlockStyle: "fenced",
|
|
35
|
+
});
|
|
36
|
+
turndown.remove(["script", "style", "noscript", "meta", "link"]);
|
|
37
|
+
return turndown.turndown(html).trim();
|
|
38
|
+
}
|
|
39
|
+
function htmlToText(html) {
|
|
40
|
+
const document = domino.createDocument(html);
|
|
41
|
+
for (const el of [...document.querySelectorAll("script, style, noscript")])
|
|
42
|
+
el.remove();
|
|
43
|
+
const text = document.body?.textContent ?? document.documentElement?.textContent ?? "";
|
|
44
|
+
return text
|
|
45
|
+
.split("\n")
|
|
46
|
+
.map((l) => l.trim())
|
|
47
|
+
.filter(Boolean)
|
|
48
|
+
.join("\n");
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Fetches `url` and returns it as text/markdown/html. Redirects are followed by `fetch` itself
|
|
52
|
+
* (capped at the runtime's own default, ~20 hops). Non-textual responses (images, binaries) are
|
|
53
|
+
* refused with a clear error rather than returned as garbage. When the converted text is larger
|
|
54
|
+
* than `MAX_EMBEDDED_CHARS`, the full text is written to a workspace-scoped cache file
|
|
55
|
+
* (`.alisio/cache/webfetch/<hash>.<ext>`) so a follow-up `read_file` is never lossy.
|
|
56
|
+
*/
|
|
57
|
+
export async function webfetch(workspace, url, format = "markdown", timeoutSeconds = DEFAULT_TIMEOUT_SECONDS, signal) {
|
|
58
|
+
let parsed;
|
|
59
|
+
try {
|
|
60
|
+
parsed = new URL(url);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
throw new Error(`webfetch: not a valid URL: ${url}`);
|
|
64
|
+
}
|
|
65
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:")
|
|
66
|
+
throw new Error(`webfetch only supports http(s) URLs, got: ${parsed.protocol}`);
|
|
67
|
+
const seconds = Math.min(MAX_TIMEOUT_SECONDS, Math.max(1, timeoutSeconds));
|
|
68
|
+
const combined = AbortSignal.any([signal, AbortSignal.timeout(seconds * 1000)]);
|
|
69
|
+
const res = await fetch(parsed, {
|
|
70
|
+
signal: combined,
|
|
71
|
+
redirect: "follow",
|
|
72
|
+
headers: {
|
|
73
|
+
// A default fetch UA is blocked by some sites; a browser-like UA matches common practice
|
|
74
|
+
// for this exact kind of tool (opencode does the same) without impersonating a real user.
|
|
75
|
+
"User-Agent": "Mozilla/5.0 (compatible; AlisioAgent/1.0; +https://github.com/GustavoGutierrez/alisio)",
|
|
76
|
+
Accept: format === "html" ? "text/html,*/*;q=0.8" : "text/html,text/plain,*/*;q=0.8",
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
const contentType = res.headers.get("content-type") ?? "";
|
|
80
|
+
const declaredLength = Number(res.headers.get("content-length") ?? "0");
|
|
81
|
+
if (declaredLength > MAX_RESPONSE_BYTES)
|
|
82
|
+
throw new Error(`webfetch: response too large (${declaredLength} bytes, limit ${MAX_RESPONSE_BYTES})`);
|
|
83
|
+
if (!isTextualContentType(contentType))
|
|
84
|
+
throw new Error(`webfetch only supports textual content (text/*, JSON, XML); got content-type ` +
|
|
85
|
+
`"${contentType || "unknown"}". Binary and image responses are refused.`);
|
|
86
|
+
const buffer = await res.arrayBuffer();
|
|
87
|
+
if (buffer.byteLength > MAX_RESPONSE_BYTES)
|
|
88
|
+
throw new Error(`webfetch: response too large (${buffer.byteLength} bytes, limit ${MAX_RESPONSE_BYTES})`);
|
|
89
|
+
const raw = Buffer.from(buffer).toString("utf8");
|
|
90
|
+
const isHtml = contentType.includes("html");
|
|
91
|
+
const converted = format === "html"
|
|
92
|
+
? raw
|
|
93
|
+
: isHtml
|
|
94
|
+
? format === "text"
|
|
95
|
+
? htmlToText(raw)
|
|
96
|
+
: htmlToMarkdown(raw)
|
|
97
|
+
: raw;
|
|
98
|
+
const truncated = converted.length > MAX_EMBEDDED_CHARS;
|
|
99
|
+
let fullTextPath;
|
|
100
|
+
if (truncated) {
|
|
101
|
+
const ext = format === "html" ? "html" : format === "text" ? "txt" : "md";
|
|
102
|
+
const hash = createHash("sha256").update(`${url}\n${format}`).digest("hex").slice(0, 24);
|
|
103
|
+
const relative = join(".alisio", "cache", "webfetch", `${hash}.${ext}`);
|
|
104
|
+
const path = await safePath(workspace, relative);
|
|
105
|
+
await mkdir(dirname(path), { recursive: true });
|
|
106
|
+
await writeFile(path, converted, "utf8");
|
|
107
|
+
fullTextPath = relative;
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
url: parsed.toString(),
|
|
111
|
+
status: res.status,
|
|
112
|
+
contentType,
|
|
113
|
+
format,
|
|
114
|
+
content: converted.slice(0, MAX_EMBEDDED_CHARS),
|
|
115
|
+
truncated,
|
|
116
|
+
...(fullTextPath ? { fullTextPath } : {}),
|
|
117
|
+
bytes: buffer.byteLength,
|
|
118
|
+
};
|
|
119
|
+
}
|
package/dist/trust.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface TrustEntry {
|
|
2
|
+
trusted: boolean;
|
|
3
|
+
/** sha256 of `.alisio/config.json`'s content, or null when that file does not exist. */
|
|
4
|
+
configHash: string | null;
|
|
5
|
+
updatedAt: number;
|
|
6
|
+
}
|
|
7
|
+
export interface TrustListing extends TrustEntry {
|
|
8
|
+
workspace: string;
|
|
9
|
+
}
|
|
10
|
+
/** Resolving a workspace's trust, without ever prompting. */
|
|
11
|
+
export interface TrustResolution {
|
|
12
|
+
/** Whether the workspace's project resources should currently load. */
|
|
13
|
+
trusted: boolean;
|
|
14
|
+
/** Whether there is anything here needing a trust decision in the first place. */
|
|
15
|
+
hasProjectResources: boolean;
|
|
16
|
+
/** True when the caller should ask (no stored decision, or the config changed since). */
|
|
17
|
+
needsPrompt: boolean;
|
|
18
|
+
configHash: string | null;
|
|
19
|
+
}
|
|
20
|
+
export declare function trustStorePath(): string;
|
|
21
|
+
export declare function hasProjectResources(workspace: string): Promise<boolean>;
|
|
22
|
+
export declare function hashProjectConfig(workspace: string): Promise<string | null>;
|
|
23
|
+
/** The raw stored decision for a workspace, or undefined when none exists yet. */
|
|
24
|
+
export declare function getTrust(workspace: string): Promise<TrustEntry | undefined>;
|
|
25
|
+
export declare function setTrust(workspace: string, trusted: boolean, configHash: string | null): Promise<void>;
|
|
26
|
+
/** Returns whether an entry actually existed to remove. */
|
|
27
|
+
export declare function revokeTrust(workspace: string): Promise<boolean>;
|
|
28
|
+
export declare function listTrust(): Promise<TrustListing[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Read-only resolution: never prompts. `needsPrompt` tells an interactive caller it must ask
|
|
31
|
+
* (nothing stored yet, or `.alisio/config.json` changed since the last decision — a changed file
|
|
32
|
+
* is never trusted silently). A headless caller should treat `needsPrompt` the same as untrusted.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveTrust(workspace: string): Promise<TrustResolution>;
|
package/dist/trust.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One-time, per-directory project trust, replacing `--trust-project` for the common interactive
|
|
3
|
+
* case. Trusting a workspace lets Alisio load `.alisio/config.json` (which can redirect the
|
|
4
|
+
* provider endpoint/API key), `.alisio/plugins` (executable code), and project agents/skills/
|
|
5
|
+
* prompts — exactly the same things `--trust-project`/`--config` already unlock for one run. This
|
|
6
|
+
* module only decides and persists the yes/no; it never itself prompts (that is a CLI/TUI concern,
|
|
7
|
+
* since only an interactive caller has someone to ask) and it never mutates policy.
|
|
8
|
+
*
|
|
9
|
+
* Never used for a `--trust-project`/`--config` invocation: that flag is already explicit, one-run
|
|
10
|
+
* trust and must not be persisted as though it were an interactive grant.
|
|
11
|
+
*/
|
|
12
|
+
import { createHash } from "node:crypto";
|
|
13
|
+
import { mkdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
14
|
+
import { dirname, join } from "node:path";
|
|
15
|
+
import { stateHome } from "./config.js";
|
|
16
|
+
export function trustStorePath() {
|
|
17
|
+
return join(stateHome(), "trust.json");
|
|
18
|
+
}
|
|
19
|
+
/** Project-level resources that today require `--trust-project`/`--config` to load. */
|
|
20
|
+
const PROJECT_RESOURCE_RELATIVE_PATHS = [
|
|
21
|
+
".alisio/config.json",
|
|
22
|
+
".alisio/plugins",
|
|
23
|
+
".alisio/agents",
|
|
24
|
+
".agents/agents",
|
|
25
|
+
".alisio/skills",
|
|
26
|
+
".alisio/prompts",
|
|
27
|
+
];
|
|
28
|
+
async function pathExists(path) {
|
|
29
|
+
try {
|
|
30
|
+
await stat(path);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export async function hasProjectResources(workspace) {
|
|
38
|
+
for (const relative of PROJECT_RESOURCE_RELATIVE_PATHS)
|
|
39
|
+
if (await pathExists(join(workspace, relative)))
|
|
40
|
+
return true;
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
export async function hashProjectConfig(workspace) {
|
|
44
|
+
try {
|
|
45
|
+
const content = await readFile(join(workspace, ".alisio", "config.json"), "utf8");
|
|
46
|
+
return createHash("sha256").update(content).digest("hex");
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async function readStore() {
|
|
53
|
+
try {
|
|
54
|
+
const raw = JSON.parse(await readFile(trustStorePath(), "utf8"));
|
|
55
|
+
if (raw && typeof raw === "object" && raw.entries && typeof raw.entries === "object")
|
|
56
|
+
return { version: 1, entries: raw.entries };
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
/* Missing or corrupt: start fresh rather than fail the whole CLI over a trust cache. */
|
|
60
|
+
}
|
|
61
|
+
return { version: 1, entries: {} };
|
|
62
|
+
}
|
|
63
|
+
async function writeStore(store) {
|
|
64
|
+
const path = trustStorePath();
|
|
65
|
+
await mkdir(dirname(path), { recursive: true, mode: 0o700 });
|
|
66
|
+
const temporary = `${path}.${crypto.randomUUID()}.tmp`;
|
|
67
|
+
try {
|
|
68
|
+
await writeFile(temporary, `${JSON.stringify(store, null, 2)}\n`, { mode: 0o600 });
|
|
69
|
+
await rename(temporary, path);
|
|
70
|
+
}
|
|
71
|
+
finally {
|
|
72
|
+
await rm(temporary, { force: true });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** The raw stored decision for a workspace, or undefined when none exists yet. */
|
|
76
|
+
export async function getTrust(workspace) {
|
|
77
|
+
return (await readStore()).entries[workspace];
|
|
78
|
+
}
|
|
79
|
+
export async function setTrust(workspace, trusted, configHash) {
|
|
80
|
+
const store = await readStore();
|
|
81
|
+
store.entries[workspace] = { trusted, configHash, updatedAt: Date.now() };
|
|
82
|
+
await writeStore(store);
|
|
83
|
+
}
|
|
84
|
+
/** Returns whether an entry actually existed to remove. */
|
|
85
|
+
export async function revokeTrust(workspace) {
|
|
86
|
+
const store = await readStore();
|
|
87
|
+
if (!(workspace in store.entries))
|
|
88
|
+
return false;
|
|
89
|
+
delete store.entries[workspace];
|
|
90
|
+
await writeStore(store);
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
export async function listTrust() {
|
|
94
|
+
const store = await readStore();
|
|
95
|
+
return Object.entries(store.entries)
|
|
96
|
+
.map(([workspace, entry]) => ({ workspace, ...entry }))
|
|
97
|
+
.sort((a, b) => b.updatedAt - a.updatedAt);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Read-only resolution: never prompts. `needsPrompt` tells an interactive caller it must ask
|
|
101
|
+
* (nothing stored yet, or `.alisio/config.json` changed since the last decision — a changed file
|
|
102
|
+
* is never trusted silently). A headless caller should treat `needsPrompt` the same as untrusted.
|
|
103
|
+
*/
|
|
104
|
+
export async function resolveTrust(workspace) {
|
|
105
|
+
const hasResources = await hasProjectResources(workspace);
|
|
106
|
+
const configHash = await hashProjectConfig(workspace);
|
|
107
|
+
if (!hasResources)
|
|
108
|
+
return { trusted: false, hasProjectResources: false, needsPrompt: false, configHash };
|
|
109
|
+
const stored = await getTrust(workspace);
|
|
110
|
+
if (!stored || stored.configHash !== configHash)
|
|
111
|
+
return { trusted: false, hasProjectResources: true, needsPrompt: true, configHash };
|
|
112
|
+
return { trusted: stored.trusted, hasProjectResources: true, needsPrompt: false, configHash };
|
|
113
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads the @alisio/core package version at runtime so the MCP client metadata stays in sync
|
|
3
|
+
* with the published package. Resolves the manifest relative to the module (`src/version.ts` →
|
|
4
|
+
* `../package.json` in the source tree; `dist/version.js` → `../package.json` when installed).
|
|
5
|
+
* Standalone binaries inject ALISIO_PACKAGE_VERSION at build time (scripts/binary-build.ts).
|
|
6
|
+
*/
|
|
7
|
+
export declare function loadVersion(fromHere: string): string;
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
/**
|
|
5
|
+
* Fallback used when neither the build-time injection nor the package manifest is readable.
|
|
6
|
+
* A development marker, never a publish literal: it cannot silently desync from the package.
|
|
7
|
+
*/
|
|
8
|
+
const FALLBACK = "dev";
|
|
9
|
+
/**
|
|
10
|
+
* Reads the @alisio/core package version at runtime so the MCP client metadata stays in sync
|
|
11
|
+
* with the published package. Resolves the manifest relative to the module (`src/version.ts` →
|
|
12
|
+
* `../package.json` in the source tree; `dist/version.js` → `../package.json` when installed).
|
|
13
|
+
* Standalone binaries inject ALISIO_PACKAGE_VERSION at build time (scripts/binary-build.ts).
|
|
14
|
+
*/
|
|
15
|
+
export function loadVersion(fromHere) {
|
|
16
|
+
if (process.env.ALISIO_PACKAGE_VERSION)
|
|
17
|
+
return process.env.ALISIO_PACKAGE_VERSION;
|
|
18
|
+
try {
|
|
19
|
+
const manifest = join(dirname(fileURLToPath(fromHere)), "..", "package.json");
|
|
20
|
+
const parsed = JSON.parse(readFileSync(manifest, "utf8"));
|
|
21
|
+
return typeof parsed.version === "string" && parsed.version ? parsed.version : FALLBACK;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return FALLBACK;
|
|
25
|
+
}
|
|
26
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alisio/core",
|
|
3
|
+
"version": "0.1.0-alpha.10",
|
|
4
|
+
"description": "Embeddable provider-agnostic Alisio agent core: tool loop, context compaction, local tools, MCP, plugin host and SQLite session store. Runs on Node >=22.16 and Bun.",
|
|
5
|
+
"author": "Gustavo Gutiérrez",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/GustavoGutierrez/alisio.git",
|
|
10
|
+
"directory": "packages/core"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://gustavogutierrez.github.io/alisio/",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/GustavoGutierrez/alisio/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"ai",
|
|
18
|
+
"coding-agent",
|
|
19
|
+
"llm",
|
|
20
|
+
"agent-harness",
|
|
21
|
+
"openai-compatible",
|
|
22
|
+
"plugins",
|
|
23
|
+
"mcp",
|
|
24
|
+
"agent"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE"
|
|
38
|
+
],
|
|
39
|
+
"sideEffects": false,
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=22.16"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@alisio/sdk": "0.1.0-alpha.6",
|
|
45
|
+
"@mixmark-io/domino": "2.2.0",
|
|
46
|
+
"@modelcontextprotocol/client": "2.1.0",
|
|
47
|
+
"ajv": "8.20.0",
|
|
48
|
+
"turndown": "7.2.4",
|
|
49
|
+
"yaml": "2.9.1",
|
|
50
|
+
"zod": "4.6.5"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public",
|
|
54
|
+
"registry": "https://registry.npmjs.com/"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/turndown": "5.0.6"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsc -p tsconfig.build.json"
|
|
61
|
+
}
|
|
62
|
+
}
|