@bonginkan/maria-lite 8.0.2 → 10.0.0
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/README.md +61 -2
- package/assets/vui/avatar/live2d/live2dcubismcore.min.js +18211 -0
- package/dist/cli.cjs +14116 -8077
- package/dist/desktop-client.js +2672 -1246
- package/dist/ext.cjs +67 -34
- package/dist/ext.d.cts +1 -1
- package/dist/vui-avatar-client.js +51078 -0
- package/origin/index.meta.json +1 -1
- package/package.json +4 -2
package/dist/ext.cjs
CHANGED
|
@@ -10122,7 +10122,7 @@ var require_lodash = __commonJS({
|
|
|
10122
10122
|
var require_aspromise = __commonJS({
|
|
10123
10123
|
"../node_modules/.pnpm/@protobufjs+aspromise@1.1.2/node_modules/@protobufjs/aspromise/index.js"(exports2, module2) {
|
|
10124
10124
|
module2.exports = asPromise;
|
|
10125
|
-
function asPromise(fn,
|
|
10125
|
+
function asPromise(fn, ctx2) {
|
|
10126
10126
|
var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true;
|
|
10127
10127
|
while (index < arguments.length)
|
|
10128
10128
|
params[offset++] = arguments[index++];
|
|
@@ -10141,7 +10141,7 @@ var require_aspromise = __commonJS({
|
|
|
10141
10141
|
}
|
|
10142
10142
|
};
|
|
10143
10143
|
try {
|
|
10144
|
-
fn.apply(
|
|
10144
|
+
fn.apply(ctx2 || null, params);
|
|
10145
10145
|
} catch (err) {
|
|
10146
10146
|
if (pending) {
|
|
10147
10147
|
pending = false;
|
|
@@ -10259,10 +10259,10 @@ var require_eventemitter = __commonJS({
|
|
|
10259
10259
|
function EventEmitter() {
|
|
10260
10260
|
this._listeners = {};
|
|
10261
10261
|
}
|
|
10262
|
-
EventEmitter.prototype.on = function on(evt, fn,
|
|
10262
|
+
EventEmitter.prototype.on = function on(evt, fn, ctx2) {
|
|
10263
10263
|
(this._listeners[evt] || (this._listeners[evt] = [])).push({
|
|
10264
10264
|
fn,
|
|
10265
|
-
ctx:
|
|
10265
|
+
ctx: ctx2 || this
|
|
10266
10266
|
});
|
|
10267
10267
|
return this;
|
|
10268
10268
|
};
|
|
@@ -26890,13 +26890,13 @@ var require_server = __commonJS({
|
|
|
26890
26890
|
this.trace("Enable idle timeout for " + socket.remoteAddress + ":" + socket.remotePort);
|
|
26891
26891
|
return idleTimeoutObj;
|
|
26892
26892
|
}
|
|
26893
|
-
onIdleTimeout(
|
|
26893
|
+
onIdleTimeout(ctx2, session) {
|
|
26894
26894
|
const { socket } = session;
|
|
26895
|
-
const sessionInfo =
|
|
26895
|
+
const sessionInfo = ctx2.sessionIdleTimeouts.get(session);
|
|
26896
26896
|
if (sessionInfo !== void 0 && sessionInfo.activeStreams === 0) {
|
|
26897
|
-
if (Date.now() - sessionInfo.lastIdle >=
|
|
26898
|
-
|
|
26899
|
-
|
|
26897
|
+
if (Date.now() - sessionInfo.lastIdle >= ctx2.sessionIdleTimeout) {
|
|
26898
|
+
ctx2.trace("Session idle timeout triggered for " + (socket === null || socket === void 0 ? void 0 : socket.remoteAddress) + ":" + (socket === null || socket === void 0 ? void 0 : socket.remotePort) + " last idle at " + sessionInfo.lastIdle);
|
|
26899
|
+
ctx2.closeSession(session);
|
|
26900
26900
|
} else {
|
|
26901
26901
|
sessionInfo.timeout.refresh();
|
|
26902
26902
|
}
|
|
@@ -96963,11 +96963,19 @@ async function writePersonaStore(store) {
|
|
|
96963
96963
|
} });
|
|
96964
96964
|
}
|
|
96965
96965
|
async function getPersonaById(idOrLabel) {
|
|
96966
|
+
const needle = String(idOrLabel || "").trim();
|
|
96967
|
+
if (!needle) return null;
|
|
96966
96968
|
const store = await readPersonaStore();
|
|
96967
|
-
const byId = store.personas.find((p) => p.personaId ===
|
|
96969
|
+
const byId = store.personas.find((p) => p.personaId === needle);
|
|
96968
96970
|
if (byId) return byId;
|
|
96969
|
-
const lower2 =
|
|
96970
|
-
|
|
96971
|
+
const lower2 = needle.toLowerCase();
|
|
96972
|
+
const byLabel = store.personas.find((p) => p.label.toLowerCase() === lower2);
|
|
96973
|
+
if (byLabel) return byLabel;
|
|
96974
|
+
const normalized = sanitizePersonaLabel(needle);
|
|
96975
|
+
if (!normalized) return null;
|
|
96976
|
+
return store.personas.find((p) => {
|
|
96977
|
+
return sanitizePersonaLabel(p.label) === normalized || sanitizePersonaLabel(p.personaId) === normalized;
|
|
96978
|
+
}) ?? null;
|
|
96971
96979
|
}
|
|
96972
96980
|
async function getDefaultPersona() {
|
|
96973
96981
|
const store = await readPersonaStore();
|
|
@@ -97310,7 +97318,7 @@ var PlanRestrictedError = class extends Error {
|
|
|
97310
97318
|
};
|
|
97311
97319
|
var ERROR_MESSAGES = {
|
|
97312
97320
|
AUTH_REQUIRED: "\u{1F510} Authentication required \xB7 Run: /login",
|
|
97313
|
-
QUOTA_EXCEEDED: "\u{1F4CA} Monthly usage limit reached \xB7 maria /usage or /billing",
|
|
97321
|
+
QUOTA_EXCEEDED: "\u{1F4CA} Monthly usage limit reached \xB7 maria /usage, /upgrade, or /billing",
|
|
97314
97322
|
PLAN_RESTRICTED: "\u{1F512} Not available in Free plan \xB7 Join Waitlist \u2192 https://maria.dev/waitlist",
|
|
97315
97323
|
NETWORK_ERROR: "\u{1F310} Network error, check connection",
|
|
97316
97324
|
TOKEN_EXPIRED: "\u{1F504} Please re-authenticate \xB7 Run: /login",
|
|
@@ -98007,7 +98015,7 @@ function resolvePackageJsonNearEntrypoint() {
|
|
|
98007
98015
|
}
|
|
98008
98016
|
function resolveMariaLiteVersionInfo() {
|
|
98009
98017
|
const fallbackName = EXPECTED_PKG_NAME;
|
|
98010
|
-
const fallbackVersion = String(process.env.MARIA_LITE_VERSION || "").trim() || "
|
|
98018
|
+
const fallbackVersion = String(process.env.MARIA_LITE_VERSION || "").trim() || "10.0.0";
|
|
98011
98019
|
const near = resolvePackageJsonNearEntrypoint();
|
|
98012
98020
|
if (near) {
|
|
98013
98021
|
const name = fallbackName;
|
|
@@ -98593,7 +98601,7 @@ function formatQuotaExceededMessage(payload) {
|
|
|
98593
98601
|
}
|
|
98594
98602
|
lines.push("");
|
|
98595
98603
|
lines.push(`Reset date: ${resetAt || "(unknown)"}`);
|
|
98596
|
-
lines.push("Next steps:
|
|
98604
|
+
lines.push("Next steps: run maria /usage to inspect remaining quota, maria /upgrade <plan> to switch plan, or maria /billing to manage billing.");
|
|
98597
98605
|
return lines.join("\n");
|
|
98598
98606
|
}
|
|
98599
98607
|
|
|
@@ -99097,8 +99105,8 @@ async function withLiteSpinner(text, fn) {
|
|
|
99097
99105
|
if (currentDepth > 0) {
|
|
99098
99106
|
return await fn();
|
|
99099
99107
|
}
|
|
99100
|
-
const execute = async (
|
|
99101
|
-
|
|
99108
|
+
const execute = async (ctx2) => {
|
|
99109
|
+
ctx2.depth++;
|
|
99102
99110
|
if (!store) globalDepth++;
|
|
99103
99111
|
const sp = new LiteSpinner({ text });
|
|
99104
99112
|
sp.start();
|
|
@@ -99108,7 +99116,7 @@ async function withLiteSpinner(text, fn) {
|
|
|
99108
99116
|
try {
|
|
99109
99117
|
sp.stop();
|
|
99110
99118
|
} finally {
|
|
99111
|
-
|
|
99119
|
+
ctx2.depth = Math.max(0, ctx2.depth - 1);
|
|
99112
99120
|
if (!store) globalDepth = Math.max(0, globalDepth - 1);
|
|
99113
99121
|
}
|
|
99114
99122
|
}
|
|
@@ -99120,6 +99128,16 @@ async function withLiteSpinner(text, fn) {
|
|
|
99120
99128
|
return await depthCtx.run(newCtx, () => execute(newCtx));
|
|
99121
99129
|
}
|
|
99122
99130
|
init_type_coerce();
|
|
99131
|
+
var ctx = new async_hooks.AsyncLocalStorage();
|
|
99132
|
+
function getExternalBridgeContext() {
|
|
99133
|
+
return ctx.getStore() || null;
|
|
99134
|
+
}
|
|
99135
|
+
function getExternalBridgeAccessToken() {
|
|
99136
|
+
const store = ctx.getStore();
|
|
99137
|
+
return store?.accessToken ? String(store.accessToken) : null;
|
|
99138
|
+
}
|
|
99139
|
+
|
|
99140
|
+
// services/cli-auth/api-caller.ts
|
|
99123
99141
|
var authManager2 = new AuthenticationManager();
|
|
99124
99142
|
function debugLog2(line) {
|
|
99125
99143
|
if (String(process.env.MARIA_DEBUG || "").trim() !== "1") return;
|
|
@@ -99224,7 +99242,9 @@ function enterpriseCacheKey() {
|
|
|
99224
99242
|
const profileId = new TokenStorage().getProfileIdForDebug();
|
|
99225
99243
|
const apiBase = String(process.env.MARIA_API_BASE || "https://api.maria-code.ai").trim();
|
|
99226
99244
|
const authBase = String(process.env.MARIA_AUTH_BASE || "https://auth.maria-code.ai").trim();
|
|
99227
|
-
|
|
99245
|
+
const external = getExternalBridgeContext();
|
|
99246
|
+
const externalKey = external ? `external:${external.provider}:${external.mariaUserId || external.mariaEmail || external.externalUserId || "unknown"}` : "local";
|
|
99247
|
+
return `${profileId}|${apiBase}|${authBase}|${externalKey}`;
|
|
99228
99248
|
}
|
|
99229
99249
|
function resolveMirrorFallbackForNonNaturalInput() {
|
|
99230
99250
|
return resolveEnvLocaleToCliLanguage();
|
|
@@ -99281,6 +99301,19 @@ async function getEnterpriseFlag(tokens) {
|
|
|
99281
99301
|
return false;
|
|
99282
99302
|
}
|
|
99283
99303
|
}
|
|
99304
|
+
async function getEffectiveAuthTokens() {
|
|
99305
|
+
const bridgeToken = getExternalBridgeAccessToken();
|
|
99306
|
+
if (bridgeToken) {
|
|
99307
|
+
const now = Date.now();
|
|
99308
|
+
return {
|
|
99309
|
+
idToken: bridgeToken,
|
|
99310
|
+
accessToken: bridgeToken,
|
|
99311
|
+
refreshToken: "",
|
|
99312
|
+
expiresAt: now + 55 * 60 * 1e3
|
|
99313
|
+
};
|
|
99314
|
+
}
|
|
99315
|
+
return await authManager2.getValidTokens();
|
|
99316
|
+
}
|
|
99284
99317
|
async function callAPI(endpoint, options = {}) {
|
|
99285
99318
|
const isAiProxy = String(endpoint) === "/v1/ai-proxy" && String(options.method || "GET").toUpperCase() === "POST";
|
|
99286
99319
|
const localMode = isLocalModeRequestedByEnv();
|
|
@@ -99322,7 +99355,7 @@ async function callAPI(endpoint, options = {}) {
|
|
|
99322
99355
|
);
|
|
99323
99356
|
return { data: { content: text, routedModel: { vendor: "local", family: effectiveProvider, name: model, reason: "local_only" } } };
|
|
99324
99357
|
}
|
|
99325
|
-
const tokens = await
|
|
99358
|
+
const tokens = await getEffectiveAuthTokens();
|
|
99326
99359
|
if (!tokens) throw new Error("Authentication required. Please run /login first.");
|
|
99327
99360
|
const isEnterprisePlan = isAiProxy ? await getEnterpriseFlag(tokens) : false;
|
|
99328
99361
|
if (isAiProxy && isEnterprisePlan) {
|
|
@@ -99555,8 +99588,8 @@ var PERSONA_BLACKLIST = /* @__PURE__ */ new Set([
|
|
|
99555
99588
|
"doctor"
|
|
99556
99589
|
]);
|
|
99557
99590
|
var LiteWorkerAgent = class {
|
|
99558
|
-
async aiPromptStructured(
|
|
99559
|
-
return await executeAiProxyPromptStructuredWithCtx(
|
|
99591
|
+
async aiPromptStructured(ctx2, req) {
|
|
99592
|
+
return await executeAiProxyPromptStructuredWithCtx(ctx2, req);
|
|
99560
99593
|
}
|
|
99561
99594
|
/**
|
|
99562
99595
|
* Resolve active persona and format it for prompt injection.
|
|
@@ -99565,10 +99598,10 @@ var LiteWorkerAgent = class {
|
|
|
99565
99598
|
*
|
|
99566
99599
|
* @param role "creator" = full persona (inner + creative), "writer" = formal info only
|
|
99567
99600
|
*/
|
|
99568
|
-
async resolvePersonaBlock(
|
|
99601
|
+
async resolvePersonaBlock(ctx2, role = "creator") {
|
|
99569
99602
|
if (PERSONA_BLACKLIST.has(this.commandId)) return "";
|
|
99570
99603
|
try {
|
|
99571
|
-
const pOpt = typeof
|
|
99604
|
+
const pOpt = typeof ctx2.parsed.options?.persona === "string" ? ctx2.parsed.options.persona.trim() : "";
|
|
99572
99605
|
const { getPersonaById: getPersonaById2, getDefaultPersona: getDefaultPersona2, formatPersonaForPrompt: formatPersonaForPrompt2 } = await Promise.resolve().then(() => (init_persona_store(), persona_store_exports));
|
|
99573
99606
|
const persona = pOpt ? await getPersonaById2(pOpt) : await getDefaultPersona2();
|
|
99574
99607
|
if (persona) return formatPersonaForPrompt2(persona, role);
|
|
@@ -99578,8 +99611,8 @@ var LiteWorkerAgent = class {
|
|
|
99578
99611
|
}
|
|
99579
99612
|
};
|
|
99580
99613
|
var LiteCheckerAgent = class {
|
|
99581
|
-
async aiPromptStructured(
|
|
99582
|
-
return await executeAiProxyPromptStructuredWithCtx(
|
|
99614
|
+
async aiPromptStructured(ctx2, req) {
|
|
99615
|
+
return await executeAiProxyPromptStructuredWithCtx(ctx2, req);
|
|
99583
99616
|
}
|
|
99584
99617
|
};
|
|
99585
99618
|
function mergeAppend(a, b) {
|
|
@@ -99592,14 +99625,14 @@ function mergeAppend(a, b) {
|
|
|
99592
99625
|
|
|
99593
99626
|
${y}`;
|
|
99594
99627
|
}
|
|
99595
|
-
function withAiProxyPromptAppendFromCtx(
|
|
99596
|
-
const llm =
|
|
99628
|
+
function withAiProxyPromptAppendFromCtx(ctx2, req) {
|
|
99629
|
+
const llm = ctx2.llm || {};
|
|
99597
99630
|
const systemPrompt = mergeAppend(llm.systemAppend, req.systemPrompt);
|
|
99598
99631
|
const developerPrompt = mergeAppend(llm.developerAppend, req.developerPrompt);
|
|
99599
99632
|
const outLang = typeof llm.outputLanguage === "string" && isCliLanguage(llm.outputLanguage) ? llm.outputLanguage : void 0;
|
|
99600
99633
|
let spinnerTextOverride = req.spinnerTextOverride;
|
|
99601
|
-
if (spinnerTextOverride &&
|
|
99602
|
-
spinnerTextOverride = spinnerTextOverride.replace(/\bMARIA\b/g,
|
|
99634
|
+
if (spinnerTextOverride && ctx2.personaLabel) {
|
|
99635
|
+
spinnerTextOverride = spinnerTextOverride.replace(/\bMARIA\b/g, ctx2.personaLabel);
|
|
99603
99636
|
}
|
|
99604
99637
|
return {
|
|
99605
99638
|
...req,
|
|
@@ -99609,12 +99642,12 @@ function withAiProxyPromptAppendFromCtx(ctx, req) {
|
|
|
99609
99642
|
...spinnerTextOverride !== req.spinnerTextOverride ? { spinnerTextOverride } : {}
|
|
99610
99643
|
};
|
|
99611
99644
|
}
|
|
99612
|
-
async function executeAiProxyPromptStructuredWithCtx(
|
|
99613
|
-
let merged = withAiProxyPromptAppendFromCtx(
|
|
99614
|
-
if (
|
|
99645
|
+
async function executeAiProxyPromptStructuredWithCtx(ctx2, req) {
|
|
99646
|
+
let merged = withAiProxyPromptAppendFromCtx(ctx2, req);
|
|
99647
|
+
if (ctx2.personaId) {
|
|
99615
99648
|
try {
|
|
99616
99649
|
const { readPersonaMemory: readPersonaMemory2, formatPersonaMemoryForPrompt: formatPersonaMemoryForPrompt2 } = await Promise.resolve().then(() => (init_persona_memory(), persona_memory_exports));
|
|
99617
|
-
const memory = await readPersonaMemory2(
|
|
99650
|
+
const memory = await readPersonaMemory2(ctx2.personaId);
|
|
99618
99651
|
const memoryBlock = formatPersonaMemoryForPrompt2(memory);
|
|
99619
99652
|
if (memoryBlock) {
|
|
99620
99653
|
const existing = typeof merged.developerPrompt === "string" ? merged.developerPrompt : "";
|
package/dist/ext.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type LiteBuiltInCommandId = "login" | "logout" | "account" | "help" | "constitution" | "version" | "vup" | "docs-update" | "connect" | "api-secret" | "bulk-register" | "recompile-api" | "skills" | "plugins" | "gen-skills" | "git" | "gh" | "research" | "kp-sync" | "kp-generate" | "kp-update" | "kp-synthesis" | "origin-fetch" | "deps" | "pdf" | "docs" | "stop" | "restart" | "chat" | "code" | "develop" | "auto-dev" | "doctor" | "self-improve" | "goal-loop" | "evolve" | "watch" | "universe" | "blog" | "image" | "video" | "music" | "manga" | "slides" | "proposal" | "novel" | "ceo" | "coo" | "cpo" | "cto" | "caio" | "cxo" | "ceo-clone" | "cto-clone" | "caio-clone" | "coo-clone" | "cpo-clone" | "desktop" | "spreadsheet" | "task-manager" | "calculator" | "twin" | "phone-tenant" | "phone-dept" | "phone-prompt" | "phone-dict" | "phone-hp-import" | "phone-deploy" | "phone-init" | "daily-report" | "daily-news" | "daily-papers" | "daily-insights" | "discord-setup" | "github-webhook" | "slack-webhook" | "notification-router" | "events" | "gtm" | "apollo" | "clay" | "gong" | "hubspot" | "salesforce" | "billing-pl" | "dev-adviser" | "dev-decision" | "resource-manager" | "estimate";
|
|
1
|
+
type LiteBuiltInCommandId = "login" | "logout" | "account" | "usage" | "upgrade" | "billing" | "help" | "review" | "constitution" | "version" | "vup" | "docs-update" | "connect" | "api-secret" | "bulk-register" | "recompile-api" | "skills" | "plugins" | "gen-skills" | "git" | "gh" | "research" | "kp-sync" | "kp-generate" | "kp-update" | "kp-synthesis" | "origin-fetch" | "deps" | "pdf" | "docs" | "stop" | "restart" | "chat" | "code" | "develop" | "auto-dev" | "doctor" | "self-improve" | "goal-loop" | "evolve" | "watch" | "universe" | "blog" | "image" | "video" | "music" | "manga" | "slides" | "proposal" | "novel" | "ceo" | "coo" | "cpo" | "cto" | "caio" | "cxo" | "ceo-clone" | "cto-clone" | "caio-clone" | "coo-clone" | "cpo-clone" | "desktop" | "spreadsheet" | "task-manager" | "calculator" | "twin" | "phone-tenant" | "phone-dept" | "phone-prompt" | "phone-dict" | "phone-hp-import" | "phone-deploy" | "phone-init" | "daily-report" | "daily-news" | "daily-papers" | "daily-insights" | "discord-setup" | "github-webhook" | "slack-webhook" | "notification-router" | "events" | "gtm" | "apollo" | "clay" | "gong" | "hubspot" | "salesforce" | "billing-pl" | "dev-adviser" | "dev-decision" | "resource-manager" | "estimate" | "analytics" | "vui";
|
|
2
2
|
type LiteCommandId = LiteBuiltInCommandId | (string & {});
|
|
3
3
|
type LiteStepOutcome = "PASS" | "WARN" | "STOP";
|
|
4
4
|
type LiteStepResult = {
|