@bike4mind/cli 0.20.0 → 0.20.1
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/{AgentHistoryStore-C8uUKjjC.mjs → AgentHistoryStore-BQiATPsQ.mjs} +283 -40
- package/dist/{ApiClient-B_CQrUiF.mjs → ApiClient-BPmlalut.mjs} +2 -2
- package/dist/{ConfigStore-DD3DcC3-.mjs → ConfigStore-CNfbeaJf.mjs} +346 -11
- package/dist/{buildAgent-mVuXU_H4.mjs → buildAgent-DwPvcTpz.mjs} +2 -2
- package/dist/commands/acpCommand.mjs +4 -4
- package/dist/commands/apiCommand.mjs +1 -1
- package/dist/commands/doctorCommand.mjs +1 -1
- package/dist/commands/envCommand.mjs +1 -1
- package/dist/commands/headlessCommand.mjs +3 -3
- package/dist/commands/mcpCommand.mjs +3 -3
- package/dist/commands/pluginCommand.mjs +1 -1
- package/dist/commands/updateCommand.mjs +1 -1
- package/dist/index.mjs +45 -27
- package/dist/{package-BqKSCbso.mjs → package-CxHSRXdp.mjs} +1 -1
- package/dist/{serve-CuF0I5en.mjs → serve-Du3HiqAH.mjs} +2 -2
- package/package.json +9 -9
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as RemoteSkillSource, A as FallbackLlmBackend, C as createWriteTodosTool, D as createResumeAgentTool, E as createCoordinateTaskTool, G as DEFAULT_THOROUGHNESS, H as DEFAULT_AGENT_MODEL, I as PermissionManager, J as setWebSocketToolExecutor, K as clearFeatureModuleTools, N as findIterationBoundary, O as createBackgroundAgentTools, P as extractCompactInstructions, Q as isReadOnlyTool, R as getProcessHooks, S as createTodoStore, T as parseAgentConfig, U as DEFAULT_MAX_ITERATIONS, V as ALWAYS_DENIED_FOR_AGENTS, W as DEFAULT_RETRY_CONFIG, X as buildSystemPrompt, Y as getPlanModeFilePath, Z as buildSkillsPromptSection, _ as createDecisionStore, at as searchCommands, b as createWorkItemTools, c as isTransientNetworkError, ct as searchFiles, d as createReviewGateTool, et as CustomCommandStore, f as formatReviewGatesOutput, ft as MAX_PASTE_SIZE, g as createDecisionLogTool, h as formatBlockersOutput, it as processFileReferences, j as substituteArguments, k as createAgentDelegateTool, lt as warmFileCache, m as createBlockerTools, nt as SessionStore, ot as mergeCommands, p as createBlockerStore, q as registerFeatureModuleTools, rt as hasFileReferences, st as formatFileSize, tt as CheckpointStore, u as createReviewGateStore, ut as COMPACTION_SUMMARY_MARKER, v as formatDecisionsOutput, w as createSkillTool, x as createFindDefinitionTool, y as createGetFileStructureTool } from "./AgentHistoryStore-
|
|
2
|
+
import { $ as RemoteSkillSource, A as FallbackLlmBackend, C as createWriteTodosTool, D as createResumeAgentTool, E as createCoordinateTaskTool, G as DEFAULT_THOROUGHNESS, H as DEFAULT_AGENT_MODEL, I as PermissionManager, J as setWebSocketToolExecutor, K as clearFeatureModuleTools, N as findIterationBoundary, O as createBackgroundAgentTools, P as extractCompactInstructions, Q as isReadOnlyTool, R as getProcessHooks, S as createTodoStore, T as parseAgentConfig, U as DEFAULT_MAX_ITERATIONS, V as ALWAYS_DENIED_FOR_AGENTS, W as DEFAULT_RETRY_CONFIG, X as buildSystemPrompt, Y as getPlanModeFilePath, Z as buildSkillsPromptSection, _ as createDecisionStore, at as searchCommands, b as createWorkItemTools, c as isTransientNetworkError, ct as searchFiles, d as createReviewGateTool, et as CustomCommandStore, f as formatReviewGatesOutput, ft as MAX_PASTE_SIZE, g as createDecisionLogTool, h as formatBlockersOutput, it as processFileReferences, j as substituteArguments, k as createAgentDelegateTool, lt as warmFileCache, m as createBlockerTools, nt as SessionStore, ot as mergeCommands, p as createBlockerStore, q as registerFeatureModuleTools, rt as hasFileReferences, st as formatFileSize, tt as CheckpointStore, u as createReviewGateStore, ut as COMPACTION_SUMMARY_MARKER, v as formatDecisionsOutput, w as createSkillTool, x as createFindDefinitionTool, y as createGetFileStructureTool } from "./AgentHistoryStore-BQiATPsQ.mjs";
|
|
3
3
|
import { a as selectLiveSubagentTokens, i as selectLiveSubagentCredits, n as selectActiveBackgroundShells, o as useCliStore, r as selectCompletedBackgroundShells, t as selectActiveBackgroundAgents } from "./store-CvjTpQPs.mjs";
|
|
4
4
|
import { r as isFeatureEnabled, t as PluginStore } from "./PluginStore-DwvOJ-G3.mjs";
|
|
5
|
-
import { a as getCreditsUrl, b as CREDIT_DEDUCT_TRANSACTION_TYPES, c as requireApiUrl, i as LOCAL_DEV_URL, l as resolveApiEndpoint, n as logger, o as getEnvironmentName, r as ApiEndpointUnconfiguredError, s as parseApiUrl, t as ConfigStore, x as ChatModels } from "./ConfigStore-
|
|
5
|
+
import { a as getCreditsUrl, b as CREDIT_DEDUCT_TRANSACTION_TYPES, c as requireApiUrl, i as LOCAL_DEV_URL, l as resolveApiEndpoint, n as logger, o as getEnvironmentName, r as ApiEndpointUnconfiguredError, s as parseApiUrl, t as ConfigStore, x as ChatModels } from "./ConfigStore-CNfbeaJf.mjs";
|
|
6
6
|
import { t as getShellSessionManager } from "./ShellSessionManager-6o8KZzl1-vrbPAUTq.mjs";
|
|
7
|
-
import { n as OAuthClient, t as ApiClient } from "./ApiClient-
|
|
7
|
+
import { n as OAuthClient, t as ApiClient } from "./ApiClient-BPmlalut.mjs";
|
|
8
8
|
import { i as getTokenCounter, n as ConversationContext, r as reconstructTurnBlocks, t as WorkItemsClient } from "./WorkItemsClient-Cow6nXx7.mjs";
|
|
9
|
-
import { a as createToolSearchTool, i as buildLlmBackend, n as buildSupportingStores, o as deferredToolRegistry, r as buildSandbox, s as NotifyingLlmBackend, t as buildAgent } from "./buildAgent-
|
|
10
|
-
import { t as version } from "./package-
|
|
9
|
+
import { a as createToolSearchTool, i as buildLlmBackend, n as buildSupportingStores, o as deferredToolRegistry, r as buildSandbox, s as NotifyingLlmBackend, t as buildAgent } from "./buildAgent-DwPvcTpz.mjs";
|
|
10
|
+
import { t as version } from "./package-CxHSRXdp.mjs";
|
|
11
11
|
import { r as checkForUpdate } from "./updateChecker-CQW8bxo6.mjs";
|
|
12
12
|
import React, { useCallback, useEffect, useMemo, useReducer, useRef, useState, useSyncExternalStore } from "react";
|
|
13
13
|
import { Box, Static, Text, render, useApp, useInput, usePaste, useStdout } from "ink";
|
|
@@ -24,7 +24,7 @@ import TextInput from "ink-text-input";
|
|
|
24
24
|
import { z as z$1 } from "zod";
|
|
25
25
|
import { marked } from "marked";
|
|
26
26
|
import { highlight } from "cli-highlight";
|
|
27
|
-
import { actorColorIndex } from "@bike4mind/hearth";
|
|
27
|
+
import { ACTOR_COLOR_SLOTS, actorColorIndex, actorKindMarker, actorKindSchema, selfClaimedActorKindSchema } from "@bike4mind/hearth";
|
|
28
28
|
import axios, { isAxiosError } from "axios";
|
|
29
29
|
import SelectInput from "ink-select-input";
|
|
30
30
|
import jwt from "jsonwebtoken";
|
|
@@ -6124,6 +6124,8 @@ const HearthEventSchema = z$1.object({
|
|
|
6124
6124
|
actorId: z$1.string(),
|
|
6125
6125
|
/** Display name resolved by the server so surfaces need no actor lookup. */
|
|
6126
6126
|
actorName: z$1.string().optional(),
|
|
6127
|
+
/** Resolved server-side; `human` is reserved there and never self-claimed. */
|
|
6128
|
+
actorKind: actorKindSchema.optional(),
|
|
6127
6129
|
kind: HearthEventKindSchema,
|
|
6128
6130
|
human: HearthHumanBodySchema,
|
|
6129
6131
|
machine: HearthMachineBodySchema.optional(),
|
|
@@ -6142,7 +6144,14 @@ const HearthEventSchema = z$1.object({
|
|
|
6142
6144
|
const HearthSessionSchema = z$1.object({
|
|
6143
6145
|
id: z$1.string().min(1).max(200),
|
|
6144
6146
|
/** Friendly name for the session (the notebook name); display only. */
|
|
6145
|
-
label: z$1.string().max(200).optional()
|
|
6147
|
+
label: z$1.string().max(200).optional(),
|
|
6148
|
+
/**
|
|
6149
|
+
* What this session IS, so the server badges it honestly. Every write the CLI
|
|
6150
|
+
* makes originates in an LLM tool call, so a CLI session is an agent even
|
|
6151
|
+
* though its name is derived from the human's account. Only the self-claimable
|
|
6152
|
+
* kinds are accepted server-side; 'human' stays reserved there.
|
|
6153
|
+
*/
|
|
6154
|
+
kind: selfClaimedActorKindSchema.optional()
|
|
6146
6155
|
});
|
|
6147
6156
|
const HearthChannelSchema = z$1.object({
|
|
6148
6157
|
id: z$1.string(),
|
|
@@ -6488,26 +6497,27 @@ function createDelegateTool(service) {
|
|
|
6488
6497
|
/**
|
|
6489
6498
|
* Per-actor color for terminal output.
|
|
6490
6499
|
*
|
|
6491
|
-
*
|
|
6492
|
-
* as in the SPA -
|
|
6493
|
-
*
|
|
6494
|
-
*
|
|
6495
|
-
*
|
|
6500
|
+
* Both the SLOT and the hues come from @bike4mind/hearth so an actor lands on
|
|
6501
|
+
* the same color here as in the SPA - a session that reads as green in the web
|
|
6502
|
+
* channel view and amber in the CLI is two identities to a human, not one. Only
|
|
6503
|
+
* the ENCODING is local: the shared palette is light/dark hex pairs, which a
|
|
6504
|
+
* terminal cannot take directly.
|
|
6496
6505
|
*
|
|
6497
|
-
* 256-color
|
|
6498
|
-
*
|
|
6499
|
-
*
|
|
6500
|
-
*
|
|
6501
|
-
*
|
|
6506
|
+
* Truecolor rather than the 256-color cube so the emitted color is the validated
|
|
6507
|
+
* hue itself and not a nearest-neighbour approximation of it - the all-pairs
|
|
6508
|
+
* separation numbers in ACTOR_COLOR_SLOTS only hold for the exact steps. The
|
|
6509
|
+
* dark step is used because a terminal is assumed dark and there is no portable
|
|
6510
|
+
* way to ask it. Colour is never the only signal either way: the actor name and
|
|
6511
|
+
* the kind marker are always printed alongside.
|
|
6502
6512
|
*/
|
|
6503
|
-
const ACTOR_ANSI_COLORS =
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6513
|
+
const ACTOR_ANSI_COLORS = ACTOR_COLOR_SLOTS.map((slot) => {
|
|
6514
|
+
const [r, g, b] = [
|
|
6515
|
+
1,
|
|
6516
|
+
3,
|
|
6517
|
+
5
|
|
6518
|
+
].map((i) => parseInt(slot.dark.slice(i, i + 2), 16));
|
|
6519
|
+
return `\x1b[38;2;${r};${g};${b}m`;
|
|
6520
|
+
});
|
|
6511
6521
|
const RESET = "\x1B[0m";
|
|
6512
6522
|
/**
|
|
6513
6523
|
* Whether to emit escape codes at all. Honors NO_COLOR (the de-facto standard)
|
|
@@ -6617,7 +6627,7 @@ Posting to Hearth is unrestricted - the constraint is on OBEYING what you read o
|
|
|
6617
6627
|
for (const event of recent) {
|
|
6618
6628
|
const time = new Date(event.createdAt).toLocaleTimeString();
|
|
6619
6629
|
const icon = KIND_ICONS[event.kind] ?? "·";
|
|
6620
|
-
const actor = colorizeActor(event.actorId, event.actorName ?? event.actorId);
|
|
6630
|
+
const actor = colorizeActor(event.actorId, `${actorKindMarker(event.actorKind)} ${event.actorName ?? event.actorId}`);
|
|
6621
6631
|
const text = event.human.text.slice(0, 120) + (event.human.text.length > 120 ? "..." : "");
|
|
6622
6632
|
console.log(` ${time} ${icon} [${event.channelId}#${event.seq}] ${actor}: ${text}`);
|
|
6623
6633
|
}
|
|
@@ -6638,12 +6648,20 @@ Posting to Hearth is unrestricted - the constraint is on OBEYING what you read o
|
|
|
6638
6648
|
* Current CLI session as Hearth's per-session identity, or undefined before one
|
|
6639
6649
|
* exists. `label` is the notebook name, which the server renders but never uses
|
|
6640
6650
|
* as the actor identity key - it is renameable and auto-titled.
|
|
6651
|
+
*
|
|
6652
|
+
* `kind: 'agent'` because every hearth_* write is an LLM tool call - there is no
|
|
6653
|
+
* path by which a human types directly into the log from here - so leaving the
|
|
6654
|
+
* kind to default made the account's agent traffic badge as Human, which is the
|
|
6655
|
+
* one distinction a reader of a busy channel most needs. The NAME is still
|
|
6656
|
+
* server-derived from the account, so this only sharpens the badge; it claims
|
|
6657
|
+
* nothing about who owns the session.
|
|
6641
6658
|
*/
|
|
6642
6659
|
function hearthSessionFromStore() {
|
|
6643
6660
|
const session = useCliStore.getState().session;
|
|
6644
6661
|
return session ? {
|
|
6645
6662
|
id: session.id,
|
|
6646
|
-
label: session.name
|
|
6663
|
+
label: session.name,
|
|
6664
|
+
kind: "agent"
|
|
6647
6665
|
} : void 0;
|
|
6648
6666
|
}
|
|
6649
6667
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { c as requireApiUrl, d as AGENT_QUEST_MANIFEST, f as AGENT_QUEST_MCP_URI, n as logger, s as parseApiUrl, t as ConfigStore, u as AGENT_QUEST_ID } from "./ConfigStore-
|
|
3
|
-
import { t as ApiClient } from "./ApiClient-
|
|
2
|
+
import { c as requireApiUrl, d as AGENT_QUEST_MANIFEST, f as AGENT_QUEST_MCP_URI, n as logger, s as parseApiUrl, t as ConfigStore, u as AGENT_QUEST_ID } from "./ConfigStore-CNfbeaJf.mjs";
|
|
3
|
+
import { t as ApiClient } from "./ApiClient-BPmlalut.mjs";
|
|
4
4
|
import { z as z$1 } from "zod";
|
|
5
5
|
import { isAxiosError } from "axios";
|
|
6
6
|
import { Writable } from "node:stream";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bike4mind/cli",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Interactive CLI tool for Bike4Mind with ReAct agents",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"zod": "^4.4.3",
|
|
111
111
|
"zod-validation-error": "^5.0.0",
|
|
112
112
|
"zustand": "^5.0.13",
|
|
113
|
-
"@bike4mind/hearth": "0.
|
|
113
|
+
"@bike4mind/hearth": "0.3.0"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
116
|
"@types/better-sqlite3": "^7.6.13",
|
|
@@ -126,14 +126,14 @@
|
|
|
126
126
|
"tsx": "^4.23.0",
|
|
127
127
|
"typescript": "^5.9.3",
|
|
128
128
|
"vitest": "^4.1.10",
|
|
129
|
-
"@bike4mind/agents": "0.20.
|
|
130
|
-
"@bike4mind/common": "
|
|
131
|
-
"@bike4mind/fab-pipeline": "1.
|
|
132
|
-
"@bike4mind/llm-adapters": "0.11.
|
|
133
|
-
"@bike4mind/mcp": "1.41.
|
|
129
|
+
"@bike4mind/agents": "0.20.2",
|
|
130
|
+
"@bike4mind/common": "5.0.0",
|
|
131
|
+
"@bike4mind/fab-pipeline": "1.1.0",
|
|
132
|
+
"@bike4mind/llm-adapters": "0.11.2",
|
|
133
|
+
"@bike4mind/mcp": "1.41.3",
|
|
134
134
|
"@bike4mind/observability": "0.2.0",
|
|
135
|
-
"@bike4mind/services": "
|
|
136
|
-
"@bike4mind/utils": "
|
|
135
|
+
"@bike4mind/services": "6.0.0",
|
|
136
|
+
"@bike4mind/utils": "4.1.0"
|
|
137
137
|
},
|
|
138
138
|
"optionalDependencies": {
|
|
139
139
|
"@vscode/ripgrep": "^1.18.0"
|