@nac3/forge-cli 0.2.0-alpha.4 → 0.2.0-alpha.5
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/chat/panel.js +2 -2
- package/dist/chat/server.js +9 -9
- package/dist/chat/tools/git.js +4 -4
- package/dist/chat/tools/github.js +3 -3
- package/dist/chat/tools/lifecycle.js +3 -3
- package/dist/chat/tools/manual.js +1 -1
- package/dist/chat/tools/reader.js +8 -8
- package/dist/chat/tools.js +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/voice/intents.d.ts +1 -1
- package/dist/voice/intents.js +0 -0
- package/package.json +2 -2
package/dist/chat/panel.js
CHANGED
|
@@ -1093,7 +1093,7 @@ async function dispatchReaderIntent(utterance, intent) {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
/* Update the active reader doc on a successful open so
|
|
1095
1095
|
subsequent voice commands ("siguiente", etc) target it. */
|
|
1096
|
-
if (intent.tool === '
|
|
1096
|
+
if (intent.tool === 'forge_reader_open' && !data.is_error) {
|
|
1097
1097
|
const docId = data.result && data.result.doc_id;
|
|
1098
1098
|
if (docId) state.activeReaderDocId = String(docId);
|
|
1099
1099
|
}
|
|
@@ -1311,7 +1311,7 @@ async function ingestSpecFile(file) {
|
|
|
1311
1311
|
state.toolHistory.push({
|
|
1312
1312
|
turnIndex: state.messages.length - 1,
|
|
1313
1313
|
rounds: [{
|
|
1314
|
-
tool: '
|
|
1314
|
+
tool: 'forge_spec_ingest',
|
|
1315
1315
|
input: { filename: ing.filename, format: ing.format },
|
|
1316
1316
|
display: 'parsed ' + ing.format + ': ' + (ing.title || ing.filename),
|
|
1317
1317
|
is_error: false,
|
package/dist/chat/server.js
CHANGED
|
@@ -466,17 +466,17 @@ async function handleVoiceStt(req, res, ctx) {
|
|
|
466
466
|
* runs.
|
|
467
467
|
*/
|
|
468
468
|
const FORGE_TOOL_DIRECT_ALLOWLIST = new Set([
|
|
469
|
-
'
|
|
470
|
-
'
|
|
471
|
-
'
|
|
472
|
-
'
|
|
473
|
-
'
|
|
474
|
-
'
|
|
475
|
-
'
|
|
476
|
-
'
|
|
469
|
+
'forge_reader_open',
|
|
470
|
+
'forge_reader_list_documents',
|
|
471
|
+
'forge_reader_read_section',
|
|
472
|
+
'forge_reader_next_block',
|
|
473
|
+
'forge_reader_search',
|
|
474
|
+
'forge_reader_bookmark_set',
|
|
475
|
+
'forge_reader_bookmark_jump',
|
|
476
|
+
'forge_reader_recap',
|
|
477
477
|
/* Fase F.8 -- HTML user manuals in 10 languages. Read-only,
|
|
478
478
|
same safety profile as the reader tools. */
|
|
479
|
-
'
|
|
479
|
+
'forge_manual_open',
|
|
480
480
|
]);
|
|
481
481
|
async function handleForgeToolDispatch(req, res, ctx) {
|
|
482
482
|
let body;
|
package/dist/chat/tools/git.js
CHANGED
|
@@ -65,7 +65,7 @@ async function resolveRepoDir(repoDir, ctx) {
|
|
|
65
65
|
* Specs
|
|
66
66
|
* ============================================================ */
|
|
67
67
|
export const GIT_COMMIT_SPEC = {
|
|
68
|
-
name: '
|
|
68
|
+
name: 'forge_git_commit',
|
|
69
69
|
description: 'Commit staged changes (or all tracked changes with `all`=true) in the given git checkout. Returns the commit hash on success.',
|
|
70
70
|
input_schema: {
|
|
71
71
|
type: 'object',
|
|
@@ -79,7 +79,7 @@ export const GIT_COMMIT_SPEC = {
|
|
|
79
79
|
requires_approval: true,
|
|
80
80
|
};
|
|
81
81
|
export const GIT_PUSH_SPEC = {
|
|
82
|
-
name: '
|
|
82
|
+
name: 'forge_git_push',
|
|
83
83
|
description: 'Push the current branch to the configured remote. Set `force`=true ONLY for force-push (irreversible -- gated by the V1.10 liveness check).',
|
|
84
84
|
input_schema: {
|
|
85
85
|
type: 'object',
|
|
@@ -94,7 +94,7 @@ export const GIT_PUSH_SPEC = {
|
|
|
94
94
|
requires_approval: true,
|
|
95
95
|
};
|
|
96
96
|
export const GIT_PULL_SPEC = {
|
|
97
|
-
name: '
|
|
97
|
+
name: 'forge_git_pull',
|
|
98
98
|
description: 'Pull from the configured remote. Fast-forward only by default.',
|
|
99
99
|
input_schema: {
|
|
100
100
|
type: 'object',
|
|
@@ -108,7 +108,7 @@ export const GIT_PULL_SPEC = {
|
|
|
108
108
|
requires_approval: true,
|
|
109
109
|
};
|
|
110
110
|
export const GIT_LOG_SPEC = {
|
|
111
|
-
name: '
|
|
111
|
+
name: 'forge_git_log',
|
|
112
112
|
description: 'List the last N commits of the given checkout. Default 10, max 50.',
|
|
113
113
|
input_schema: {
|
|
114
114
|
type: 'object',
|
|
@@ -32,7 +32,7 @@ const VAULT_SLOT = 'github_token';
|
|
|
32
32
|
const GITHUB_API = 'https://api.github.com';
|
|
33
33
|
/* ------------------ Tool specs ------------------ */
|
|
34
34
|
export const CREATE_GITHUB_REPO_SPEC = {
|
|
35
|
-
name: '
|
|
35
|
+
name: 'forge_create_github_repo',
|
|
36
36
|
description: 'Create a new repository under the authenticated GitHub user. Requires vault slot github_token with repo scope. Returns the new repository metadata including clone_url.',
|
|
37
37
|
input_schema: {
|
|
38
38
|
type: 'object',
|
|
@@ -46,7 +46,7 @@ export const CREATE_GITHUB_REPO_SPEC = {
|
|
|
46
46
|
requires_approval: true,
|
|
47
47
|
};
|
|
48
48
|
export const CLONE_REPO_SPEC = {
|
|
49
|
-
name: '
|
|
49
|
+
name: 'forge_clone_repo',
|
|
50
50
|
description: 'Clone a remote git repository to a local directory. Public repos need no auth. Private repos use the github_token slot when present. Returns the resolved target_dir + the first commit hash.',
|
|
51
51
|
input_schema: {
|
|
52
52
|
type: 'object',
|
|
@@ -59,7 +59,7 @@ export const CLONE_REPO_SPEC = {
|
|
|
59
59
|
requires_approval: true,
|
|
60
60
|
};
|
|
61
61
|
export const BRANCH_STATUS_SPEC = {
|
|
62
|
-
name: '
|
|
62
|
+
name: 'forge_branch_status',
|
|
63
63
|
description: 'Read the current git branch + dirty-tree status of a local checkout. Returns branch name, ahead/behind counters vs upstream when present, list of dirty files (max 50).',
|
|
64
64
|
input_schema: {
|
|
65
65
|
type: 'object',
|
|
@@ -37,7 +37,7 @@ let active = null;
|
|
|
37
37
|
* Specs
|
|
38
38
|
* ============================================================ */
|
|
39
39
|
export const RUN_APP_SPEC = {
|
|
40
|
-
name: '
|
|
40
|
+
name: 'forge_run_app',
|
|
41
41
|
description: 'Launch the project dev server. Auto-detects the package manager (npm / yarn / pnpm) and the script (dev / start / serve). Returns pid + best-effort URL.',
|
|
42
42
|
input_schema: {
|
|
43
43
|
type: 'object',
|
|
@@ -51,7 +51,7 @@ export const RUN_APP_SPEC = {
|
|
|
51
51
|
requires_approval: true,
|
|
52
52
|
};
|
|
53
53
|
export const STOP_APP_SPEC = {
|
|
54
|
-
name: '
|
|
54
|
+
name: 'forge_stop_app',
|
|
55
55
|
description: 'Stop the running app spawned by forge.run_app. Returns the final logs tail.',
|
|
56
56
|
input_schema: {
|
|
57
57
|
type: 'object',
|
|
@@ -63,7 +63,7 @@ export const STOP_APP_SPEC = {
|
|
|
63
63
|
requires_approval: true,
|
|
64
64
|
};
|
|
65
65
|
export const RESTART_APP_SPEC = {
|
|
66
|
-
name: '
|
|
66
|
+
name: 'forge_restart_app',
|
|
67
67
|
description: 'Stop the running app + relaunch with the same (or new) options.',
|
|
68
68
|
input_schema: {
|
|
69
69
|
type: 'object',
|
|
@@ -47,7 +47,7 @@ const MANUAL_PATH_CANDIDATES = (lang) => {
|
|
|
47
47
|
return manualBaseDirs().map((dir) => path.join(dir, fname));
|
|
48
48
|
};
|
|
49
49
|
export const MANUAL_OPEN_SPEC = {
|
|
50
|
-
name: '
|
|
50
|
+
name: 'forge_manual_open',
|
|
51
51
|
description: 'Open the Yujin Forge user manual in the requested language (default: current user language). Resolves to docs/manuals/manual.<lang>.html and opens it through the reader pipeline so the user can navigate by voice. Available languages: es, en, pt, fr, ja, zh, hi, ar, de, it.',
|
|
52
52
|
input_schema: {
|
|
53
53
|
type: 'object',
|
|
@@ -45,7 +45,7 @@ export function _resetReaderForTests() {
|
|
|
45
45
|
* Specs
|
|
46
46
|
* ============================================================ */
|
|
47
47
|
export const READER_OPEN_SPEC = {
|
|
48
|
-
name: '
|
|
48
|
+
name: 'forge_reader_open',
|
|
49
49
|
description: 'Open a document for reading. Auto-detects format (txt / md / source / ...). Returns the doc_id + title + section count + first block.',
|
|
50
50
|
input_schema: {
|
|
51
51
|
type: 'object',
|
|
@@ -57,13 +57,13 @@ export const READER_OPEN_SPEC = {
|
|
|
57
57
|
requires_approval: false,
|
|
58
58
|
};
|
|
59
59
|
export const READER_LIST_DOCS_SPEC = {
|
|
60
|
-
name: '
|
|
60
|
+
name: 'forge_reader_list_documents',
|
|
61
61
|
description: 'List all documents currently open in this chat session.',
|
|
62
62
|
input_schema: { type: 'object', properties: {}, required: [] },
|
|
63
63
|
requires_approval: false,
|
|
64
64
|
};
|
|
65
65
|
export const READER_READ_SECTION_SPEC = {
|
|
66
|
-
name: '
|
|
66
|
+
name: 'forge_reader_read_section',
|
|
67
67
|
description: 'Return the blocks of a section. With no index, returns the current section under the cursor.',
|
|
68
68
|
input_schema: {
|
|
69
69
|
type: 'object',
|
|
@@ -76,7 +76,7 @@ export const READER_READ_SECTION_SPEC = {
|
|
|
76
76
|
requires_approval: false,
|
|
77
77
|
};
|
|
78
78
|
export const READER_NEXT_BLOCK_SPEC = {
|
|
79
|
-
name: '
|
|
79
|
+
name: 'forge_reader_next_block',
|
|
80
80
|
description: 'Advance the reader cursor one block forward. Returns the new block contents.',
|
|
81
81
|
input_schema: {
|
|
82
82
|
type: 'object',
|
|
@@ -88,7 +88,7 @@ export const READER_NEXT_BLOCK_SPEC = {
|
|
|
88
88
|
requires_approval: false,
|
|
89
89
|
};
|
|
90
90
|
export const READER_SEARCH_SPEC = {
|
|
91
|
-
name: '
|
|
91
|
+
name: 'forge_reader_search',
|
|
92
92
|
description: 'Full-text search across a document. Returns top hits sorted by match count.',
|
|
93
93
|
input_schema: {
|
|
94
94
|
type: 'object',
|
|
@@ -102,7 +102,7 @@ export const READER_SEARCH_SPEC = {
|
|
|
102
102
|
requires_approval: false,
|
|
103
103
|
};
|
|
104
104
|
export const READER_BOOKMARK_SET_SPEC = {
|
|
105
|
-
name: '
|
|
105
|
+
name: 'forge_reader_bookmark_set',
|
|
106
106
|
description: 'Set a named bookmark at the current cursor position.',
|
|
107
107
|
input_schema: {
|
|
108
108
|
type: 'object',
|
|
@@ -115,7 +115,7 @@ export const READER_BOOKMARK_SET_SPEC = {
|
|
|
115
115
|
requires_approval: false,
|
|
116
116
|
};
|
|
117
117
|
export const READER_BOOKMARK_JUMP_SPEC = {
|
|
118
|
-
name: '
|
|
118
|
+
name: 'forge_reader_bookmark_jump',
|
|
119
119
|
description: 'Jump the cursor to a previously-set bookmark.',
|
|
120
120
|
input_schema: {
|
|
121
121
|
type: 'object',
|
|
@@ -128,7 +128,7 @@ export const READER_BOOKMARK_JUMP_SPEC = {
|
|
|
128
128
|
requires_approval: false,
|
|
129
129
|
};
|
|
130
130
|
export const READER_RECAP_SPEC = {
|
|
131
|
-
name: '
|
|
131
|
+
name: 'forge_reader_recap',
|
|
132
132
|
description: 'Return the last N spoken blocks from the reader playback buffer. Default window 10. mode="summary" returns a Claude-generated 1-2 sentence summary instead of literal blocks (charges tokens; gated by env YF_ENABLE_CLAUDE_RECAP=1).',
|
|
133
133
|
input_schema: {
|
|
134
134
|
type: 'object',
|
package/dist/chat/tools.js
CHANGED
|
@@ -41,7 +41,7 @@ import { MANUAL_OPEN_SPEC, runManualOpen, } from './tools/manual.js';
|
|
|
41
41
|
* forge.read_manifest
|
|
42
42
|
* ============================================================ */
|
|
43
43
|
export const READ_MANIFEST_SPEC = {
|
|
44
|
-
name: '
|
|
44
|
+
name: 'forge_read_manifest',
|
|
45
45
|
description: 'Read the NAC-3 manifest from the active project. Returns the manifest JSON (plugin_slug, version, elements array). Optionally filter to a specific plugin slug via the `plugin_slug` argument.',
|
|
46
46
|
input_schema: {
|
|
47
47
|
type: 'object',
|
|
@@ -105,7 +105,7 @@ export async function runReadManifest(args, ctx) {
|
|
|
105
105
|
* forge.consult_nac_spec
|
|
106
106
|
* ============================================================ */
|
|
107
107
|
export const CONSULT_NAC_SPEC = {
|
|
108
|
-
name: '
|
|
108
|
+
name: 'forge_consult_nac_spec',
|
|
109
109
|
description: 'Search the NAC-3 specification (docs/SPEC.md in the project) for paragraphs matching a free-text query. Returns up to 5 matches with their section headings + snippet. Useful when the chat needs to ground its answer in the canonical contract.',
|
|
110
110
|
input_schema: {
|
|
111
111
|
type: 'object',
|
|
@@ -231,7 +231,7 @@ function clampMax(n) {
|
|
|
231
231
|
* forge.list_files
|
|
232
232
|
* ============================================================ */
|
|
233
233
|
export const LIST_FILES_SPEC = {
|
|
234
|
-
name: '
|
|
234
|
+
name: 'forge_list_files',
|
|
235
235
|
description: 'List source files under a directory of the active project. Bounded read-only walk with a hard cap on file count + a glob filter for the basename. Useful when the chat needs to know what is in the project before opening anything.',
|
|
236
236
|
input_schema: {
|
|
237
237
|
type: 'object',
|
|
@@ -358,7 +358,7 @@ export function compileBasenameGlob(glob) {
|
|
|
358
358
|
* forge.read_file
|
|
359
359
|
* ============================================================ */
|
|
360
360
|
export const READ_FILE_SPEC = {
|
|
361
|
-
name: '
|
|
361
|
+
name: 'forge_read_file',
|
|
362
362
|
description: 'Read a single source file from the active project. Path must be relative to the project root and stay within it. Refuses binary files (NUL byte detection) and files larger than max_bytes (default 64KB). Use forge.list_files first when you do not already know the path.',
|
|
363
363
|
input_schema: {
|
|
364
364
|
type: 'object',
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/dist/voice/intents.d.ts
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
* the contract is the literal string the chat dispatcher
|
|
36
36
|
* accepts. If a tool is renamed there, this list must follow.
|
|
37
37
|
*/
|
|
38
|
-
export type ReaderToolName = '
|
|
38
|
+
export type ReaderToolName = 'forge_reader_open' | 'forge_reader_list_documents' | 'forge_reader_read_section' | 'forge_reader_next_block' | 'forge_reader_search' | 'forge_reader_bookmark_set' | 'forge_reader_bookmark_jump' | 'forge_reader_recap' | 'forge_manual_open';
|
|
39
39
|
export interface MatchedIntent {
|
|
40
40
|
tool: ReaderToolName;
|
|
41
41
|
args: Record<string, unknown>;
|
package/dist/voice/intents.js
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nac3/forge-cli",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.5",
|
|
4
4
|
"description": "Yujin Forge -- voice-first NAC-3 React development framework. CLI + chat panel + spec ingest + 10-format document reader + voice loop.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pablo Kuschnirof <pablo@rpaforce.com>",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=18.17",
|
|
53
|
-
"pnpm": ">=
|
|
53
|
+
"pnpm": ">=9"
|
|
54
54
|
},
|
|
55
55
|
"packageManager": "pnpm@11.3.0",
|
|
56
56
|
"files": [
|