mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
Introspection agent demo (#15232)
This commit is contained in:
committed by
GitHub
parent
db67bb106a
commit
10ba348a3a
@@ -18,20 +18,32 @@
|
||||
// limitations under the License.
|
||||
|
||||
import { execSync } from 'node:child_process';
|
||||
import { writeFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
import { writeFileSync, existsSync, cpSync } from 'node:fs';
|
||||
import { join, basename } from 'node:path';
|
||||
|
||||
if (!process.cwd().includes('packages')) {
|
||||
console.error('must be invoked from a package directory');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const packageName = basename(process.cwd());
|
||||
|
||||
// build typescript files
|
||||
execSync('tsc --build', { stdio: 'inherit' });
|
||||
|
||||
// copy .{md,json} files
|
||||
execSync('node ../../scripts/copy_files.js', { stdio: 'inherit' });
|
||||
|
||||
// Copy documentation for the core package
|
||||
if (packageName === 'core') {
|
||||
const docsSource = join(process.cwd(), '..', '..', 'docs');
|
||||
const docsTarget = join(process.cwd(), 'dist', 'docs');
|
||||
if (existsSync(docsSource)) {
|
||||
cpSync(docsSource, docsTarget, { recursive: true, dereference: true });
|
||||
console.log('Copied documentation to dist/docs');
|
||||
}
|
||||
}
|
||||
|
||||
// touch dist/.last_build
|
||||
writeFileSync(join(process.cwd(), 'dist', '.last_build'), '');
|
||||
process.exit(0);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { copyFileSync, existsSync, mkdirSync } from 'node:fs';
|
||||
import { copyFileSync, existsSync, mkdirSync, cpSync } from 'node:fs';
|
||||
import { dirname, join, basename } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { glob } from 'glob';
|
||||
@@ -53,4 +53,13 @@ for (const file of policyFiles) {
|
||||
}
|
||||
|
||||
console.log(`Copied ${policyFiles.length} policy files to bundle/policies/`);
|
||||
|
||||
// 3. Copy Documentation (docs/)
|
||||
const docsSrc = join(root, 'docs');
|
||||
const docsDest = join(bundleDir, 'docs');
|
||||
if (existsSync(docsSrc)) {
|
||||
cpSync(docsSrc, docsDest, { recursive: true, dereference: true });
|
||||
console.log('Copied docs to bundle/docs/');
|
||||
}
|
||||
|
||||
console.log('Assets copied to bundle/');
|
||||
|
||||
Reference in New Issue
Block a user