@gurulu/cli 1.6.2 → 1.6.4
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/bin.js +25 -62
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -62
- package/dist/wizard/agent.d.ts.map +1 -1
- package/dist/wizard/context.d.ts.map +1 -1
- package/dist/wizard/run.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -41729,12 +41729,14 @@ function readTruncated(abs, maxBytes) {
|
|
|
41729
41729
|
const raw = redactSecrets(readFileSync9(abs, "utf-8"));
|
|
41730
41730
|
if (raw.length <= maxBytes)
|
|
41731
41731
|
return { content: raw, truncated: false };
|
|
41732
|
-
const
|
|
41733
|
-
const tail = maxBytes - head;
|
|
41734
|
-
return {
|
|
41735
|
-
content: `${raw.slice(0, head)}
|
|
41732
|
+
const marker = `
|
|
41736
41733
|
/* …${raw.length - maxBytes} char kesildi… */
|
|
41737
|
-
|
|
41734
|
+
`;
|
|
41735
|
+
const budget = Math.max(0, maxBytes - marker.length);
|
|
41736
|
+
const head = Math.floor(budget * 0.65);
|
|
41737
|
+
const tail = budget - head;
|
|
41738
|
+
return {
|
|
41739
|
+
content: `${raw.slice(0, head)}${marker}${tail > 0 ? raw.slice(-tail) : ""}`,
|
|
41738
41740
|
truncated: true
|
|
41739
41741
|
};
|
|
41740
41742
|
} catch {
|
|
@@ -42112,7 +42114,16 @@ function buildWireSystemPrompt() {
|
|
|
42112
42114
|
return [
|
|
42113
42115
|
"You are Gurulu's capture wire agent. Add the approved analytics events to the user's code,",
|
|
42114
42116
|
"plus any additional wiring tasks given (e.g. wrapping an LLM client, mounting a provider).",
|
|
42115
|
-
"
|
|
42117
|
+
"",
|
|
42118
|
+
"OUTPUT: respond with ONLY a single JSON object per turn — no prose, no markdown fences,",
|
|
42119
|
+
'no <think> blocks. Exact shape: {"reasoning": "<short why>", "action": <one action below>}',
|
|
42120
|
+
"action is exactly one of:",
|
|
42121
|
+
' {"tool": "read", "path": "src/file.ts"}',
|
|
42122
|
+
' {"tool": "edit", "path": "src/file.ts", "find": "<exact unique existing snippet>", "replace": "<that snippet plus added code>"}',
|
|
42123
|
+
' {"tool": "bash", "cmd": "npm run typecheck"}',
|
|
42124
|
+
' {"tool": "done", "summary": "<what was wired>"}',
|
|
42125
|
+
'Example turn: {"reasoning": "Read entry to find the init call site", "action": {"tool": "read", "path": "src/main.tsx"}}',
|
|
42126
|
+
"",
|
|
42116
42127
|
"HARD RULES:",
|
|
42117
42128
|
"- ADDITIVE-ONLY: every edit `replace` MUST contain `find` verbatim — you may only ADD code,",
|
|
42118
42129
|
' never delete or rewrite existing code. Edits violating this are rejected. To "wrap" an existing',
|
|
@@ -42336,6 +42347,10 @@ async function runWizard(opts) {
|
|
|
42336
42347
|
}
|
|
42337
42348
|
opts.cwd = target;
|
|
42338
42349
|
}
|
|
42350
|
+
const priorConfig = readProjectConfig(opts.cwd);
|
|
42351
|
+
if (priorConfig?.workspace_id) {
|
|
42352
|
+
p4.log.info(c3.dim(`Bu proje zaten bağlı (workspace ${priorConfig.workspace_id.slice(0, 8)}…) — güncelleme / yeni özellik ekleme modu.`));
|
|
42353
|
+
}
|
|
42339
42354
|
const TOTAL = 6;
|
|
42340
42355
|
const phase = (n2, label) => {
|
|
42341
42356
|
p4.log.step(`${c3.dim(`[${n2}/${TOTAL}]`)} ${c3.bold(label)}`);
|
|
@@ -42653,61 +42668,9 @@ async function resolveWorkspace(client, authWorkspaceId, opts) {
|
|
|
42653
42668
|
if (opts.writeKey) {
|
|
42654
42669
|
return { workspaceId: opts.workspaceId ?? authWorkspaceId, writeKey: opts.writeKey };
|
|
42655
42670
|
}
|
|
42656
|
-
|
|
42657
|
-
|
|
42658
|
-
|
|
42659
|
-
return { workspaceId: wsId, writeKey: write_key2 };
|
|
42660
|
-
}
|
|
42661
|
-
let list = [];
|
|
42662
|
-
try {
|
|
42663
|
-
list = (await client.listWorkspaces()).workspaces;
|
|
42664
|
-
} catch {
|
|
42665
|
-
list = [];
|
|
42666
|
-
}
|
|
42667
|
-
const CREATE = "__create__";
|
|
42668
|
-
let selected;
|
|
42669
|
-
if (list.length === 0) {
|
|
42670
|
-
selected = CREATE;
|
|
42671
|
-
} else {
|
|
42672
|
-
const initial = list.find((w2) => w2.workspace_id === authWorkspaceId)?.workspace_id ?? list[0]?.workspace_id ?? CREATE;
|
|
42673
|
-
const choice = await p4.select({
|
|
42674
|
-
message: "Workspace seç",
|
|
42675
|
-
options: [
|
|
42676
|
-
...list.map((w2) => ({ value: w2.workspace_id, label: w2.name, hint: w2.slug })),
|
|
42677
|
-
{ value: CREATE, label: "➕ Yeni workspace oluştur" }
|
|
42678
|
-
],
|
|
42679
|
-
initialValue: initial
|
|
42680
|
-
});
|
|
42681
|
-
if (p4.isCancel(choice))
|
|
42682
|
-
bail();
|
|
42683
|
-
selected = choice;
|
|
42684
|
-
}
|
|
42685
|
-
if (selected === CREATE) {
|
|
42686
|
-
const name = await p4.text({
|
|
42687
|
-
message: "Workspace adı",
|
|
42688
|
-
placeholder: "My App",
|
|
42689
|
-
validate: (v2) => v2.trim() ? undefined : "gerekli"
|
|
42690
|
-
});
|
|
42691
|
-
if (p4.isCancel(name))
|
|
42692
|
-
bail();
|
|
42693
|
-
const domain = await p4.text({
|
|
42694
|
-
message: "Domain",
|
|
42695
|
-
placeholder: "example.com",
|
|
42696
|
-
validate: (v2) => v2.trim().length >= 3 ? undefined : "geçerli domain gerekli"
|
|
42697
|
-
});
|
|
42698
|
-
if (p4.isCancel(domain))
|
|
42699
|
-
bail();
|
|
42700
|
-
const s2 = p4.spinner();
|
|
42701
|
-
s2.start("Workspace oluşturuluyor…");
|
|
42702
|
-
const created = await client.createWorkspace({
|
|
42703
|
-
name: String(name).trim(),
|
|
42704
|
-
domain: String(domain).trim()
|
|
42705
|
-
});
|
|
42706
|
-
s2.stop(`Workspace oluşturuldu: ${created.name}`);
|
|
42707
|
-
return { workspaceId: created.workspace_id, writeKey: created.write_key };
|
|
42708
|
-
}
|
|
42709
|
-
const { write_key } = await client.issueWriteKey(selected);
|
|
42710
|
-
return { workspaceId: selected, writeKey: write_key };
|
|
42671
|
+
const wsId = opts.workspaceId ?? authWorkspaceId;
|
|
42672
|
+
const { write_key } = await client.issueWriteKey(wsId);
|
|
42673
|
+
return { workspaceId: wsId, writeKey: write_key };
|
|
42711
42674
|
}
|
|
42712
42675
|
function injectionLine(strategy, reason, file) {
|
|
42713
42676
|
if (strategy === "prepend-entry" && reason === "injected")
|
|
@@ -43148,7 +43111,7 @@ var uninstallCmd = defineCommand({
|
|
|
43148
43111
|
});
|
|
43149
43112
|
|
|
43150
43113
|
// src/index.ts
|
|
43151
|
-
var VERSION = "1.6.
|
|
43114
|
+
var VERSION = "1.6.4";
|
|
43152
43115
|
var mainCmd = defineCommand({
|
|
43153
43116
|
meta: {
|
|
43154
43117
|
name: "gurulu",
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -41306,12 +41306,14 @@ function readTruncated(abs, maxBytes) {
|
|
|
41306
41306
|
const raw = redactSecrets(readFileSync9(abs, "utf-8"));
|
|
41307
41307
|
if (raw.length <= maxBytes)
|
|
41308
41308
|
return { content: raw, truncated: false };
|
|
41309
|
-
const
|
|
41310
|
-
const tail = maxBytes - head;
|
|
41311
|
-
return {
|
|
41312
|
-
content: `${raw.slice(0, head)}
|
|
41309
|
+
const marker = `
|
|
41313
41310
|
/* …${raw.length - maxBytes} char kesildi… */
|
|
41314
|
-
|
|
41311
|
+
`;
|
|
41312
|
+
const budget = Math.max(0, maxBytes - marker.length);
|
|
41313
|
+
const head = Math.floor(budget * 0.65);
|
|
41314
|
+
const tail = budget - head;
|
|
41315
|
+
return {
|
|
41316
|
+
content: `${raw.slice(0, head)}${marker}${tail > 0 ? raw.slice(-tail) : ""}`,
|
|
41315
41317
|
truncated: true
|
|
41316
41318
|
};
|
|
41317
41319
|
} catch {
|
|
@@ -41689,7 +41691,16 @@ function buildWireSystemPrompt() {
|
|
|
41689
41691
|
return [
|
|
41690
41692
|
"You are Gurulu's capture wire agent. Add the approved analytics events to the user's code,",
|
|
41691
41693
|
"plus any additional wiring tasks given (e.g. wrapping an LLM client, mounting a provider).",
|
|
41692
|
-
"
|
|
41694
|
+
"",
|
|
41695
|
+
"OUTPUT: respond with ONLY a single JSON object per turn — no prose, no markdown fences,",
|
|
41696
|
+
'no <think> blocks. Exact shape: {"reasoning": "<short why>", "action": <one action below>}',
|
|
41697
|
+
"action is exactly one of:",
|
|
41698
|
+
' {"tool": "read", "path": "src/file.ts"}',
|
|
41699
|
+
' {"tool": "edit", "path": "src/file.ts", "find": "<exact unique existing snippet>", "replace": "<that snippet plus added code>"}',
|
|
41700
|
+
' {"tool": "bash", "cmd": "npm run typecheck"}',
|
|
41701
|
+
' {"tool": "done", "summary": "<what was wired>"}',
|
|
41702
|
+
'Example turn: {"reasoning": "Read entry to find the init call site", "action": {"tool": "read", "path": "src/main.tsx"}}',
|
|
41703
|
+
"",
|
|
41693
41704
|
"HARD RULES:",
|
|
41694
41705
|
"- ADDITIVE-ONLY: every edit `replace` MUST contain `find` verbatim — you may only ADD code,",
|
|
41695
41706
|
' never delete or rewrite existing code. Edits violating this are rejected. To "wrap" an existing',
|
|
@@ -41913,6 +41924,10 @@ async function runWizard(opts) {
|
|
|
41913
41924
|
}
|
|
41914
41925
|
opts.cwd = target;
|
|
41915
41926
|
}
|
|
41927
|
+
const priorConfig = readProjectConfig(opts.cwd);
|
|
41928
|
+
if (priorConfig?.workspace_id) {
|
|
41929
|
+
p4.log.info(c3.dim(`Bu proje zaten bağlı (workspace ${priorConfig.workspace_id.slice(0, 8)}…) — güncelleme / yeni özellik ekleme modu.`));
|
|
41930
|
+
}
|
|
41916
41931
|
const TOTAL = 6;
|
|
41917
41932
|
const phase = (n2, label) => {
|
|
41918
41933
|
p4.log.step(`${c3.dim(`[${n2}/${TOTAL}]`)} ${c3.bold(label)}`);
|
|
@@ -42230,61 +42245,9 @@ async function resolveWorkspace(client, authWorkspaceId, opts) {
|
|
|
42230
42245
|
if (opts.writeKey) {
|
|
42231
42246
|
return { workspaceId: opts.workspaceId ?? authWorkspaceId, writeKey: opts.writeKey };
|
|
42232
42247
|
}
|
|
42233
|
-
|
|
42234
|
-
|
|
42235
|
-
|
|
42236
|
-
return { workspaceId: wsId, writeKey: write_key2 };
|
|
42237
|
-
}
|
|
42238
|
-
let list = [];
|
|
42239
|
-
try {
|
|
42240
|
-
list = (await client.listWorkspaces()).workspaces;
|
|
42241
|
-
} catch {
|
|
42242
|
-
list = [];
|
|
42243
|
-
}
|
|
42244
|
-
const CREATE = "__create__";
|
|
42245
|
-
let selected;
|
|
42246
|
-
if (list.length === 0) {
|
|
42247
|
-
selected = CREATE;
|
|
42248
|
-
} else {
|
|
42249
|
-
const initial = list.find((w2) => w2.workspace_id === authWorkspaceId)?.workspace_id ?? list[0]?.workspace_id ?? CREATE;
|
|
42250
|
-
const choice = await p4.select({
|
|
42251
|
-
message: "Workspace seç",
|
|
42252
|
-
options: [
|
|
42253
|
-
...list.map((w2) => ({ value: w2.workspace_id, label: w2.name, hint: w2.slug })),
|
|
42254
|
-
{ value: CREATE, label: "➕ Yeni workspace oluştur" }
|
|
42255
|
-
],
|
|
42256
|
-
initialValue: initial
|
|
42257
|
-
});
|
|
42258
|
-
if (p4.isCancel(choice))
|
|
42259
|
-
bail();
|
|
42260
|
-
selected = choice;
|
|
42261
|
-
}
|
|
42262
|
-
if (selected === CREATE) {
|
|
42263
|
-
const name = await p4.text({
|
|
42264
|
-
message: "Workspace adı",
|
|
42265
|
-
placeholder: "My App",
|
|
42266
|
-
validate: (v2) => v2.trim() ? undefined : "gerekli"
|
|
42267
|
-
});
|
|
42268
|
-
if (p4.isCancel(name))
|
|
42269
|
-
bail();
|
|
42270
|
-
const domain = await p4.text({
|
|
42271
|
-
message: "Domain",
|
|
42272
|
-
placeholder: "example.com",
|
|
42273
|
-
validate: (v2) => v2.trim().length >= 3 ? undefined : "geçerli domain gerekli"
|
|
42274
|
-
});
|
|
42275
|
-
if (p4.isCancel(domain))
|
|
42276
|
-
bail();
|
|
42277
|
-
const s2 = p4.spinner();
|
|
42278
|
-
s2.start("Workspace oluşturuluyor…");
|
|
42279
|
-
const created = await client.createWorkspace({
|
|
42280
|
-
name: String(name).trim(),
|
|
42281
|
-
domain: String(domain).trim()
|
|
42282
|
-
});
|
|
42283
|
-
s2.stop(`Workspace oluşturuldu: ${created.name}`);
|
|
42284
|
-
return { workspaceId: created.workspace_id, writeKey: created.write_key };
|
|
42285
|
-
}
|
|
42286
|
-
const { write_key } = await client.issueWriteKey(selected);
|
|
42287
|
-
return { workspaceId: selected, writeKey: write_key };
|
|
42248
|
+
const wsId = opts.workspaceId ?? authWorkspaceId;
|
|
42249
|
+
const { write_key } = await client.issueWriteKey(wsId);
|
|
42250
|
+
return { workspaceId: wsId, writeKey: write_key };
|
|
42288
42251
|
}
|
|
42289
42252
|
function injectionLine(strategy, reason, file) {
|
|
42290
42253
|
if (strategy === "prepend-entry" && reason === "injected")
|
|
@@ -42725,7 +42688,7 @@ var uninstallCmd = defineCommand({
|
|
|
42725
42688
|
});
|
|
42726
42689
|
|
|
42727
42690
|
// src/index.ts
|
|
42728
|
-
var VERSION = "1.6.
|
|
42691
|
+
var VERSION = "1.6.4";
|
|
42729
42692
|
var mainCmd = defineCommand({
|
|
42730
42693
|
meta: {
|
|
42731
42694
|
name: "gurulu",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/wizard/agent.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAuC/D,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,OAAO,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;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M,EAAE,EACf,UAAU,GAAE,MAAM,EAAO,GACxB,MAAM,CA2BR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/wizard/context.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,WAAW;IAC1B,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsBD,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAWrD;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/wizard/context.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,WAAW;IAC1B,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAsBD,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAWrD;AAyGD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,WAAW,CAwC9D"}
|
package/dist/wizard/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/wizard/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/wizard/run.ts"],"names":[],"mappings":"AAuCA,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4CAA4C;IAC5C,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,sFAAsF;IACtF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA0DD,wBAAsB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAwclE"}
|