micro-models-agent 2.4.0 → 2.8.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/CHANGELOG.md +109 -0
- package/README.md +88 -38
- package/bin/mma.mjs +41 -41
- package/dist/assets/app.js +246 -3032
- package/dist/assets/hljs.js +1244 -0
- package/dist/assets/index.html +15 -1
- package/dist/assets/js/api.js +28 -0
- package/dist/assets/js/dialog.js +105 -0
- package/dist/assets/js/dom.js +157 -0
- package/dist/assets/js/feed.js +995 -0
- package/dist/assets/js/format.js +114 -0
- package/dist/assets/js/i18n.js +46 -0
- package/dist/assets/js/settings.js +1126 -0
- package/dist/assets/js/store.js +79 -0
- package/dist/assets/js/tabs.js +672 -0
- package/dist/assets/md.js +277 -0
- package/dist/assets/setup.js +557 -0
- package/dist/assets/smd.js +1665 -0
- package/dist/assets/styles.css +271 -21
- package/dist/i18n/en.json +171 -3
- package/dist/i18n/ru.json +171 -3
- package/dist/main.js +4958 -2588
- package/dist/modules/browser/bridge-server.mjs +3 -3
- package/package.json +10 -2
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// Shared mutable UI state for the `mma web` frontend.
|
|
2
|
+
//
|
|
3
|
+
// Was IIFE closure scope in `app.js`. ESM live bindings cannot be reassigned
|
|
4
|
+
// from importers, so everything mutable lives on the `S` singleton and every
|
|
5
|
+
// module reads/writes `S.*` explicitly.
|
|
6
|
+
|
|
7
|
+
export const THEME_KEY = "mma-theme";
|
|
8
|
+
export const MAX_IMAGES = 3;
|
|
9
|
+
export const MAX_IMAGE_BYTES = 6 * 1024 * 1024;
|
|
10
|
+
|
|
11
|
+
export const S = {
|
|
12
|
+
state: {
|
|
13
|
+
config: null,
|
|
14
|
+
registry: [],
|
|
15
|
+
webToken: null,
|
|
16
|
+
models: [],
|
|
17
|
+
sessions: [],
|
|
18
|
+
host: {},
|
|
19
|
+
busy: false,
|
|
20
|
+
activeSessionId: null,
|
|
21
|
+
memory: undefined,
|
|
22
|
+
skills: undefined,
|
|
23
|
+
pluginsData: undefined,
|
|
24
|
+
providers: undefined,
|
|
25
|
+
providerPresets: [],
|
|
26
|
+
providerForm: null,
|
|
27
|
+
// Transient error shown inline in the sessions dropdown (visible without the modal).
|
|
28
|
+
sessionsError: null,
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
tabs: [],
|
|
32
|
+
activeTabId: null,
|
|
33
|
+
liveTabId: null,
|
|
34
|
+
newSeq: 0,
|
|
35
|
+
attachments: [],
|
|
36
|
+
attachErrTimer: null,
|
|
37
|
+
|
|
38
|
+
curText: null,
|
|
39
|
+
curMd: null,
|
|
40
|
+
turnMd: "",
|
|
41
|
+
turnRoots: [],
|
|
42
|
+
curThink: null,
|
|
43
|
+
lastPlanSig: null,
|
|
44
|
+
lastUsageSig: null,
|
|
45
|
+
lastEnvSig: null,
|
|
46
|
+
runCount: 0,
|
|
47
|
+
runFails: 0,
|
|
48
|
+
runReconOnly: true,
|
|
49
|
+
runNodes: [],
|
|
50
|
+
runDuration: 0,
|
|
51
|
+
busyTimer: null,
|
|
52
|
+
pendingArgs: new Map(),
|
|
53
|
+
toolNodes: new Map(),
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export function setPath(obj, path, value) {
|
|
57
|
+
const parts = path.split(".");
|
|
58
|
+
let cur = obj;
|
|
59
|
+
for (let i = 0; i < parts.length - 1; i++) {
|
|
60
|
+
if (cur[parts[i]] == null || typeof cur[parts[i]] !== "object") cur[parts[i]] = {};
|
|
61
|
+
cur = cur[parts[i]];
|
|
62
|
+
}
|
|
63
|
+
cur[parts[parts.length - 1]] = value;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function getPath(obj, path) {
|
|
67
|
+
const parts = path.split(".");
|
|
68
|
+
let cur = obj;
|
|
69
|
+
for (const p of parts) {
|
|
70
|
+
if (cur == null || typeof cur !== "object") return undefined;
|
|
71
|
+
cur = cur[p];
|
|
72
|
+
}
|
|
73
|
+
return cur;
|
|
74
|
+
}
|
|
75
|
+
// Cross-module UI hooks, registered by `app.js` boot. Lets settings-level
|
|
76
|
+
// writes refresh app-shell chrome (locale) without importing app — keeps the
|
|
77
|
+
// module DAG acyclic (app → settings → tabs; dialog is a leaf).
|
|
78
|
+
export const hooks = { applyStaticI18n: null };
|
|
79
|
+
|