@taurgis/bonsai 3.1.0 → 3.2.2
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/README.md +21 -4
- package/agents/agents/salesforce-docs-researcher.agent.md +14 -1
- package/agents/instructions/salesforce-research.instructions.md +2 -1
- package/bin/cli.mjs +9 -17
- package/dist/base-command.d.ts +37 -10
- package/dist/base-command.js +113 -46
- package/dist/commands/config/base.js +11 -2
- package/dist/commands/config/get.js +8 -12
- package/dist/commands/config/index.js +2 -2
- package/dist/commands/config/list.js +10 -16
- package/dist/commands/config/set.d.ts +2 -1
- package/dist/commands/config/set.js +34 -27
- package/dist/commands/config/unset.d.ts +2 -1
- package/dist/commands/config/unset.js +25 -24
- package/dist/commands/fetch.d.ts +7 -15
- package/dist/commands/fetch.js +58 -401
- package/dist/commands/import.d.ts +4 -9
- package/dist/commands/import.js +56 -280
- package/dist/commands/inspect.d.ts +7 -1
- package/dist/commands/inspect.js +103 -52
- package/dist/commands/list.d.ts +13 -1
- package/dist/commands/list.js +79 -32
- package/dist/commands/prune.d.ts +4 -1
- package/dist/commands/prune.js +56 -65
- package/dist/commands/status.d.ts +3 -2
- package/dist/commands/status.js +52 -79
- package/dist/hooks/command-not-found/suggest.d.ts +1 -0
- package/dist/hooks/command-not-found/suggest.js +66 -39
- package/dist/lib/argv.d.ts +24 -3
- package/dist/lib/argv.js +124 -53
- package/dist/lib/batch.d.ts +41 -0
- package/dist/lib/batch.js +39 -0
- package/dist/lib/cache-view.d.ts +21 -0
- package/dist/lib/cache-view.js +30 -0
- package/dist/lib/cli-emit.d.ts +28 -0
- package/dist/lib/cli-emit.js +44 -0
- package/dist/lib/cli-error-policy.d.ts +57 -0
- package/dist/lib/cli-error-policy.js +74 -0
- package/dist/lib/cli-flag-manifest.d.ts +5 -0
- package/dist/lib/cli-flag-manifest.js +8 -0
- package/dist/lib/cli-presentation.d.ts +39 -0
- package/dist/lib/cli-presentation.js +50 -0
- package/dist/lib/cli-result-types.d.ts +88 -0
- package/dist/lib/cli-result-types.js +2 -0
- package/dist/lib/config/index.d.ts +22 -4
- package/dist/lib/config/index.js +59 -4
- package/dist/lib/config/resolve.d.ts +21 -0
- package/dist/lib/config/resolve.js +55 -6
- package/dist/lib/config-persist.d.ts +28 -0
- package/dist/lib/config-persist.js +29 -0
- package/dist/lib/envelope.d.ts +41 -3
- package/dist/lib/envelope.js +147 -4
- package/dist/lib/help-preflight.d.ts +5 -8
- package/dist/lib/help-preflight.js +13 -32
- package/dist/lib/json-meta.d.ts +0 -2
- package/dist/lib/json-meta.js +21 -25
- package/dist/lib/limit-flag.d.ts +11 -1
- package/dist/lib/limit-flag.js +19 -6
- package/dist/lib/parse-error-ux.d.ts +5 -0
- package/dist/lib/parse-error-ux.js +73 -0
- package/dist/lib/prune-flags.d.ts +28 -0
- package/dist/lib/prune-flags.js +74 -0
- package/dist/lib/research/artifact-index.d.ts +11 -2
- package/dist/lib/research/artifact-index.js +7 -4
- package/dist/lib/research/browser.d.ts +41 -2
- package/dist/lib/research/browser.js +139 -50
- package/dist/lib/research/capture.d.ts +24 -2
- package/dist/lib/research/capture.js +24 -4
- package/dist/lib/research/cli-io.d.ts +33 -0
- package/dist/lib/research/cli-io.js +27 -0
- package/dist/lib/research/compress.d.ts +7 -0
- package/dist/lib/research/compress.js +7 -3
- package/dist/lib/research/docs/capabilities.d.ts +15 -0
- package/dist/lib/research/docs/capabilities.js +5 -0
- package/dist/lib/research/docs/clean-dom.d.ts +2 -0
- package/dist/lib/research/docs/clean-dom.js +2 -0
- package/dist/lib/research/docs/code-blocks.d.ts +2 -0
- package/dist/lib/research/docs/code-blocks.js +2 -0
- package/dist/lib/research/docs/detect.d.ts +4 -0
- package/dist/lib/research/docs/detect.js +4 -0
- package/dist/lib/research/docs/machine-readable.d.ts +18 -0
- package/dist/lib/research/docs/machine-readable.js +10 -0
- package/dist/lib/research/docs/markdown-source.d.ts +20 -0
- package/dist/lib/research/docs/markdown-source.js +19 -2
- package/dist/lib/research/docs/quality-gates.d.ts +5 -0
- package/dist/lib/research/docs/quality-gates.js +4 -0
- package/dist/lib/research/docs/rsc.d.ts +9 -2
- package/dist/lib/research/docs/rsc.js +5 -2
- package/dist/lib/research/docs/section-artifacts.d.ts +12 -0
- package/dist/lib/research/docs/section-artifacts.js +12 -0
- package/dist/lib/research/docs/sections.d.ts +18 -0
- package/dist/lib/research/docs/sections.js +17 -1
- package/dist/lib/research/docs/source-map.d.ts +28 -0
- package/dist/lib/research/docs/source-map.js +27 -0
- package/dist/lib/research/docs/validate.d.ts +35 -2
- package/dist/lib/research/docs/validate.js +47 -2
- package/dist/lib/research/extract.d.ts +16 -0
- package/dist/lib/research/extract.js +12 -1
- package/dist/lib/research/fetch-command-service.d.ts +36 -0
- package/dist/lib/research/fetch-command-service.js +310 -0
- package/dist/lib/research/fetch-result.d.ts +114 -0
- package/dist/lib/research/fetch-result.js +212 -0
- package/dist/lib/research/fetcher.d.ts +46 -8
- package/dist/lib/research/fetcher.js +58 -30
- package/dist/lib/research/freshness.d.ts +54 -11
- package/dist/lib/research/freshness.js +91 -31
- package/dist/lib/research/import-command-service.d.ts +56 -0
- package/dist/lib/research/import-command-service.js +381 -0
- package/dist/lib/research/keywords.js +5 -1
- package/dist/lib/research/markdown.d.ts +12 -1
- package/dist/lib/research/markdown.js +13 -5
- package/dist/lib/research/persist-artifact.d.ts +23 -0
- package/dist/lib/research/persist-artifact.js +27 -0
- package/dist/lib/research/prompt-injection.d.ts +8 -0
- package/dist/lib/research/prompt-injection.js +42 -13
- package/dist/lib/research/proxy.d.ts +14 -8
- package/dist/lib/research/proxy.js +14 -10
- package/dist/lib/research/revalidate.d.ts +49 -20
- package/dist/lib/research/revalidate.js +80 -15
- package/dist/lib/research/schema.d.ts +7 -0
- package/dist/lib/research/schema.js +2 -0
- package/dist/lib/research/secret-scan.d.ts +6 -0
- package/dist/lib/research/secret-scan.js +8 -0
- package/dist/lib/research/secure-write.d.ts +11 -1
- package/dist/lib/research/secure-write.js +38 -7
- package/dist/lib/research/storage.d.ts +5 -1
- package/dist/lib/research/storage.js +8 -3
- package/dist/lib/research/summarize.d.ts +15 -0
- package/dist/lib/research/summarize.js +11 -0
- package/dist/lib/research/url.d.ts +9 -6
- package/dist/lib/research/url.js +33 -21
- package/dist/lib/text.d.ts +7 -2
- package/dist/lib/text.js +13 -2
- package/dist/lib/value-flags.d.ts +14 -0
- package/dist/lib/value-flags.js +28 -0
- package/dist/sites/coveo.d.ts +10 -0
- package/dist/sites/coveo.js +10 -0
- package/dist/sites/index.d.ts +16 -0
- package/dist/sites/index.js +16 -4
- package/dist/sites/markdown-twin.d.ts +31 -0
- package/dist/sites/markdown-twin.js +56 -0
- package/dist/sites/salesforce/fetch-page.d.ts +8 -2
- package/dist/sites/salesforce/fetch-page.js +14 -3
- package/dist/sites/salesforce/help-tooling-markdown.d.ts +30 -0
- package/dist/sites/salesforce/help-tooling-markdown.js +74 -0
- package/dist/sites/salesforce/index.d.ts +1 -0
- package/dist/sites/salesforce/index.js +1 -0
- package/dist/sites/salesforce-developer/fetch-page.d.ts +6 -1
- package/dist/sites/salesforce-developer/fetch-page.js +6 -1
- package/dist/sites/salesforce-developer/index.d.ts +1 -0
- package/dist/sites/salesforce-developer/index.js +1 -0
- package/dist/sites/salesforce-developer/route-markdown.d.ts +18 -6
- package/dist/sites/salesforce-developer/route-markdown.js +29 -67
- package/dist/sites/salesforce-doc-fetch.d.ts +39 -5
- package/dist/sites/salesforce-doc-fetch.js +52 -7
- package/dist/sites/salesforce-dom-probe.d.ts +20 -2
- package/dist/sites/salesforce-dom-probe.js +20 -2
- package/dist/sites/types.d.ts +14 -8
- package/dist/sites/types.js +3 -0
- package/oclif.manifest.json +192 -87
- package/package.json +19 -7
- package/agents/agents/official-docs-researcher.agent.md +0 -87
- package/agents/instructions/web-research.instructions.md +0 -44
- package/agents/skills/web-research/SKILL.md +0 -118
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import { ConfigCommand, configScopeFlags } from './base.js';
|
|
3
|
-
import { KEY_META,
|
|
3
|
+
import { KEY_META, validKeysHint } from '../../lib/config/index.js';
|
|
4
|
+
import { persistConfigPatch } from '../../lib/config-persist.js';
|
|
4
5
|
export default class ConfigSet extends ConfigCommand {
|
|
5
6
|
static id = 'config set';
|
|
6
|
-
static summary = 'Set a research configuration key
|
|
7
|
-
static description = 'Persist a configuration value. Writes user-level config by default; pass --local
|
|
7
|
+
static summary = 'Set a research configuration key';
|
|
8
|
+
static description = 'Persist a configuration value. Writes user-level config by default; pass --local for project-level config (.bonsai.json in cwd).\n\n' +
|
|
8
9
|
`Valid keys: ${validKeysHint()}. The inline form \`<key>=<value>\` is also accepted.`;
|
|
9
10
|
static examples = [
|
|
10
11
|
{
|
|
11
|
-
description: 'store research cache
|
|
12
|
+
description: 'store research cache in the current project',
|
|
12
13
|
command: '<%= config.bin %> config set storage project --local',
|
|
13
14
|
},
|
|
14
15
|
{
|
|
15
|
-
description: 'set the user-level default
|
|
16
|
+
description: 'set the user-level default with key=value',
|
|
16
17
|
command: '<%= config.bin %> config set storage=global',
|
|
17
18
|
},
|
|
18
19
|
];
|
|
@@ -22,11 +23,11 @@ export default class ConfigSet extends ConfigCommand {
|
|
|
22
23
|
};
|
|
23
24
|
static flags = {
|
|
24
25
|
...configScopeFlags({
|
|
25
|
-
global: '
|
|
26
|
-
local: '
|
|
26
|
+
global: 'write user-level config (default)',
|
|
27
|
+
local: 'write project-level config (.bonsai.json in cwd)',
|
|
27
28
|
}),
|
|
28
29
|
'dry-run': Flags.boolean({
|
|
29
|
-
description: '
|
|
30
|
+
description: 'preview write without saving',
|
|
30
31
|
default: false,
|
|
31
32
|
}),
|
|
32
33
|
};
|
|
@@ -39,6 +40,11 @@ export default class ConfigSet extends ConfigCommand {
|
|
|
39
40
|
this.error(`Missing required argument: value for key "${keyArg}"`, {
|
|
40
41
|
exit: 2,
|
|
41
42
|
code: 'MISSING_ARGUMENT',
|
|
43
|
+
suggestions: [
|
|
44
|
+
meta.values
|
|
45
|
+
? `Use one of: ${meta.values.join(', ')}`
|
|
46
|
+
: `Provide a value for ${keyArg}: ${meta.description}`,
|
|
47
|
+
],
|
|
42
48
|
});
|
|
43
49
|
}
|
|
44
50
|
const parsed = meta.parseValue(valueArg);
|
|
@@ -47,35 +53,36 @@ export default class ConfigSet extends ConfigCommand {
|
|
|
47
53
|
this.error(`Invalid value "${valueArg}" for "${keyArg}". ${guidance}`, {
|
|
48
54
|
exit: 2,
|
|
49
55
|
code: 'INVALID_VALUE',
|
|
56
|
+
suggestions: meta.values?.map((value) => `Set ${keyArg} to "${value}": ${this.config.bin} config set ${keyArg} ${value}`),
|
|
50
57
|
});
|
|
51
58
|
}
|
|
52
59
|
const scope = this.writeScope(this.flags.local);
|
|
53
60
|
const formatted = meta.format(parsed);
|
|
54
|
-
|
|
61
|
+
const dryRun = this.effectiveDryRun(this.flags['dry-run']);
|
|
62
|
+
if (dryRun) {
|
|
55
63
|
if (!this.jsonEnabled())
|
|
56
64
|
this.log(`[dry-run] Would set ${keyArg} = ${formatted} (${scope})`);
|
|
57
|
-
return { key: keyArg, value: parsed, scope, dryRun: true };
|
|
65
|
+
return { key: keyArg, value: parsed, scope, dryRun: true, status: 'would_set' };
|
|
58
66
|
}
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
writeUserConfig(configDir, patch);
|
|
67
|
+
const persisted = persistConfigPatch({
|
|
68
|
+
scope,
|
|
69
|
+
cwd: process.cwd(),
|
|
70
|
+
configDir: this.config.configDir,
|
|
71
|
+
patch: { [keyArg]: parsed },
|
|
72
|
+
action: 'set',
|
|
73
|
+
bin: this.config.bin,
|
|
74
|
+
key: keyArg,
|
|
75
|
+
});
|
|
76
|
+
if (!persisted.ok) {
|
|
77
|
+
this.error(persisted.message, {
|
|
78
|
+
exit: 1,
|
|
79
|
+
code: persisted.code,
|
|
80
|
+
suggestions: persisted.suggestions,
|
|
81
|
+
});
|
|
75
82
|
}
|
|
76
83
|
if (!this.jsonEnabled())
|
|
77
84
|
this.log(`Set ${keyArg} = ${formatted} (${scope})`);
|
|
78
|
-
return { key: keyArg, value: parsed, scope, dryRun: false };
|
|
85
|
+
return { key: keyArg, value: parsed, scope, dryRun: false, status: 'set' };
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
/**
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConfigCommand } from './base.js';
|
|
2
|
+
import type { ConfigWriteResult } from '../../lib/cli-result-types.js';
|
|
2
3
|
export default class ConfigUnset extends ConfigCommand<typeof ConfigUnset> {
|
|
3
4
|
static id: string;
|
|
4
5
|
static summary: string;
|
|
@@ -16,5 +17,5 @@ export default class ConfigUnset extends ConfigCommand<typeof ConfigUnset> {
|
|
|
16
17
|
local: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
18
|
};
|
|
18
19
|
static stdoutIsPrimaryData: boolean;
|
|
19
|
-
run(): Promise<
|
|
20
|
+
run(): Promise<ConfigWriteResult>;
|
|
20
21
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import { ConfigCommand, configScopeFlags } from './base.js';
|
|
3
|
-
import {
|
|
3
|
+
import { validKeysHint } from '../../lib/config/index.js';
|
|
4
|
+
import { persistConfigPatch } from '../../lib/config-persist.js';
|
|
4
5
|
export default class ConfigUnset extends ConfigCommand {
|
|
5
6
|
static id = 'config unset';
|
|
6
|
-
static summary = 'Remove a research configuration key
|
|
7
|
+
static summary = 'Remove a research configuration key';
|
|
7
8
|
static description = `Delete a key from user-level config (default) or project-level config (--local), restoring the built-in default.\n\nValid keys: ${validKeysHint()}.`;
|
|
8
9
|
static examples = [
|
|
9
10
|
{
|
|
@@ -20,11 +21,11 @@ export default class ConfigUnset extends ConfigCommand {
|
|
|
20
21
|
};
|
|
21
22
|
static flags = {
|
|
22
23
|
...configScopeFlags({
|
|
23
|
-
global: '
|
|
24
|
-
local: '
|
|
24
|
+
global: 'remove from user-level config (default)',
|
|
25
|
+
local: 'remove from project-level config (.bonsai.json in cwd)',
|
|
25
26
|
}),
|
|
26
27
|
'dry-run': Flags.boolean({
|
|
27
|
-
description: '
|
|
28
|
+
description: 'preview removal without saving',
|
|
28
29
|
default: false,
|
|
29
30
|
}),
|
|
30
31
|
};
|
|
@@ -33,30 +34,30 @@ export default class ConfigUnset extends ConfigCommand {
|
|
|
33
34
|
const key = this.args.key;
|
|
34
35
|
this.validateConfigKeyAndScope(key, this.flags.global, this.flags.local);
|
|
35
36
|
const scope = this.writeScope(this.flags.local);
|
|
36
|
-
|
|
37
|
+
const dryRun = this.effectiveDryRun(this.flags['dry-run']);
|
|
38
|
+
if (dryRun) {
|
|
37
39
|
if (!this.jsonEnabled())
|
|
38
40
|
this.log(`[dry-run] Would unset ${key} (${scope})`);
|
|
39
|
-
return { key, scope, dryRun: true };
|
|
41
|
+
return { key, scope, dryRun: true, status: 'would_unset' };
|
|
40
42
|
}
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
writeUserConfig(configDir, patch);
|
|
43
|
+
const persisted = persistConfigPatch({
|
|
44
|
+
scope,
|
|
45
|
+
cwd: process.cwd(),
|
|
46
|
+
configDir: this.config.configDir,
|
|
47
|
+
patch: { [key]: undefined },
|
|
48
|
+
action: 'unset',
|
|
49
|
+
bin: this.config.bin,
|
|
50
|
+
key,
|
|
51
|
+
});
|
|
52
|
+
if (!persisted.ok) {
|
|
53
|
+
this.error(persisted.message, {
|
|
54
|
+
exit: 1,
|
|
55
|
+
code: persisted.code,
|
|
56
|
+
suggestions: persisted.suggestions,
|
|
57
|
+
});
|
|
57
58
|
}
|
|
58
59
|
if (!this.jsonEnabled())
|
|
59
60
|
this.log(`Unset ${key} (${scope})`);
|
|
60
|
-
return { key, scope, dryRun: false };
|
|
61
|
+
return { key, scope, dryRun: false, status: 'unset' };
|
|
61
62
|
}
|
|
62
63
|
}
|
package/dist/commands/fetch.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseCommand } from '../base-command.js';
|
|
2
|
+
/** Hidden named `fetch` command; usually invoked as `bonsai <url>`. */
|
|
2
3
|
export default class FetchCommand extends BaseCommand<typeof FetchCommand> {
|
|
3
4
|
static id: string;
|
|
4
5
|
static hidden: boolean;
|
|
@@ -26,20 +27,11 @@ export default class FetchCommand extends BaseCommand<typeof FetchCommand> {
|
|
|
26
27
|
storage: import("@oclif/core/interfaces").OptionFlag<"global" | "project" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
28
|
};
|
|
28
29
|
static stdoutIsPrimaryData: boolean;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
private
|
|
35
|
-
private resolveArtifact;
|
|
36
|
-
private persistFreshArtifact;
|
|
37
|
-
private persistSectionsIfFresh;
|
|
30
|
+
/**
|
|
31
|
+
* When a multi-URL batch has any per-URL failure, keep the result array (including hits) and
|
|
32
|
+
* surface FETCH_FAILED on the envelope — same batch contract as status/inspect CACHE_MISS.
|
|
33
|
+
*/
|
|
34
|
+
protected toSuccessJson(data: unknown): Record<string, unknown>;
|
|
35
|
+
private serviceFlags;
|
|
38
36
|
run(): Promise<unknown>;
|
|
39
|
-
private fetchSingleTarget;
|
|
40
37
|
}
|
|
41
|
-
export declare function describeError(err: unknown): string;
|
|
42
|
-
export declare function fetchFailureGuidance(message: string, url: string): {
|
|
43
|
-
suggestions: string[];
|
|
44
|
-
ref?: string;
|
|
45
|
-
} | undefined;
|