zen-code 4.5.0 → 4.6.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/dist/{app-DtYW5k3J.mjs → app-CM8R0ZR6.mjs} +4893 -4705
- package/dist/{checkpoint-1sAx_j1E-4BdN8r-w.mjs → checkpoint-1sAx_j1E-DrVPlSLR.mjs} +2 -2
- package/dist/{checkpoint-DxiUsHMy-BV-8KBKD.mjs → checkpoint-DxiUsHMy-Cjy5WGNC.mjs} +2 -2
- package/dist/cli.mjs +44 -20
- package/dist/{graphBuilder-B0bC88R_.mjs → graphBuilder-mpLrx9tk.mjs} +2752 -2319
- package/dist/{index-BHwkVemt.mjs → index-B6kFMamn.mjs} +1 -1
- package/dist/{index-CSvPIzA-.mjs → index-ChCbbHFS.mjs} +10 -11
- package/dist/{index-Bgm_TqjU.mjs → index-FHDPQ2Qk.mjs} +4 -5
- package/dist/{memories-B8HqG014.mjs → memories-DirsFRdm.mjs} +1 -1
- package/dist/metadata-XVTVXthy.mjs +6 -0
- package/dist/nonInteractive.mjs +1 -1
- package/dist/{queue-Bfg-8ehP-Lko1egu-.mjs → queue-Cu_nO_wt-ChzSaooi.mjs} +1 -1
- package/dist/{shallow-DAx5vVov.mjs → shallow-tfhh5rlz.mjs} +5 -6
- package/dist/{sqlite-adapter-Bbonr5S5-DQLjfvyu.mjs → sqlite-adapter-BKOLSdoL-BlGKN04G.mjs} +13 -10
- package/dist/{subTasks-BTMXARkP.mjs → subTasks-Bt97OwvY.mjs} +46 -47
- package/dist/zen-code.mjs +1 -1
- package/package.json +5 -5
- package/dist/id-Cu7CRpDw.mjs +0 -79
- package/dist/zen-init.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, C as m, F as o, e as c, S as i, a as p, d as h, b as k, h as n, f as g, g as T, T as f, c as l } from "./graphBuilder-
|
|
1
|
+
import { A as s, C as m, F as o, e as c, S as i, a as p, d as h, b as k, h as n, f as g, g as T, T as f, c as l } from "./graphBuilder-mpLrx9tk.mjs";
|
|
2
2
|
import { FileSystemSkillStore as y } from "./FileSystemSkillStore-yvEvcRxB.mjs";
|
|
3
3
|
import { FileSystemPluginStore as F } from "./FileSystemPluginStore-ChortK7z.mjs";
|
|
4
4
|
import "lowdb";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "./graphBuilder-B0bC88R_.mjs";
|
|
1
|
+
import { B as C, u as v, c as x, T as $, m as I } from "./app-CM8R0ZR6.mjs";
|
|
2
|
+
import "./graphBuilder-mpLrx9tk.mjs";
|
|
4
3
|
import { createClient as O, createCluster as N } from "redis";
|
|
5
4
|
const W = [
|
|
6
5
|
{
|
|
@@ -106,7 +105,7 @@ const W = [
|
|
|
106
105
|
}
|
|
107
106
|
}
|
|
108
107
|
];
|
|
109
|
-
var
|
|
108
|
+
var E = class T extends C {
|
|
110
109
|
client;
|
|
111
110
|
ttlConfig;
|
|
112
111
|
constructor(e, t) {
|
|
@@ -115,13 +114,13 @@ var L = class m extends v {
|
|
|
115
114
|
static async fromUrl(e, t) {
|
|
116
115
|
const s = O({ url: e });
|
|
117
116
|
await s.connect();
|
|
118
|
-
const i = new
|
|
117
|
+
const i = new T(s, t);
|
|
119
118
|
return await i.ensureIndexes(), i;
|
|
120
119
|
}
|
|
121
120
|
static async fromCluster(e, t) {
|
|
122
121
|
const s = N({ rootNodes: e });
|
|
123
122
|
await s.connect();
|
|
124
|
-
const i = new
|
|
123
|
+
const i = new T(s, t);
|
|
125
124
|
return await i.ensureIndexes(), i;
|
|
126
125
|
}
|
|
127
126
|
async get(e) {
|
|
@@ -147,7 +146,7 @@ var L = class m extends v {
|
|
|
147
146
|
await this.ensureIndexes();
|
|
148
147
|
const c = e.configurable?.thread_id, o = e.configurable?.checkpoint_ns ?? "", f = e.configurable?.checkpoint_id;
|
|
149
148
|
if (!c) throw new Error("thread_id is required");
|
|
150
|
-
const n = t.id ||
|
|
149
|
+
const n = t.id || v(0), r = `checkpoint:${c}:${o}:${n}`, p = x(t);
|
|
151
150
|
if (p.channel_values && i !== void 0) if (Object.keys(i).length === 0) p.channel_values = {};
|
|
152
151
|
else {
|
|
153
152
|
const u = {};
|
|
@@ -249,14 +248,14 @@ var L = class m extends v {
|
|
|
249
248
|
const _ = await this.client.json.get(y);
|
|
250
249
|
if (_) {
|
|
251
250
|
let k = !0;
|
|
252
|
-
for (const [S,
|
|
251
|
+
for (const [S, m] of Object.entries(t.filter)) {
|
|
253
252
|
const A = _.metadata?.[S];
|
|
254
|
-
if (
|
|
253
|
+
if (m === null) {
|
|
255
254
|
if (A !== null) {
|
|
256
255
|
k = !1;
|
|
257
256
|
break;
|
|
258
257
|
}
|
|
259
|
-
} else if (A !==
|
|
258
|
+
} else if (A !== m) {
|
|
260
259
|
k = !1;
|
|
261
260
|
break;
|
|
262
261
|
}
|
|
@@ -460,5 +459,5 @@ function g(w) {
|
|
|
460
459
|
});
|
|
461
460
|
}
|
|
462
461
|
export {
|
|
463
|
-
|
|
462
|
+
E as RedisSaver
|
|
464
463
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as n } from "./graphBuilder-
|
|
2
|
-
import {
|
|
1
|
+
import { l as n } from "./graphBuilder-mpLrx9tk.mjs";
|
|
2
|
+
import { D as b, u as j, y as v, t as R, B as T, z as L, E as x, G as A, r as $, w as _, s as C, M as I, P as E, x as z, q as U, v as F, p as W, H as K } from "./graphBuilder-mpLrx9tk.mjs";
|
|
3
3
|
import r from "node:fs/promises";
|
|
4
4
|
import { join as m } from "node:path";
|
|
5
5
|
import { l as d } from "./load-Cjl9cJ0o.mjs";
|
|
@@ -197,8 +197,8 @@ export {
|
|
|
197
197
|
x as BaseStorage,
|
|
198
198
|
A as MemoryStorage,
|
|
199
199
|
$ as MiddlewareCustomParamsSchema,
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
_ as MiddlewareRegistry,
|
|
201
|
+
C as MiddlewareSchema,
|
|
202
202
|
I as ModelSchema,
|
|
203
203
|
E as PromptSchema,
|
|
204
204
|
P as SkillsMiddleware,
|
|
@@ -207,6 +207,5 @@ export {
|
|
|
207
207
|
F as ToolRegistry,
|
|
208
208
|
W as ToolSchema,
|
|
209
209
|
K as anthropicPromptCachingMiddleware,
|
|
210
|
-
Y as fromLangChainTool,
|
|
211
210
|
d as listSkills
|
|
212
211
|
};
|
package/dist/nonInteractive.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import
|
|
3
|
-
import "./graphBuilder-B0bC88R_.mjs";
|
|
1
|
+
import { B as $, u as g } from "./app-CM8R0ZR6.mjs";
|
|
2
|
+
import "./graphBuilder-mpLrx9tk.mjs";
|
|
4
3
|
import { createClient as T } from "redis";
|
|
5
4
|
function k(u) {
|
|
6
5
|
if (u === null || typeof u != "object") return JSON.stringify(u);
|
|
@@ -87,7 +86,7 @@ const S = [{
|
|
|
87
86
|
}
|
|
88
87
|
}
|
|
89
88
|
}];
|
|
90
|
-
var
|
|
89
|
+
var C = class w extends $ {
|
|
91
90
|
client;
|
|
92
91
|
ttlConfig;
|
|
93
92
|
constructor(t, e) {
|
|
@@ -106,7 +105,7 @@ var O = class w extends g {
|
|
|
106
105
|
await this.ensureIndexes();
|
|
107
106
|
const s = t.configurable?.thread_id, c = t.configurable?.checkpoint_ns ?? "", r = t.configurable?.checkpoint_id;
|
|
108
107
|
if (!s) throw new Error("thread_id is required");
|
|
109
|
-
const a = e.id ||
|
|
108
|
+
const a = e.id || g(0), l = `checkpoint:${s}:${c}:shallow`;
|
|
110
109
|
let h = null, p = null;
|
|
111
110
|
try {
|
|
112
111
|
h = await this.client.json.get(l), h && typeof h == "object" && (p = h.checkpoint_id);
|
|
@@ -328,5 +327,5 @@ var O = class w extends g {
|
|
|
328
327
|
}
|
|
329
328
|
};
|
|
330
329
|
export {
|
|
331
|
-
|
|
330
|
+
C as ShallowRedisSaver
|
|
332
331
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { F as e } from "./sql-CJsUpKEQ.mjs";
|
|
2
|
-
class
|
|
2
|
+
class L {
|
|
3
3
|
db;
|
|
4
4
|
constructor(t) {
|
|
5
5
|
this.db = t;
|
|
@@ -22,14 +22,17 @@ class d {
|
|
|
22
22
|
}
|
|
23
23
|
return t;
|
|
24
24
|
}
|
|
25
|
-
buildJsonQuery(t,
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
buildJsonQuery(t, s, a, T) {
|
|
26
|
+
const E = `$.${a.includes("-") || a.includes(".") || a.includes(" ") ? `"${a}"` : a}`;
|
|
27
|
+
let r;
|
|
28
|
+
if (typeof T == "string" || typeof T == "number" ? r = T : typeof T == "boolean" ? r = T ? 1 : 0 : T === null ? r = null : r = JSON.stringify(T), T === null) {
|
|
29
|
+
const n = `"${a}":null`;
|
|
30
|
+
return e`
|
|
31
|
+
json_extract(${e.ref(s)}, ${e.lit(E)}) IS NULL
|
|
32
|
+
AND ${e.ref(s)} LIKE ${e.lit(`%${n}%`)}
|
|
33
|
+
`;
|
|
34
|
+
}
|
|
35
|
+
return e`json_extract(${e.ref(s)}, ${e.lit(E)}) = ${e.lit(r)}`;
|
|
33
36
|
}
|
|
34
37
|
now() {
|
|
35
38
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -64,5 +67,5 @@ class d {
|
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
export {
|
|
67
|
-
|
|
70
|
+
L as SQLiteAdapter
|
|
68
71
|
};
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import { tool as
|
|
2
|
-
import { Command as
|
|
3
|
-
import { z as
|
|
4
|
-
import { m as
|
|
1
|
+
import { tool as g, HumanMessage as h, SystemMessage as p } from "langchain";
|
|
2
|
+
import { Command as m, Annotation as f } from "@langchain/langgraph";
|
|
3
|
+
import { z as n } from "zod";
|
|
4
|
+
import { m as b, n as y, o as w } from "./graphBuilder-mpLrx9tk.mjs";
|
|
5
5
|
import "@langchain/openai";
|
|
6
|
-
|
|
7
|
-
task_store:
|
|
6
|
+
n.object({
|
|
7
|
+
task_store: n.record(n.string(), n.any()).default({})
|
|
8
8
|
});
|
|
9
|
-
|
|
10
|
-
task_store:
|
|
9
|
+
b().build({
|
|
10
|
+
task_store: f({
|
|
11
11
|
reducer: (r, t) => ({ ...r, ...t }),
|
|
12
12
|
default: () => ({})
|
|
13
13
|
})
|
|
14
14
|
});
|
|
15
|
-
const
|
|
16
|
-
task_id:
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const k = n.object({
|
|
16
|
+
task_id: n.string().optional().describe("The task id to ask the subagent, if not provided, will use the tool call id"),
|
|
17
|
+
subagent_id: n.string().describe(
|
|
18
|
+
'REQUIRED. The specific ID of the subagent to invoke (e.g., "agents/default", "agents/manager"). Must match exactly one of the available subagents listed in the system prompt.'
|
|
19
19
|
),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
subagent_type: n.string().describe(
|
|
21
|
+
'REQUIRED. The type/category of subagent (e.g., "general-purpose", "statusline-setup"). Must be one of the available agent types listed in the tool description.'
|
|
22
|
+
),
|
|
23
|
+
task_description: n.string().describe("Describe the user state and what you want the subagent to do."),
|
|
24
|
+
data_transfer: n.any().optional().describe("Data to transfer to the subagent.")
|
|
25
|
+
}), _ = (r, t) => g(
|
|
23
26
|
async (e, s) => {
|
|
24
27
|
const a = s.state, o = e.task_id || s.toolCall.id;
|
|
25
|
-
let
|
|
28
|
+
let i = {
|
|
26
29
|
messages: []
|
|
27
30
|
};
|
|
28
|
-
o && a?.task_store?.[o] ?
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
new
|
|
31
|
+
o && a?.task_store?.[o] ? i = a?.task_store[o] : (i = JSON.parse(JSON.stringify(a)), i.messages = [], i.task_store = {});
|
|
32
|
+
const l = await r(o, e, a);
|
|
33
|
+
i.messages.push(new h({ content: e.task_description })), e.data_transfer && i.messages.push(
|
|
34
|
+
new h({
|
|
32
35
|
content: `Here is the data to help you complete the task: ${JSON.stringify(
|
|
33
36
|
e.data_transfer,
|
|
34
37
|
null,
|
|
@@ -36,25 +39,23 @@ const _ = i.object({
|
|
|
36
39
|
)}`
|
|
37
40
|
})
|
|
38
41
|
);
|
|
39
|
-
const
|
|
42
|
+
const u = await l.invoke(i), c = u.messages.at(-1), d = {
|
|
40
43
|
task_store: {
|
|
41
44
|
...a?.task_store || {},
|
|
42
|
-
[o]:
|
|
45
|
+
[o]: u
|
|
43
46
|
},
|
|
44
47
|
messages: [
|
|
45
48
|
{
|
|
46
49
|
role: "tool",
|
|
47
50
|
content: `task_id: ${o}
|
|
48
51
|
---
|
|
49
|
-
` + (
|
|
52
|
+
` + (c?.text || ""),
|
|
50
53
|
tool_call_id: s.toolCall.id
|
|
51
54
|
}
|
|
52
55
|
]
|
|
53
56
|
};
|
|
54
|
-
return
|
|
55
|
-
|
|
56
|
-
}), new f({
|
|
57
|
-
update: c
|
|
57
|
+
return new m({
|
|
58
|
+
update: d
|
|
58
59
|
});
|
|
59
60
|
},
|
|
60
61
|
{
|
|
@@ -66,9 +67,10 @@ Available agent types and the tools they have access to:
|
|
|
66
67
|
- statusline-setup: Use this agent to configure the user's Claude Code status line setting. (Tools: Read, Edit)
|
|
67
68
|
- output-style-setup: Use this agent to create a Claude Code output style. (Tools: Read, Write, Edit, Glob, LS, Grep)
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
**IMPORTANT: Both subagent_id AND subagent_type are REQUIRED parameters. You must provide BOTH.**
|
|
71
71
|
|
|
72
|
+
- subagent_id: The specific ID of the subagent (e.g., "agents/default", "agents/manager")
|
|
73
|
+
- subagent_type: The type category of the subagent (e.g., "general-purpose", "statusline-setup")
|
|
72
74
|
|
|
73
75
|
When NOT to use the Agent tool:
|
|
74
76
|
- If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly
|
|
@@ -121,9 +123,9 @@ Since the user is greeting, use the greeting-responder agent to respond with a f
|
|
|
121
123
|
assistant: "I'm going to use the Task tool to launch the with the greeting-responder agent"
|
|
122
124
|
</example>
|
|
123
125
|
`,
|
|
124
|
-
schema:
|
|
126
|
+
schema: k
|
|
125
127
|
}
|
|
126
|
-
),
|
|
128
|
+
), v = `
|
|
127
129
|
|
|
128
130
|
## SubAgents System
|
|
129
131
|
|
|
@@ -138,7 +140,7 @@ You have access to a subagent system that can delegate specialized tasks to othe
|
|
|
138
140
|
SubAgents follow a **progressive disclosure** pattern - you know they exist (name + description above), but you only delegate tasks when needed:
|
|
139
141
|
|
|
140
142
|
1. **Recognize when to delegate**: Check if the user's task matches a subagent's specialization
|
|
141
|
-
2. **Use the
|
|
143
|
+
2. **Use the task tool**: Call the tool with the subagent's ID and a clear task description
|
|
142
144
|
3. **Provide context**: Use the \`data_transfer\` parameter to pass relevant information
|
|
143
145
|
4. **Get results**: The subagent will process the task and return results
|
|
144
146
|
|
|
@@ -150,7 +152,7 @@ SubAgents follow a **progressive disclosure** pattern - you know they exist (nam
|
|
|
150
152
|
|
|
151
153
|
**SubAgent Tool Usage:**
|
|
152
154
|
|
|
153
|
-
The \`
|
|
155
|
+
The \`task\` tool is available for delegation:
|
|
154
156
|
|
|
155
157
|
- **subagent_id**: The ID of the subagent to delegate to
|
|
156
158
|
- **task_description**: Clear description of what needs to be done
|
|
@@ -162,24 +164,21 @@ The \`ask_subagents\` tool is available for delegation:
|
|
|
162
164
|
User: "Can you have the research agent look into quantum computing developments?"
|
|
163
165
|
|
|
164
166
|
1. Check available subagents above → See "research" subagent with ID
|
|
165
|
-
2. Use
|
|
167
|
+
2. Use task tool with appropriate parameters
|
|
166
168
|
3. Provide clear task description and any necessary context
|
|
167
169
|
4. Process the results from the subagent
|
|
168
170
|
|
|
169
171
|
Remember: SubAgents are tools to distribute work and leverage specialized capabilities. When in doubt, check if a subagent exists for the task!
|
|
170
172
|
`;
|
|
171
|
-
class
|
|
173
|
+
class U {
|
|
172
174
|
name = "SubAgentsMiddleware";
|
|
173
|
-
stateSchema =
|
|
174
|
-
contextSchema =
|
|
175
|
+
stateSchema = y;
|
|
176
|
+
// contextSchema = undefined;
|
|
175
177
|
tools = [];
|
|
176
178
|
agentList = Promise.resolve("");
|
|
177
179
|
constructor(t) {
|
|
178
180
|
this.agentList = this.formatSubAgentsList(t), this.tools.push(
|
|
179
|
-
|
|
180
|
-
async (e, s, a) => await y("agents/default", t, a, {}, { subagent_id: e }),
|
|
181
|
-
{}
|
|
182
|
-
)
|
|
181
|
+
_(async (e, s, a) => await w(s.subagent_id, t, a, {}, { parent_id: e }))
|
|
183
182
|
);
|
|
184
183
|
}
|
|
185
184
|
/**
|
|
@@ -188,23 +187,23 @@ class W {
|
|
|
188
187
|
async formatSubAgentsList(t) {
|
|
189
188
|
const e = [];
|
|
190
189
|
for (const s of await t.listAgents())
|
|
191
|
-
e.push(`- **${s.id}**: ${s.description}`), e.push(` → Use
|
|
190
|
+
e.push(`- **${s.id}**: ${s.description}`), e.push(` → Use task with subagent_id: "${s.id}"`);
|
|
192
191
|
return e.join(`
|
|
193
192
|
`);
|
|
194
193
|
}
|
|
195
194
|
async wrapModelCall(t, e) {
|
|
196
|
-
const s = await this.agentList, a =
|
|
195
|
+
const s = await this.agentList, a = v.replace("{subagents_list}", s);
|
|
197
196
|
let o;
|
|
198
197
|
t.systemPrompt ? o = t.systemPrompt + `
|
|
199
198
|
|
|
200
199
|
` + a : o = a;
|
|
201
|
-
const
|
|
200
|
+
const i = new p(o), l = {
|
|
202
201
|
...t,
|
|
203
|
-
systemMessage:
|
|
202
|
+
systemMessage: i
|
|
204
203
|
};
|
|
205
|
-
return await e(
|
|
204
|
+
return await e(l);
|
|
206
205
|
}
|
|
207
206
|
}
|
|
208
207
|
export {
|
|
209
|
-
|
|
208
|
+
U as SubAgentsMiddleware
|
|
210
209
|
};
|
package/dist/zen-code.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zen-code",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/cli.mjs",
|
|
6
6
|
"bin": "./dist/cli.mjs",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@langchain/google-genai": "^2.1.18",
|
|
19
19
|
"@langchain/langgraph": "^1.1.0",
|
|
20
20
|
"@langchain/openai": "1.1.3",
|
|
21
|
-
"@langgraph-js/pure-graph": "^3.
|
|
21
|
+
"@langgraph-js/pure-graph": "^3.1.2",
|
|
22
22
|
"chalk": "^5.6.2",
|
|
23
23
|
"execa": "^9.6.1",
|
|
24
24
|
"extract-zip": "^2.0.1",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@inkjs/ui": "^2.0.0",
|
|
44
44
|
"@langchain/mcp-adapters": "^1.1.1",
|
|
45
|
-
"@langgraph-js/sdk": "^4.6.
|
|
45
|
+
"@langgraph-js/sdk": "^4.6.3",
|
|
46
46
|
"@nanostores/react": "^1.0.0",
|
|
47
47
|
"@tanstack/react-query": "^5.90.21",
|
|
48
48
|
"@testing-library/react": "^16.3.2",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"vitest": "^4.0.18",
|
|
69
69
|
"@codegraph/agent": "1.0.0",
|
|
70
70
|
"@codegraph/union-client": "1.0.0",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
71
|
+
"ink-pro": "1.1.0",
|
|
72
|
+
"@codegraph/config": "1.0.0"
|
|
73
73
|
},
|
|
74
74
|
"babel": {
|
|
75
75
|
"presets": [
|
package/dist/id-Cu7CRpDw.mjs
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { I as P, J as d, K as _ } from "./graphBuilder-B0bC88R_.mjs";
|
|
2
|
-
var v, m, g = 0, O = 0;
|
|
3
|
-
function h(r, e, n) {
|
|
4
|
-
var f = 0, t = e || new Array(16);
|
|
5
|
-
r = r || {};
|
|
6
|
-
var i = r.node, a = r.clockseq;
|
|
7
|
-
if (r._v6 || (i || (i = v), a == null && (a = m)), i == null || a == null) {
|
|
8
|
-
var u = r.random || (r.rng || P)();
|
|
9
|
-
i == null && (i = [u[0], u[1], u[2], u[3], u[4], u[5]], !v && !r._v6 && (i[0] |= 1, v = i)), a == null && (a = (u[6] << 8 | u[7]) & 16383, m === void 0 && !r._v6 && (m = a));
|
|
10
|
-
}
|
|
11
|
-
var c = r.msecs !== void 0 ? r.msecs : Date.now(), o = r.nsecs !== void 0 ? r.nsecs : O + 1, j = c - g + (o - O) / 1e4;
|
|
12
|
-
if (j < 0 && r.clockseq === void 0 && (a = a + 1 & 16383), (j < 0 || c > g) && r.nsecs === void 0 && (o = 0), o >= 1e4)
|
|
13
|
-
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
|
|
14
|
-
g = c, O = o, m = a, c += 122192928e5;
|
|
15
|
-
var l = ((c & 268435455) * 1e4 + o) % 4294967296;
|
|
16
|
-
t[f++] = l >>> 24 & 255, t[f++] = l >>> 16 & 255, t[f++] = l >>> 8 & 255, t[f++] = l & 255;
|
|
17
|
-
var x = c / 4294967296 * 1e4 & 268435455;
|
|
18
|
-
t[f++] = x >>> 8 & 255, t[f++] = x & 255, t[f++] = x >>> 24 & 15 | 16, t[f++] = x >>> 16 & 255, t[f++] = a >>> 8 | 128, t[f++] = a & 255;
|
|
19
|
-
for (var b = 0; b < 6; ++b)
|
|
20
|
-
t[f + b] = i[b];
|
|
21
|
-
return e || d(t);
|
|
22
|
-
}
|
|
23
|
-
function s(r) {
|
|
24
|
-
var e = typeof r == "string" ? _(r) : r, n = S(e);
|
|
25
|
-
return typeof r == "string" ? d(n) : n;
|
|
26
|
-
}
|
|
27
|
-
function S(r, e = !1) {
|
|
28
|
-
return Uint8Array.of((r[6] & 15) << 4 | r[7] >> 4 & 15, (r[7] & 15) << 4 | (r[4] & 240) >> 4, (r[4] & 15) << 4 | (r[5] & 240) >> 4, (r[5] & 15) << 4 | (r[0] & 240) >> 4, (r[0] & 15) << 4 | (r[1] & 240) >> 4, (r[1] & 15) << 4 | (r[2] & 240) >> 4, 96 | r[2] & 15, r[3], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15]);
|
|
29
|
-
}
|
|
30
|
-
function p(r, e) {
|
|
31
|
-
var n = Object.keys(r);
|
|
32
|
-
if (Object.getOwnPropertySymbols) {
|
|
33
|
-
var f = Object.getOwnPropertySymbols(r);
|
|
34
|
-
e && (f = f.filter(function(t) {
|
|
35
|
-
return Object.getOwnPropertyDescriptor(r, t).enumerable;
|
|
36
|
-
})), n.push.apply(n, f);
|
|
37
|
-
}
|
|
38
|
-
return n;
|
|
39
|
-
}
|
|
40
|
-
function w(r) {
|
|
41
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
42
|
-
var n = arguments[e] != null ? arguments[e] : {};
|
|
43
|
-
e % 2 ? p(Object(n), !0).forEach(function(f) {
|
|
44
|
-
k(r, f, n[f]);
|
|
45
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(n)) : p(Object(n)).forEach(function(f) {
|
|
46
|
-
Object.defineProperty(r, f, Object.getOwnPropertyDescriptor(n, f));
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return r;
|
|
50
|
-
}
|
|
51
|
-
function k(r, e, n) {
|
|
52
|
-
return (e = D(e)) in r ? Object.defineProperty(r, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : r[e] = n, r;
|
|
53
|
-
}
|
|
54
|
-
function D(r) {
|
|
55
|
-
var e = q(r, "string");
|
|
56
|
-
return typeof e == "symbol" ? e : e + "";
|
|
57
|
-
}
|
|
58
|
-
function q(r, e) {
|
|
59
|
-
if (typeof r != "object" || !r) return r;
|
|
60
|
-
var n = r[Symbol.toPrimitive];
|
|
61
|
-
if (n !== void 0) {
|
|
62
|
-
var f = n.call(r, e);
|
|
63
|
-
if (typeof f != "object") return f;
|
|
64
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
65
|
-
}
|
|
66
|
-
return (e === "string" ? String : Number)(r);
|
|
67
|
-
}
|
|
68
|
-
function E(r = {}, e, n = 0) {
|
|
69
|
-
var f = h(w(w({}, r), {}, {
|
|
70
|
-
_v6: !0
|
|
71
|
-
}), new Uint8Array(16));
|
|
72
|
-
return f = s(f), d(f);
|
|
73
|
-
}
|
|
74
|
-
function A(r) {
|
|
75
|
-
return E({ clockseq: r });
|
|
76
|
-
}
|
|
77
|
-
export {
|
|
78
|
-
A as u
|
|
79
|
-
};
|
package/dist/zen-init.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log("Please zen-code and use /m to configure models");
|