@arvoretech/hub 0.19.0 → 0.21.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.
|
@@ -117,7 +117,7 @@ async function checkAndAutoRegenerate(hubDir) {
|
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
119
|
console.log(chalk.yellow("\n Detected outdated configs, auto-regenerating..."));
|
|
120
|
-
const { generators: generators2 } = await import("./generate-
|
|
120
|
+
const { generators: generators2 } = await import("./generate-ZH3P5EB4.js");
|
|
121
121
|
const generator = generators2[result.editor];
|
|
122
122
|
if (!generator) {
|
|
123
123
|
console.log(chalk.red(` Unknown editor '${result.editor}' in cache. Run 'hub generate' manually.`));
|
|
@@ -1761,6 +1761,76 @@ Additional context sources:
|
|
|
1761
1761
|
- Use monitoring MCPs for production debugging and log analysis when available`);
|
|
1762
1762
|
return parts.join("\n");
|
|
1763
1763
|
}
|
|
1764
|
+
function buildFetchCheckerSection() {
|
|
1765
|
+
return `
|
|
1766
|
+
## Fact Checker \u2014 Mandatory Verification
|
|
1767
|
+
|
|
1768
|
+
**NEVER state the status of any external resource without verifying it first.**
|
|
1769
|
+
|
|
1770
|
+
Before making ANY claim about:
|
|
1771
|
+
- PR status (merged, open, closed, approved, changes requested)
|
|
1772
|
+
- Branch state (ahead, behind, conflicts, existence)
|
|
1773
|
+
- Deploy status (deployed, failed, in progress)
|
|
1774
|
+
- CI/CD pipeline results (passed, failed, running)
|
|
1775
|
+
- Issue/task status (open, closed, in progress)
|
|
1776
|
+
- Service health (up, down, degraded)
|
|
1777
|
+
- Any other external state that can change over time
|
|
1778
|
+
|
|
1779
|
+
You MUST:
|
|
1780
|
+
1. Use the appropriate tool to check the actual current state (GitHub CLI, MCP tools, git commands, etc.)
|
|
1781
|
+
2. Only THEN report the result to the user
|
|
1782
|
+
3. If you cannot verify, explicitly say "I was unable to verify this \u2014 please check manually"
|
|
1783
|
+
|
|
1784
|
+
**NEVER assume, guess, or rely on cached/stale information.** Every claim about external state must be backed by a fresh check.
|
|
1785
|
+
This applies to ALL agents in the pipeline, not just the orchestrator.`;
|
|
1786
|
+
}
|
|
1787
|
+
function buildMemorySection(config) {
|
|
1788
|
+
const enforce = config.memory?.enforce ?? false;
|
|
1789
|
+
if (enforce) {
|
|
1790
|
+
return `
|
|
1791
|
+
## Team Memory \u2014 MANDATORY
|
|
1792
|
+
|
|
1793
|
+
This workspace has a team memory knowledge base via the \`team-memory\` MCP.
|
|
1794
|
+
|
|
1795
|
+
**YOU MUST consult memory at the START of EVERY interaction.** This is not optional.
|
|
1796
|
+
|
|
1797
|
+
### On every message from the user:
|
|
1798
|
+
1. Extract the key topics, entities, and domain terms from the user's request
|
|
1799
|
+
2. Run \`search_memories\` with relevant keywords BEFORE doing anything else
|
|
1800
|
+
3. If memories are found, factor them into your response \u2014 they may contain past decisions, conventions, known issues, or domain context that directly affects the current task
|
|
1801
|
+
4. If no relevant memories are found, proceed normally
|
|
1802
|
+
|
|
1803
|
+
### Before calling tools:
|
|
1804
|
+
When you are about to use a tool that interacts with external systems (database queries, API calls, git operations, deployments, file modifications in specific domains), do a quick \`search_memories\` for the relevant entity or system first. There may be a memory about:
|
|
1805
|
+
- Schema changes, migrations, or known issues with that table/endpoint
|
|
1806
|
+
- Conventions for how that system should be used
|
|
1807
|
+
- Past incidents or gotchas that affect the operation you're about to perform
|
|
1808
|
+
This does NOT apply to simple read/search tools \u2014 use judgment on when a memory check adds value.
|
|
1809
|
+
|
|
1810
|
+
### When completing work:
|
|
1811
|
+
- If you discovered something valuable (a decision, a gotcha, a convention, a domain insight, a debugging finding), use \`add_memory\` to capture it
|
|
1812
|
+
- Be specific: include context, rationale, and affected areas
|
|
1813
|
+
- Use appropriate categories: decisions, conventions, incidents, domain, gotchas
|
|
1814
|
+
|
|
1815
|
+
### Why this matters:
|
|
1816
|
+
- Memories contain institutional knowledge that prevents repeated mistakes
|
|
1817
|
+
- Past decisions explain WHY things are the way they are
|
|
1818
|
+
- Conventions ensure consistency across the team
|
|
1819
|
+
- Gotchas save hours of debugging
|
|
1820
|
+
|
|
1821
|
+
Available tools: \`search_memories\`, \`get_memory\`, \`add_memory\`, \`list_memories\`, \`archive_memory\`, \`remove_memory\`.`;
|
|
1822
|
+
}
|
|
1823
|
+
return `
|
|
1824
|
+
## Team Memory
|
|
1825
|
+
|
|
1826
|
+
This workspace has a team memory knowledge base available via the \`team-memory\` MCP.
|
|
1827
|
+
|
|
1828
|
+
**Before starting any task**, use \`search_memories\` to find relevant context \u2014 past decisions, conventions, known issues, and domain knowledge. This avoids repeating mistakes and ensures consistency with previous choices.
|
|
1829
|
+
|
|
1830
|
+
**After completing a task**, if you discovered something valuable (a decision, a gotcha, a convention, domain insight), use \`add_memory\` to capture it for the team.
|
|
1831
|
+
|
|
1832
|
+
Available tools: \`search_memories\`, \`get_memory\`, \`add_memory\`, \`list_memories\`, \`archive_memory\`, \`remove_memory\`.`;
|
|
1833
|
+
}
|
|
1764
1834
|
function buildCoreBehaviorSections() {
|
|
1765
1835
|
const sections = [];
|
|
1766
1836
|
sections.push(`
|
|
@@ -1909,16 +1979,10 @@ ${prompt.sections.after_delivery.trim()}`);
|
|
|
1909
1979
|
sections.push(mcpToolsSectionOpenCode);
|
|
1910
1980
|
}
|
|
1911
1981
|
if (config.memory) {
|
|
1912
|
-
sections.push(
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
**Before starting any task**, use \`search_memories\` to find relevant context \u2014 past decisions, conventions, known issues, and domain knowledge. This avoids repeating mistakes and ensures consistency with previous choices.
|
|
1918
|
-
|
|
1919
|
-
**After completing a task**, if you discovered something valuable (a decision, a gotcha, a convention, domain insight), use \`add_memory\` to capture it for the team.
|
|
1920
|
-
|
|
1921
|
-
Available tools: \`search_memories\`, \`get_memory\`, \`add_memory\`, \`list_memories\`, \`archive_memory\`, \`remove_memory\`.`);
|
|
1982
|
+
sections.push(buildMemorySection(config));
|
|
1983
|
+
}
|
|
1984
|
+
if (config.workflow?.fact_checker) {
|
|
1985
|
+
sections.push(buildFetchCheckerSection());
|
|
1922
1986
|
}
|
|
1923
1987
|
const designSectionOpenCode = buildDesignSection(config);
|
|
1924
1988
|
if (designSectionOpenCode) sections.push(designSectionOpenCode);
|
|
@@ -2234,16 +2298,10 @@ ${prompt.sections.after_delivery.trim()}`);
|
|
|
2234
2298
|
sections.push(mcpToolsSectionKiro);
|
|
2235
2299
|
}
|
|
2236
2300
|
if (config.memory) {
|
|
2237
|
-
sections.push(
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
**Before starting any task**, use \`search_memories\` to find relevant context \u2014 past decisions, conventions, known issues, and domain knowledge. This avoids repeating mistakes and ensures consistency with previous choices.
|
|
2243
|
-
|
|
2244
|
-
**After completing a task**, if you discovered something valuable (a decision, a gotcha, a convention, domain insight), use \`add_memory\` to capture it for the team.
|
|
2245
|
-
|
|
2246
|
-
Available tools: \`search_memories\`, \`get_memory\`, \`add_memory\`, \`list_memories\`, \`archive_memory\`, \`remove_memory\`.`);
|
|
2301
|
+
sections.push(buildMemorySection(config));
|
|
2302
|
+
}
|
|
2303
|
+
if (config.workflow?.fact_checker) {
|
|
2304
|
+
sections.push(buildFetchCheckerSection());
|
|
2247
2305
|
}
|
|
2248
2306
|
const designSectionKiro = buildDesignSection(config);
|
|
2249
2307
|
if (designSectionKiro) sections.push(designSectionKiro);
|
|
@@ -2429,16 +2487,10 @@ ${prompt.sections.after_delivery.trim()}`);
|
|
|
2429
2487
|
sections.push(mcpToolsSectionCursor);
|
|
2430
2488
|
}
|
|
2431
2489
|
if (config.memory) {
|
|
2432
|
-
sections.push(
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
**Before starting any task**, use \`search_memories\` to find relevant context \u2014 past decisions, conventions, known issues, and domain knowledge. This avoids repeating mistakes and ensures consistency with previous choices.
|
|
2438
|
-
|
|
2439
|
-
**After completing a task**, if you discovered something valuable (a decision, a gotcha, a convention, domain insight), use \`add_memory\` to capture it for the team.
|
|
2440
|
-
|
|
2441
|
-
Available tools: \`search_memories\`, \`get_memory\`, \`add_memory\`, \`list_memories\`, \`archive_memory\`, \`remove_memory\`.`);
|
|
2490
|
+
sections.push(buildMemorySection(config));
|
|
2491
|
+
}
|
|
2492
|
+
if (config.workflow?.fact_checker) {
|
|
2493
|
+
sections.push(buildFetchCheckerSection());
|
|
2442
2494
|
}
|
|
2443
2495
|
const designSectionCursor = buildDesignSection(config);
|
|
2444
2496
|
if (designSectionCursor) sections.push(designSectionCursor);
|
package/dist/config/index.d.ts
CHANGED
|
@@ -115,6 +115,7 @@ interface MemoryConfig {
|
|
|
115
115
|
categories?: string[];
|
|
116
116
|
auto_capture?: boolean;
|
|
117
117
|
embedding_model?: string;
|
|
118
|
+
enforce?: boolean;
|
|
118
119
|
}
|
|
119
120
|
interface RemoteSource {
|
|
120
121
|
name: string;
|
|
@@ -163,6 +164,7 @@ interface HubConfig {
|
|
|
163
164
|
pipeline?: WorkflowStep[];
|
|
164
165
|
prompt?: PromptCustomization;
|
|
165
166
|
enforce_workflow?: boolean;
|
|
167
|
+
fact_checker?: boolean;
|
|
166
168
|
};
|
|
167
169
|
}
|
|
168
170
|
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
horizontalLine,
|
|
7
7
|
personaCommand,
|
|
8
8
|
symbols
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KRYKCNRK.js";
|
|
10
10
|
import {
|
|
11
11
|
loadHubConfig,
|
|
12
12
|
resolveConfigPath
|
|
@@ -3875,7 +3875,9 @@ import { readFileSync } from "fs";
|
|
|
3875
3875
|
import { join as join17, dirname } from "path";
|
|
3876
3876
|
import { fileURLToPath } from "url";
|
|
3877
3877
|
import chalk15 from "chalk";
|
|
3878
|
+
import ora from "ora";
|
|
3878
3879
|
var PACKAGE_NAME = "@arvoretech/hub";
|
|
3880
|
+
var RELEASES_URL = "https://hub.arvore.com.br/api/releases.json";
|
|
3879
3881
|
function getCurrentVersion() {
|
|
3880
3882
|
const __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
3881
3883
|
const pkgPath = join17(__dirname2, "..", "package.json");
|
|
@@ -3888,6 +3890,24 @@ async function getLatestVersion() {
|
|
|
3888
3890
|
const data = await res.json();
|
|
3889
3891
|
return data.version;
|
|
3890
3892
|
}
|
|
3893
|
+
function compareVersions(a, b) {
|
|
3894
|
+
const pa = a.split(".").map(Number);
|
|
3895
|
+
const pb = b.split(".").map(Number);
|
|
3896
|
+
for (let i = 0; i < 3; i++) {
|
|
3897
|
+
if ((pa[i] ?? 0) !== (pb[i] ?? 0)) return (pa[i] ?? 0) - (pb[i] ?? 0);
|
|
3898
|
+
}
|
|
3899
|
+
return 0;
|
|
3900
|
+
}
|
|
3901
|
+
async function getReleasesBetween(from, to) {
|
|
3902
|
+
try {
|
|
3903
|
+
const res = await fetch(RELEASES_URL, { signal: AbortSignal.timeout(5e3) });
|
|
3904
|
+
if (!res.ok) return [];
|
|
3905
|
+
const releases = await res.json();
|
|
3906
|
+
return releases.filter((r) => compareVersions(r.version, from) > 0 && compareVersions(r.version, to) <= 0).sort((a, b) => compareVersions(a.version, b.version));
|
|
3907
|
+
} catch {
|
|
3908
|
+
return [];
|
|
3909
|
+
}
|
|
3910
|
+
}
|
|
3891
3911
|
function detectPackageManager() {
|
|
3892
3912
|
const userAgent = process.env.npm_config_user_agent ?? "";
|
|
3893
3913
|
if (userAgent.startsWith("pnpm")) return "pnpm";
|
|
@@ -3921,47 +3941,61 @@ function buildInstallCommand(pm) {
|
|
|
3921
3941
|
return `npm install -g ${PACKAGE_NAME}@latest`;
|
|
3922
3942
|
}
|
|
3923
3943
|
}
|
|
3944
|
+
var typeColors = {
|
|
3945
|
+
feat: chalk15.green,
|
|
3946
|
+
fix: chalk15.yellow,
|
|
3947
|
+
refactor: chalk15.magenta,
|
|
3948
|
+
chore: chalk15.dim
|
|
3949
|
+
};
|
|
3950
|
+
function formatChangeType(type) {
|
|
3951
|
+
const color = typeColors[type] ?? chalk15.dim;
|
|
3952
|
+
return color(type.toUpperCase().padEnd(8));
|
|
3953
|
+
}
|
|
3924
3954
|
var updateCommand = new Command16("update").description("Update hub CLI to the latest version").option("--check", "Only check for updates without installing").action(async (opts) => {
|
|
3925
3955
|
const currentVersion = getCurrentVersion();
|
|
3926
|
-
|
|
3927
|
-
Current version: ${currentVersion}`));
|
|
3956
|
+
const checkSpinner = ora({ text: "Checking for updates...", color: "cyan" }).start();
|
|
3928
3957
|
let latestVersion;
|
|
3929
3958
|
try {
|
|
3930
3959
|
latestVersion = await getLatestVersion();
|
|
3931
3960
|
} catch (err) {
|
|
3932
|
-
|
|
3933
|
-
`));
|
|
3961
|
+
checkSpinner.fail(`Failed to check for updates: ${err.message}`);
|
|
3934
3962
|
return;
|
|
3935
3963
|
}
|
|
3936
|
-
console.log(chalk15.blue(` Latest version: ${latestVersion}`));
|
|
3937
3964
|
if (currentVersion === latestVersion) {
|
|
3938
|
-
|
|
3965
|
+
checkSpinner.succeed(chalk15.green(`Already on the latest version (${currentVersion})`));
|
|
3939
3966
|
return;
|
|
3940
3967
|
}
|
|
3941
|
-
|
|
3942
|
-
|
|
3968
|
+
checkSpinner.succeed(`Update available: ${chalk15.dim(currentVersion)} \u2192 ${chalk15.green(latestVersion)}`);
|
|
3969
|
+
const releases = await getReleasesBetween(currentVersion, latestVersion);
|
|
3970
|
+
if (releases.length > 0) {
|
|
3971
|
+
console.log();
|
|
3972
|
+
console.log(chalk15.cyan(" Releases included:"));
|
|
3973
|
+
for (const release of releases) {
|
|
3974
|
+
const date = (/* @__PURE__ */ new Date(release.date + "T00:00:00")).toLocaleDateString("pt-BR");
|
|
3975
|
+
console.log();
|
|
3976
|
+
console.log(` ${chalk15.green("\u25CF")} ${chalk15.white.bold(`v${release.version}`)} ${chalk15.dim(`\u2014 ${release.title}`)} ${chalk15.dim(`(${date})`)}`);
|
|
3977
|
+
for (const change of release.changes) {
|
|
3978
|
+
console.log(` ${formatChangeType(change.type)} ${chalk15.dim(change.title)}`);
|
|
3979
|
+
}
|
|
3980
|
+
}
|
|
3981
|
+
console.log();
|
|
3982
|
+
console.log(chalk15.dim(` Full notes: https://hub.arvore.com.br/releases`));
|
|
3983
|
+
}
|
|
3943
3984
|
const pm = detectPackageManager();
|
|
3944
3985
|
if (opts.check) {
|
|
3945
3986
|
console.log(chalk15.dim(`
|
|
3946
|
-
Run 'hub update'
|
|
3987
|
+
Run 'hub update' to install.
|
|
3947
3988
|
`));
|
|
3948
3989
|
return;
|
|
3949
3990
|
}
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
Updating with ${pm}...
|
|
3953
|
-
`));
|
|
3954
|
-
console.log(chalk15.dim(` $ ${installCmd}
|
|
3955
|
-
`));
|
|
3991
|
+
console.log();
|
|
3992
|
+
const installSpinner = ora({ text: `Updating with ${pm}...`, color: "cyan" }).start();
|
|
3956
3993
|
try {
|
|
3957
|
-
execSync12(
|
|
3958
|
-
|
|
3959
|
-
Updated to ${latestVersion} successfully.
|
|
3960
|
-
`));
|
|
3994
|
+
execSync12(buildInstallCommand(pm), { stdio: "pipe" });
|
|
3995
|
+
installSpinner.succeed(chalk15.green(`Updated to ${latestVersion}`));
|
|
3961
3996
|
} catch {
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
console.log(chalk15.dim(` $ ${installCmd}
|
|
3997
|
+
installSpinner.fail("Update failed");
|
|
3998
|
+
console.log(chalk15.dim(` Try running manually: ${buildInstallCommand(pm)}
|
|
3965
3999
|
`));
|
|
3966
4000
|
}
|
|
3967
4001
|
});
|