Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gaxios/build/esm/system-test/test.install.js +123 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gaxios/build/esm/test/test.retry.d.ts +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gaxios/build/esm/test/test.retry.js +362 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gaxios/build/esm/test/test.retry.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gcp-metadata/build/src/gcp-residency.d.ts +57 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gcp-metadata/build/src/gcp-residency.js +114 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gcp-metadata/build/src/gcp-residency.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gcp-metadata/build/src/index.d.ts +156 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gcp-metadata/build/src/index.js +402 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gcp-metadata/build/src/index.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/glob.d.ts +388 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/glob.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/glob.js +247 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/glob.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/has-magic.d.ts +14 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/has-magic.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/has-magic.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/ignore.d.ts +24 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/ignore.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/ignore.js +119 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/ignore.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/index.d.ts +97 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/index.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/index.js +68 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/index.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/package.json +3 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/pattern.d.ts +76 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/pattern.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/pattern.js +219 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/pattern.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/processor.d.ts +59 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/processor.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/processor.js +301 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/processor.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/walker.d.ts +97 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/walker.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/walker.js +387 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/walker.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/bin.d.mts +3 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/bin.d.mts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/bin.mjs +276 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/bin.mjs.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/glob.d.ts +388 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/glob.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/glob.js +243 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/glob.js.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/has-magic.d.ts +14 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/has-magic.d.ts.map +1 -0
- platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/has-magic.js +23 -0
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gaxios/build/esm/system-test/test.install.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2019 Google LLC
|
| 2 |
+
//
|
| 3 |
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
| 4 |
+
// you may not use this file except in compliance with the License.
|
| 5 |
+
// You may obtain a copy of the License at
|
| 6 |
+
//
|
| 7 |
+
// http://www.apache.org/licenses/LICENSE-2.0
|
| 8 |
+
//
|
| 9 |
+
// Unless required by applicable law or agreed to in writing, software
|
| 10 |
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
| 11 |
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 12 |
+
// See the License for the specific language governing permissions and
|
| 13 |
+
// limitations under the License.
|
| 14 |
+
import assert from 'assert';
|
| 15 |
+
import { execFile } from 'child_process';
|
| 16 |
+
import fs from 'fs';
|
| 17 |
+
import mv from 'mv';
|
| 18 |
+
import ncp from 'ncp';
|
| 19 |
+
import path from 'path';
|
| 20 |
+
import tmp from 'tmp';
|
| 21 |
+
import { promisify } from 'util';
|
| 22 |
+
import { describe, it, before, after } from 'mocha';
|
| 23 |
+
import { packNTest } from 'pack-n-play';
|
| 24 |
+
import { createServer } from 'node:http';
|
| 25 |
+
import util from '../src/util.cjs';
|
| 26 |
+
/**
|
| 27 |
+
* Optionally keep the staging directory between tests.
|
| 28 |
+
*/
|
| 29 |
+
const KEEP_STAGING_DIRECTORY = false;
|
| 30 |
+
const mvp = promisify(mv);
|
| 31 |
+
const ncpp = promisify(ncp);
|
| 32 |
+
const pkg = util.pkg;
|
| 33 |
+
const exec = promisify(execFile);
|
| 34 |
+
describe('📦 pack and install', () => {
|
| 35 |
+
let stagingDir;
|
| 36 |
+
let stagingPath;
|
| 37 |
+
before(() => {
|
| 38 |
+
stagingDir = tmp.dirSync({
|
| 39 |
+
keep: KEEP_STAGING_DIRECTORY,
|
| 40 |
+
unsafeCleanup: true,
|
| 41 |
+
});
|
| 42 |
+
stagingPath = stagingDir.name;
|
| 43 |
+
});
|
| 44 |
+
after('cleanup staging', () => {
|
| 45 |
+
if (!KEEP_STAGING_DIRECTORY) {
|
| 46 |
+
stagingDir.removeCallback();
|
| 47 |
+
}
|
| 48 |
+
});
|
| 49 |
+
describe('pack-n-play', () => {
|
| 50 |
+
let server;
|
| 51 |
+
let url;
|
| 52 |
+
before(async () => {
|
| 53 |
+
server = createServer((req, res) => {
|
| 54 |
+
res.writeHead(200, { 'content-type': 'text/plain' });
|
| 55 |
+
res.end(`Hello, ${req.headers['user-agent'] || 'World'}`);
|
| 56 |
+
});
|
| 57 |
+
await new Promise((resolve, reject) => {
|
| 58 |
+
server.on('error', reject);
|
| 59 |
+
server.listen(0, resolve);
|
| 60 |
+
});
|
| 61 |
+
const address = server.address();
|
| 62 |
+
if (typeof address === 'string') {
|
| 63 |
+
url = address;
|
| 64 |
+
}
|
| 65 |
+
else {
|
| 66 |
+
const base = new URL('http://localhost');
|
| 67 |
+
base.host = address.address;
|
| 68 |
+
base.port = address.port.toString();
|
| 69 |
+
url = base.toString();
|
| 70 |
+
}
|
| 71 |
+
});
|
| 72 |
+
after(() => {
|
| 73 |
+
server.close();
|
| 74 |
+
});
|
| 75 |
+
it('supports ESM', async () => {
|
| 76 |
+
await packNTest({
|
| 77 |
+
sample: {
|
| 78 |
+
description: 'import as ESM',
|
| 79 |
+
esm: `
|
| 80 |
+
import {Gaxios} from 'gaxios';
|
| 81 |
+
|
| 82 |
+
const gaxios = new Gaxios();
|
| 83 |
+
await gaxios.request({url: '${url}'});
|
| 84 |
+
`,
|
| 85 |
+
},
|
| 86 |
+
});
|
| 87 |
+
});
|
| 88 |
+
it('supports CJS', async () => {
|
| 89 |
+
await packNTest({
|
| 90 |
+
sample: {
|
| 91 |
+
description: 'require as CJS',
|
| 92 |
+
cjs: `
|
| 93 |
+
const {Gaxios} = require('gaxios');
|
| 94 |
+
|
| 95 |
+
const gaxios = new Gaxios();
|
| 96 |
+
gaxios.request({url: '${url}'}).then(console.log);
|
| 97 |
+
`,
|
| 98 |
+
},
|
| 99 |
+
});
|
| 100 |
+
});
|
| 101 |
+
});
|
| 102 |
+
describe('webpack', () => {
|
| 103 |
+
/**
|
| 104 |
+
* Create a staging directory with temp fixtures used to test on a fresh
|
| 105 |
+
* application.
|
| 106 |
+
*/
|
| 107 |
+
before('pack and install', async () => {
|
| 108 |
+
await exec('npm', ['pack']);
|
| 109 |
+
const tarball = `${pkg.name}-${pkg.version}.tgz`;
|
| 110 |
+
await mvp(tarball, `${stagingPath}/gaxios.tgz`);
|
| 111 |
+
await ncpp('system-test/fixtures/sample', `${stagingPath}/`);
|
| 112 |
+
await exec('npm', ['install'], { cwd: `${stagingPath}/` });
|
| 113 |
+
});
|
| 114 |
+
it('should be able to webpack the library', async () => {
|
| 115 |
+
// we expect npm install is executed in the before hook
|
| 116 |
+
await exec('npx', ['webpack'], { cwd: `${stagingPath}/` });
|
| 117 |
+
const bundle = path.join(stagingPath, 'dist', 'bundle.min.js');
|
| 118 |
+
const stat = fs.statSync(bundle);
|
| 119 |
+
assert(stat.size < 256 * 1024);
|
| 120 |
+
}).timeout(20000);
|
| 121 |
+
});
|
| 122 |
+
});
|
| 123 |
+
//# sourceMappingURL=test.install.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gaxios/build/esm/test/test.retry.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export {};
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gaxios/build/esm/test/test.retry.js
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2018 Google LLC
|
| 2 |
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
| 3 |
+
// you may not use this file except in compliance with the License.
|
| 4 |
+
// You may obtain a copy of the License at
|
| 5 |
+
//
|
| 6 |
+
// http://www.apache.org/licenses/LICENSE-2.0
|
| 7 |
+
//
|
| 8 |
+
// Unless required by applicable law or agreed to in writing, software
|
| 9 |
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
| 10 |
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 11 |
+
// See the License for the specific language governing permissions and
|
| 12 |
+
// limitations under the License.
|
| 13 |
+
import assert from 'assert';
|
| 14 |
+
import nock from 'nock';
|
| 15 |
+
import { describe, it, afterEach } from 'mocha';
|
| 16 |
+
import { Gaxios, GaxiosError, request } from '../src/index.js';
|
| 17 |
+
nock.disableNetConnect();
|
| 18 |
+
const url = 'https://example.com';
|
| 19 |
+
function getConfig(err) {
|
| 20 |
+
const e = err;
|
| 21 |
+
if (e && e.config && e.config.retryConfig) {
|
| 22 |
+
return e.config.retryConfig;
|
| 23 |
+
}
|
| 24 |
+
return;
|
| 25 |
+
}
|
| 26 |
+
afterEach(() => {
|
| 27 |
+
nock.cleanAll();
|
| 28 |
+
});
|
| 29 |
+
describe('🛸 retry & exponential backoff', () => {
|
| 30 |
+
it('should provide an expected set of defaults', async () => {
|
| 31 |
+
const scope = nock(url).get('/').times(4).reply(500);
|
| 32 |
+
await assert.rejects(request({ url, retry: true }), (e) => {
|
| 33 |
+
scope.done();
|
| 34 |
+
const config = getConfig(e);
|
| 35 |
+
if (!config) {
|
| 36 |
+
assert.fail('no config available');
|
| 37 |
+
}
|
| 38 |
+
assert.strictEqual(config.currentRetryAttempt, 3);
|
| 39 |
+
assert.strictEqual(config.retry, 3);
|
| 40 |
+
assert.strictEqual(config.noResponseRetries, 2);
|
| 41 |
+
const expectedMethods = ['GET', 'HEAD', 'PUT', 'OPTIONS', 'DELETE'];
|
| 42 |
+
for (const method of config.httpMethodsToRetry) {
|
| 43 |
+
assert(expectedMethods.indexOf(method) > -1);
|
| 44 |
+
}
|
| 45 |
+
const expectedStatusCodes = [
|
| 46 |
+
[100, 199],
|
| 47 |
+
[408, 408],
|
| 48 |
+
[429, 429],
|
| 49 |
+
[500, 599],
|
| 50 |
+
];
|
| 51 |
+
const statusCodesToRetry = config.statusCodesToRetry;
|
| 52 |
+
for (let i = 0; i < statusCodesToRetry.length; i++) {
|
| 53 |
+
const [min, max] = statusCodesToRetry[i];
|
| 54 |
+
const [expMin, expMax] = expectedStatusCodes[i];
|
| 55 |
+
assert.strictEqual(min, expMin);
|
| 56 |
+
assert.strictEqual(max, expMax);
|
| 57 |
+
}
|
| 58 |
+
return true;
|
| 59 |
+
});
|
| 60 |
+
});
|
| 61 |
+
it('should retry on 500 on the main export', async () => {
|
| 62 |
+
const body = { buttered: '🥖' };
|
| 63 |
+
const scopes = [
|
| 64 |
+
nock(url).get('/').reply(500),
|
| 65 |
+
nock(url).get('/').reply(200, body),
|
| 66 |
+
];
|
| 67 |
+
const res = await request({
|
| 68 |
+
url,
|
| 69 |
+
retry: true,
|
| 70 |
+
});
|
| 71 |
+
assert.deepStrictEqual(res.data, body);
|
| 72 |
+
scopes.forEach(s => s.done());
|
| 73 |
+
});
|
| 74 |
+
it('should not retry on a post', async () => {
|
| 75 |
+
const scope = nock(url).post('/').reply(500);
|
| 76 |
+
await assert.rejects(request({ url, method: 'POST', retry: true }), (e) => {
|
| 77 |
+
const config = getConfig(e);
|
| 78 |
+
return config.currentRetryAttempt === 0;
|
| 79 |
+
});
|
| 80 |
+
scope.done();
|
| 81 |
+
});
|
| 82 |
+
it('should not retry if user aborted request', async () => {
|
| 83 |
+
const ac = new AbortController();
|
| 84 |
+
const config = {
|
| 85 |
+
method: 'GET',
|
| 86 |
+
url: 'https://google.com',
|
| 87 |
+
signal: ac.signal,
|
| 88 |
+
retryConfig: { retry: 10, noResponseRetries: 10 },
|
| 89 |
+
};
|
| 90 |
+
const req = request(config);
|
| 91 |
+
ac.abort();
|
| 92 |
+
try {
|
| 93 |
+
await req;
|
| 94 |
+
throw Error('unreachable');
|
| 95 |
+
}
|
| 96 |
+
catch (err) {
|
| 97 |
+
assert(err instanceof GaxiosError);
|
| 98 |
+
assert(err.config);
|
| 99 |
+
assert.strictEqual(err.config.retryConfig?.currentRetryAttempt, 0);
|
| 100 |
+
}
|
| 101 |
+
});
|
| 102 |
+
it('should retry at least the configured number of times', async () => {
|
| 103 |
+
const body = { dippy: '🥚' };
|
| 104 |
+
const scopes = [
|
| 105 |
+
nock(url).get('/').times(3).reply(500),
|
| 106 |
+
nock(url).get('/').reply(200, body),
|
| 107 |
+
];
|
| 108 |
+
const cfg = { url, retryConfig: { retry: 4 } };
|
| 109 |
+
const res = await request(cfg);
|
| 110 |
+
assert.deepStrictEqual(res.data, body);
|
| 111 |
+
scopes.forEach(s => s.done());
|
| 112 |
+
});
|
| 113 |
+
it('should not retry more than configured', async () => {
|
| 114 |
+
const scope = nock(url).get('/').twice().reply(500);
|
| 115 |
+
const cfg = { url, retryConfig: { retry: 1 } };
|
| 116 |
+
await assert.rejects(request(cfg), (e) => {
|
| 117 |
+
return getConfig(e).currentRetryAttempt === 1;
|
| 118 |
+
});
|
| 119 |
+
scope.done();
|
| 120 |
+
});
|
| 121 |
+
it('should not retry on 4xx errors', async () => {
|
| 122 |
+
const scope = nock(url).get('/').reply(404);
|
| 123 |
+
await assert.rejects(request({ url, retry: true }), (e) => {
|
| 124 |
+
const cfg = getConfig(e);
|
| 125 |
+
return cfg.currentRetryAttempt === 0;
|
| 126 |
+
});
|
| 127 |
+
scope.done();
|
| 128 |
+
});
|
| 129 |
+
it('should retain the baseURL on retry', async () => {
|
| 130 |
+
const body = { pumpkin: '🥧' };
|
| 131 |
+
const url = '/path';
|
| 132 |
+
const baseURL = 'http://example.com';
|
| 133 |
+
const scope = nock(baseURL).get(url).reply(500).get(url).reply(200, body);
|
| 134 |
+
const gaxios = new Gaxios({ baseURL });
|
| 135 |
+
const res = await gaxios.request({
|
| 136 |
+
url,
|
| 137 |
+
retry: true,
|
| 138 |
+
});
|
| 139 |
+
assert.deepStrictEqual(res.data, body);
|
| 140 |
+
scope.done();
|
| 141 |
+
});
|
| 142 |
+
it('should not retry if retries set to 0', async () => {
|
| 143 |
+
const scope = nock(url).get('/').reply(500);
|
| 144 |
+
const cfg = { url, retryConfig: { retry: 0 } };
|
| 145 |
+
await assert.rejects(request(cfg), (e) => {
|
| 146 |
+
const cfg = getConfig(e);
|
| 147 |
+
return cfg.currentRetryAttempt === 0;
|
| 148 |
+
});
|
| 149 |
+
scope.done();
|
| 150 |
+
});
|
| 151 |
+
it('should notify on retry attempts', async () => {
|
| 152 |
+
const body = { buttered: '🥖' };
|
| 153 |
+
const scopes = [
|
| 154 |
+
nock(url).get('/').reply(500),
|
| 155 |
+
nock(url).get('/').reply(200, body),
|
| 156 |
+
];
|
| 157 |
+
let flipped = false;
|
| 158 |
+
const config = {
|
| 159 |
+
url,
|
| 160 |
+
retryConfig: {
|
| 161 |
+
onRetryAttempt: err => {
|
| 162 |
+
const cfg = getConfig(err);
|
| 163 |
+
assert.strictEqual(cfg.currentRetryAttempt, 1);
|
| 164 |
+
flipped = true;
|
| 165 |
+
},
|
| 166 |
+
},
|
| 167 |
+
};
|
| 168 |
+
await request(config);
|
| 169 |
+
assert.strictEqual(flipped, true);
|
| 170 |
+
scopes.forEach(s => s.done());
|
| 171 |
+
});
|
| 172 |
+
it('accepts async onRetryAttempt handler', async () => {
|
| 173 |
+
const body = { buttered: '🥖' };
|
| 174 |
+
const scopes = [
|
| 175 |
+
nock(url).get('/').reply(500),
|
| 176 |
+
nock(url).get('/').reply(200, body),
|
| 177 |
+
];
|
| 178 |
+
let flipped = false;
|
| 179 |
+
const config = {
|
| 180 |
+
url,
|
| 181 |
+
retryConfig: {
|
| 182 |
+
onRetryAttempt: async (err) => {
|
| 183 |
+
const cfg = getConfig(err);
|
| 184 |
+
assert.strictEqual(cfg.currentRetryAttempt, 1);
|
| 185 |
+
flipped = true;
|
| 186 |
+
},
|
| 187 |
+
},
|
| 188 |
+
};
|
| 189 |
+
await request(config);
|
| 190 |
+
assert.strictEqual(flipped, true);
|
| 191 |
+
scopes.forEach(s => s.done());
|
| 192 |
+
});
|
| 193 |
+
it('should support overriding the shouldRetry method', async () => {
|
| 194 |
+
const scope = nock(url).get('/').reply(500);
|
| 195 |
+
const config = {
|
| 196 |
+
url,
|
| 197 |
+
retryConfig: {
|
| 198 |
+
shouldRetry: () => {
|
| 199 |
+
return false;
|
| 200 |
+
},
|
| 201 |
+
},
|
| 202 |
+
};
|
| 203 |
+
await assert.rejects(request(config), (e) => {
|
| 204 |
+
const cfg = getConfig(e);
|
| 205 |
+
return cfg.currentRetryAttempt === 0;
|
| 206 |
+
});
|
| 207 |
+
scope.done();
|
| 208 |
+
});
|
| 209 |
+
it('should support overriding the shouldRetry method with a promise', async () => {
|
| 210 |
+
const scope = nock(url).get('/').reply(500);
|
| 211 |
+
const config = {
|
| 212 |
+
url,
|
| 213 |
+
retryConfig: {
|
| 214 |
+
shouldRetry: async () => {
|
| 215 |
+
return false;
|
| 216 |
+
},
|
| 217 |
+
},
|
| 218 |
+
};
|
| 219 |
+
await assert.rejects(request(config), (e) => {
|
| 220 |
+
const cfg = getConfig(e);
|
| 221 |
+
return cfg.currentRetryAttempt === 0;
|
| 222 |
+
});
|
| 223 |
+
scope.done();
|
| 224 |
+
});
|
| 225 |
+
it('should retry on ENOTFOUND', async () => {
|
| 226 |
+
const body = { spicy: '🌮' };
|
| 227 |
+
const scopes = [
|
| 228 |
+
nock(url).get('/').reply(500, { code: 'ENOTFOUND' }),
|
| 229 |
+
nock(url).get('/').reply(200, body),
|
| 230 |
+
];
|
| 231 |
+
const res = await request({ url, retry: true });
|
| 232 |
+
assert.deepStrictEqual(res.data, body);
|
| 233 |
+
scopes.forEach(s => s.done());
|
| 234 |
+
});
|
| 235 |
+
it('should retry on ETIMEDOUT', async () => {
|
| 236 |
+
const body = { sizzling: '🥓' };
|
| 237 |
+
const scopes = [
|
| 238 |
+
nock(url).get('/').reply(500, { code: 'ETIMEDOUT' }),
|
| 239 |
+
nock(url).get('/').reply(200, body),
|
| 240 |
+
];
|
| 241 |
+
const res = await request({ url, retry: true });
|
| 242 |
+
assert.deepStrictEqual(res.data, body);
|
| 243 |
+
scopes.forEach(s => s.done());
|
| 244 |
+
});
|
| 245 |
+
it('should allow configuring noResponseRetries', async () => {
|
| 246 |
+
// `nock` is not listening, therefore it should fail
|
| 247 |
+
const config = { url, retryConfig: { noResponseRetries: 0 } };
|
| 248 |
+
await assert.rejects(request(config), (e) => {
|
| 249 |
+
return (e.code === 'ENETUNREACH' &&
|
| 250 |
+
e.config.retryConfig?.currentRetryAttempt === 0);
|
| 251 |
+
});
|
| 252 |
+
});
|
| 253 |
+
it('should delay the initial retry by 100ms by default', async () => {
|
| 254 |
+
const scope = nock(url).get('/').reply(500).get('/').reply(200, {});
|
| 255 |
+
const start = Date.now();
|
| 256 |
+
await request({
|
| 257 |
+
url,
|
| 258 |
+
retry: true,
|
| 259 |
+
});
|
| 260 |
+
const delay = Date.now() - start;
|
| 261 |
+
assert.ok(delay > 100 && delay < 199);
|
| 262 |
+
scope.done();
|
| 263 |
+
});
|
| 264 |
+
it('should respect the retryDelay if configured', async () => {
|
| 265 |
+
const scope = nock(url).get('/').reply(500).get('/').reply(200, {});
|
| 266 |
+
const start = Date.now();
|
| 267 |
+
await request({
|
| 268 |
+
url,
|
| 269 |
+
retryConfig: {
|
| 270 |
+
retryDelay: 500,
|
| 271 |
+
},
|
| 272 |
+
});
|
| 273 |
+
const delay = Date.now() - start;
|
| 274 |
+
assert.ok(delay > 500 && delay < 599);
|
| 275 |
+
scope.done();
|
| 276 |
+
});
|
| 277 |
+
it('should respect retryDelayMultiplier if configured', async () => {
|
| 278 |
+
const scope = nock(url)
|
| 279 |
+
.get('/')
|
| 280 |
+
.reply(500)
|
| 281 |
+
.get('/')
|
| 282 |
+
.reply(500)
|
| 283 |
+
.get('/')
|
| 284 |
+
.reply(200, {});
|
| 285 |
+
const start = Date.now();
|
| 286 |
+
await request({
|
| 287 |
+
url,
|
| 288 |
+
retryConfig: {
|
| 289 |
+
retryDelayMultiplier: 3,
|
| 290 |
+
},
|
| 291 |
+
});
|
| 292 |
+
const delay = Date.now() - start;
|
| 293 |
+
assert.ok(delay > 1000 && delay < 1999);
|
| 294 |
+
scope.done();
|
| 295 |
+
});
|
| 296 |
+
it('should respect totalTimeout if configured', async () => {
|
| 297 |
+
const scope = nock(url)
|
| 298 |
+
.get('/')
|
| 299 |
+
.reply(500)
|
| 300 |
+
.get('/')
|
| 301 |
+
.reply(500)
|
| 302 |
+
.get('/')
|
| 303 |
+
.reply(200, {});
|
| 304 |
+
const start = Date.now();
|
| 305 |
+
await request({
|
| 306 |
+
url,
|
| 307 |
+
retryConfig: {
|
| 308 |
+
retryDelayMultiplier: 100,
|
| 309 |
+
totalTimeout: 3000,
|
| 310 |
+
},
|
| 311 |
+
});
|
| 312 |
+
const delay = Date.now() - start;
|
| 313 |
+
assert.ok(delay > 3000 && delay < 3999);
|
| 314 |
+
scope.done();
|
| 315 |
+
});
|
| 316 |
+
it('should respect maxRetryDelay if configured', async () => {
|
| 317 |
+
const scope = nock(url)
|
| 318 |
+
.get('/')
|
| 319 |
+
.reply(500)
|
| 320 |
+
.get('/')
|
| 321 |
+
.reply(500)
|
| 322 |
+
.get('/')
|
| 323 |
+
.reply(200, {});
|
| 324 |
+
const start = Date.now();
|
| 325 |
+
await request({
|
| 326 |
+
url,
|
| 327 |
+
retryConfig: {
|
| 328 |
+
retryDelayMultiplier: 100,
|
| 329 |
+
maxRetryDelay: 4000,
|
| 330 |
+
},
|
| 331 |
+
});
|
| 332 |
+
const delay = Date.now() - start;
|
| 333 |
+
assert.ok(delay > 4000 && delay < 4999);
|
| 334 |
+
scope.done();
|
| 335 |
+
});
|
| 336 |
+
it('should retry on `timeout`', async () => {
|
| 337 |
+
const scope = nock(url).get('/').delay(500).reply(400).get('/').reply(204);
|
| 338 |
+
const gaxios = new Gaxios();
|
| 339 |
+
const timeout = 100;
|
| 340 |
+
async function onRetryAttempt({ config, message }) {
|
| 341 |
+
assert(config.signal?.reason instanceof DOMException);
|
| 342 |
+
assert.equal(config.signal.reason.name, 'TimeoutError');
|
| 343 |
+
assert.match(message, /timeout/i);
|
| 344 |
+
// increase timeout to something higher to avoid time-sensitive flaky tests
|
| 345 |
+
// note: the second `nock` GET is not delayed like the first one
|
| 346 |
+
config.timeout = 10000;
|
| 347 |
+
}
|
| 348 |
+
const res = await gaxios.request({
|
| 349 |
+
url,
|
| 350 |
+
timeout,
|
| 351 |
+
// NOTE: `node-fetch` does not yet support `TimeoutError` - testing with native `fetch` for now.
|
| 352 |
+
fetchImplementation: fetch,
|
| 353 |
+
retryConfig: {
|
| 354 |
+
onRetryAttempt,
|
| 355 |
+
},
|
| 356 |
+
});
|
| 357 |
+
assert.equal(res.status, 204);
|
| 358 |
+
assert.equal(res.config?.retryConfig?.currentRetryAttempt, 1);
|
| 359 |
+
scope.done();
|
| 360 |
+
});
|
| 361 |
+
});
|
| 362 |
+
//# sourceMappingURL=test.retry.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gaxios/build/esm/test/test.retry.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"test.retry.js","sourceRoot":"","sources":["../../../test/test.retry.ts"],"names":[],"mappings":"AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAE,WAAW,EAAiB,OAAO,EAAC,MAAM,iBAAiB,CAAC;AAE5E,IAAI,CAAC,iBAAiB,EAAE,CAAC;AAEzB,MAAM,GAAG,GAAG,qBAAqB,CAAC;AAElC,SAAS,SAAS,CAAC,GAAU;IAC3B,MAAM,CAAC,GAAG,GAAkB,CAAC;IAC7B,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QAC1C,OAAO,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC;IAC9B,CAAC;IACD,OAAO;AACT,CAAC;AAED,SAAS,CAAC,GAAG,EAAE;IACb,IAAI,CAAC,QAAQ,EAAE,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,gCAAgC,EAAE,GAAG,EAAE;IAC9C,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
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Copyright 2022 Google LLC
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
/**
|
| 17 |
+
* Known paths unique to Google Compute Engine Linux instances
|
| 18 |
+
*/
|
| 19 |
+
export declare const GCE_LINUX_BIOS_PATHS: {
|
| 20 |
+
BIOS_DATE: string;
|
| 21 |
+
BIOS_VENDOR: string;
|
| 22 |
+
};
|
| 23 |
+
/**
|
| 24 |
+
* Determines if the process is running on a Google Cloud Serverless environment (Cloud Run or Cloud Functions instance).
|
| 25 |
+
*
|
| 26 |
+
* Uses the:
|
| 27 |
+
* - {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.
|
| 28 |
+
* - {@link https://cloud.google.com/functions/docs/env-var Cloud Functions environment variables}.
|
| 29 |
+
*
|
| 30 |
+
* @returns {boolean} `true` if the process is running on GCP serverless, `false` otherwise.
|
| 31 |
+
*/
|
| 32 |
+
export declare function isGoogleCloudServerless(): boolean;
|
| 33 |
+
/**
|
| 34 |
+
* Determines if the process is running on a Linux Google Compute Engine instance.
|
| 35 |
+
*
|
| 36 |
+
* @returns {boolean} `true` if the process is running on Linux GCE, `false` otherwise.
|
| 37 |
+
*/
|
| 38 |
+
export declare function isGoogleComputeEngineLinux(): boolean;
|
| 39 |
+
/**
|
| 40 |
+
* Determines if the process is running on a Google Compute Engine instance with a known
|
| 41 |
+
* MAC address.
|
| 42 |
+
*
|
| 43 |
+
* @returns {boolean} `true` if the process is running on GCE (as determined by MAC address), `false` otherwise.
|
| 44 |
+
*/
|
| 45 |
+
export declare function isGoogleComputeEngineMACAddress(): boolean;
|
| 46 |
+
/**
|
| 47 |
+
* Determines if the process is running on a Google Compute Engine instance.
|
| 48 |
+
*
|
| 49 |
+
* @returns {boolean} `true` if the process is running on GCE, `false` otherwise.
|
| 50 |
+
*/
|
| 51 |
+
export declare function isGoogleComputeEngine(): boolean;
|
| 52 |
+
/**
|
| 53 |
+
* Determines if the process is running on Google Cloud Platform.
|
| 54 |
+
*
|
| 55 |
+
* @returns {boolean} `true` if the process is running on GCP, `false` otherwise.
|
| 56 |
+
*/
|
| 57 |
+
export declare function detectGCPResidency(): boolean;
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gcp-metadata/build/src/gcp-residency.js
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
/**
|
| 3 |
+
* Copyright 2022 Google LLC
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 18 |
+
exports.GCE_LINUX_BIOS_PATHS = void 0;
|
| 19 |
+
exports.isGoogleCloudServerless = isGoogleCloudServerless;
|
| 20 |
+
exports.isGoogleComputeEngineLinux = isGoogleComputeEngineLinux;
|
| 21 |
+
exports.isGoogleComputeEngineMACAddress = isGoogleComputeEngineMACAddress;
|
| 22 |
+
exports.isGoogleComputeEngine = isGoogleComputeEngine;
|
| 23 |
+
exports.detectGCPResidency = detectGCPResidency;
|
| 24 |
+
const fs_1 = require("fs");
|
| 25 |
+
const os_1 = require("os");
|
| 26 |
+
/**
|
| 27 |
+
* Known paths unique to Google Compute Engine Linux instances
|
| 28 |
+
*/
|
| 29 |
+
exports.GCE_LINUX_BIOS_PATHS = {
|
| 30 |
+
BIOS_DATE: '/sys/class/dmi/id/bios_date',
|
| 31 |
+
BIOS_VENDOR: '/sys/class/dmi/id/bios_vendor',
|
| 32 |
+
};
|
| 33 |
+
const GCE_MAC_ADDRESS_REGEX = /^42:01/;
|
| 34 |
+
/**
|
| 35 |
+
* Determines if the process is running on a Google Cloud Serverless environment (Cloud Run or Cloud Functions instance).
|
| 36 |
+
*
|
| 37 |
+
* Uses the:
|
| 38 |
+
* - {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.
|
| 39 |
+
* - {@link https://cloud.google.com/functions/docs/env-var Cloud Functions environment variables}.
|
| 40 |
+
*
|
| 41 |
+
* @returns {boolean} `true` if the process is running on GCP serverless, `false` otherwise.
|
| 42 |
+
*/
|
| 43 |
+
function isGoogleCloudServerless() {
|
| 44 |
+
/**
|
| 45 |
+
* `CLOUD_RUN_JOB` is used for Cloud Run Jobs
|
| 46 |
+
* - See {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.
|
| 47 |
+
*
|
| 48 |
+
* `FUNCTION_NAME` is used in older Cloud Functions environments:
|
| 49 |
+
* - See {@link https://cloud.google.com/functions/docs/env-var Python 3.7 and Go 1.11}.
|
| 50 |
+
*
|
| 51 |
+
* `K_SERVICE` is used in Cloud Run and newer Cloud Functions environments:
|
| 52 |
+
* - See {@link https://cloud.google.com/run/docs/container-contract#env-vars Cloud Run environment variables}.
|
| 53 |
+
* - See {@link https://cloud.google.com/functions/docs/env-var Cloud Functions newer runtimes}.
|
| 54 |
+
*/
|
| 55 |
+
const isGFEnvironment = process.env.CLOUD_RUN_JOB ||
|
| 56 |
+
process.env.FUNCTION_NAME ||
|
| 57 |
+
process.env.K_SERVICE;
|
| 58 |
+
return !!isGFEnvironment;
|
| 59 |
+
}
|
| 60 |
+
/**
|
| 61 |
+
* Determines if the process is running on a Linux Google Compute Engine instance.
|
| 62 |
+
*
|
| 63 |
+
* @returns {boolean} `true` if the process is running on Linux GCE, `false` otherwise.
|
| 64 |
+
*/
|
| 65 |
+
function isGoogleComputeEngineLinux() {
|
| 66 |
+
if ((0, os_1.platform)() !== 'linux')
|
| 67 |
+
return false;
|
| 68 |
+
try {
|
| 69 |
+
// ensure this file exist
|
| 70 |
+
(0, fs_1.statSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_DATE);
|
| 71 |
+
// ensure this file exist and matches
|
| 72 |
+
const biosVendor = (0, fs_1.readFileSync)(exports.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR, 'utf8');
|
| 73 |
+
return /Google/.test(biosVendor);
|
| 74 |
+
}
|
| 75 |
+
catch {
|
| 76 |
+
return false;
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
/**
|
| 80 |
+
* Determines if the process is running on a Google Compute Engine instance with a known
|
| 81 |
+
* MAC address.
|
| 82 |
+
*
|
| 83 |
+
* @returns {boolean} `true` if the process is running on GCE (as determined by MAC address), `false` otherwise.
|
| 84 |
+
*/
|
| 85 |
+
function isGoogleComputeEngineMACAddress() {
|
| 86 |
+
const interfaces = (0, os_1.networkInterfaces)();
|
| 87 |
+
for (const item of Object.values(interfaces)) {
|
| 88 |
+
if (!item)
|
| 89 |
+
continue;
|
| 90 |
+
for (const { mac } of item) {
|
| 91 |
+
if (GCE_MAC_ADDRESS_REGEX.test(mac)) {
|
| 92 |
+
return true;
|
| 93 |
+
}
|
| 94 |
+
}
|
| 95 |
+
}
|
| 96 |
+
return false;
|
| 97 |
+
}
|
| 98 |
+
/**
|
| 99 |
+
* Determines if the process is running on a Google Compute Engine instance.
|
| 100 |
+
*
|
| 101 |
+
* @returns {boolean} `true` if the process is running on GCE, `false` otherwise.
|
| 102 |
+
*/
|
| 103 |
+
function isGoogleComputeEngine() {
|
| 104 |
+
return isGoogleComputeEngineLinux() || isGoogleComputeEngineMACAddress();
|
| 105 |
+
}
|
| 106 |
+
/**
|
| 107 |
+
* Determines if the process is running on Google Cloud Platform.
|
| 108 |
+
*
|
| 109 |
+
* @returns {boolean} `true` if the process is running on GCP, `false` otherwise.
|
| 110 |
+
*/
|
| 111 |
+
function detectGCPResidency() {
|
| 112 |
+
return isGoogleCloudServerless() || isGoogleComputeEngine();
|
| 113 |
+
}
|
| 114 |
+
//# sourceMappingURL=gcp-residency.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gcp-metadata/build/src/gcp-residency.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"gcp-residency.js","sourceRoot":"","sources":["../../src/gcp-residency.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAwBH,0DAkBC;AAOD,gEAcC;AAQD,0EAcC;AAOD,sDAEC;AAOD,gDAEC;AArGD,2BAA0C;AAC1C,2BAA+C;AAE/C;;GAEG;AACU,QAAA,oBAAoB,GAAG;IAClC,SAAS,EAAE,6BAA6B;IACxC,WAAW,EAAE,+BAA+B;CAC7C,CAAC;AAEF,MAAM,qBAAqB,GAAG,QAAQ,CAAC;AAEvC;;;;;;;;GAQG;AACH,SAAgB,uBAAuB;IACrC;;;;;;;;;;OAUG;IACH,MAAM,eAAe,GACnB,OAAO,CAAC,GAAG,CAAC,aAAa;QACzB,OAAO,CAAC,GAAG,CAAC,aAAa;QACzB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC;IAExB,OAAO,CAAC,CAAC,eAAe,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,SAAgB,0BAA0B;IACxC,IAAI,IAAA,aAAQ,GAAE,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAEzC,IAAI,CAAC;QACH,yBAAyB;QACzB,IAAA,aAAQ,EAAC,4BAAoB,CAAC,SAAS,CAAC,CAAC;QAEzC,qCAAqC;QACrC,MAAM,UAAU,GAAG,IAAA,iBAAY,EAAC,4BAAoB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAE1E,OAAO,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Copyright 2018 Google LLC
|
| 3 |
+
*
|
| 4 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
+
* you may not use this file except in compliance with the License.
|
| 6 |
+
* You may obtain a copy of the License at
|
| 7 |
+
*
|
| 8 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
+
*
|
| 10 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 11 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
+
* See the License for the specific language governing permissions and
|
| 14 |
+
* limitations under the License.
|
| 15 |
+
*/
|
| 16 |
+
export declare const BASE_PATH = "/computeMetadata/v1";
|
| 17 |
+
export declare const HOST_ADDRESS = "http://169.254.169.254";
|
| 18 |
+
export declare const SECONDARY_HOST_ADDRESS = "http://metadata.google.internal.";
|
| 19 |
+
export declare const HEADER_NAME = "Metadata-Flavor";
|
| 20 |
+
export declare const HEADER_VALUE = "Google";
|
| 21 |
+
export declare const HEADERS: Readonly<{
|
| 22 |
+
"Metadata-Flavor": "Google";
|
| 23 |
+
}>;
|
| 24 |
+
/**
|
| 25 |
+
* Metadata server detection override options.
|
| 26 |
+
*
|
| 27 |
+
* Available via `process.env.METADATA_SERVER_DETECTION`.
|
| 28 |
+
*/
|
| 29 |
+
export declare const METADATA_SERVER_DETECTION: Readonly<{
|
| 30 |
+
'assume-present': "don't try to ping the metadata server, but assume it's present";
|
| 31 |
+
none: "don't try to ping the metadata server, but don't try to use it either";
|
| 32 |
+
'bios-only': "treat the result of a BIOS probe as canonical (don't fall back to pinging)";
|
| 33 |
+
'ping-only': "skip the BIOS probe, and go straight to pinging";
|
| 34 |
+
}>;
|
| 35 |
+
type HeadersInit = ConstructorParameters<typeof Headers>[0];
|
| 36 |
+
export interface Options {
|
| 37 |
+
params?: {
|
| 38 |
+
[index: string]: string;
|
| 39 |
+
};
|
| 40 |
+
property?: string;
|
| 41 |
+
headers?: HeadersInit;
|
| 42 |
+
}
|
| 43 |
+
export interface MetadataAccessor {
|
| 44 |
+
/**
|
| 45 |
+
*
|
| 46 |
+
* @example
|
| 47 |
+
*
|
| 48 |
+
* // equivalent to `project('project-id')`;
|
| 49 |
+
* const metadataKey = 'project/project-id';
|
| 50 |
+
*/
|
| 51 |
+
metadataKey: string;
|
| 52 |
+
params?: Options['params'];
|
| 53 |
+
headers?: Options['headers'];
|
| 54 |
+
noResponseRetries?: number;
|
| 55 |
+
fastFail?: boolean;
|
| 56 |
+
}
|
| 57 |
+
export type BulkResults<T extends readonly MetadataAccessor[]> = {
|
| 58 |
+
[key in T[number]['metadataKey']]: ReturnType<JSON['parse']>;
|
| 59 |
+
};
|
| 60 |
+
/**
|
| 61 |
+
* Obtain metadata for the current GCE instance.
|
| 62 |
+
*
|
| 63 |
+
* @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}
|
| 64 |
+
*
|
| 65 |
+
* @example
|
| 66 |
+
* ```
|
| 67 |
+
* const serviceAccount: {} = await instance('service-accounts/');
|
| 68 |
+
* const serviceAccountEmail: string = await instance('service-accounts/default/email');
|
| 69 |
+
* ```
|
| 70 |
+
*/
|
| 71 |
+
export declare function instance<T = any>(options?: string | Options): Promise<T>;
|
| 72 |
+
/**
|
| 73 |
+
* Obtain metadata for the current GCP project.
|
| 74 |
+
*
|
| 75 |
+
* @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}
|
| 76 |
+
*
|
| 77 |
+
* @example
|
| 78 |
+
* ```
|
| 79 |
+
* const projectId: string = await project('project-id');
|
| 80 |
+
* const numericProjectId: number = await project('numeric-project-id');
|
| 81 |
+
* ```
|
| 82 |
+
*/
|
| 83 |
+
export declare function project<T = any>(options?: string | Options): Promise<T>;
|
| 84 |
+
/**
|
| 85 |
+
* Obtain metadata for the current universe.
|
| 86 |
+
*
|
| 87 |
+
* @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}
|
| 88 |
+
*
|
| 89 |
+
* @example
|
| 90 |
+
* ```
|
| 91 |
+
* const universeDomain: string = await universe('universe-domain');
|
| 92 |
+
* ```
|
| 93 |
+
*/
|
| 94 |
+
export declare function universe<T>(options?: string | Options): Promise<T>;
|
| 95 |
+
/**
|
| 96 |
+
* Retrieve metadata items in parallel.
|
| 97 |
+
*
|
| 98 |
+
* @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}
|
| 99 |
+
*
|
| 100 |
+
* @example
|
| 101 |
+
* ```
|
| 102 |
+
* const data = await bulk([
|
| 103 |
+
* {
|
| 104 |
+
* metadataKey: 'instance',
|
| 105 |
+
* },
|
| 106 |
+
* {
|
| 107 |
+
* metadataKey: 'project/project-id',
|
| 108 |
+
* },
|
| 109 |
+
* ] as const);
|
| 110 |
+
*
|
| 111 |
+
* // data.instance;
|
| 112 |
+
* // data['project/project-id'];
|
| 113 |
+
* ```
|
| 114 |
+
*
|
| 115 |
+
* @param properties The metadata properties to retrieve
|
| 116 |
+
* @returns The metadata in `metadatakey:value` format
|
| 117 |
+
*/
|
| 118 |
+
export declare function bulk<T extends readonly Readonly<MetadataAccessor>[], R extends BulkResults<T> = BulkResults<T>>(properties: T): Promise<R>;
|
| 119 |
+
/**
|
| 120 |
+
* Determine if the metadata server is currently available.
|
| 121 |
+
*/
|
| 122 |
+
export declare function isAvailable(): Promise<boolean>;
|
| 123 |
+
/**
|
| 124 |
+
* reset the memoized isAvailable() lookup.
|
| 125 |
+
*/
|
| 126 |
+
export declare function resetIsAvailableCache(): void;
|
| 127 |
+
/**
|
| 128 |
+
* A cache for the detected GCP Residency.
|
| 129 |
+
*/
|
| 130 |
+
export declare let gcpResidencyCache: boolean | null;
|
| 131 |
+
/**
|
| 132 |
+
* Detects GCP Residency.
|
| 133 |
+
* Caches results to reduce costs for subsequent calls.
|
| 134 |
+
*
|
| 135 |
+
* @see setGCPResidency for setting
|
| 136 |
+
*/
|
| 137 |
+
export declare function getGCPResidency(): boolean;
|
| 138 |
+
/**
|
| 139 |
+
* Sets the detected GCP Residency.
|
| 140 |
+
* Useful for forcing metadata server detection behavior.
|
| 141 |
+
*
|
| 142 |
+
* Set `null` to autodetect the environment (default behavior).
|
| 143 |
+
* @see getGCPResidency for getting
|
| 144 |
+
*/
|
| 145 |
+
export declare function setGCPResidency(value?: boolean | null): void;
|
| 146 |
+
/**
|
| 147 |
+
* Obtain the timeout for requests to the metadata server.
|
| 148 |
+
*
|
| 149 |
+
* In certain environments and conditions requests can take longer than
|
| 150 |
+
* the default timeout to complete. This function will determine the
|
| 151 |
+
* appropriate timeout based on the environment.
|
| 152 |
+
*
|
| 153 |
+
* @returns {number} a request timeout duration in milliseconds.
|
| 154 |
+
*/
|
| 155 |
+
export declare function requestTimeout(): number;
|
| 156 |
+
export * from './gcp-residency';
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gcp-metadata/build/src/index.js
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
/**
|
| 3 |
+
* Copyright 2018 Google LLC
|
| 4 |
+
*
|
| 5 |
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 |
+
* you may not use this file except in compliance with the License.
|
| 7 |
+
* You may obtain a copy of the License at
|
| 8 |
+
*
|
| 9 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
| 10 |
+
*
|
| 11 |
+
* Unless required by applicable law or agreed to in writing, software
|
| 12 |
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 |
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 |
+
* See the License for the specific language governing permissions and
|
| 15 |
+
* limitations under the License.
|
| 16 |
+
*/
|
| 17 |
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
| 18 |
+
if (k2 === undefined) k2 = k;
|
| 19 |
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
| 20 |
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
| 21 |
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
| 22 |
+
}
|
| 23 |
+
Object.defineProperty(o, k2, desc);
|
| 24 |
+
}) : (function(o, m, k, k2) {
|
| 25 |
+
if (k2 === undefined) k2 = k;
|
| 26 |
+
o[k2] = m[k];
|
| 27 |
+
}));
|
| 28 |
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
| 29 |
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
| 30 |
+
}) : function(o, v) {
|
| 31 |
+
o["default"] = v;
|
| 32 |
+
});
|
| 33 |
+
var __importStar = (this && this.__importStar) || (function () {
|
| 34 |
+
var ownKeys = function(o) {
|
| 35 |
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
| 36 |
+
var ar = [];
|
| 37 |
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
| 38 |
+
return ar;
|
| 39 |
+
};
|
| 40 |
+
return ownKeys(o);
|
| 41 |
+
};
|
| 42 |
+
return function (mod) {
|
| 43 |
+
if (mod && mod.__esModule) return mod;
|
| 44 |
+
var result = {};
|
| 45 |
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
| 46 |
+
__setModuleDefault(result, mod);
|
| 47 |
+
return result;
|
| 48 |
+
};
|
| 49 |
+
})();
|
| 50 |
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
| 51 |
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
| 52 |
+
};
|
| 53 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 54 |
+
exports.gcpResidencyCache = exports.METADATA_SERVER_DETECTION = exports.HEADERS = exports.HEADER_VALUE = exports.HEADER_NAME = exports.SECONDARY_HOST_ADDRESS = exports.HOST_ADDRESS = exports.BASE_PATH = void 0;
|
| 55 |
+
exports.instance = instance;
|
| 56 |
+
exports.project = project;
|
| 57 |
+
exports.universe = universe;
|
| 58 |
+
exports.bulk = bulk;
|
| 59 |
+
exports.isAvailable = isAvailable;
|
| 60 |
+
exports.resetIsAvailableCache = resetIsAvailableCache;
|
| 61 |
+
exports.getGCPResidency = getGCPResidency;
|
| 62 |
+
exports.setGCPResidency = setGCPResidency;
|
| 63 |
+
exports.requestTimeout = requestTimeout;
|
| 64 |
+
const gaxios_1 = require("gaxios");
|
| 65 |
+
const jsonBigint = require("json-bigint");
|
| 66 |
+
const gcp_residency_1 = require("./gcp-residency");
|
| 67 |
+
const logger = __importStar(require("google-logging-utils"));
|
| 68 |
+
exports.BASE_PATH = '/computeMetadata/v1';
|
| 69 |
+
exports.HOST_ADDRESS = 'http://169.254.169.254';
|
| 70 |
+
exports.SECONDARY_HOST_ADDRESS = 'http://metadata.google.internal.';
|
| 71 |
+
exports.HEADER_NAME = 'Metadata-Flavor';
|
| 72 |
+
exports.HEADER_VALUE = 'Google';
|
| 73 |
+
exports.HEADERS = Object.freeze({ [exports.HEADER_NAME]: exports.HEADER_VALUE });
|
| 74 |
+
const log = logger.log('gcp-metadata');
|
| 75 |
+
/**
|
| 76 |
+
* Metadata server detection override options.
|
| 77 |
+
*
|
| 78 |
+
* Available via `process.env.METADATA_SERVER_DETECTION`.
|
| 79 |
+
*/
|
| 80 |
+
exports.METADATA_SERVER_DETECTION = Object.freeze({
|
| 81 |
+
'assume-present': "don't try to ping the metadata server, but assume it's present",
|
| 82 |
+
none: "don't try to ping the metadata server, but don't try to use it either",
|
| 83 |
+
'bios-only': "treat the result of a BIOS probe as canonical (don't fall back to pinging)",
|
| 84 |
+
'ping-only': 'skip the BIOS probe, and go straight to pinging',
|
| 85 |
+
});
|
| 86 |
+
/**
|
| 87 |
+
* Returns the base URL while taking into account the GCE_METADATA_HOST
|
| 88 |
+
* environment variable if it exists.
|
| 89 |
+
*
|
| 90 |
+
* @returns The base URL, e.g., http://169.254.169.254/computeMetadata/v1.
|
| 91 |
+
*/
|
| 92 |
+
function getBaseUrl(baseUrl) {
|
| 93 |
+
if (!baseUrl) {
|
| 94 |
+
baseUrl =
|
| 95 |
+
process.env.GCE_METADATA_IP ||
|
| 96 |
+
process.env.GCE_METADATA_HOST ||
|
| 97 |
+
exports.HOST_ADDRESS;
|
| 98 |
+
}
|
| 99 |
+
// If no scheme is provided default to HTTP:
|
| 100 |
+
if (!/^https?:\/\//.test(baseUrl)) {
|
| 101 |
+
baseUrl = `http://${baseUrl}`;
|
| 102 |
+
}
|
| 103 |
+
return new URL(exports.BASE_PATH, baseUrl).href;
|
| 104 |
+
}
|
| 105 |
+
// Accepts an options object passed from the user to the API. In previous
|
| 106 |
+
// versions of the API, it referred to a `Request` or an `Axios` request
|
| 107 |
+
// options object. Now it refers to an object with very limited property
|
| 108 |
+
// names. This is here to help ensure users don't pass invalid options when
|
| 109 |
+
// they upgrade from 0.4 to 0.5 to 0.8.
|
| 110 |
+
function validate(options) {
|
| 111 |
+
Object.keys(options).forEach(key => {
|
| 112 |
+
switch (key) {
|
| 113 |
+
case 'params':
|
| 114 |
+
case 'property':
|
| 115 |
+
case 'headers':
|
| 116 |
+
break;
|
| 117 |
+
case 'qs':
|
| 118 |
+
throw new Error("'qs' is not a valid configuration option. Please use 'params' instead.");
|
| 119 |
+
default:
|
| 120 |
+
throw new Error(`'${key}' is not a valid configuration option.`);
|
| 121 |
+
}
|
| 122 |
+
});
|
| 123 |
+
}
|
| 124 |
+
async function metadataAccessor(type, options = {}, noResponseRetries = 3, fastFail = false) {
|
| 125 |
+
const headers = new Headers(exports.HEADERS);
|
| 126 |
+
let metadataKey = '';
|
| 127 |
+
let params = {};
|
| 128 |
+
if (typeof type === 'object') {
|
| 129 |
+
const metadataAccessor = type;
|
| 130 |
+
new Headers(metadataAccessor.headers).forEach((value, key) => headers.set(key, value));
|
| 131 |
+
metadataKey = metadataAccessor.metadataKey;
|
| 132 |
+
params = metadataAccessor.params || params;
|
| 133 |
+
noResponseRetries = metadataAccessor.noResponseRetries || noResponseRetries;
|
| 134 |
+
fastFail = metadataAccessor.fastFail || fastFail;
|
| 135 |
+
}
|
| 136 |
+
else {
|
| 137 |
+
metadataKey = type;
|
| 138 |
+
}
|
| 139 |
+
if (typeof options === 'string') {
|
| 140 |
+
metadataKey += `/${options}`;
|
| 141 |
+
}
|
| 142 |
+
else {
|
| 143 |
+
validate(options);
|
| 144 |
+
if (options.property) {
|
| 145 |
+
metadataKey += `/${options.property}`;
|
| 146 |
+
}
|
| 147 |
+
new Headers(options.headers).forEach((value, key) => headers.set(key, value));
|
| 148 |
+
params = options.params || params;
|
| 149 |
+
}
|
| 150 |
+
const requestMethod = fastFail ? fastFailMetadataRequest : gaxios_1.request;
|
| 151 |
+
const req = {
|
| 152 |
+
url: `${getBaseUrl()}/${metadataKey}`,
|
| 153 |
+
headers,
|
| 154 |
+
retryConfig: { noResponseRetries },
|
| 155 |
+
params,
|
| 156 |
+
responseType: 'text',
|
| 157 |
+
timeout: requestTimeout(),
|
| 158 |
+
};
|
| 159 |
+
log.info('instance request %j', req);
|
| 160 |
+
const res = await requestMethod(req);
|
| 161 |
+
log.info('instance metadata is %s', res.data);
|
| 162 |
+
const metadataFlavor = res.headers.get(exports.HEADER_NAME);
|
| 163 |
+
if (metadataFlavor !== exports.HEADER_VALUE) {
|
| 164 |
+
throw new RangeError(`Invalid response from metadata service: incorrect ${exports.HEADER_NAME} header. Expected '${exports.HEADER_VALUE}', got ${metadataFlavor ? `'${metadataFlavor}'` : 'no header'}`);
|
| 165 |
+
}
|
| 166 |
+
if (typeof res.data === 'string') {
|
| 167 |
+
try {
|
| 168 |
+
return jsonBigint.parse(res.data);
|
| 169 |
+
}
|
| 170 |
+
catch {
|
| 171 |
+
/* ignore */
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
return res.data;
|
| 175 |
+
}
|
| 176 |
+
async function fastFailMetadataRequest(options) {
|
| 177 |
+
const secondaryOptions = {
|
| 178 |
+
...options,
|
| 179 |
+
url: options.url
|
| 180 |
+
?.toString()
|
| 181 |
+
.replace(getBaseUrl(), getBaseUrl(exports.SECONDARY_HOST_ADDRESS)),
|
| 182 |
+
};
|
| 183 |
+
// We race a connection between DNS/IP to metadata server. There are a couple
|
| 184 |
+
// reasons for this:
|
| 185 |
+
//
|
| 186 |
+
// 1. the DNS is slow in some GCP environments; by checking both, we might
|
| 187 |
+
// detect the runtime environment significantly faster.
|
| 188 |
+
// 2. we can't just check the IP, which is tarpitted and slow to respond
|
| 189 |
+
// on a user's local machine.
|
| 190 |
+
//
|
| 191 |
+
// Returns first resolved promise or if all promises get rejected we return an AggregateError.
|
| 192 |
+
//
|
| 193 |
+
// Note, however, if a failure happens prior to a success, a rejection should
|
| 194 |
+
// occur, this is for folks running locally.
|
| 195 |
+
//
|
| 196 |
+
const r1 = (0, gaxios_1.request)(options);
|
| 197 |
+
const r2 = (0, gaxios_1.request)(secondaryOptions);
|
| 198 |
+
return Promise.any([r1, r2]);
|
| 199 |
+
}
|
| 200 |
+
/**
|
| 201 |
+
* Obtain metadata for the current GCE instance.
|
| 202 |
+
*
|
| 203 |
+
* @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}
|
| 204 |
+
*
|
| 205 |
+
* @example
|
| 206 |
+
* ```
|
| 207 |
+
* const serviceAccount: {} = await instance('service-accounts/');
|
| 208 |
+
* const serviceAccountEmail: string = await instance('service-accounts/default/email');
|
| 209 |
+
* ```
|
| 210 |
+
*/
|
| 211 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 212 |
+
function instance(options) {
|
| 213 |
+
return metadataAccessor('instance', options);
|
| 214 |
+
}
|
| 215 |
+
/**
|
| 216 |
+
* Obtain metadata for the current GCP project.
|
| 217 |
+
*
|
| 218 |
+
* @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}
|
| 219 |
+
*
|
| 220 |
+
* @example
|
| 221 |
+
* ```
|
| 222 |
+
* const projectId: string = await project('project-id');
|
| 223 |
+
* const numericProjectId: number = await project('numeric-project-id');
|
| 224 |
+
* ```
|
| 225 |
+
*/
|
| 226 |
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
| 227 |
+
function project(options) {
|
| 228 |
+
return metadataAccessor('project', options);
|
| 229 |
+
}
|
| 230 |
+
/**
|
| 231 |
+
* Obtain metadata for the current universe.
|
| 232 |
+
*
|
| 233 |
+
* @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}
|
| 234 |
+
*
|
| 235 |
+
* @example
|
| 236 |
+
* ```
|
| 237 |
+
* const universeDomain: string = await universe('universe-domain');
|
| 238 |
+
* ```
|
| 239 |
+
*/
|
| 240 |
+
function universe(options) {
|
| 241 |
+
return metadataAccessor('universe', options);
|
| 242 |
+
}
|
| 243 |
+
/**
|
| 244 |
+
* Retrieve metadata items in parallel.
|
| 245 |
+
*
|
| 246 |
+
* @see {@link https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys}
|
| 247 |
+
*
|
| 248 |
+
* @example
|
| 249 |
+
* ```
|
| 250 |
+
* const data = await bulk([
|
| 251 |
+
* {
|
| 252 |
+
* metadataKey: 'instance',
|
| 253 |
+
* },
|
| 254 |
+
* {
|
| 255 |
+
* metadataKey: 'project/project-id',
|
| 256 |
+
* },
|
| 257 |
+
* ] as const);
|
| 258 |
+
*
|
| 259 |
+
* // data.instance;
|
| 260 |
+
* // data['project/project-id'];
|
| 261 |
+
* ```
|
| 262 |
+
*
|
| 263 |
+
* @param properties The metadata properties to retrieve
|
| 264 |
+
* @returns The metadata in `metadatakey:value` format
|
| 265 |
+
*/
|
| 266 |
+
async function bulk(properties) {
|
| 267 |
+
const r = {};
|
| 268 |
+
await Promise.all(properties.map(item => {
|
| 269 |
+
return (async () => {
|
| 270 |
+
const res = await metadataAccessor(item);
|
| 271 |
+
const key = item.metadataKey;
|
| 272 |
+
r[key] = res;
|
| 273 |
+
})();
|
| 274 |
+
}));
|
| 275 |
+
return r;
|
| 276 |
+
}
|
| 277 |
+
/*
|
| 278 |
+
* How many times should we retry detecting GCP environment.
|
| 279 |
+
*/
|
| 280 |
+
function detectGCPAvailableRetries() {
|
| 281 |
+
return process.env.DETECT_GCP_RETRIES
|
| 282 |
+
? Number(process.env.DETECT_GCP_RETRIES)
|
| 283 |
+
: 0;
|
| 284 |
+
}
|
| 285 |
+
let cachedIsAvailableResponse;
|
| 286 |
+
/**
|
| 287 |
+
* Determine if the metadata server is currently available.
|
| 288 |
+
*/
|
| 289 |
+
async function isAvailable() {
|
| 290 |
+
if (process.env.METADATA_SERVER_DETECTION) {
|
| 291 |
+
const value = process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();
|
| 292 |
+
if (!(value in exports.METADATA_SERVER_DETECTION)) {
|
| 293 |
+
throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${value}\`, but it should be \`${Object.keys(exports.METADATA_SERVER_DETECTION).join('`, `')}\`, or unset`);
|
| 294 |
+
}
|
| 295 |
+
switch (value) {
|
| 296 |
+
case 'assume-present':
|
| 297 |
+
return true;
|
| 298 |
+
case 'none':
|
| 299 |
+
return false;
|
| 300 |
+
case 'bios-only':
|
| 301 |
+
return getGCPResidency();
|
| 302 |
+
case 'ping-only':
|
| 303 |
+
// continue, we want to ping the server
|
| 304 |
+
}
|
| 305 |
+
}
|
| 306 |
+
try {
|
| 307 |
+
// If a user is instantiating several GCP libraries at the same time,
|
| 308 |
+
// this may result in multiple calls to isAvailable(), to detect the
|
| 309 |
+
// runtime environment. We use the same promise for each of these calls
|
| 310 |
+
// to reduce the network load.
|
| 311 |
+
if (cachedIsAvailableResponse === undefined) {
|
| 312 |
+
cachedIsAvailableResponse = metadataAccessor('instance', undefined, detectGCPAvailableRetries(),
|
| 313 |
+
// If the default HOST_ADDRESS has been overridden, we should not
|
| 314 |
+
// make an effort to try SECONDARY_HOST_ADDRESS (as we are likely in
|
| 315 |
+
// a non-GCP environment):
|
| 316 |
+
!(process.env.GCE_METADATA_IP || process.env.GCE_METADATA_HOST));
|
| 317 |
+
}
|
| 318 |
+
await cachedIsAvailableResponse;
|
| 319 |
+
return true;
|
| 320 |
+
}
|
| 321 |
+
catch (e) {
|
| 322 |
+
const err = e;
|
| 323 |
+
if (process.env.DEBUG_AUTH) {
|
| 324 |
+
console.info(err);
|
| 325 |
+
}
|
| 326 |
+
if (err.type === 'request-timeout') {
|
| 327 |
+
// If running in a GCP environment, metadata endpoint should return
|
| 328 |
+
// within ms.
|
| 329 |
+
return false;
|
| 330 |
+
}
|
| 331 |
+
if (err.response && err.response.status === 404) {
|
| 332 |
+
return false;
|
| 333 |
+
}
|
| 334 |
+
else {
|
| 335 |
+
if (!(err.response && err.response.status === 404) &&
|
| 336 |
+
// A warning is emitted if we see an unexpected err.code, or err.code
|
| 337 |
+
// is not populated:
|
| 338 |
+
(!err.code ||
|
| 339 |
+
![
|
| 340 |
+
'EHOSTDOWN',
|
| 341 |
+
'EHOSTUNREACH',
|
| 342 |
+
'ENETUNREACH',
|
| 343 |
+
'ENOENT',
|
| 344 |
+
'ENOTFOUND',
|
| 345 |
+
'ECONNREFUSED',
|
| 346 |
+
].includes(err.code.toString()))) {
|
| 347 |
+
let code = 'UNKNOWN';
|
| 348 |
+
if (err.code)
|
| 349 |
+
code = err.code.toString();
|
| 350 |
+
process.emitWarning(`received unexpected error = ${err.message} code = ${code}`, 'MetadataLookupWarning');
|
| 351 |
+
}
|
| 352 |
+
// Failure to resolve the metadata service means that it is not available.
|
| 353 |
+
return false;
|
| 354 |
+
}
|
| 355 |
+
}
|
| 356 |
+
}
|
| 357 |
+
/**
|
| 358 |
+
* reset the memoized isAvailable() lookup.
|
| 359 |
+
*/
|
| 360 |
+
function resetIsAvailableCache() {
|
| 361 |
+
cachedIsAvailableResponse = undefined;
|
| 362 |
+
}
|
| 363 |
+
/**
|
| 364 |
+
* A cache for the detected GCP Residency.
|
| 365 |
+
*/
|
| 366 |
+
exports.gcpResidencyCache = null;
|
| 367 |
+
/**
|
| 368 |
+
* Detects GCP Residency.
|
| 369 |
+
* Caches results to reduce costs for subsequent calls.
|
| 370 |
+
*
|
| 371 |
+
* @see setGCPResidency for setting
|
| 372 |
+
*/
|
| 373 |
+
function getGCPResidency() {
|
| 374 |
+
if (exports.gcpResidencyCache === null) {
|
| 375 |
+
setGCPResidency();
|
| 376 |
+
}
|
| 377 |
+
return exports.gcpResidencyCache;
|
| 378 |
+
}
|
| 379 |
+
/**
|
| 380 |
+
* Sets the detected GCP Residency.
|
| 381 |
+
* Useful for forcing metadata server detection behavior.
|
| 382 |
+
*
|
| 383 |
+
* Set `null` to autodetect the environment (default behavior).
|
| 384 |
+
* @see getGCPResidency for getting
|
| 385 |
+
*/
|
| 386 |
+
function setGCPResidency(value = null) {
|
| 387 |
+
exports.gcpResidencyCache = value !== null ? value : (0, gcp_residency_1.detectGCPResidency)();
|
| 388 |
+
}
|
| 389 |
+
/**
|
| 390 |
+
* Obtain the timeout for requests to the metadata server.
|
| 391 |
+
*
|
| 392 |
+
* In certain environments and conditions requests can take longer than
|
| 393 |
+
* the default timeout to complete. This function will determine the
|
| 394 |
+
* appropriate timeout based on the environment.
|
| 395 |
+
*
|
| 396 |
+
* @returns {number} a request timeout duration in milliseconds.
|
| 397 |
+
*/
|
| 398 |
+
function requestTimeout() {
|
| 399 |
+
return getGCPResidency() ? 0 : 3000;
|
| 400 |
+
}
|
| 401 |
+
__exportStar(require("./gcp-residency"), exports);
|
| 402 |
+
//# sourceMappingURL=index.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/gcp-metadata/build/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2NH,4BAEC;AAcD,0BAEC;AAYD,4BAEC;AAyBD,oBAkBC;AAgBD,kCAmFC;AAKD,sDAEC;AAaD,0CAMC;AASD,0CAEC;AAWD,wCAEC;AAzbD,mCAA2E;AAC3E,0CAA2C;AAC3C,mDAAmD;AACnD,6DAA+C;AAElC,QAAA,SAAS,GAAG,qBAAqB,CAAC;AAClC,QA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
|
|
|
|
|
|
|
| 1 |
+
import { Minimatch } from 'minimatch';
|
| 2 |
+
import { Minipass } from 'minipass';
|
| 3 |
+
import { FSOption, Path, PathScurry } from 'path-scurry';
|
| 4 |
+
import { IgnoreLike } from './ignore.js';
|
| 5 |
+
import { Pattern } from './pattern.js';
|
| 6 |
+
export type MatchSet = Minimatch['set'];
|
| 7 |
+
export type GlobParts = Exclude<Minimatch['globParts'], undefined>;
|
| 8 |
+
/**
|
| 9 |
+
* A `GlobOptions` object may be provided to any of the exported methods, and
|
| 10 |
+
* must be provided to the `Glob` constructor.
|
| 11 |
+
*
|
| 12 |
+
* All options are optional, boolean, and false by default, unless otherwise
|
| 13 |
+
* noted.
|
| 14 |
+
*
|
| 15 |
+
* All resolved options are added to the Glob object as properties.
|
| 16 |
+
*
|
| 17 |
+
* If you are running many `glob` operations, you can pass a Glob object as the
|
| 18 |
+
* `options` argument to a subsequent operation to share the previously loaded
|
| 19 |
+
* cache.
|
| 20 |
+
*/
|
| 21 |
+
export interface GlobOptions {
|
| 22 |
+
/**
|
| 23 |
+
* Set to `true` to always receive absolute paths for
|
| 24 |
+
* matched files. Set to `false` to always return relative paths.
|
| 25 |
+
*
|
| 26 |
+
* When this option is not set, absolute paths are returned for patterns
|
| 27 |
+
* that are absolute, and otherwise paths are returned that are relative
|
| 28 |
+
* to the `cwd` setting.
|
| 29 |
+
*
|
| 30 |
+
* This does _not_ make an extra system call to get
|
| 31 |
+
* the realpath, it only does string path resolution.
|
| 32 |
+
*
|
| 33 |
+
* Conflicts with {@link withFileTypes}
|
| 34 |
+
*/
|
| 35 |
+
absolute?: boolean;
|
| 36 |
+
/**
|
| 37 |
+
* Set to false to enable {@link windowsPathsNoEscape}
|
| 38 |
+
*
|
| 39 |
+
* @deprecated
|
| 40 |
+
*/
|
| 41 |
+
allowWindowsEscape?: boolean;
|
| 42 |
+
/**
|
| 43 |
+
* The current working directory in which to search. Defaults to
|
| 44 |
+
* `process.cwd()`.
|
| 45 |
+
*
|
| 46 |
+
* May be eiher a string path or a `file://` URL object or string.
|
| 47 |
+
*/
|
| 48 |
+
cwd?: string | URL;
|
| 49 |
+
/**
|
| 50 |
+
* Include `.dot` files in normal matches and `globstar`
|
| 51 |
+
* matches. Note that an explicit dot in a portion of the pattern
|
| 52 |
+
* will always match dot files.
|
| 53 |
+
*/
|
| 54 |
+
dot?: boolean;
|
| 55 |
+
/**
|
| 56 |
+
* Prepend all relative path strings with `./` (or `.\` on Windows).
|
| 57 |
+
*
|
| 58 |
+
* Without this option, returned relative paths are "bare", so instead of
|
| 59 |
+
* returning `'./foo/bar'`, they are returned as `'foo/bar'`.
|
| 60 |
+
*
|
| 61 |
+
* Relative patterns starting with `'../'` are not prepended with `./`, even
|
| 62 |
+
* if this option is set.
|
| 63 |
+
*/
|
| 64 |
+
dotRelative?: boolean;
|
| 65 |
+
/**
|
| 66 |
+
* Follow symlinked directories when expanding `**`
|
| 67 |
+
* patterns. This can result in a lot of duplicate references in
|
| 68 |
+
* the presence of cyclic links, and make performance quite bad.
|
| 69 |
+
*
|
| 70 |
+
* By default, a `**` in a pattern will follow 1 symbolic link if
|
| 71 |
+
* it is not the first item in the pattern, or none if it is the
|
| 72 |
+
* first item in the pattern, following the same behavior as Bash.
|
| 73 |
+
*/
|
| 74 |
+
follow?: boolean;
|
| 75 |
+
/**
|
| 76 |
+
* string or string[], or an object with `ignored` and `childrenIgnored`
|
| 77 |
+
* methods.
|
| 78 |
+
*
|
| 79 |
+
* If a string or string[] is provided, then this is treated as a glob
|
| 80 |
+
* pattern or array of glob patterns to exclude from matches. To ignore all
|
| 81 |
+
* children within a directory, as well as the entry itself, append `'/**'`
|
| 82 |
+
* to the ignore pattern.
|
| 83 |
+
*
|
| 84 |
+
* **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of
|
| 85 |
+
* any other settings.
|
| 86 |
+
*
|
| 87 |
+
* If an object is provided that has `ignored(path)` and/or
|
| 88 |
+
* `childrenIgnored(path)` methods, then these methods will be called to
|
| 89 |
+
* determine whether any Path is a match or if its children should be
|
| 90 |
+
* traversed, respectively.
|
| 91 |
+
*/
|
| 92 |
+
ignore?: string | string[] | IgnoreLike;
|
| 93 |
+
/**
|
| 94 |
+
* Treat brace expansion like `{a,b}` as a "magic" pattern. Has no
|
| 95 |
+
* effect if {@link nobrace} is set.
|
| 96 |
+
*
|
| 97 |
+
* Only has effect on the {@link hasMagic} function.
|
| 98 |
+
*/
|
| 99 |
+
magicalBraces?: boolean;
|
| 100 |
+
/**
|
| 101 |
+
* Add a `/` character to directory matches. Note that this requires
|
| 102 |
+
* additional stat calls in some cases.
|
| 103 |
+
*/
|
| 104 |
+
mark?: boolean;
|
| 105 |
+
/**
|
| 106 |
+
* Perform a basename-only match if the pattern does not contain any slash
|
| 107 |
+
* characters. That is, `*.js` would be treated as equivalent to
|
| 108 |
+
* `**\/*.js`, matching all js files in all directories.
|
| 109 |
+
*/
|
| 110 |
+
matchBase?: boolean;
|
| 111 |
+
/**
|
| 112 |
+
* Limit the directory traversal to a given depth below the cwd.
|
| 113 |
+
* Note that this does NOT prevent traversal to sibling folders,
|
| 114 |
+
* root patterns, and so on. It only limits the maximum folder depth
|
| 115 |
+
* that the walk will descend, relative to the cwd.
|
| 116 |
+
*/
|
| 117 |
+
maxDepth?: number;
|
| 118 |
+
/**
|
| 119 |
+
* Do not expand `{a,b}` and `{1..3}` brace sets.
|
| 120 |
+
*/
|
| 121 |
+
nobrace?: boolean;
|
| 122 |
+
/**
|
| 123 |
+
* Perform a case-insensitive match. This defaults to `true` on macOS and
|
| 124 |
+
* Windows systems, and `false` on all others.
|
| 125 |
+
*
|
| 126 |
+
* **Note** `nocase` should only be explicitly set when it is
|
| 127 |
+
* known that the filesystem's case sensitivity differs from the
|
| 128 |
+
* platform default. If set `true` on case-sensitive file
|
| 129 |
+
* systems, or `false` on case-insensitive file systems, then the
|
| 130 |
+
* walk may return more or less results than expected.
|
| 131 |
+
*/
|
| 132 |
+
nocase?: boolean;
|
| 133 |
+
/**
|
| 134 |
+
* Do not match directories, only files. (Note: to match
|
| 135 |
+
* _only_ directories, put a `/` at the end of the pattern.)
|
| 136 |
+
*/
|
| 137 |
+
nodir?: boolean;
|
| 138 |
+
/**
|
| 139 |
+
* Do not match "extglob" patterns such as `+(a|b)`.
|
| 140 |
+
*/
|
| 141 |
+
noext?: boolean;
|
| 142 |
+
/**
|
| 143 |
+
* Do not match `**` against multiple filenames. (Ie, treat it as a normal
|
| 144 |
+
* `*` instead.)
|
| 145 |
+
*
|
| 146 |
+
* Conflicts with {@link matchBase}
|
| 147 |
+
*/
|
| 148 |
+
noglobstar?: boolean;
|
| 149 |
+
/**
|
| 150 |
+
* Defaults to value of `process.platform` if available, or `'linux'` if
|
| 151 |
+
* not. Setting `platform:'win32'` on non-Windows systems may cause strange
|
| 152 |
+
* behavior.
|
| 153 |
+
*/
|
| 154 |
+
platform?: NodeJS.Platform;
|
| 155 |
+
/**
|
| 156 |
+
* Set to true to call `fs.realpath` on all of the
|
| 157 |
+
* results. In the case of an entry that cannot be resolved, the
|
| 158 |
+
* entry is omitted. This incurs a slight performance penalty, of
|
| 159 |
+
* course, because of the added system calls.
|
| 160 |
+
*/
|
| 161 |
+
realpath?: boolean;
|
| 162 |
+
/**
|
| 163 |
+
*
|
| 164 |
+
* A string path resolved against the `cwd` option, which
|
| 165 |
+
* is used as the starting point for absolute patterns that start
|
| 166 |
+
* with `/`, (but not drive letters or UNC paths on Windows).
|
| 167 |
+
*
|
| 168 |
+
* Note that this _doesn't_ necessarily limit the walk to the
|
| 169 |
+
* `root` directory, and doesn't affect the cwd starting point for
|
| 170 |
+
* non-absolute patterns. A pattern containing `..` will still be
|
| 171 |
+
* able to traverse out of the root directory, if it is not an
|
| 172 |
+
* actual root directory on the filesystem, and any non-absolute
|
| 173 |
+
* patterns will be matched in the `cwd`. For example, the
|
| 174 |
+
* pattern `/../*` with `{root:'/some/path'}` will return all
|
| 175 |
+
* files in `/some`, not all files in `/some/path`. The pattern
|
| 176 |
+
* `*` with `{root:'/some/path'}` will return all the entries in
|
| 177 |
+
* the cwd, not the entries in `/some/path`.
|
| 178 |
+
*
|
| 179 |
+
* To start absolute and non-absolute patterns in the same
|
| 180 |
+
* path, you can use `{root:''}`. However, be aware that on
|
| 181 |
+
* Windows systems, a pattern like `x:/*` or `//host/share/*` will
|
| 182 |
+
* _always_ start in the `x:/` or `//host/share` directory,
|
| 183 |
+
* regardless of the `root` setting.
|
| 184 |
+
*/
|
| 185 |
+
root?: string;
|
| 186 |
+
/**
|
| 187 |
+
* A [PathScurry](http://npm.im/path-scurry) object used
|
| 188 |
+
* to traverse the file system. If the `nocase` option is set
|
| 189 |
+
* explicitly, then any provided `scurry` object must match this
|
| 190 |
+
* setting.
|
| 191 |
+
*/
|
| 192 |
+
scurry?: PathScurry;
|
| 193 |
+
/**
|
| 194 |
+
* Call `lstat()` on all entries, whether required or not to determine
|
| 195 |
+
* if it's a valid match. When used with {@link withFileTypes}, this means
|
| 196 |
+
* that matches will include data such as modified time, permissions, and
|
| 197 |
+
* so on. Note that this will incur a performance cost due to the added
|
| 198 |
+
* system calls.
|
| 199 |
+
*/
|
| 200 |
+
stat?: boolean;
|
| 201 |
+
/**
|
| 202 |
+
* An AbortSignal which will cancel the Glob walk when
|
| 203 |
+
* triggered.
|
| 204 |
+
*/
|
| 205 |
+
signal?: AbortSignal;
|
| 206 |
+
/**
|
| 207 |
+
* Use `\\` as a path separator _only_, and
|
| 208 |
+
* _never_ as an escape character. If set, all `\\` characters are
|
| 209 |
+
* replaced with `/` in the pattern.
|
| 210 |
+
*
|
| 211 |
+
* Note that this makes it **impossible** to match against paths
|
| 212 |
+
* containing literal glob pattern characters, but allows matching
|
| 213 |
+
* with patterns constructed using `path.join()` and
|
| 214 |
+
* `path.resolve()` on Windows platforms, mimicking the (buggy!)
|
| 215 |
+
* behavior of Glob v7 and before on Windows. Please use with
|
| 216 |
+
* caution, and be mindful of [the caveat below about Windows
|
| 217 |
+
* paths](#windows). (For legacy reasons, this is also set if
|
| 218 |
+
* `allowWindowsEscape` is set to the exact value `false`.)
|
| 219 |
+
*/
|
| 220 |
+
windowsPathsNoEscape?: boolean;
|
| 221 |
+
/**
|
| 222 |
+
* Return [PathScurry](http://npm.im/path-scurry)
|
| 223 |
+
* `Path` objects instead of strings. These are similar to a
|
| 224 |
+
* NodeJS `Dirent` object, but with additional methods and
|
| 225 |
+
* properties.
|
| 226 |
+
*
|
| 227 |
+
* Conflicts with {@link absolute}
|
| 228 |
+
*/
|
| 229 |
+
withFileTypes?: boolean;
|
| 230 |
+
/**
|
| 231 |
+
* An fs implementation to override some or all of the defaults. See
|
| 232 |
+
* http://npm.im/path-scurry for details about what can be overridden.
|
| 233 |
+
*/
|
| 234 |
+
fs?: FSOption;
|
| 235 |
+
/**
|
| 236 |
+
* Just passed along to Minimatch. Note that this makes all pattern
|
| 237 |
+
* matching operations slower and *extremely* noisy.
|
| 238 |
+
*/
|
| 239 |
+
debug?: boolean;
|
| 240 |
+
/**
|
| 241 |
+
* Return `/` delimited paths, even on Windows.
|
| 242 |
+
*
|
| 243 |
+
* On posix systems, this has no effect. But, on Windows, it means that
|
| 244 |
+
* paths will be `/` delimited, and absolute paths will be their full
|
| 245 |
+
* resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return
|
| 246 |
+
* `'//?/C:/foo/bar'`
|
| 247 |
+
*/
|
| 248 |
+
posix?: boolean;
|
| 249 |
+
/**
|
| 250 |
+
* Do not match any children of any matches. For example, the pattern
|
| 251 |
+
* `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.
|
| 252 |
+
*
|
| 253 |
+
* This is especially useful for cases like "find all `node_modules`
|
| 254 |
+
* folders, but not the ones in `node_modules`".
|
| 255 |
+
*
|
| 256 |
+
* In order to support this, the `Ignore` implementation must support an
|
| 257 |
+
* `add(pattern: string)` method. If using the default `Ignore` class, then
|
| 258 |
+
* this is fine, but if this is set to `false`, and a custom `Ignore` is
|
| 259 |
+
* provided that does not have an `add()` method, then it will throw an
|
| 260 |
+
* error.
|
| 261 |
+
*
|
| 262 |
+
* **Caveat** It *only* ignores matches that would be a descendant of a
|
| 263 |
+
* previous match, and only if that descendant is matched *after* the
|
| 264 |
+
* ancestor is encountered. Since the file system walk happens in
|
| 265 |
+
* indeterminate order, it's possible that a match will already be added
|
| 266 |
+
* before its ancestor, if multiple or braced patterns are used.
|
| 267 |
+
*
|
| 268 |
+
* For example:
|
| 269 |
+
*
|
| 270 |
+
* ```ts
|
| 271 |
+
* const results = await glob([
|
| 272 |
+
* // likely to match first, since it's just a stat
|
| 273 |
+
* 'a/b/c/d/e/f',
|
| 274 |
+
*
|
| 275 |
+
* // this pattern is more complicated! It must to various readdir()
|
| 276 |
+
* // calls and test the results against a regular expression, and that
|
| 277 |
+
* // is certainly going to take a little bit longer.
|
| 278 |
+
* //
|
| 279 |
+
* // So, later on, it encounters a match at 'a/b/c/d/e', but it's too
|
| 280 |
+
* // late to ignore a/b/c/d/e/f, because it's already been emitted.
|
| 281 |
+
* 'a/[bdf]/?/[a-z]/*',
|
| 282 |
+
* ], { includeChildMatches: false })
|
| 283 |
+
* ```
|
| 284 |
+
*
|
| 285 |
+
* It's best to only set this to `false` if you can be reasonably sure that
|
| 286 |
+
* no components of the pattern will potentially match one another's file
|
| 287 |
+
* system descendants, or if the occasional included child entry will not
|
| 288 |
+
* cause problems.
|
| 289 |
+
*
|
| 290 |
+
* @default true
|
| 291 |
+
*/
|
| 292 |
+
includeChildMatches?: boolean;
|
| 293 |
+
}
|
| 294 |
+
export type GlobOptionsWithFileTypesTrue = GlobOptions & {
|
| 295 |
+
withFileTypes: true;
|
| 296 |
+
absolute?: undefined;
|
| 297 |
+
mark?: undefined;
|
| 298 |
+
posix?: undefined;
|
| 299 |
+
};
|
| 300 |
+
export type GlobOptionsWithFileTypesFalse = GlobOptions & {
|
| 301 |
+
withFileTypes?: false;
|
| 302 |
+
};
|
| 303 |
+
export type GlobOptionsWithFileTypesUnset = GlobOptions & {
|
| 304 |
+
withFileTypes?: undefined;
|
| 305 |
+
};
|
| 306 |
+
export type Result<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path;
|
| 307 |
+
export type Results<Opts> = Result<Opts>[];
|
| 308 |
+
export type FileTypes<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean;
|
| 309 |
+
/**
|
| 310 |
+
* An object that can perform glob pattern traversals.
|
| 311 |
+
*/
|
| 312 |
+
export declare class Glob<Opts extends GlobOptions> implements GlobOptions {
|
| 313 |
+
absolute?: boolean;
|
| 314 |
+
cwd: string;
|
| 315 |
+
root?: string;
|
| 316 |
+
dot: boolean;
|
| 317 |
+
dotRelative: boolean;
|
| 318 |
+
follow: boolean;
|
| 319 |
+
ignore?: string | string[] | IgnoreLike;
|
| 320 |
+
magicalBraces: boolean;
|
| 321 |
+
mark?: boolean;
|
| 322 |
+
matchBase: boolean;
|
| 323 |
+
maxDepth: number;
|
| 324 |
+
nobrace: boolean;
|
| 325 |
+
nocase: boolean;
|
| 326 |
+
nodir: boolean;
|
| 327 |
+
noext: boolean;
|
| 328 |
+
noglobstar: boolean;
|
| 329 |
+
pattern: string[];
|
| 330 |
+
platform: NodeJS.Platform;
|
| 331 |
+
realpath: boolean;
|
| 332 |
+
scurry: PathScurry;
|
| 333 |
+
stat: boolean;
|
| 334 |
+
signal?: AbortSignal;
|
| 335 |
+
windowsPathsNoEscape: boolean;
|
| 336 |
+
withFileTypes: FileTypes<Opts>;
|
| 337 |
+
includeChildMatches: boolean;
|
| 338 |
+
/**
|
| 339 |
+
* The options provided to the constructor.
|
| 340 |
+
*/
|
| 341 |
+
opts: Opts;
|
| 342 |
+
/**
|
| 343 |
+
* An array of parsed immutable {@link Pattern} objects.
|
| 344 |
+
*/
|
| 345 |
+
patterns: Pattern[];
|
| 346 |
+
/**
|
| 347 |
+
* All options are stored as properties on the `Glob` object.
|
| 348 |
+
*
|
| 349 |
+
* See {@link GlobOptions} for full options descriptions.
|
| 350 |
+
*
|
| 351 |
+
* Note that a previous `Glob` object can be passed as the
|
| 352 |
+
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
| 353 |
+
* and caches with a new pattern.
|
| 354 |
+
*
|
| 355 |
+
* Traversal functions can be called multiple times to run the walk
|
| 356 |
+
* again.
|
| 357 |
+
*/
|
| 358 |
+
constructor(pattern: string | string[], opts: Opts);
|
| 359 |
+
/**
|
| 360 |
+
* Returns a Promise that resolves to the results array.
|
| 361 |
+
*/
|
| 362 |
+
walk(): Promise<Results<Opts>>;
|
| 363 |
+
/**
|
| 364 |
+
* synchronous {@link Glob.walk}
|
| 365 |
+
*/
|
| 366 |
+
walkSync(): Results<Opts>;
|
| 367 |
+
/**
|
| 368 |
+
* Stream results asynchronously.
|
| 369 |
+
*/
|
| 370 |
+
stream(): Minipass<Result<Opts>, Result<Opts>>;
|
| 371 |
+
/**
|
| 372 |
+
* Stream results synchronously.
|
| 373 |
+
*/
|
| 374 |
+
streamSync(): Minipass<Result<Opts>, Result<Opts>>;
|
| 375 |
+
/**
|
| 376 |
+
* Default sync iteration function. Returns a Generator that
|
| 377 |
+
* iterates over the results.
|
| 378 |
+
*/
|
| 379 |
+
iterateSync(): Generator<Result<Opts>, void, void>;
|
| 380 |
+
[Symbol.iterator](): Generator<Result<Opts>, void, void>;
|
| 381 |
+
/**
|
| 382 |
+
* Default async iteration function. Returns an AsyncGenerator that
|
| 383 |
+
* iterates over the results.
|
| 384 |
+
*/
|
| 385 |
+
iterate(): AsyncGenerator<Result<Opts>, void, void>;
|
| 386 |
+
[Symbol.asyncIterator](): AsyncGenerator<Result<Opts>, void, void>;
|
| 387 |
+
}
|
| 388 |
+
//# sourceMappingURL=glob.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/glob.d.ts.map
ADD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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.Glob = void 0;
|
| 4 |
+
const minimatch_1 = require("minimatch");
|
| 5 |
+
const node_url_1 = require("node:url");
|
| 6 |
+
const path_scurry_1 = require("path-scurry");
|
| 7 |
+
const pattern_js_1 = require("./pattern.js");
|
| 8 |
+
const walker_js_1 = require("./walker.js");
|
| 9 |
+
// if no process global, just call it linux.
|
| 10 |
+
// so we default to case-sensitive, / separators
|
| 11 |
+
const defaultPlatform = (typeof process === 'object' &&
|
| 12 |
+
process &&
|
| 13 |
+
typeof process.platform === 'string') ?
|
| 14 |
+
process.platform
|
| 15 |
+
: 'linux';
|
| 16 |
+
/**
|
| 17 |
+
* An object that can perform glob pattern traversals.
|
| 18 |
+
*/
|
| 19 |
+
class Glob {
|
| 20 |
+
absolute;
|
| 21 |
+
cwd;
|
| 22 |
+
root;
|
| 23 |
+
dot;
|
| 24 |
+
dotRelative;
|
| 25 |
+
follow;
|
| 26 |
+
ignore;
|
| 27 |
+
magicalBraces;
|
| 28 |
+
mark;
|
| 29 |
+
matchBase;
|
| 30 |
+
maxDepth;
|
| 31 |
+
nobrace;
|
| 32 |
+
nocase;
|
| 33 |
+
nodir;
|
| 34 |
+
noext;
|
| 35 |
+
noglobstar;
|
| 36 |
+
pattern;
|
| 37 |
+
platform;
|
| 38 |
+
realpath;
|
| 39 |
+
scurry;
|
| 40 |
+
stat;
|
| 41 |
+
signal;
|
| 42 |
+
windowsPathsNoEscape;
|
| 43 |
+
withFileTypes;
|
| 44 |
+
includeChildMatches;
|
| 45 |
+
/**
|
| 46 |
+
* The options provided to the constructor.
|
| 47 |
+
*/
|
| 48 |
+
opts;
|
| 49 |
+
/**
|
| 50 |
+
* An array of parsed immutable {@link Pattern} objects.
|
| 51 |
+
*/
|
| 52 |
+
patterns;
|
| 53 |
+
/**
|
| 54 |
+
* All options are stored as properties on the `Glob` object.
|
| 55 |
+
*
|
| 56 |
+
* See {@link GlobOptions} for full options descriptions.
|
| 57 |
+
*
|
| 58 |
+
* Note that a previous `Glob` object can be passed as the
|
| 59 |
+
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
| 60 |
+
* and caches with a new pattern.
|
| 61 |
+
*
|
| 62 |
+
* Traversal functions can be called multiple times to run the walk
|
| 63 |
+
* again.
|
| 64 |
+
*/
|
| 65 |
+
constructor(pattern, opts) {
|
| 66 |
+
/* c8 ignore start */
|
| 67 |
+
if (!opts)
|
| 68 |
+
throw new TypeError('glob options required');
|
| 69 |
+
/* c8 ignore stop */
|
| 70 |
+
this.withFileTypes = !!opts.withFileTypes;
|
| 71 |
+
this.signal = opts.signal;
|
| 72 |
+
this.follow = !!opts.follow;
|
| 73 |
+
this.dot = !!opts.dot;
|
| 74 |
+
this.dotRelative = !!opts.dotRelative;
|
| 75 |
+
this.nodir = !!opts.nodir;
|
| 76 |
+
this.mark = !!opts.mark;
|
| 77 |
+
if (!opts.cwd) {
|
| 78 |
+
this.cwd = '';
|
| 79 |
+
}
|
| 80 |
+
else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
|
| 81 |
+
opts.cwd = (0, node_url_1.fileURLToPath)(opts.cwd);
|
| 82 |
+
}
|
| 83 |
+
this.cwd = opts.cwd || '';
|
| 84 |
+
this.root = opts.root;
|
| 85 |
+
this.magicalBraces = !!opts.magicalBraces;
|
| 86 |
+
this.nobrace = !!opts.nobrace;
|
| 87 |
+
this.noext = !!opts.noext;
|
| 88 |
+
this.realpath = !!opts.realpath;
|
| 89 |
+
this.absolute = opts.absolute;
|
| 90 |
+
this.includeChildMatches = opts.includeChildMatches !== false;
|
| 91 |
+
this.noglobstar = !!opts.noglobstar;
|
| 92 |
+
this.matchBase = !!opts.matchBase;
|
| 93 |
+
this.maxDepth =
|
| 94 |
+
typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;
|
| 95 |
+
this.stat = !!opts.stat;
|
| 96 |
+
this.ignore = opts.ignore;
|
| 97 |
+
if (this.withFileTypes && this.absolute !== undefined) {
|
| 98 |
+
throw new Error('cannot set absolute and withFileTypes:true');
|
| 99 |
+
}
|
| 100 |
+
if (typeof pattern === 'string') {
|
| 101 |
+
pattern = [pattern];
|
| 102 |
+
}
|
| 103 |
+
this.windowsPathsNoEscape =
|
| 104 |
+
!!opts.windowsPathsNoEscape ||
|
| 105 |
+
opts.allowWindowsEscape ===
|
| 106 |
+
false;
|
| 107 |
+
if (this.windowsPathsNoEscape) {
|
| 108 |
+
pattern = pattern.map(p => p.replace(/\\/g, '/'));
|
| 109 |
+
}
|
| 110 |
+
if (this.matchBase) {
|
| 111 |
+
if (opts.noglobstar) {
|
| 112 |
+
throw new TypeError('base matching requires globstar');
|
| 113 |
+
}
|
| 114 |
+
pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));
|
| 115 |
+
}
|
| 116 |
+
this.pattern = pattern;
|
| 117 |
+
this.platform = opts.platform || defaultPlatform;
|
| 118 |
+
this.opts = { ...opts, platform: this.platform };
|
| 119 |
+
if (opts.scurry) {
|
| 120 |
+
this.scurry = opts.scurry;
|
| 121 |
+
if (opts.nocase !== undefined &&
|
| 122 |
+
opts.nocase !== opts.scurry.nocase) {
|
| 123 |
+
throw new Error('nocase option contradicts provided scurry option');
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
else {
|
| 127 |
+
const Scurry = opts.platform === 'win32' ? path_scurry_1.PathScurryWin32
|
| 128 |
+
: opts.platform === 'darwin' ? path_scurry_1.PathScurryDarwin
|
| 129 |
+
: opts.platform ? path_scurry_1.PathScurryPosix
|
| 130 |
+
: path_scurry_1.PathScurry;
|
| 131 |
+
this.scurry = new Scurry(this.cwd, {
|
| 132 |
+
nocase: opts.nocase,
|
| 133 |
+
fs: opts.fs,
|
| 134 |
+
});
|
| 135 |
+
}
|
| 136 |
+
this.nocase = this.scurry.nocase;
|
| 137 |
+
// If you do nocase:true on a case-sensitive file system, then
|
| 138 |
+
// we need to use regexps instead of strings for non-magic
|
| 139 |
+
// path portions, because statting `aBc` won't return results
|
| 140 |
+
// for the file `AbC` for example.
|
| 141 |
+
const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32';
|
| 142 |
+
const mmo = {
|
| 143 |
+
// default nocase based on platform
|
| 144 |
+
...opts,
|
| 145 |
+
dot: this.dot,
|
| 146 |
+
matchBase: this.matchBase,
|
| 147 |
+
nobrace: this.nobrace,
|
| 148 |
+
nocase: this.nocase,
|
| 149 |
+
nocaseMagicOnly,
|
| 150 |
+
nocomment: true,
|
| 151 |
+
noext: this.noext,
|
| 152 |
+
nonegate: true,
|
| 153 |
+
optimizationLevel: 2,
|
| 154 |
+
platform: this.platform,
|
| 155 |
+
windowsPathsNoEscape: this.windowsPathsNoEscape,
|
| 156 |
+
debug: !!this.opts.debug,
|
| 157 |
+
};
|
| 158 |
+
const mms = this.pattern.map(p => new minimatch_1.Minimatch(p, mmo));
|
| 159 |
+
const [matchSet, globParts] = mms.reduce((set, m) => {
|
| 160 |
+
set[0].push(...m.set);
|
| 161 |
+
set[1].push(...m.globParts);
|
| 162 |
+
return set;
|
| 163 |
+
}, [[], []]);
|
| 164 |
+
this.patterns = matchSet.map((set, i) => {
|
| 165 |
+
const g = globParts[i];
|
| 166 |
+
/* c8 ignore start */
|
| 167 |
+
if (!g)
|
| 168 |
+
throw new Error('invalid pattern object');
|
| 169 |
+
/* c8 ignore stop */
|
| 170 |
+
return new pattern_js_1.Pattern(set, g, 0, this.platform);
|
| 171 |
+
});
|
| 172 |
+
}
|
| 173 |
+
async walk() {
|
| 174 |
+
// Walkers always return array of Path objects, so we just have to
|
| 175 |
+
// coerce them into the right shape. It will have already called
|
| 176 |
+
// realpath() if the option was set to do so, so we know that's cached.
|
| 177 |
+
// start out knowing the cwd, at least
|
| 178 |
+
return [
|
| 179 |
+
...(await new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
| 180 |
+
...this.opts,
|
| 181 |
+
maxDepth: this.maxDepth !== Infinity ?
|
| 182 |
+
this.maxDepth + this.scurry.cwd.depth()
|
| 183 |
+
: Infinity,
|
| 184 |
+
platform: this.platform,
|
| 185 |
+
nocase: this.nocase,
|
| 186 |
+
includeChildMatches: this.includeChildMatches,
|
| 187 |
+
}).walk()),
|
| 188 |
+
];
|
| 189 |
+
}
|
| 190 |
+
walkSync() {
|
| 191 |
+
return [
|
| 192 |
+
...new walker_js_1.GlobWalker(this.patterns, this.scurry.cwd, {
|
| 193 |
+
...this.opts,
|
| 194 |
+
maxDepth: this.maxDepth !== Infinity ?
|
| 195 |
+
this.maxDepth + this.scurry.cwd.depth()
|
| 196 |
+
: Infinity,
|
| 197 |
+
platform: this.platform,
|
| 198 |
+
nocase: this.nocase,
|
| 199 |
+
includeChildMatches: this.includeChildMatches,
|
| 200 |
+
}).walkSync(),
|
| 201 |
+
];
|
| 202 |
+
}
|
| 203 |
+
stream() {
|
| 204 |
+
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
| 205 |
+
...this.opts,
|
| 206 |
+
maxDepth: this.maxDepth !== Infinity ?
|
| 207 |
+
this.maxDepth + this.scurry.cwd.depth()
|
| 208 |
+
: Infinity,
|
| 209 |
+
platform: this.platform,
|
| 210 |
+
nocase: this.nocase,
|
| 211 |
+
includeChildMatches: this.includeChildMatches,
|
| 212 |
+
}).stream();
|
| 213 |
+
}
|
| 214 |
+
streamSync() {
|
| 215 |
+
return new walker_js_1.GlobStream(this.patterns, this.scurry.cwd, {
|
| 216 |
+
...this.opts,
|
| 217 |
+
maxDepth: this.maxDepth !== Infinity ?
|
| 218 |
+
this.maxDepth + this.scurry.cwd.depth()
|
| 219 |
+
: Infinity,
|
| 220 |
+
platform: this.platform,
|
| 221 |
+
nocase: this.nocase,
|
| 222 |
+
includeChildMatches: this.includeChildMatches,
|
| 223 |
+
}).streamSync();
|
| 224 |
+
}
|
| 225 |
+
/**
|
| 226 |
+
* Default sync iteration function. Returns a Generator that
|
| 227 |
+
* iterates over the results.
|
| 228 |
+
*/
|
| 229 |
+
iterateSync() {
|
| 230 |
+
return this.streamSync()[Symbol.iterator]();
|
| 231 |
+
}
|
| 232 |
+
[Symbol.iterator]() {
|
| 233 |
+
return this.iterateSync();
|
| 234 |
+
}
|
| 235 |
+
/**
|
| 236 |
+
* Default async iteration function. Returns an AsyncGenerator that
|
| 237 |
+
* iterates over the results.
|
| 238 |
+
*/
|
| 239 |
+
iterate() {
|
| 240 |
+
return this.stream()[Symbol.asyncIterator]();
|
| 241 |
+
}
|
| 242 |
+
[Symbol.asyncIterator]() {
|
| 243 |
+
return this.iterate();
|
| 244 |
+
}
|
| 245 |
+
}
|
| 246 |
+
exports.Glob = Glob;
|
| 247 |
+
//# sourceMappingURL=glob.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/glob.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":";;;AAAA,yCAAuD;AAEvD,uCAAwC;AACxC,6CAOoB;AAEpB,6CAAsC;AACtC,2CAAoD;AAKpD,4CAA4C;AAC5C,gDAAgD;AAChD,MAAM,eAAe,GACnB,CAC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AAM;YACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;SAC9C,CAAC,CAAC,MAAM,EAAE,CAAA;IACb,CAAC;IAMD,UAAU;QACR,OAAO,IAAI,sBAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;YACpD,GAAG,IAAI,CAAC,IAAI;YACZ,QAAQ,EACN,IAAI,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC;gBAC1B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE;gBACzC,CAAC,CAAC,QAAQ;YACZ,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;SAC9C,CAAC,CAAC,UAAU,EAAE,CAAA;IACjB,CAAC;IAED;;;OAGG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;IAC7C,CAAC;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;QACf,OAAO,IAAI,CAAC,WAAW,EAAE,CAAA;IAC3B,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;IAC9C,CAAC;IACD,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACvB,CAAC;CACF;AA7QD,oBA6QC","sourcesContent":["import { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { fileURLToPath } from 'node:url'\nimport {\n FSOption,\n Path,\n PathScurry,\n PathScurryDarwin,\n PathScurryPosix,\n PathScurryWin32,\n} from 'path-scurry'\nimport { IgnoreLike } from './ignore.js'\nimport { Pattern } from './pattern.js'\nimport { GlobStream, GlobWalker } from './walker.js'\n\nexport type MatchSet = Minimatch['set']\nexport type GlobParts = Exclude<Minimatch['globParts'], undefined>\n\n// if no process global, just call it linux.\n// so we default to case-sensitive, / separators\nconst defaultPlatform: NodeJS.Platform =\n (\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ) ?\n process.platform\n : 'linux'\n\n/**\n * A `GlobOptions` object may be provided to any of the exported methods, and\n * must be provided to the `Glob` constructor.\n *\n * All options are optional, boolean, and false by default, unless otherwise\n * noted.\n *\n * All resolved options are added to the Glob object as properties.\n *\n * If you are running many `glob` operations, you can pass a Glob object as the\n * `options` argument to a subsequent operation to share the previously loaded\n * cache.\n */\nexport interface GlobOptions {\n /**\n * Set to `true` to always receive absolute paths for\n * matched files. Set to `false` to always return relative paths.\n *\n * When this option is not set, absolute paths are returned for patterns\n * that are absolute, and otherwise paths are returned that are relative\n * to the `cwd` setting.\n *\n * This does _not_ make an extra system call to get\n * the realpath, it only does string path resolution.\n *\n * Conflicts with {@link withFileTypes}\n */\n absolute?: boolean\n\n /**\n * Set to false to enable {@link windowsPathsNoEscape}\n *\n * @deprecated\n */\n allowWindowsEscape?: boolean\n\n /**\n * The current working directory in which to search. Defaults to\n * `process.cwd()`.\n *\n * May be eiher a string path or a `file://` URL object or string.\n */\n cwd?: string | URL\n\n /**\n * Include `.dot` files in normal matches and `globstar`\n * matches. Note that an explicit dot in a portion of the pattern\n * will always match dot files.\n */\n dot?: boolean\n\n /**\n * Prepend all relative path strings with `./` (or `.\\` on Windows).\n *\n * Without this option, returned relative paths are \"bare\", so instead of\n * returning `'./foo/bar'`, they are returned as `'foo/bar'`.\n *\n * Relative patterns starting with `'../'` are not prepended with `./`, even\n * if this option is set.\n */\n dotRelative?: boolean\n\n /**\n * Follow symlinked directories when expanding `**`\n * patterns. This can result in a lot of duplicate references in\n * the presence of cyclic links, and make performance quite bad.\n *\n * By default, a `**` in a pattern will follow 1 symbolic link if\n * it is not the first item in the pattern, or none if it is the\n * first item in the pattern, following the same behavior as Bash.\n */\n follow?: boolean\n\n /**\n * string or string[], or an object with `ignored` and `childrenIgnored`\n * methods.\n *\n * If a string or string[] is provided, then this is treated as a glob\n * pattern or array of glob patterns to exclude from matches. To ignore all\n * children within a directory, as well as the entry itself, append `'/**'`\n * to the ignore pattern.\n *\n * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of\n * any other settings.\n *\n * If an object is provided that has `ignored(path)` and/or\n * `childrenIgnored(path)` methods, then these methods will be called to\n * determine whether any Path is a match or if its children should be\n * traversed, respectively.\n */\n ignore?: string | string[] | IgnoreLike\n\n /**\n * Treat brace expansion like `{a,b}` as a \"magic\" pattern. Has no\n * effect if {@link nobrace} is set.\n *\n * Only has effect on the {@link hasMagic} function.\n */\n magicalBraces?: boolean\n\n /**\n * Add a `/` character to directory matches. Note that this requires\n * additional stat calls in some cases.\n */\n mark?: boolean\n\n /**\n * Perform a basename-only match if the pattern does not contain any slash\n * characters. That is, `*.js` would be treated as equivalent to\n * `**\\/*.js`, matching all js files in all directories.\n */\n matchBase?: boolean\n\n /**\n * Limit the directory traversal to a given depth below the cwd.\n * Note that this does NOT prevent traversal to sibling folders,\n * root patterns, and so on. It only limits the maximum folder depth\n * that the walk will descend, relative to the cwd.\n */\n maxDepth?: number\n\n /**\n * Do not expand `{a,b}` and `{1..3}` brace sets.\n */\n nobrace?: boolean\n\n /**\n * Perform a case-insensitive match. This defaults to `true` on macOS and\n * Windows systems, and `false` on all others.\n *\n * **Note** `nocase` should only be explicitly set when it is\n * known that the filesystem's case sensitivity differs from the\n * platform default. If set `true` on case-sensitive file\n * systems, or `false` on case-insensitive file systems, then the\n * walk may return more or less results than expected.\n */\n nocase?: boolean\n\n /**\n * Do not match directories, only files. (Note: to match\n * _only_ directories, put a `/` at the end of the pattern.)\n */\n nodir?: boolean\n\n /**\n * Do not match \"extglob\" patterns such as `+(a|b)`.\n */\n noext?: boolean\n\n /**\n * Do not match `**` against multiple filenames. (Ie, treat it as a normal\n * `*` instead.)\n *\n * Conflicts with {@link matchBase}\n */\n noglobstar?: boolean\n\n /**\n * Defaults to value of `process.platform` if available, or `'linux'` if\n * not. Setting `platform:'win32'` on non-Windows systems may cause strange\n * behavior.\n */\n platform?: NodeJS.Platform\n\n /**\n * Set to true to call `fs.realpath` on all of the\n * results. In the case of an entry that cannot be resolved, the\n * entry is omitted. This incurs a slight performance penalty, of\n * course, because of the added system calls.\n */\n realpath?: boolean\n\n /**\n *\n * A string path resolved against the `cwd` option, which\n * is used as the starting point for absolute patterns that start\n * with `/`, (but not drive letters or UNC paths on Windows).\n *\n * Note that this _doesn't_ necessarily limit the walk to the\n * `root` directory, and doesn't affect the cwd starting point for\n * non-absolute patterns. A pattern containing `..` will still be\n * able to traverse out of the root directory, if it is not an\n * actual root directory on the filesystem, and any non-absolute\n * patterns will be matched in the `cwd`. For example, the\n * pattern `/../*` with `{root:'/some/path'}` will return all\n * files in `/some`, not all files in `/some/path`. The pattern\n * `*` with `{root:'/some/path'}` will return all the entries in\n * the cwd, not the entries in `/some/path`.\n *\n * To start absolute and non-absolute patterns in the same\n * path, you can use `{root:''}`. However, be aware that on\n * Windows systems, a pattern like `x:/*` or `//host/share/*` will\n * _always_ start in the `x:/` or `//host/share` directory,\n * regardless of the `root` setting.\n */\n root?: string\n\n /**\n * A [PathScurry](http://npm.im/path-scurry) object used\n * to traverse the file system. If the `nocase` option is set\n * explicitly, then any provided `scurry` object must match this\n * setting.\n */\n scurry?: PathScurry\n\n /**\n * Call `lstat()` on all entries, whether required or not to determine\n * if it's a valid match. When used with {@link withFileTypes}, this means\n * that matches will include data such as modified time, permissions, and\n * so on. Note that this will incur a performance cost due to the added\n * system calls.\n */\n stat?: boolean\n\n /**\n * An AbortSignal which will cancel the Glob walk when\n * triggered.\n */\n signal?: AbortSignal\n\n /**\n * Use `\\\\` as a path separator _only_, and\n * _never_ as an escape character. If set, all `\\\\` characters are\n * replaced with `/` in the pattern.\n *\n * Note that this makes it **impossible** to match against paths\n * containing literal glob pattern characters, but allows matching\n * with patterns constructed using `path.join()` and\n * `path.resolve()` on Windows platforms, mimicking the (buggy!)\n * behavior of Glob v7 and before on Windows. Please use with\n * caution, and be mindful of [the caveat below about Windows\n * paths](#windows). (For legacy reasons, this is also set if\n * `allowWindowsEscape` is set to the exact value `false`.)\n */\n windowsPathsNoEscape?: boolean\n\n /**\n * Return [PathScurry](http://npm.im/path-scurry)\n * `Path` objects instead of strings. These are similar to a\n * NodeJS `Dirent` object, but with additional methods and\n * properties.\n *\n * Conflicts with {@link absolute}\n */\n withFileTypes?: boolean\n\n /**\n * An fs implementation to override some or all of the defaults. See\n * http://npm.im/path-scurry for details about what can be overridden.\n */\n fs?: FSOption\n\n /**\n * Just passed along to Minimatch. Note that this makes all pattern\n * matching operations slower and *extremely* noisy.\n */\n debug?: boolean\n\n /**\n * Return `/` delimited paths, even on Windows.\n *\n * On posix systems, this has no effect. But, on Windows, it means that\n * paths will be `/` delimited, and absolute paths will be their full\n * resolved UNC forms, eg instead of `'C:\\\\foo\\\\bar'`, it would return\n * `'//?/C:/foo/bar'`\n */\n posix?: boolean\n\n /**\n * Do not match any children of any matches. For example, the pattern\n * `**\\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.\n *\n * This is especially useful for cases like \"find all `node_modules`\n * folders, but not the ones in `node_modules`\".\n *\n * In order to support this, the `Ignore` implementation must support an\n * `add(pattern: string)` method. If using the default `Ignore` class, then\n * this is fine, but if this is set to `false`, and a custom `Ignore` is\n * provided that does not have an `add()` method, then it will throw an\n * error.\n *\n * **Caveat** It *only* ignores matches that would be a descendant of a\n * previous match, and only if that descendant is matched *after* the\n * ancestor is encountered. Since the file system walk happens in\n * indeterminate order, it's possible that a match will already be added\n * before its ancestor, if multiple or braced patterns are used.\n *\n * For example:\n *\n * ```ts\n * const results = await glob([\n * // likely to match first, since it's just a stat\n * 'a/b/c/d/e/f',\n *\n * // this pattern is more complicated! It must to various readdir()\n * // calls and test the results against a regular expression, and that\n * // is certainly going to take a little bit longer.\n * //\n * // So, later on, it encounters a match at 'a/b/c/d/e', but it's too\n * // late to ignore a/b/c/d/e/f, because it's already been emitted.\n * 'a/[bdf]/?/[a-z]/*',\n * ], { includeChildMatches: false })\n * ```\n *\n * It's best to only set this to `false` if you can be reasonably sure that\n * no components of the pattern will potentially match one another's file\n * system descendants, or if the occasional included child entry will not\n * cause problems.\n *\n * @default true\n */\n includeChildMatches?: boolean\n}\n\nexport type GlobOptionsWithFileTypesTrue = GlobOptions & {\n withFileTypes: true\n // string options not relevant if returning Path objects.\n absolute?: undefined\n mark?: undefined\n posix?: undefined\n}\n\nexport type GlobOptionsWithFileTypesFalse = GlobOptions & {\n withFileTypes?: false\n}\n\nexport type GlobOptionsWithFileTypesUnset = GlobOptions & {\n withFileTypes?: undefined\n}\n\nexport type Result<Opts> =\n Opts extends GlobOptionsWithFileTypesTrue ? Path\n : Opts extends GlobOptionsWithFileTypesFalse ? string\n : Opts extends GlobOptionsWithFileTypesUnset ? string\n : string | Path\nexport type Results<Opts> = Result<Opts>[]\n\nexport type FileTypes<Opts> =\n Opts extends GlobOptionsWithFileTypesTrue ? true\n : Opts extends GlobOptionsWithFileTypesFalse ? false\n : Opts extends GlobOptionsWithFileTypesUnset ? false\n : boolean\n\n/**\n * An object that can perform glob pattern traversals.\n */\nexport class Glob<Opts extends GlobOptions> implements GlobOptions {\n absolute?: boolean\n cwd: string\n root?: string\n dot: boolean\n dotRelative: boolean\n follow: boolean\n ignore?: string | string[] | IgnoreLike\n magicalBraces: boolean\n mark?: boolean\n matchBase: boolean\n maxDepth: number\n nobrace: boolean\n nocase: boolean\n nodir: boolean\n noext: boolean\n noglobstar: boolean\n pattern: string[]\n platform: NodeJS.Platform\n realpath: boolean\n scurry: PathScurry\n stat: boolean\n signal?: AbortSignal\n windowsPathsNoEscape: boolean\n withFileTypes: FileTypes<Opts>\n includeChildMatches: boolean\n\n /**\n * The options provided to the constructor.\n */\n opts: Opts\n\n /**\n * An array of parsed immutable {@link Pattern} objects.\n */\n patterns: Pattern[]\n\n /**\n * All options are stored as properties on the `Glob` object.\n *\n * See {@link GlobOptions} for full options descriptions.\n *\n * Note that a previous `Glob` object can be passed as the\n * `GlobOptions` to another `Glob` instantiation to re-use settings\n * and caches with a new pattern.\n *\n * Traversal functions can be called multiple times to run the walk\n * again.\n */\n constructor(pattern: string | string[], opts: Opts) {\n /* c8 ignore start */\n if (!opts) throw new TypeError('glob options required')\n /* c8 ignore stop */\n this.withFileTypes = !!opts.withFileTypes as FileTypes<Opts>\n this.signal = opts.signal\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.dotRelative = !!opts.dotRelative\n this.nodir = !!opts.nodir\n this.mark = !!opts.mark\n if (!opts.cwd) {\n this.cwd = ''\n } else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {\n opts.cwd = fileURLToPath(opts.cwd)\n }\n this.cwd = opts.cwd || ''\n this.root = opts.root\n this.magicalBraces = !!opts.magicalBraces\n this.nobrace = !!opts.nobrace\n this.noext = !!opts.noext\n this.realpath = !!opts.realpath\n this.absolute = opts.absolute\n this.includeChildMatches = opts.includeChildMatches !== false\n\n this.noglobstar = !!opts.noglobstar\n this.matchBase = !!opts.matchBase\n this.maxDepth =\n typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity\n this.stat = !!opts.stat\n this.ignore = opts.ignore\n\n if (this.withFileTypes && this.absolute !== undefined) {\n throw new Error('cannot set absolute and withFileTypes:true')\n }\n\n if (typeof pattern === 'string') {\n pattern = [pattern]\n }\n\n this.windowsPathsNoEscape =\n !!opts.windowsPathsNoEscape ||\n (opts as { allowWindowsEscape?: boolean }).allowWindowsEscape ===\n false\n\n if (this.windowsPathsNoEscape) {\n pattern = pattern.map(p => p.replace(/\\\\/g, '/'))\n }\n\n if (this.matchBase) {\n if (opts.noglobstar) {\n throw new TypeError('base matching requires globstar')\n }\n pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`))\n }\n\n this.pattern = pattern\n\n this.platform = opts.platform || defaultPlatform\n this.opts = { ...opts, platform: this.platform }\n if (opts.scurry) {\n this.scurry = opts.scurry\n if (\n opts.nocase !== undefined &&\n opts.nocase !== opts.scurry.nocase\n ) {\n throw new Error('nocase option contradicts provided scurry option')\n }\n } else {\n const Scurry =\n opts.platform === 'win32' ? PathScurryWin32\n : opts.platform === 'darwin' ? PathScurryDarwin\n : opts.platform ? PathScurryPosix\n : PathScurry\n this.scurry = new Scurry(this.cwd, {\n nocase: opts.nocase,\n fs: opts.fs,\n })\n }\n this.nocase = this.scurry.nocase\n\n // If you do nocase:true on a case-sensitive file system, then\n // we need to use regexps instead of strings for non-magic\n // path portions, because statting `aBc` won't return results\n // for the file `AbC` for example.\n const nocaseMagicOnly =\n this.platform === 'darwin' || this.platform === 'win32'\n\n const mmo: MinimatchOptions = {\n // default nocase based on platform\n ...opts,\n dot: this.dot,\n matchBase: this.matchBase,\n nobrace: this.nobrace,\n nocase: this.nocase,\n nocaseMagicOnly,\n nocomment: true,\n noext: this.noext,\n nonegate: true,\n optimizationLevel: 2,\n platform: this.platform,\n windowsPathsNoEscape: this.windowsPathsNoEscape,\n debug: !!this.opts.debug,\n }\n\n const mms = this.pattern.map(p => new Minimatch(p, mmo))\n const [matchSet, globParts] = mms.reduce(\n (set: [MatchSet, GlobParts], m) => {\n set[0].push(...m.set)\n set[1].push(...m.globParts)\n return set\n },\n [[], []],\n )\n this.patterns = matchSet.map((set, i) => {\n const g = globParts[i]\n /* c8 ignore start */\n if (!g) throw new Error('invalid pattern object')\n /* c8 ignore stop */\n return new Pattern(set, g, 0, this.platform)\n })\n }\n\n /**\n * Returns a Promise that resolves to the results array.\n */\n async walk(): Promise<Results<Opts>>\n async walk(): Promise<(string | Path)[]> {\n // Walkers always return array of Path objects, so we just have to\n // coerce them into the right shape. It will have already called\n // realpath() if the option was set to do so, so we know that's cached.\n // start out knowing the cwd, at least\n return [\n ...(await new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walk()),\n ]\n }\n\n /**\n * synchronous {@link Glob.walk}\n */\n walkSync(): Results<Opts>\n walkSync(): (string | Path)[] {\n return [\n ...new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walkSync(),\n ]\n }\n\n /**\n * Stream results asynchronously.\n */\n stream(): Minipass<Result<Opts>, Result<Opts>>\n stream(): Minipass<string | Path, string | Path> {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).stream()\n }\n\n /**\n * Stream results synchronously.\n */\n streamSync(): Minipass<Result<Opts>, Result<Opts>>\n streamSync(): Minipass<string | Path, string | Path> {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).streamSync()\n }\n\n /**\n * Default sync iteration function. Returns a Generator that\n * iterates over the results.\n */\n iterateSync(): Generator<Result<Opts>, void, void> {\n return this.streamSync()[Symbol.iterator]()\n }\n [Symbol.iterator]() {\n return this.iterateSync()\n }\n\n /**\n * Default async iteration function. Returns an AsyncGenerator that\n * iterates over the results.\n */\n iterate(): AsyncGenerator<Result<Opts>, void, void> {\n return this.stream()[Symbol.asyncIterator]()\n }\n [Symbol.asyncIterator]() {\n return this.iterate()\n }\n}\n"]}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/has-magic.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { GlobOptions } from './glob.js';
|
| 2 |
+
/**
|
| 3 |
+
* Return true if the patterns provided contain any magic glob characters,
|
| 4 |
+
* given the options provided.
|
| 5 |
+
*
|
| 6 |
+
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
| 7 |
+
* is set, as brace expansion just turns one string into an array of strings.
|
| 8 |
+
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
| 9 |
+
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
| 10 |
+
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
| 11 |
+
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
| 12 |
+
*/
|
| 13 |
+
export declare const hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
| 14 |
+
//# sourceMappingURL=has-magic.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/has-magic.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"has-magic.d.ts","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,YACV,MAAM,GAAG,MAAM,EAAE,YACjB,WAAW,KACnB,OAQF,CAAA"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/has-magic.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.hasMagic = void 0;
|
| 4 |
+
const minimatch_1 = require("minimatch");
|
| 5 |
+
/**
|
| 6 |
+
* Return true if the patterns provided contain any magic glob characters,
|
| 7 |
+
* given the options provided.
|
| 8 |
+
*
|
| 9 |
+
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
| 10 |
+
* is set, as brace expansion just turns one string into an array of strings.
|
| 11 |
+
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
| 12 |
+
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
| 13 |
+
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
| 14 |
+
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
| 15 |
+
*/
|
| 16 |
+
const hasMagic = (pattern, options = {}) => {
|
| 17 |
+
if (!Array.isArray(pattern)) {
|
| 18 |
+
pattern = [pattern];
|
| 19 |
+
}
|
| 20 |
+
for (const p of pattern) {
|
| 21 |
+
if (new minimatch_1.Minimatch(p, options).hasMagic())
|
| 22 |
+
return true;
|
| 23 |
+
}
|
| 24 |
+
return false;
|
| 25 |
+
};
|
| 26 |
+
exports.hasMagic = hasMagic;
|
| 27 |
+
//# sourceMappingURL=has-magic.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/has-magic.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"has-magic.js","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAGrC;;;;;;;;;;GAUG;AACI,MAAM,QAAQ,GAAG,CACtB,OAA0B,EAC1B,UAAuB,EAAE,EAChB,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,IAAI,qBAAS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE;YAAE,OAAO,IAAI,CAAA;IACvD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAXY,QAAA,QAAQ,YAWpB","sourcesContent":["import { Minimatch } from 'minimatch'\nimport { GlobOptions } from './glob.js'\n\n/**\n * Return true if the patterns provided contain any magic glob characters,\n * given the options provided.\n *\n * Brace expansion is not considered \"magic\" unless the `magicalBraces` option\n * is set, as brace expansion just turns one string into an array of strings.\n * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and\n * `'xby'` both do not contain any magic glob characters, and it's treated the\n * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`\n * is in the options, brace expansion _is_ treated as a pattern having magic.\n */\nexport const hasMagic = (\n pattern: string | string[],\n options: GlobOptions = {},\n): boolean => {\n if (!Array.isArray(pattern)) {\n pattern = [pattern]\n }\n for (const p of pattern) {\n if (new Minimatch(p, options).hasMagic()) return true\n }\n return false\n}\n"]}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/ignore.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Minimatch, MinimatchOptions } from 'minimatch';
|
| 2 |
+
import { Path } from 'path-scurry';
|
| 3 |
+
import { GlobWalkerOpts } from './walker.js';
|
| 4 |
+
export interface IgnoreLike {
|
| 5 |
+
ignored?: (p: Path) => boolean;
|
| 6 |
+
childrenIgnored?: (p: Path) => boolean;
|
| 7 |
+
add?: (ignore: string) => void;
|
| 8 |
+
}
|
| 9 |
+
/**
|
| 10 |
+
* Class used to process ignored patterns
|
| 11 |
+
*/
|
| 12 |
+
export declare class Ignore implements IgnoreLike {
|
| 13 |
+
relative: Minimatch[];
|
| 14 |
+
relativeChildren: Minimatch[];
|
| 15 |
+
absolute: Minimatch[];
|
| 16 |
+
absoluteChildren: Minimatch[];
|
| 17 |
+
platform: NodeJS.Platform;
|
| 18 |
+
mmopts: MinimatchOptions;
|
| 19 |
+
constructor(ignored: string[], { nobrace, nocase, noext, noglobstar, platform, }: GlobWalkerOpts);
|
| 20 |
+
add(ign: string): void;
|
| 21 |
+
ignored(p: Path): boolean;
|
| 22 |
+
childrenIgnored(p: Path): boolean;
|
| 23 |
+
}
|
| 24 |
+
//# sourceMappingURL=ignore.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/ignore.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"ignore.d.ts","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAElC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IAC9B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,OAAO,CAAA;IACtC,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAC/B;AAWD;;GAEG;AACH,qBAAa,MAAO,YAAW,UAAU;IACvC,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,gBAAgB,EAAE,SAAS,EAAE,CAAA;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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// give it a pattern, and it'll be able to tell you if
|
| 3 |
+
// a given path should be ignored.
|
| 4 |
+
// Ignoring a path ignores its children if the pattern ends in /**
|
| 5 |
+
// Ignores are always parsed in dot:true mode
|
| 6 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 7 |
+
exports.Ignore = void 0;
|
| 8 |
+
const minimatch_1 = require("minimatch");
|
| 9 |
+
const pattern_js_1 = require("./pattern.js");
|
| 10 |
+
const defaultPlatform = (typeof process === 'object' &&
|
| 11 |
+
process &&
|
| 12 |
+
typeof process.platform === 'string') ?
|
| 13 |
+
process.platform
|
| 14 |
+
: 'linux';
|
| 15 |
+
/**
|
| 16 |
+
* Class used to process ignored patterns
|
| 17 |
+
*/
|
| 18 |
+
class Ignore {
|
| 19 |
+
relative;
|
| 20 |
+
relativeChildren;
|
| 21 |
+
absolute;
|
| 22 |
+
absoluteChildren;
|
| 23 |
+
platform;
|
| 24 |
+
mmopts;
|
| 25 |
+
constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) {
|
| 26 |
+
this.relative = [];
|
| 27 |
+
this.absolute = [];
|
| 28 |
+
this.relativeChildren = [];
|
| 29 |
+
this.absoluteChildren = [];
|
| 30 |
+
this.platform = platform;
|
| 31 |
+
this.mmopts = {
|
| 32 |
+
dot: true,
|
| 33 |
+
nobrace,
|
| 34 |
+
nocase,
|
| 35 |
+
noext,
|
| 36 |
+
noglobstar,
|
| 37 |
+
optimizationLevel: 2,
|
| 38 |
+
platform,
|
| 39 |
+
nocomment: true,
|
| 40 |
+
nonegate: true,
|
| 41 |
+
};
|
| 42 |
+
for (const ign of ignored)
|
| 43 |
+
this.add(ign);
|
| 44 |
+
}
|
| 45 |
+
add(ign) {
|
| 46 |
+
// this is a little weird, but it gives us a clean set of optimized
|
| 47 |
+
// minimatch matchers, without getting tripped up if one of them
|
| 48 |
+
// ends in /** inside a brace section, and it's only inefficient at
|
| 49 |
+
// the start of the walk, not along it.
|
| 50 |
+
// It'd be nice if the Pattern class just had a .test() method, but
|
| 51 |
+
// handling globstars is a bit of a pita, and that code already lives
|
| 52 |
+
// in minimatch anyway.
|
| 53 |
+
// Another way would be if maybe Minimatch could take its set/globParts
|
| 54 |
+
// as an option, and then we could at least just use Pattern to test
|
| 55 |
+
// for absolute-ness.
|
| 56 |
+
// Yet another way, Minimatch could take an array of glob strings, and
|
| 57 |
+
// a cwd option, and do the right thing.
|
| 58 |
+
const mm = new minimatch_1.Minimatch(ign, this.mmopts);
|
| 59 |
+
for (let i = 0; i < mm.set.length; i++) {
|
| 60 |
+
const parsed = mm.set[i];
|
| 61 |
+
const globParts = mm.globParts[i];
|
| 62 |
+
/* c8 ignore start */
|
| 63 |
+
if (!parsed || !globParts) {
|
| 64 |
+
throw new Error('invalid pattern object');
|
| 65 |
+
}
|
| 66 |
+
// strip off leading ./ portions
|
| 67 |
+
// https://github.com/isaacs/node-glob/issues/570
|
| 68 |
+
while (parsed[0] === '.' && globParts[0] === '.') {
|
| 69 |
+
parsed.shift();
|
| 70 |
+
globParts.shift();
|
| 71 |
+
}
|
| 72 |
+
/* c8 ignore stop */
|
| 73 |
+
const p = new pattern_js_1.Pattern(parsed, globParts, 0, this.platform);
|
| 74 |
+
const m = new minimatch_1.Minimatch(p.globString(), this.mmopts);
|
| 75 |
+
const children = globParts[globParts.length - 1] === '**';
|
| 76 |
+
const absolute = p.isAbsolute();
|
| 77 |
+
if (absolute)
|
| 78 |
+
this.absolute.push(m);
|
| 79 |
+
else
|
| 80 |
+
this.relative.push(m);
|
| 81 |
+
if (children) {
|
| 82 |
+
if (absolute)
|
| 83 |
+
this.absoluteChildren.push(m);
|
| 84 |
+
else
|
| 85 |
+
this.relativeChildren.push(m);
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
ignored(p) {
|
| 90 |
+
const fullpath = p.fullpath();
|
| 91 |
+
const fullpaths = `${fullpath}/`;
|
| 92 |
+
const relative = p.relative() || '.';
|
| 93 |
+
const relatives = `${relative}/`;
|
| 94 |
+
for (const m of this.relative) {
|
| 95 |
+
if (m.match(relative) || m.match(relatives))
|
| 96 |
+
return true;
|
| 97 |
+
}
|
| 98 |
+
for (const m of this.absolute) {
|
| 99 |
+
if (m.match(fullpath) || m.match(fullpaths))
|
| 100 |
+
return true;
|
| 101 |
+
}
|
| 102 |
+
return false;
|
| 103 |
+
}
|
| 104 |
+
childrenIgnored(p) {
|
| 105 |
+
const fullpath = p.fullpath() + '/';
|
| 106 |
+
const relative = (p.relative() || '.') + '/';
|
| 107 |
+
for (const m of this.relativeChildren) {
|
| 108 |
+
if (m.match(relative))
|
| 109 |
+
return true;
|
| 110 |
+
}
|
| 111 |
+
for (const m of this.absoluteChildren) {
|
| 112 |
+
if (m.match(fullpath))
|
| 113 |
+
return true;
|
| 114 |
+
}
|
| 115 |
+
return false;
|
| 116 |
+
}
|
| 117 |
+
}
|
| 118 |
+
exports.Ignore = Ignore;
|
| 119 |
+
//# sourceMappingURL=ignore.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/ignore.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"ignore.js","sourceRoot":"","sources":["../../src/ignore.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,kCAAkC;AAClC,kEAAkE;AAClE,6CAA6C;;;AAE7C,yCAAuD;AAEvD,6CAAsC;AAStC,MAAM,eAAe,GACnB,CACE,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IACP,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CACrC,CAAC,CAAC;IACD,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAA;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AAM,SAAS,GAAG,GAAG,QAAQ,GAAG,CAAA;QAChC,MAAM,QAAQ,GAAG,CAAC,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAA;QACpC,MAAM,SAAS,GAAG,GAAG,QAAQ,GAAG,CAAA;QAChC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC9B,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;gBAAE,OAAO,IAAI,CAAA;QAC1D,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC9B,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;gBAAE,OAAO,IAAI,CAAA;QAC1D,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,eAAe,CAAC,CAAO;QACrB,MAAM,QAAQ,GAAG,CAAC,CAAC,QAAQ,EAAE,GAAG,GAAG,CAAA;QACnC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,GAAG,GAAG,CAAA;QAC5C,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;QACpC,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACtC,IAAI,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;QACpC,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAvGD,wBAuGC","sourcesContent":["// give it a pattern, and it'll be able to tell you if\n// a given path should be ignored.\n// Ignoring a path ignores its children if the pattern ends in /**\n// Ignores are always parsed in dot:true mode\n\nimport { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\nexport interface IgnoreLike {\n ignored?: (p: Path) => boolean\n childrenIgnored?: (p: Path) => boolean\n add?: (ignore: string) => void\n}\n\nconst defaultPlatform: NodeJS.Platform =\n (\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ) ?\n process.platform\n : 'linux'\n\n/**\n * Class used to process ignored patterns\n */\nexport class Ignore implements IgnoreLike {\n relative: Minimatch[]\n relativeChildren: Minimatch[]\n absolute: Minimatch[]\n absoluteChildren: Minimatch[]\n platform: NodeJS.Platform\n mmopts: MinimatchOptions\n\n constructor(\n ignored: string[],\n {\n nobrace,\n nocase,\n noext,\n noglobstar,\n platform = defaultPlatform,\n }: GlobWalkerOpts,\n ) {\n this.relative = []\n this.absolute = []\n this.relativeChildren = []\n this.absoluteChildren = []\n this.platform = platform\n this.mmopts = {\n dot: true,\n nobrace,\n nocase,\n noext,\n noglobstar,\n optimizationLevel: 2,\n platform,\n nocomment: true,\n nonegate: true,\n }\n for (const ign of ignored) this.add(ign)\n }\n\n add(ign: string) {\n // this is a little weird, but it gives us a clean set of optimized\n // minimatch matchers, without getting tripped up if one of them\n // ends in /** inside a brace section, and it's only inefficient at\n // the start of the walk, not along it.\n // It'd be nice if the Pattern class just had a .test() method, but\n // handling globstars is a bit of a pita, and that code already lives\n // in minimatch anyway.\n // Another way would be if maybe Minimatch could take its set/globParts\n // as an option, and then we could at least just use Pattern to test\n // for absolute-ness.\n // Yet another way, Minimatch could take an array of glob strings, and\n // a cwd option, and do the right thing.\n const mm = new Minimatch(ign, this.mmopts)\n for (let i = 0; i < mm.set.length; i++) {\n const parsed = mm.set[i]\n const globParts = mm.globParts[i]\n /* c8 ignore start */\n if (!parsed || !globParts) {\n throw new Error('invalid pattern object')\n }\n // strip off leading ./ portions\n // https://github.com/isaacs/node-glob/issues/570\n while (parsed[0] === '.' && globParts[0] === '.') {\n parsed.shift()\n globParts.shift()\n }\n /* c8 ignore stop */\n const p = new Pattern(parsed, globParts, 0, this.platform)\n const m = new Minimatch(p.globString(), this.mmopts)\n const children = globParts[globParts.length - 1] === '**'\n const absolute = p.isAbsolute()\n if (absolute) this.absolute.push(m)\n else this.relative.push(m)\n if (children) {\n if (absolute) this.absoluteChildren.push(m)\n else this.relativeChildren.push(m)\n }\n }\n }\n\n ignored(p: Path): boolean {\n const fullpath = p.fullpath()\n const fullpaths = `${fullpath}/`\n const relative = p.relative() || '.'\n const relatives = `${relative}/`\n for (const m of this.relative) {\n if (m.match(relative) || m.match(relatives)) return true\n }\n for (const m of this.absolute) {\n if (m.match(fullpath) || m.match(fullpaths)) return true\n }\n return false\n }\n\n childrenIgnored(p: Path): boolean {\n const fullpath = p.fullpath() + '/'\n const relative = (p.relative() || '.') + '/'\n for (const m of this.relativeChildren) {\n if (m.match(relative)) return true\n }\n for (const m of this.absoluteChildren) {\n if (m.match(fullpath)) return true\n }\n return false\n }\n}\n"]}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/index.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Minipass } from 'minipass';
|
| 2 |
+
import { Path } from 'path-scurry';
|
| 3 |
+
import type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset } from './glob.js';
|
| 4 |
+
import { Glob } from './glob.js';
|
| 5 |
+
export { escape, unescape } from 'minimatch';
|
| 6 |
+
export type { FSOption, Path, WalkOptions, WalkOptionsWithFileTypesTrue, WalkOptionsWithFileTypesUnset, } from 'path-scurry';
|
| 7 |
+
export { Glob } from './glob.js';
|
| 8 |
+
export type { GlobOptions, GlobOptionsWithFileTypesFalse, GlobOptionsWithFileTypesTrue, GlobOptionsWithFileTypesUnset, } from './glob.js';
|
| 9 |
+
export { hasMagic } from './has-magic.js';
|
| 10 |
+
export { Ignore } from './ignore.js';
|
| 11 |
+
export type { IgnoreLike } from './ignore.js';
|
| 12 |
+
export type { MatchStream } from './walker.js';
|
| 13 |
+
/**
|
| 14 |
+
* Syncronous form of {@link globStream}. Will read all the matches as fast as
|
| 15 |
+
* you consume them, even all in a single tick if you consume them immediately,
|
| 16 |
+
* but will still respond to backpressure if they're not consumed immediately.
|
| 17 |
+
*/
|
| 18 |
+
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
| 19 |
+
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
| 20 |
+
export declare function globStreamSync(pattern: string | string[], options: GlobOptionsWithFileTypesUnset): Minipass<string, string>;
|
| 21 |
+
export declare function globStreamSync(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
| 22 |
+
/**
|
| 23 |
+
* Return a stream that emits all the strings or `Path` objects and
|
| 24 |
+
* then emits `end` when completed.
|
| 25 |
+
*/
|
| 26 |
+
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Minipass<string, string>;
|
| 27 |
+
export declare function globStream(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Minipass<Path, Path>;
|
| 28 |
+
export declare function globStream(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Minipass<string, string>;
|
| 29 |
+
export declare function globStream(pattern: string | string[], options: GlobOptions): Minipass<Path, Path> | Minipass<string, string>;
|
| 30 |
+
/**
|
| 31 |
+
* Synchronous form of {@link glob}
|
| 32 |
+
*/
|
| 33 |
+
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): string[];
|
| 34 |
+
export declare function globSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Path[];
|
| 35 |
+
export declare function globSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): string[];
|
| 36 |
+
export declare function globSync(pattern: string | string[], options: GlobOptions): Path[] | string[];
|
| 37 |
+
/**
|
| 38 |
+
* Perform an asynchronous glob search for the pattern(s) specified. Returns
|
| 39 |
+
* [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the
|
| 40 |
+
* {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for
|
| 41 |
+
* full option descriptions.
|
| 42 |
+
*/
|
| 43 |
+
declare function glob_(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Promise<string[]>;
|
| 44 |
+
declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Promise<Path[]>;
|
| 45 |
+
declare function glob_(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Promise<string[]>;
|
| 46 |
+
declare function glob_(pattern: string | string[], options: GlobOptions): Promise<Path[] | string[]>;
|
| 47 |
+
/**
|
| 48 |
+
* Return a sync iterator for walking glob pattern matches.
|
| 49 |
+
*/
|
| 50 |
+
export declare function globIterateSync(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): Generator<string, void, void>;
|
| 51 |
+
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): Generator<Path, void, void>;
|
| 52 |
+
export declare function globIterateSync(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): Generator<string, void, void>;
|
| 53 |
+
export declare function globIterateSync(pattern: string | string[], options: GlobOptions): Generator<Path, void, void> | Generator<string, void, void>;
|
| 54 |
+
/**
|
| 55 |
+
* Return an async iterator for walking glob pattern matches.
|
| 56 |
+
*/
|
| 57 |
+
export declare function globIterate(pattern: string | string[], options?: GlobOptionsWithFileTypesUnset | undefined): AsyncGenerator<string, void, void>;
|
| 58 |
+
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesTrue): AsyncGenerator<Path, void, void>;
|
| 59 |
+
export declare function globIterate(pattern: string | string[], options: GlobOptionsWithFileTypesFalse): AsyncGenerator<string, void, void>;
|
| 60 |
+
export declare function globIterate(pattern: string | string[], options: GlobOptions): AsyncGenerator<Path, void, void> | AsyncGenerator<string, void, void>;
|
| 61 |
+
export declare const streamSync: typeof globStreamSync;
|
| 62 |
+
export declare const stream: typeof globStream & {
|
| 63 |
+
sync: typeof globStreamSync;
|
| 64 |
+
};
|
| 65 |
+
export declare const iterateSync: typeof globIterateSync;
|
| 66 |
+
export declare const iterate: typeof globIterate & {
|
| 67 |
+
sync: typeof globIterateSync;
|
| 68 |
+
};
|
| 69 |
+
export declare const sync: typeof globSync & {
|
| 70 |
+
stream: typeof globStreamSync;
|
| 71 |
+
iterate: typeof globIterateSync;
|
| 72 |
+
};
|
| 73 |
+
export declare const glob: typeof glob_ & {
|
| 74 |
+
glob: typeof glob_;
|
| 75 |
+
globSync: typeof globSync;
|
| 76 |
+
sync: typeof globSync & {
|
| 77 |
+
stream: typeof globStreamSync;
|
| 78 |
+
iterate: typeof globIterateSync;
|
| 79 |
+
};
|
| 80 |
+
globStream: typeof globStream;
|
| 81 |
+
stream: typeof globStream & {
|
| 82 |
+
sync: typeof globStreamSync;
|
| 83 |
+
};
|
| 84 |
+
globStreamSync: typeof globStreamSync;
|
| 85 |
+
streamSync: typeof globStreamSync;
|
| 86 |
+
globIterate: typeof globIterate;
|
| 87 |
+
iterate: typeof globIterate & {
|
| 88 |
+
sync: typeof globIterateSync;
|
| 89 |
+
};
|
| 90 |
+
globIterateSync: typeof globIterateSync;
|
| 91 |
+
iterateSync: typeof globIterateSync;
|
| 92 |
+
Glob: typeof Glob;
|
| 93 |
+
hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
| 94 |
+
escape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape">) => string;
|
| 95 |
+
unescape: (s: string, { windowsPathsNoEscape, }?: Pick<import("minimatch").MinimatchOptions, "windowsPathsNoEscape">) => string;
|
| 96 |
+
};
|
| 97 |
+
//# sourceMappingURL=index.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,KAAK,EACV,WAAW,EACX,6BAA6B,EAC7B,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5C,YAAY,EACV,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,IAAI,EAAE,MAAM,W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AAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,6BAA6B,GACrC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACrC,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,OAAO,EAAE,WAAW,GACnB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AASxE,eAAO,MAAM,UAAU,uBAAiB,CAAA;AACxC,eAAO,MAAM,MAAM;;CAAsD,CAAA;AACzE,eAAO,MAAM,WAAW,wBAAkB,CAAA;AAC1C,eAAO,MAAM,OAAO;;CAElB,CAAA;AACF,eAAO,MAAM,IAAI;;;CAGf,CAAA;AAEF,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;CAgBf,CAAA"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/index.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.glob = exports.sync = exports.iterate = exports.iterateSync = exports.stream = exports.streamSync = exports.Ignore = exports.hasMagic = exports.Glob = exports.unescape = exports.escape = void 0;
|
| 4 |
+
exports.globStreamSync = globStreamSync;
|
| 5 |
+
exports.globStream = globStream;
|
| 6 |
+
exports.globSync = globSync;
|
| 7 |
+
exports.globIterateSync = globIterateSync;
|
| 8 |
+
exports.globIterate = globIterate;
|
| 9 |
+
const minimatch_1 = require("minimatch");
|
| 10 |
+
const glob_js_1 = require("./glob.js");
|
| 11 |
+
const has_magic_js_1 = require("./has-magic.js");
|
| 12 |
+
var minimatch_2 = require("minimatch");
|
| 13 |
+
Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return minimatch_2.escape; } });
|
| 14 |
+
Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return minimatch_2.unescape; } });
|
| 15 |
+
var glob_js_2 = require("./glob.js");
|
| 16 |
+
Object.defineProperty(exports, "Glob", { enumerable: true, get: function () { return glob_js_2.Glob; } });
|
| 17 |
+
var has_magic_js_2 = require("./has-magic.js");
|
| 18 |
+
Object.defineProperty(exports, "hasMagic", { enumerable: true, get: function () { return has_magic_js_2.hasMagic; } });
|
| 19 |
+
var ignore_js_1 = require("./ignore.js");
|
| 20 |
+
Object.defineProperty(exports, "Ignore", { enumerable: true, get: function () { return ignore_js_1.Ignore; } });
|
| 21 |
+
function globStreamSync(pattern, options = {}) {
|
| 22 |
+
return new glob_js_1.Glob(pattern, options).streamSync();
|
| 23 |
+
}
|
| 24 |
+
function globStream(pattern, options = {}) {
|
| 25 |
+
return new glob_js_1.Glob(pattern, options).stream();
|
| 26 |
+
}
|
| 27 |
+
function globSync(pattern, options = {}) {
|
| 28 |
+
return new glob_js_1.Glob(pattern, options).walkSync();
|
| 29 |
+
}
|
| 30 |
+
async function glob_(pattern, options = {}) {
|
| 31 |
+
return new glob_js_1.Glob(pattern, options).walk();
|
| 32 |
+
}
|
| 33 |
+
function globIterateSync(pattern, options = {}) {
|
| 34 |
+
return new glob_js_1.Glob(pattern, options).iterateSync();
|
| 35 |
+
}
|
| 36 |
+
function globIterate(pattern, options = {}) {
|
| 37 |
+
return new glob_js_1.Glob(pattern, options).iterate();
|
| 38 |
+
}
|
| 39 |
+
// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc
|
| 40 |
+
exports.streamSync = globStreamSync;
|
| 41 |
+
exports.stream = Object.assign(globStream, { sync: globStreamSync });
|
| 42 |
+
exports.iterateSync = globIterateSync;
|
| 43 |
+
exports.iterate = Object.assign(globIterate, {
|
| 44 |
+
sync: globIterateSync,
|
| 45 |
+
});
|
| 46 |
+
exports.sync = Object.assign(globSync, {
|
| 47 |
+
stream: globStreamSync,
|
| 48 |
+
iterate: globIterateSync,
|
| 49 |
+
});
|
| 50 |
+
exports.glob = Object.assign(glob_, {
|
| 51 |
+
glob: glob_,
|
| 52 |
+
globSync,
|
| 53 |
+
sync: exports.sync,
|
| 54 |
+
globStream,
|
| 55 |
+
stream: exports.stream,
|
| 56 |
+
globStreamSync,
|
| 57 |
+
streamSync: exports.streamSync,
|
| 58 |
+
globIterate,
|
| 59 |
+
iterate: exports.iterate,
|
| 60 |
+
globIterateSync,
|
| 61 |
+
iterateSync: exports.iterateSync,
|
| 62 |
+
Glob: glob_js_1.Glob,
|
| 63 |
+
hasMagic: has_magic_js_1.hasMagic,
|
| 64 |
+
escape: minimatch_1.escape,
|
| 65 |
+
unescape: minimatch_1.unescape,
|
| 66 |
+
});
|
| 67 |
+
exports.glob.glob = exports.glob;
|
| 68 |
+
//# sourceMappingURL=index.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAqDA,wCAKC;AAsBD,gCAKC;AAqBD,4BAKC;AAkDD,0CAKC;AAqBD,kCAKC;AAhMD,yCAA4C;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I,EAAE,cAAc,EAAE,CAAC,CAAA;AAC5D,QAAA,WAAW,GAAG,eAAe,CAAA;AAC7B,QAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;IAChD,IAAI,EAAE,eAAe;CACtB,CAAC,CAAA;AACW,QAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;IAC1C,MAAM,EAAE,cAAc;IACtB,OAAO,EAAE,eAAe;CACzB,CAAC,CAAA;AAEW,QAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE;IACvC,IAAI,EAAE,KAAK;IACX,QAAQ;IACR,IAAI,EAAJ,YAAI;IACJ,UAAU;IACV,MAAM,EAAN,cAAM;IACN,cAAc;IACd,UAAU,EAAV,kBAAU;IACV,WAAW;IACX,OAAO,EAAP,eAAO;IACP,eAAe;IACf,WAAW,EAAX,mBAAW;IACX,IAAI,EAAJ,cAAI;IACJ,QAAQ,EAAR,uBAAQ;IACR,MAAM,EAAN,kBAAM;IACN,QAAQ,EAAR,oBAAQ;CACT,CAAC,CAAA;AACF,YAAI,CAAC,IAAI,GAAG,YAAI,CAAA","sourcesContent":["import { escape, unescape } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nimport { Glob } from './glob.js'\nimport { hasMagic } from './has-magic.js'\n\nexport { escape, unescape } from 'minimatch'\nexport type {\n FSOption,\n Path,\n WalkOptions,\n WalkOptionsWithFileTypesTrue,\n WalkOptionsWithFileTypesUnset,\n} from 'path-scurry'\nexport { Glob } from './glob.js'\nexport type {\n GlobOptions,\n GlobOptionsWithFileTypesFalse,\n GlobOptionsWithFileTypesTrue,\n GlobOptionsWithFileTypesUnset,\n} from './glob.js'\nexport { hasMagic } from './has-magic.js'\nexport { Ignore } from './ignore.js'\nexport type { IgnoreLike } from './ignore.js'\nexport type { MatchStream } from './walker.js'\n\n/**\n * Syncronous form of {@link globStream}. Will read all the matches as fast as\n * you consume them, even all in a single tick if you consume them immediately,\n * but will still respond to backpressure if they're not consumed immediately.\n */\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass<Path, Path>\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass<string, string>\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesUnset,\n): Minipass<string, string>\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass<Path, Path> | Minipass<string, string>\nexport function globStreamSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).streamSync()\n}\n\n/**\n * Return a stream that emits all the strings or `Path` objects and\n * then emits `end` when completed.\n */\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Minipass<string, string>\nexport function globStream(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Minipass<Path, Path>\nexport function globStream(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Minipass<string, string>\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions,\n): Minipass<Path, Path> | Minipass<string, string>\nexport function globStream(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).stream()\n}\n\n/**\n * Synchronous form of {@link glob}\n */\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Path[]\nexport function globSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions,\n): Path[] | string[]\nexport function globSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).walkSync()\n}\n\n/**\n * Perform an asynchronous glob search for the pattern(s) specified. Returns\n * [Path](https://isaacs.github.io/path-scurry/classes/PathBase) objects if the\n * {@link withFileTypes} option is set to `true`. See {@link GlobOptions} for\n * full option descriptions.\n */\nasync function glob_(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Promise<string[]>\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Promise<Path[]>\nasync function glob_(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Promise<string[]>\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions,\n): Promise<Path[] | string[]>\nasync function glob_(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).walk()\n}\n\n/**\n * Return a sync iterator for walking glob pattern matches.\n */\nexport function globIterateSync(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): Generator<string, void, void>\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): Generator<Path, void, void>\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): Generator<string, void, void>\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions,\n): Generator<Path, void, void> | Generator<string, void, void>\nexport function globIterateSync(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).iterateSync()\n}\n\n/**\n * Return an async iterator for walking glob pattern matches.\n */\nexport function globIterate(\n pattern: string | string[],\n options?: GlobOptionsWithFileTypesUnset | undefined,\n): AsyncGenerator<string, void, void>\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesTrue,\n): AsyncGenerator<Path, void, void>\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptionsWithFileTypesFalse,\n): AsyncGenerator<string, void, void>\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions,\n): AsyncGenerator<Path, void, void> | AsyncGenerator<string, void, void>\nexport function globIterate(\n pattern: string | string[],\n options: GlobOptions = {},\n) {\n return new Glob(pattern, options).iterate()\n}\n\n// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc\nexport const streamSync = globStreamSync\nexport const stream = Object.assign(globStream, { sync: globStreamSync })\nexport const iterateSync = globIterateSync\nexport const iterate = Object.assign(globIterate, {\n sync: globIterateSync,\n})\nexport const sync = Object.assign(globSync, {\n stream: globStreamSync,\n iterate: globIterateSync,\n})\n\nexport const glob = Object.assign(glob_, {\n glob: glob_,\n globSync,\n sync,\n globStream,\n stream,\n globStreamSync,\n streamSync,\n globIterate,\n iterate,\n globIterateSync,\n iterateSync,\n Glob,\n hasMagic,\n escape,\n unescape,\n})\nglob.glob = glob\n"]}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/package.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"type": "commonjs"
|
| 3 |
+
}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/pattern.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { GLOBSTAR } from 'minimatch';
|
| 2 |
+
export type MMPattern = string | RegExp | typeof GLOBSTAR;
|
| 3 |
+
export type PatternList = [p: MMPattern, ...rest: MMPattern[]];
|
| 4 |
+
export type UNCPatternList = [
|
| 5 |
+
p0: '',
|
| 6 |
+
p1: '',
|
| 7 |
+
p2: string,
|
| 8 |
+
p3: string,
|
| 9 |
+
...rest: MMPattern[]
|
| 10 |
+
];
|
| 11 |
+
export type DrivePatternList = [p0: string, ...rest: MMPattern[]];
|
| 12 |
+
export type AbsolutePatternList = [p0: '', ...rest: MMPattern[]];
|
| 13 |
+
export type GlobList = [p: string, ...rest: string[]];
|
| 14 |
+
/**
|
| 15 |
+
* An immutable-ish view on an array of glob parts and their parsed
|
| 16 |
+
* results
|
| 17 |
+
*/
|
| 18 |
+
export declare class Pattern {
|
| 19 |
+
#private;
|
| 20 |
+
readonly length: number;
|
| 21 |
+
constructor(patternList: MMPattern[], globList: string[], index: number, platform: NodeJS.Platform);
|
| 22 |
+
/**
|
| 23 |
+
* The first entry in the parsed list of patterns
|
| 24 |
+
*/
|
| 25 |
+
pattern(): MMPattern;
|
| 26 |
+
/**
|
| 27 |
+
* true of if pattern() returns a string
|
| 28 |
+
*/
|
| 29 |
+
isString(): boolean;
|
| 30 |
+
/**
|
| 31 |
+
* true of if pattern() returns GLOBSTAR
|
| 32 |
+
*/
|
| 33 |
+
isGlobstar(): boolean;
|
| 34 |
+
/**
|
| 35 |
+
* true if pattern() returns a regexp
|
| 36 |
+
*/
|
| 37 |
+
isRegExp(): boolean;
|
| 38 |
+
/**
|
| 39 |
+
* The /-joined set of glob parts that make up this pattern
|
| 40 |
+
*/
|
| 41 |
+
globString(): string;
|
| 42 |
+
/**
|
| 43 |
+
* true if there are more pattern parts after this one
|
| 44 |
+
*/
|
| 45 |
+
hasMore(): boolean;
|
| 46 |
+
/**
|
| 47 |
+
* The rest of the pattern after this part, or null if this is the end
|
| 48 |
+
*/
|
| 49 |
+
rest(): Pattern | null;
|
| 50 |
+
/**
|
| 51 |
+
* true if the pattern represents a //unc/path/ on windows
|
| 52 |
+
*/
|
| 53 |
+
isUNC(): boolean;
|
| 54 |
+
/**
|
| 55 |
+
* True if the pattern starts with a drive letter on Windows
|
| 56 |
+
*/
|
| 57 |
+
isDrive(): boolean;
|
| 58 |
+
/**
|
| 59 |
+
* True if the pattern is rooted on an absolute path
|
| 60 |
+
*/
|
| 61 |
+
isAbsolute(): boolean;
|
| 62 |
+
/**
|
| 63 |
+
* consume the root of the pattern, and return it
|
| 64 |
+
*/
|
| 65 |
+
root(): string;
|
| 66 |
+
/**
|
| 67 |
+
* Check to see if the current globstar pattern is allowed to follow
|
| 68 |
+
* a symbolic link.
|
| 69 |
+
*/
|
| 70 |
+
checkFollowGlobstar(): boolean;
|
| 71 |
+
/**
|
| 72 |
+
* Mark that the current globstar pattern is following a symbolic link
|
| 73 |
+
*/
|
| 74 |
+
markFollowGlobstar(): boolean;
|
| 75 |
+
}
|
| 76 |
+
//# sourceMappingURL=pattern.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/pattern.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,QAAQ,CAAA;AAGzD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;AAC9D,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,EAAE;IACN,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,MAAM;IACV,GAAG,IAAI,EAAE,SAAS,EAAE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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
// this is just a very light wrapper around 2 arrays with an offset index
|
| 3 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 4 |
+
exports.Pattern = void 0;
|
| 5 |
+
const minimatch_1 = require("minimatch");
|
| 6 |
+
const isPatternList = (pl) => pl.length >= 1;
|
| 7 |
+
const isGlobList = (gl) => gl.length >= 1;
|
| 8 |
+
/**
|
| 9 |
+
* An immutable-ish view on an array of glob parts and their parsed
|
| 10 |
+
* results
|
| 11 |
+
*/
|
| 12 |
+
class Pattern {
|
| 13 |
+
#patternList;
|
| 14 |
+
#globList;
|
| 15 |
+
#index;
|
| 16 |
+
length;
|
| 17 |
+
#platform;
|
| 18 |
+
#rest;
|
| 19 |
+
#globString;
|
| 20 |
+
#isDrive;
|
| 21 |
+
#isUNC;
|
| 22 |
+
#isAbsolute;
|
| 23 |
+
#followGlobstar = true;
|
| 24 |
+
constructor(patternList, globList, index, platform) {
|
| 25 |
+
if (!isPatternList(patternList)) {
|
| 26 |
+
throw new TypeError('empty pattern list');
|
| 27 |
+
}
|
| 28 |
+
if (!isGlobList(globList)) {
|
| 29 |
+
throw new TypeError('empty glob list');
|
| 30 |
+
}
|
| 31 |
+
if (globList.length !== patternList.length) {
|
| 32 |
+
throw new TypeError('mismatched pattern list and glob list lengths');
|
| 33 |
+
}
|
| 34 |
+
this.length = patternList.length;
|
| 35 |
+
if (index < 0 || index >= this.length) {
|
| 36 |
+
throw new TypeError('index out of range');
|
| 37 |
+
}
|
| 38 |
+
this.#patternList = patternList;
|
| 39 |
+
this.#globList = globList;
|
| 40 |
+
this.#index = index;
|
| 41 |
+
this.#platform = platform;
|
| 42 |
+
// normalize root entries of absolute patterns on initial creation.
|
| 43 |
+
if (this.#index === 0) {
|
| 44 |
+
// c: => ['c:/']
|
| 45 |
+
// C:/ => ['C:/']
|
| 46 |
+
// C:/x => ['C:/', 'x']
|
| 47 |
+
// //host/share => ['//host/share/']
|
| 48 |
+
// //host/share/ => ['//host/share/']
|
| 49 |
+
// //host/share/x => ['//host/share/', 'x']
|
| 50 |
+
// /etc => ['/', 'etc']
|
| 51 |
+
// / => ['/']
|
| 52 |
+
if (this.isUNC()) {
|
| 53 |
+
// '' / '' / 'host' / 'share'
|
| 54 |
+
const [p0, p1, p2, p3, ...prest] = this.#patternList;
|
| 55 |
+
const [g0, g1, g2, g3, ...grest] = this.#globList;
|
| 56 |
+
if (prest[0] === '') {
|
| 57 |
+
// ends in /
|
| 58 |
+
prest.shift();
|
| 59 |
+
grest.shift();
|
| 60 |
+
}
|
| 61 |
+
const p = [p0, p1, p2, p3, ''].join('/');
|
| 62 |
+
const g = [g0, g1, g2, g3, ''].join('/');
|
| 63 |
+
this.#patternList = [p, ...prest];
|
| 64 |
+
this.#globList = [g, ...grest];
|
| 65 |
+
this.length = this.#patternList.length;
|
| 66 |
+
}
|
| 67 |
+
else if (this.isDrive() || this.isAbsolute()) {
|
| 68 |
+
const [p1, ...prest] = this.#patternList;
|
| 69 |
+
const [g1, ...grest] = this.#globList;
|
| 70 |
+
if (prest[0] === '') {
|
| 71 |
+
// ends in /
|
| 72 |
+
prest.shift();
|
| 73 |
+
grest.shift();
|
| 74 |
+
}
|
| 75 |
+
const p = p1 + '/';
|
| 76 |
+
const g = g1 + '/';
|
| 77 |
+
this.#patternList = [p, ...prest];
|
| 78 |
+
this.#globList = [g, ...grest];
|
| 79 |
+
this.length = this.#patternList.length;
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
/**
|
| 84 |
+
* The first entry in the parsed list of patterns
|
| 85 |
+
*/
|
| 86 |
+
pattern() {
|
| 87 |
+
return this.#patternList[this.#index];
|
| 88 |
+
}
|
| 89 |
+
/**
|
| 90 |
+
* true of if pattern() returns a string
|
| 91 |
+
*/
|
| 92 |
+
isString() {
|
| 93 |
+
return typeof this.#patternList[this.#index] === 'string';
|
| 94 |
+
}
|
| 95 |
+
/**
|
| 96 |
+
* true of if pattern() returns GLOBSTAR
|
| 97 |
+
*/
|
| 98 |
+
isGlobstar() {
|
| 99 |
+
return this.#patternList[this.#index] === minimatch_1.GLOBSTAR;
|
| 100 |
+
}
|
| 101 |
+
/**
|
| 102 |
+
* true if pattern() returns a regexp
|
| 103 |
+
*/
|
| 104 |
+
isRegExp() {
|
| 105 |
+
return this.#patternList[this.#index] instanceof RegExp;
|
| 106 |
+
}
|
| 107 |
+
/**
|
| 108 |
+
* The /-joined set of glob parts that make up this pattern
|
| 109 |
+
*/
|
| 110 |
+
globString() {
|
| 111 |
+
return (this.#globString =
|
| 112 |
+
this.#globString ||
|
| 113 |
+
(this.#index === 0 ?
|
| 114 |
+
this.isAbsolute() ?
|
| 115 |
+
this.#globList[0] + this.#globList.slice(1).join('/')
|
| 116 |
+
: this.#globList.join('/')
|
| 117 |
+
: this.#globList.slice(this.#index).join('/')));
|
| 118 |
+
}
|
| 119 |
+
/**
|
| 120 |
+
* true if there are more pattern parts after this one
|
| 121 |
+
*/
|
| 122 |
+
hasMore() {
|
| 123 |
+
return this.length > this.#index + 1;
|
| 124 |
+
}
|
| 125 |
+
/**
|
| 126 |
+
* The rest of the pattern after this part, or null if this is the end
|
| 127 |
+
*/
|
| 128 |
+
rest() {
|
| 129 |
+
if (this.#rest !== undefined)
|
| 130 |
+
return this.#rest;
|
| 131 |
+
if (!this.hasMore())
|
| 132 |
+
return (this.#rest = null);
|
| 133 |
+
this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform);
|
| 134 |
+
this.#rest.#isAbsolute = this.#isAbsolute;
|
| 135 |
+
this.#rest.#isUNC = this.#isUNC;
|
| 136 |
+
this.#rest.#isDrive = this.#isDrive;
|
| 137 |
+
return this.#rest;
|
| 138 |
+
}
|
| 139 |
+
/**
|
| 140 |
+
* true if the pattern represents a //unc/path/ on windows
|
| 141 |
+
*/
|
| 142 |
+
isUNC() {
|
| 143 |
+
const pl = this.#patternList;
|
| 144 |
+
return this.#isUNC !== undefined ?
|
| 145 |
+
this.#isUNC
|
| 146 |
+
: (this.#isUNC =
|
| 147 |
+
this.#platform === 'win32' &&
|
| 148 |
+
this.#index === 0 &&
|
| 149 |
+
pl[0] === '' &&
|
| 150 |
+
pl[1] === '' &&
|
| 151 |
+
typeof pl[2] === 'string' &&
|
| 152 |
+
!!pl[2] &&
|
| 153 |
+
typeof pl[3] === 'string' &&
|
| 154 |
+
!!pl[3]);
|
| 155 |
+
}
|
| 156 |
+
// pattern like C:/...
|
| 157 |
+
// split = ['C:', ...]
|
| 158 |
+
// XXX: would be nice to handle patterns like `c:*` to test the cwd
|
| 159 |
+
// in c: for *, but I don't know of a way to even figure out what that
|
| 160 |
+
// cwd is without actually chdir'ing into it?
|
| 161 |
+
/**
|
| 162 |
+
* True if the pattern starts with a drive letter on Windows
|
| 163 |
+
*/
|
| 164 |
+
isDrive() {
|
| 165 |
+
const pl = this.#patternList;
|
| 166 |
+
return this.#isDrive !== undefined ?
|
| 167 |
+
this.#isDrive
|
| 168 |
+
: (this.#isDrive =
|
| 169 |
+
this.#platform === 'win32' &&
|
| 170 |
+
this.#index === 0 &&
|
| 171 |
+
this.length > 1 &&
|
| 172 |
+
typeof pl[0] === 'string' &&
|
| 173 |
+
/^[a-z]:$/i.test(pl[0]));
|
| 174 |
+
}
|
| 175 |
+
// pattern = '/' or '/...' or '/x/...'
|
| 176 |
+
// split = ['', ''] or ['', ...] or ['', 'x', ...]
|
| 177 |
+
// Drive and UNC both considered absolute on windows
|
| 178 |
+
/**
|
| 179 |
+
* True if the pattern is rooted on an absolute path
|
| 180 |
+
*/
|
| 181 |
+
isAbsolute() {
|
| 182 |
+
const pl = this.#patternList;
|
| 183 |
+
return this.#isAbsolute !== undefined ?
|
| 184 |
+
this.#isAbsolute
|
| 185 |
+
: (this.#isAbsolute =
|
| 186 |
+
(pl[0] === '' && pl.length > 1) ||
|
| 187 |
+
this.isDrive() ||
|
| 188 |
+
this.isUNC());
|
| 189 |
+
}
|
| 190 |
+
/**
|
| 191 |
+
* consume the root of the pattern, and return it
|
| 192 |
+
*/
|
| 193 |
+
root() {
|
| 194 |
+
const p = this.#patternList[0];
|
| 195 |
+
return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ?
|
| 196 |
+
p
|
| 197 |
+
: '';
|
| 198 |
+
}
|
| 199 |
+
/**
|
| 200 |
+
* Check to see if the current globstar pattern is allowed to follow
|
| 201 |
+
* a symbolic link.
|
| 202 |
+
*/
|
| 203 |
+
checkFollowGlobstar() {
|
| 204 |
+
return !(this.#index === 0 ||
|
| 205 |
+
!this.isGlobstar() ||
|
| 206 |
+
!this.#followGlobstar);
|
| 207 |
+
}
|
| 208 |
+
/**
|
| 209 |
+
* Mark that the current globstar pattern is following a symbolic link
|
| 210 |
+
*/
|
| 211 |
+
markFollowGlobstar() {
|
| 212 |
+
if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)
|
| 213 |
+
return false;
|
| 214 |
+
this.#followGlobstar = false;
|
| 215 |
+
return true;
|
| 216 |
+
}
|
| 217 |
+
}
|
| 218 |
+
exports.Pattern = Pattern;
|
| 219 |
+
//# sourceMappingURL=pattern.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/pattern.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"pattern.js","sourceRoot":"","sources":["../../src/pattern.ts"],"names":[],"mappings":";AAAA,yEAAyE;;;AAEzE,yCAAoC;AAgBpC,MAAM,aAAa,GAAG,CAAC,EAAe,EAAqB,EAAE,CAC3D,EAAE,CAAC,MAAM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,CAAC,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,IAAI;QACF,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;QAC9B,OAAO,CACH,OAAO,CAAC,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAChE,CAAC,CAAC;YACD,CAAC;YACH,CAAC,CAAC,EAAE,CAAA;IACR,CAAC;IAED;;;OAGG;IACH,mBAAmB;QACjB,OAAO,CAAC,CACN,IAAI,CAAC,MAAM,KAAK,CAAC;YACjB,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,CAAC,IAAI,CAAC,eAAe,CACtB,CAAA;IACH,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe;YAClE,OAAO,KAAK,CAAA;QACd,IAAI,CAAC,eAAe,GAAG,KAAK,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AArOD,0BAqOC","sourcesContent":["// this is just a very light wrapper around 2 arrays with an offset index\n\nimport { GLOBSTAR } from 'minimatch'\nexport type MMPattern = string | RegExp | typeof GLOBSTAR\n\n// an array of length >= 1\nexport type PatternList = [p: MMPattern, ...rest: MMPattern[]]\nexport type UNCPatternList = [\n p0: '',\n p1: '',\n p2: string,\n p3: string,\n ...rest: MMPattern[],\n]\nexport type DrivePatternList = [p0: string, ...rest: MMPattern[]]\nexport type AbsolutePatternList = [p0: '', ...rest: MMPattern[]]\nexport type GlobList = [p: string, ...rest: string[]]\n\nconst isPatternList = (pl: MMPattern[]): pl is PatternList =>\n pl.length >= 1\nconst isGlobList = (gl: string[]): gl is GlobList => gl.length >= 1\n\n/**\n * An immutable-ish view on an array of glob parts and their parsed\n * results\n */\nexport class Pattern {\n readonly #patternList: PatternList\n readonly #globList: GlobList\n readonly #index: number\n readonly length: number\n readonly #platform: NodeJS.Platform\n #rest?: Pattern | null\n #globString?: string\n #isDrive?: boolean\n #isUNC?: boolean\n #isAbsolute?: boolean\n #followGlobstar: boolean = true\n\n constructor(\n patternList: MMPattern[],\n globList: string[],\n index: number,\n platform: NodeJS.Platform,\n ) {\n if (!isPatternList(patternList)) {\n throw new TypeError('empty pattern list')\n }\n if (!isGlobList(globList)) {\n throw new TypeError('empty glob list')\n }\n if (globList.length !== patternList.length) {\n throw new TypeError('mismatched pattern list and glob list lengths')\n }\n this.length = patternList.length\n if (index < 0 || index >= this.length) {\n throw new TypeError('index out of range')\n }\n this.#patternList = patternList\n this.#globList = globList\n this.#index = index\n this.#platform = platform\n\n // normalize root entries of absolute patterns on initial creation.\n if (this.#index === 0) {\n // c: => ['c:/']\n // C:/ => ['C:/']\n // C:/x => ['C:/', 'x']\n // //host/share => ['//host/share/']\n // //host/share/ => ['//host/share/']\n // //host/share/x => ['//host/share/', 'x']\n // /etc => ['/', 'etc']\n // / => ['/']\n if (this.isUNC()) {\n // '' / '' / 'host' / 'share'\n const [p0, p1, p2, p3, ...prest] = this.#patternList\n const [g0, g1, g2, g3, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = [p0, p1, p2, p3, ''].join('/')\n const g = [g0, g1, g2, g3, ''].join('/')\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n } else if (this.isDrive() || this.isAbsolute()) {\n const [p1, ...prest] = this.#patternList\n const [g1, ...grest] = this.#globList\n if (prest[0] === '') {\n // ends in /\n prest.shift()\n grest.shift()\n }\n const p = (p1 as string) + '/'\n const g = g1 + '/'\n this.#patternList = [p, ...prest]\n this.#globList = [g, ...grest]\n this.length = this.#patternList.length\n }\n }\n }\n\n /**\n * The first entry in the parsed list of patterns\n */\n pattern(): MMPattern {\n return this.#patternList[this.#index] as MMPattern\n }\n\n /**\n * true of if pattern() returns a string\n */\n isString(): boolean {\n return typeof this.#patternList[this.#index] === 'string'\n }\n /**\n * true of if pattern() returns GLOBSTAR\n */\n isGlobstar(): boolean {\n return this.#patternList[this.#index] === GLOBSTAR\n }\n /**\n * true if pattern() returns a regexp\n */\n isRegExp(): boolean {\n return this.#patternList[this.#index] instanceof RegExp\n }\n\n /**\n * The /-joined set of glob parts that make up this pattern\n */\n globString(): string {\n return (this.#globString =\n this.#globString ||\n (this.#index === 0 ?\n this.isAbsolute() ?\n this.#globList[0] + this.#globList.slice(1).join('/')\n : this.#globList.join('/')\n : this.#globList.slice(this.#index).join('/')))\n }\n\n /**\n * true if there are more pattern parts after this one\n */\n hasMore(): boolean {\n return this.length > this.#index + 1\n }\n\n /**\n * The rest of the pattern after this part, or null if this is the end\n */\n rest(): Pattern | null {\n if (this.#rest !== undefined) return this.#rest\n if (!this.hasMore()) return (this.#rest = null)\n this.#rest = new Pattern(\n this.#patternList,\n this.#globList,\n this.#index + 1,\n this.#platform,\n )\n this.#rest.#isAbsolute = this.#isAbsolute\n this.#rest.#isUNC = this.#isUNC\n this.#rest.#isDrive = this.#isDrive\n return this.#rest\n }\n\n /**\n * true if the pattern represents a //unc/path/ on windows\n */\n isUNC(): boolean {\n const pl = this.#patternList\n return this.#isUNC !== undefined ?\n this.#isUNC\n : (this.#isUNC =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n pl[0] === '' &&\n pl[1] === '' &&\n typeof pl[2] === 'string' &&\n !!pl[2] &&\n typeof pl[3] === 'string' &&\n !!pl[3])\n }\n\n // pattern like C:/...\n // split = ['C:', ...]\n // XXX: would be nice to handle patterns like `c:*` to test the cwd\n // in c: for *, but I don't know of a way to even figure out what that\n // cwd is without actually chdir'ing into it?\n /**\n * True if the pattern starts with a drive letter on Windows\n */\n isDrive(): boolean {\n const pl = this.#patternList\n return this.#isDrive !== undefined ?\n this.#isDrive\n : (this.#isDrive =\n this.#platform === 'win32' &&\n this.#index === 0 &&\n this.length > 1 &&\n typeof pl[0] === 'string' &&\n /^[a-z]:$/i.test(pl[0]))\n }\n\n // pattern = '/' or '/...' or '/x/...'\n // split = ['', ''] or ['', ...] or ['', 'x', ...]\n // Drive and UNC both considered absolute on windows\n /**\n * True if the pattern is rooted on an absolute path\n */\n isAbsolute(): boolean {\n const pl = this.#patternList\n return this.#isAbsolute !== undefined ?\n this.#isAbsolute\n : (this.#isAbsolute =\n (pl[0] === '' && pl.length > 1) ||\n this.isDrive() ||\n this.isUNC())\n }\n\n /**\n * consume the root of the pattern, and return it\n */\n root(): string {\n const p = this.#patternList[0]\n return (\n typeof p === 'string' && this.isAbsolute() && this.#index === 0\n ) ?\n p\n : ''\n }\n\n /**\n * Check to see if the current globstar pattern is allowed to follow\n * a symbolic link.\n */\n checkFollowGlobstar(): boolean {\n return !(\n this.#index === 0 ||\n !this.isGlobstar() ||\n !this.#followGlobstar\n )\n }\n\n /**\n * Mark that the current globstar pattern is following a symbolic link\n */\n markFollowGlobstar(): boolean {\n if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)\n return false\n this.#followGlobstar = false\n return true\n }\n}\n"]}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/processor.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { MMRegExp } from 'minimatch';
|
| 2 |
+
import { Path } from 'path-scurry';
|
| 3 |
+
import { Pattern } from './pattern.js';
|
| 4 |
+
import { GlobWalkerOpts } from './walker.js';
|
| 5 |
+
/**
|
| 6 |
+
* A cache of which patterns have been processed for a given Path
|
| 7 |
+
*/
|
| 8 |
+
export declare class HasWalkedCache {
|
| 9 |
+
store: Map<string, Set<string>>;
|
| 10 |
+
constructor(store?: Map<string, Set<string>>);
|
| 11 |
+
copy(): HasWalkedCache;
|
| 12 |
+
hasWalked(target: Path, pattern: Pattern): boolean | undefined;
|
| 13 |
+
storeWalked(target: Path, pattern: Pattern): void;
|
| 14 |
+
}
|
| 15 |
+
/**
|
| 16 |
+
* A record of which paths have been matched in a given walk step,
|
| 17 |
+
* and whether they only are considered a match if they are a directory,
|
| 18 |
+
* and whether their absolute or relative path should be returned.
|
| 19 |
+
*/
|
| 20 |
+
export declare class MatchRecord {
|
| 21 |
+
store: Map<Path, number>;
|
| 22 |
+
add(target: Path, absolute: boolean, ifDir: boolean): void;
|
| 23 |
+
entries(): [Path, boolean, boolean][];
|
| 24 |
+
}
|
| 25 |
+
/**
|
| 26 |
+
* A collection of patterns that must be processed in a subsequent step
|
| 27 |
+
* for a given path.
|
| 28 |
+
*/
|
| 29 |
+
export declare class SubWalks {
|
| 30 |
+
store: Map<Path, Pattern[]>;
|
| 31 |
+
add(target: Path, pattern: Pattern): void;
|
| 32 |
+
get(target: Path): Pattern[];
|
| 33 |
+
entries(): [Path, Pattern[]][];
|
| 34 |
+
keys(): Path[];
|
| 35 |
+
}
|
| 36 |
+
/**
|
| 37 |
+
* The class that processes patterns for a given path.
|
| 38 |
+
*
|
| 39 |
+
* Handles child entry filtering, and determining whether a path's
|
| 40 |
+
* directory contents must be read.
|
| 41 |
+
*/
|
| 42 |
+
export declare class Processor {
|
| 43 |
+
hasWalkedCache: HasWalkedCache;
|
| 44 |
+
matches: MatchRecord;
|
| 45 |
+
subwalks: SubWalks;
|
| 46 |
+
patterns?: Pattern[];
|
| 47 |
+
follow: boolean;
|
| 48 |
+
dot: boolean;
|
| 49 |
+
opts: GlobWalkerOpts;
|
| 50 |
+
constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache);
|
| 51 |
+
processPatterns(target: Path, patterns: Pattern[]): this;
|
| 52 |
+
subwalkTargets(): Path[];
|
| 53 |
+
child(): Processor;
|
| 54 |
+
filterEntries(parent: Path, entries: Path[]): Processor;
|
| 55 |
+
testGlobstar(e: Path, pattern: Pattern, rest: Pattern | null, absolute: boolean): void;
|
| 56 |
+
testRegExp(e: Path, p: MMRegExp, rest: Pattern | null, absolute: boolean): void;
|
| 57 |
+
testString(e: Path, p: string, rest: Pattern | null, absolute: boolean): void;
|
| 58 |
+
}
|
| 59 |
+
//# sourceMappingURL=processor.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/processor.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAa,OAAO,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C;;GAEG;AACH,qBAAa,cAAc;IACzB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;gBACnB,KAAK,GAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAa;IAGvD,IAAI;IAGJ,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO;IAGxC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO;CAM3C;AAED;;;;GAIG;AACH,qBAAa,WAAW;IACtB,K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tering entries and calculating subwalks
|
| 3 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 4 |
+
exports.Processor = exports.SubWalks = exports.MatchRecord = exports.HasWalkedCache = void 0;
|
| 5 |
+
const minimatch_1 = require("minimatch");
|
| 6 |
+
/**
|
| 7 |
+
* A cache of which patterns have been processed for a given Path
|
| 8 |
+
*/
|
| 9 |
+
class HasWalkedCache {
|
| 10 |
+
store;
|
| 11 |
+
constructor(store = new Map()) {
|
| 12 |
+
this.store = store;
|
| 13 |
+
}
|
| 14 |
+
copy() {
|
| 15 |
+
return new HasWalkedCache(new Map(this.store));
|
| 16 |
+
}
|
| 17 |
+
hasWalked(target, pattern) {
|
| 18 |
+
return this.store.get(target.fullpath())?.has(pattern.globString());
|
| 19 |
+
}
|
| 20 |
+
storeWalked(target, pattern) {
|
| 21 |
+
const fullpath = target.fullpath();
|
| 22 |
+
const cached = this.store.get(fullpath);
|
| 23 |
+
if (cached)
|
| 24 |
+
cached.add(pattern.globString());
|
| 25 |
+
else
|
| 26 |
+
this.store.set(fullpath, new Set([pattern.globString()]));
|
| 27 |
+
}
|
| 28 |
+
}
|
| 29 |
+
exports.HasWalkedCache = HasWalkedCache;
|
| 30 |
+
/**
|
| 31 |
+
* A record of which paths have been matched in a given walk step,
|
| 32 |
+
* and whether they only are considered a match if they are a directory,
|
| 33 |
+
* and whether their absolute or relative path should be returned.
|
| 34 |
+
*/
|
| 35 |
+
class MatchRecord {
|
| 36 |
+
store = new Map();
|
| 37 |
+
add(target, absolute, ifDir) {
|
| 38 |
+
const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0);
|
| 39 |
+
const current = this.store.get(target);
|
| 40 |
+
this.store.set(target, current === undefined ? n : n & current);
|
| 41 |
+
}
|
| 42 |
+
// match, absolute, ifdir
|
| 43 |
+
entries() {
|
| 44 |
+
return [...this.store.entries()].map(([path, n]) => [
|
| 45 |
+
path,
|
| 46 |
+
!!(n & 2),
|
| 47 |
+
!!(n & 1),
|
| 48 |
+
]);
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
exports.MatchRecord = MatchRecord;
|
| 52 |
+
/**
|
| 53 |
+
* A collection of patterns that must be processed in a subsequent step
|
| 54 |
+
* for a given path.
|
| 55 |
+
*/
|
| 56 |
+
class SubWalks {
|
| 57 |
+
store = new Map();
|
| 58 |
+
add(target, pattern) {
|
| 59 |
+
if (!target.canReaddir()) {
|
| 60 |
+
return;
|
| 61 |
+
}
|
| 62 |
+
const subs = this.store.get(target);
|
| 63 |
+
if (subs) {
|
| 64 |
+
if (!subs.find(p => p.globString() === pattern.globString())) {
|
| 65 |
+
subs.push(pattern);
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
else
|
| 69 |
+
this.store.set(target, [pattern]);
|
| 70 |
+
}
|
| 71 |
+
get(target) {
|
| 72 |
+
const subs = this.store.get(target);
|
| 73 |
+
/* c8 ignore start */
|
| 74 |
+
if (!subs) {
|
| 75 |
+
throw new Error('attempting to walk unknown path');
|
| 76 |
+
}
|
| 77 |
+
/* c8 ignore stop */
|
| 78 |
+
return subs;
|
| 79 |
+
}
|
| 80 |
+
entries() {
|
| 81 |
+
return this.keys().map(k => [k, this.store.get(k)]);
|
| 82 |
+
}
|
| 83 |
+
keys() {
|
| 84 |
+
return [...this.store.keys()].filter(t => t.canReaddir());
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
exports.SubWalks = SubWalks;
|
| 88 |
+
/**
|
| 89 |
+
* The class that processes patterns for a given path.
|
| 90 |
+
*
|
| 91 |
+
* Handles child entry filtering, and determining whether a path's
|
| 92 |
+
* directory contents must be read.
|
| 93 |
+
*/
|
| 94 |
+
class Processor {
|
| 95 |
+
hasWalkedCache;
|
| 96 |
+
matches = new MatchRecord();
|
| 97 |
+
subwalks = new SubWalks();
|
| 98 |
+
patterns;
|
| 99 |
+
follow;
|
| 100 |
+
dot;
|
| 101 |
+
opts;
|
| 102 |
+
constructor(opts, hasWalkedCache) {
|
| 103 |
+
this.opts = opts;
|
| 104 |
+
this.follow = !!opts.follow;
|
| 105 |
+
this.dot = !!opts.dot;
|
| 106 |
+
this.hasWalkedCache =
|
| 107 |
+
hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache();
|
| 108 |
+
}
|
| 109 |
+
processPatterns(target, patterns) {
|
| 110 |
+
this.patterns = patterns;
|
| 111 |
+
const processingSet = patterns.map(p => [target, p]);
|
| 112 |
+
// map of paths to the magic-starting subwalks they need to walk
|
| 113 |
+
// first item in patterns is the filter
|
| 114 |
+
for (let [t, pattern] of processingSet) {
|
| 115 |
+
this.hasWalkedCache.storeWalked(t, pattern);
|
| 116 |
+
const root = pattern.root();
|
| 117 |
+
const absolute = pattern.isAbsolute() && this.opts.absolute !== false;
|
| 118 |
+
// start absolute patterns at root
|
| 119 |
+
if (root) {
|
| 120 |
+
t = t.resolve(root === '/' && this.opts.root !== undefined ?
|
| 121 |
+
this.opts.root
|
| 122 |
+
: root);
|
| 123 |
+
const rest = pattern.rest();
|
| 124 |
+
if (!rest) {
|
| 125 |
+
this.matches.add(t, true, false);
|
| 126 |
+
continue;
|
| 127 |
+
}
|
| 128 |
+
else {
|
| 129 |
+
pattern = rest;
|
| 130 |
+
}
|
| 131 |
+
}
|
| 132 |
+
if (t.isENOENT())
|
| 133 |
+
continue;
|
| 134 |
+
let p;
|
| 135 |
+
let rest;
|
| 136 |
+
let changed = false;
|
| 137 |
+
while (typeof (p = pattern.pattern()) === 'string' &&
|
| 138 |
+
(rest = pattern.rest())) {
|
| 139 |
+
const c = t.resolve(p);
|
| 140 |
+
t = c;
|
| 141 |
+
pattern = rest;
|
| 142 |
+
changed = true;
|
| 143 |
+
}
|
| 144 |
+
p = pattern.pattern();
|
| 145 |
+
rest = pattern.rest();
|
| 146 |
+
if (changed) {
|
| 147 |
+
if (this.hasWalkedCache.hasWalked(t, pattern))
|
| 148 |
+
continue;
|
| 149 |
+
this.hasWalkedCache.storeWalked(t, pattern);
|
| 150 |
+
}
|
| 151 |
+
// now we have either a final string for a known entry,
|
| 152 |
+
// more strings for an unknown entry,
|
| 153 |
+
// or a pattern starting with magic, mounted on t.
|
| 154 |
+
if (typeof p === 'string') {
|
| 155 |
+
// must not be final entry, otherwise we would have
|
| 156 |
+
// concatenated it earlier.
|
| 157 |
+
const ifDir = p === '..' || p === '' || p === '.';
|
| 158 |
+
this.matches.add(t.resolve(p), absolute, ifDir);
|
| 159 |
+
continue;
|
| 160 |
+
}
|
| 161 |
+
else if (p === minimatch_1.GLOBSTAR) {
|
| 162 |
+
// if no rest, match and subwalk pattern
|
| 163 |
+
// if rest, process rest and subwalk pattern
|
| 164 |
+
// if it's a symlink, but we didn't get here by way of a
|
| 165 |
+
// globstar match (meaning it's the first time THIS globstar
|
| 166 |
+
// has traversed a symlink), then we follow it. Otherwise, stop.
|
| 167 |
+
if (!t.isSymbolicLink() ||
|
| 168 |
+
this.follow ||
|
| 169 |
+
pattern.checkFollowGlobstar()) {
|
| 170 |
+
this.subwalks.add(t, pattern);
|
| 171 |
+
}
|
| 172 |
+
const rp = rest?.pattern();
|
| 173 |
+
const rrest = rest?.rest();
|
| 174 |
+
if (!rest || ((rp === '' || rp === '.') && !rrest)) {
|
| 175 |
+
// only HAS to be a dir if it ends in **/ or **/.
|
| 176 |
+
// but ending in ** will match files as well.
|
| 177 |
+
this.matches.add(t, absolute, rp === '' || rp === '.');
|
| 178 |
+
}
|
| 179 |
+
else {
|
| 180 |
+
if (rp === '..') {
|
| 181 |
+
// this would mean you're matching **/.. at the fs root,
|
| 182 |
+
// and no thanks, I'm not gonna test that specific case.
|
| 183 |
+
/* c8 ignore start */
|
| 184 |
+
const tp = t.parent || t;
|
| 185 |
+
/* c8 ignore stop */
|
| 186 |
+
if (!rrest)
|
| 187 |
+
this.matches.add(tp, absolute, true);
|
| 188 |
+
else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {
|
| 189 |
+
this.subwalks.add(tp, rrest);
|
| 190 |
+
}
|
| 191 |
+
}
|
| 192 |
+
}
|
| 193 |
+
}
|
| 194 |
+
else if (p instanceof RegExp) {
|
| 195 |
+
this.subwalks.add(t, pattern);
|
| 196 |
+
}
|
| 197 |
+
}
|
| 198 |
+
return this;
|
| 199 |
+
}
|
| 200 |
+
subwalkTargets() {
|
| 201 |
+
return this.subwalks.keys();
|
| 202 |
+
}
|
| 203 |
+
child() {
|
| 204 |
+
return new Processor(this.opts, this.hasWalkedCache);
|
| 205 |
+
}
|
| 206 |
+
// return a new Processor containing the subwalks for each
|
| 207 |
+
// child entry, and a set of matches, and
|
| 208 |
+
// a hasWalkedCache that's a copy of this one
|
| 209 |
+
// then we're going to call
|
| 210 |
+
filterEntries(parent, entries) {
|
| 211 |
+
const patterns = this.subwalks.get(parent);
|
| 212 |
+
// put matches and entry walks into the results processor
|
| 213 |
+
const results = this.child();
|
| 214 |
+
for (const e of entries) {
|
| 215 |
+
for (const pattern of patterns) {
|
| 216 |
+
const absolute = pattern.isAbsolute();
|
| 217 |
+
const p = pattern.pattern();
|
| 218 |
+
const rest = pattern.rest();
|
| 219 |
+
if (p === minimatch_1.GLOBSTAR) {
|
| 220 |
+
results.testGlobstar(e, pattern, rest, absolute);
|
| 221 |
+
}
|
| 222 |
+
else if (p instanceof RegExp) {
|
| 223 |
+
results.testRegExp(e, p, rest, absolute);
|
| 224 |
+
}
|
| 225 |
+
else {
|
| 226 |
+
results.testString(e, p, rest, absolute);
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
}
|
| 230 |
+
return results;
|
| 231 |
+
}
|
| 232 |
+
testGlobstar(e, pattern, rest, absolute) {
|
| 233 |
+
if (this.dot || !e.name.startsWith('.')) {
|
| 234 |
+
if (!pattern.hasMore()) {
|
| 235 |
+
this.matches.add(e, absolute, false);
|
| 236 |
+
}
|
| 237 |
+
if (e.canReaddir()) {
|
| 238 |
+
// if we're in follow mode or it's not a symlink, just keep
|
| 239 |
+
// testing the same pattern. If there's more after the globstar,
|
| 240 |
+
// then this symlink consumes the globstar. If not, then we can
|
| 241 |
+
// follow at most ONE symlink along the way, so we mark it, which
|
| 242 |
+
// also checks to ensure that it wasn't already marked.
|
| 243 |
+
if (this.follow || !e.isSymbolicLink()) {
|
| 244 |
+
this.subwalks.add(e, pattern);
|
| 245 |
+
}
|
| 246 |
+
else if (e.isSymbolicLink()) {
|
| 247 |
+
if (rest && pattern.checkFollowGlobstar()) {
|
| 248 |
+
this.subwalks.add(e, rest);
|
| 249 |
+
}
|
| 250 |
+
else if (pattern.markFollowGlobstar()) {
|
| 251 |
+
this.subwalks.add(e, pattern);
|
| 252 |
+
}
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
}
|
| 256 |
+
// if the NEXT thing matches this entry, then also add
|
| 257 |
+
// the rest.
|
| 258 |
+
if (rest) {
|
| 259 |
+
const rp = rest.pattern();
|
| 260 |
+
if (typeof rp === 'string' &&
|
| 261 |
+
// dots and empty were handled already
|
| 262 |
+
rp !== '..' &&
|
| 263 |
+
rp !== '' &&
|
| 264 |
+
rp !== '.') {
|
| 265 |
+
this.testString(e, rp, rest.rest(), absolute);
|
| 266 |
+
}
|
| 267 |
+
else if (rp === '..') {
|
| 268 |
+
/* c8 ignore start */
|
| 269 |
+
const ep = e.parent || e;
|
| 270 |
+
/* c8 ignore stop */
|
| 271 |
+
this.subwalks.add(ep, rest);
|
| 272 |
+
}
|
| 273 |
+
else if (rp instanceof RegExp) {
|
| 274 |
+
this.testRegExp(e, rp, rest.rest(), absolute);
|
| 275 |
+
}
|
| 276 |
+
}
|
| 277 |
+
}
|
| 278 |
+
testRegExp(e, p, rest, absolute) {
|
| 279 |
+
if (!p.test(e.name))
|
| 280 |
+
return;
|
| 281 |
+
if (!rest) {
|
| 282 |
+
this.matches.add(e, absolute, false);
|
| 283 |
+
}
|
| 284 |
+
else {
|
| 285 |
+
this.subwalks.add(e, rest);
|
| 286 |
+
}
|
| 287 |
+
}
|
| 288 |
+
testString(e, p, rest, absolute) {
|
| 289 |
+
// should never happen?
|
| 290 |
+
if (!e.isNamed(p))
|
| 291 |
+
return;
|
| 292 |
+
if (!rest) {
|
| 293 |
+
this.matches.add(e, absolute, false);
|
| 294 |
+
}
|
| 295 |
+
else {
|
| 296 |
+
this.subwalks.add(e, rest);
|
| 297 |
+
}
|
| 298 |
+
}
|
| 299 |
+
}
|
| 300 |
+
exports.Processor = Processor;
|
| 301 |
+
//# sourceMappingURL=processor.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/processor.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"processor.js","sourceRoot":"","sources":["../../src/processor.ts"],"names":[],"mappings":";AAAA,qEAAqE;;;AAErE,yCAA8C;AAK9C;;GAEG;AACH,MAAa,cAAc;IACzB,KAAK,CAA0B;IAC/B,YAAY,QAAkC,IAAI,GAAG,EAAE;QACrD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;IACD,IAAI;QACF,OAAO,IAAI,cAAc,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAChD,CAAC;IACD,SAAS,CAAC,MAAY,EAAE,OAAgB;QACtC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;IACrE,CAAC;IACD,WAAW,CAAC,MAAY,EAAE,OAAgB;QACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;QAClC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QACvC,IAAI,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAA;;YACvC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,UAAU,EA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C;aAAM,CAAC;YACN,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;CACF;AA9ND,8BA8NC","sourcesContent":["// synchronous utility for filtering entries and calculating subwalks\n\nimport { GLOBSTAR, MMRegExp } from 'minimatch'\nimport { Path } from 'path-scurry'\nimport { MMPattern, Pattern } from './pattern.js'\nimport { GlobWalkerOpts } from './walker.js'\n\n/**\n * A cache of which patterns have been processed for a given Path\n */\nexport class HasWalkedCache {\n store: Map<string, Set<string>>\n constructor(store: Map<string, Set<string>> = new Map()) {\n this.store = store\n }\n copy() {\n return new HasWalkedCache(new Map(this.store))\n }\n hasWalked(target: Path, pattern: Pattern) {\n return this.store.get(target.fullpath())?.has(pattern.globString())\n }\n storeWalked(target: Path, pattern: Pattern) {\n const fullpath = target.fullpath()\n const cached = this.store.get(fullpath)\n if (cached) cached.add(pattern.globString())\n else this.store.set(fullpath, new Set([pattern.globString()]))\n }\n}\n\n/**\n * A record of which paths have been matched in a given walk step,\n * and whether they only are considered a match if they are a directory,\n * and whether their absolute or relative path should be returned.\n */\nexport class MatchRecord {\n store: Map<Path, number> = new Map()\n add(target: Path, absolute: boolean, ifDir: boolean) {\n const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0)\n const current = this.store.get(target)\n this.store.set(target, current === undefined ? n : n & current)\n }\n // match, absolute, ifdir\n entries(): [Path, boolean, boolean][] {\n return [...this.store.entries()].map(([path, n]) => [\n path,\n !!(n & 2),\n !!(n & 1),\n ])\n }\n}\n\n/**\n * A collection of patterns that must be processed in a subsequent step\n * for a given path.\n */\nexport class SubWalks {\n store: Map<Path, Pattern[]> = new Map()\n add(target: Path, pattern: Pattern) {\n if (!target.canReaddir()) {\n return\n }\n const subs = this.store.get(target)\n if (subs) {\n if (!subs.find(p => p.globString() === pattern.globString())) {\n subs.push(pattern)\n }\n } else this.store.set(target, [pattern])\n }\n get(target: Path): Pattern[] {\n const subs = this.store.get(target)\n /* c8 ignore start */\n if (!subs) {\n throw new Error('attempting to walk unknown path')\n }\n /* c8 ignore stop */\n return subs\n }\n entries(): [Path, Pattern[]][] {\n return this.keys().map(k => [k, this.store.get(k) as Pattern[]])\n }\n keys(): Path[] {\n return [...this.store.keys()].filter(t => t.canReaddir())\n }\n}\n\n/**\n * The class that processes patterns for a given path.\n *\n * Handles child entry filtering, and determining whether a path's\n * directory contents must be read.\n */\nexport class Processor {\n hasWalkedCache: HasWalkedCache\n matches = new MatchRecord()\n subwalks = new SubWalks()\n patterns?: Pattern[]\n follow: boolean\n dot: boolean\n opts: GlobWalkerOpts\n\n constructor(opts: GlobWalkerOpts, hasWalkedCache?: HasWalkedCache) {\n this.opts = opts\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.hasWalkedCache =\n hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache()\n }\n\n processPatterns(target: Path, patterns: Pattern[]) {\n this.patterns = patterns\n const processingSet: [Path, Pattern][] = patterns.map(p => [target, p])\n\n // map of paths to the magic-starting subwalks they need to walk\n // first item in patterns is the filter\n\n for (let [t, pattern] of processingSet) {\n this.hasWalkedCache.storeWalked(t, pattern)\n\n const root = pattern.root()\n const absolute = pattern.isAbsolute() && this.opts.absolute !== false\n\n // start absolute patterns at root\n if (root) {\n t = t.resolve(\n root === '/' && this.opts.root !== undefined ?\n this.opts.root\n : root,\n )\n const rest = pattern.rest()\n if (!rest) {\n this.matches.add(t, true, false)\n continue\n } else {\n pattern = rest\n }\n }\n\n if (t.isENOENT()) continue\n\n let p: MMPattern\n let rest: Pattern | null\n let changed = false\n while (\n typeof (p = pattern.pattern()) === 'string' &&\n (rest = pattern.rest())\n ) {\n const c = t.resolve(p)\n t = c\n pattern = rest\n changed = true\n }\n p = pattern.pattern()\n rest = pattern.rest()\n if (changed) {\n if (this.hasWalkedCache.hasWalked(t, pattern)) continue\n this.hasWalkedCache.storeWalked(t, pattern)\n }\n\n // now we have either a final string for a known entry,\n // more strings for an unknown entry,\n // or a pattern starting with magic, mounted on t.\n if (typeof p === 'string') {\n // must not be final entry, otherwise we would have\n // concatenated it earlier.\n const ifDir = p === '..' || p === '' || p === '.'\n this.matches.add(t.resolve(p), absolute, ifDir)\n continue\n } else if (p === GLOBSTAR) {\n // if no rest, match and subwalk pattern\n // if rest, process rest and subwalk pattern\n // if it's a symlink, but we didn't get here by way of a\n // globstar match (meaning it's the first time THIS globstar\n // has traversed a symlink), then we follow it. Otherwise, stop.\n if (\n !t.isSymbolicLink() ||\n this.follow ||\n pattern.checkFollowGlobstar()\n ) {\n this.subwalks.add(t, pattern)\n }\n const rp = rest?.pattern()\n const rrest = rest?.rest()\n if (!rest || ((rp === '' || rp === '.') && !rrest)) {\n // only HAS to be a dir if it ends in **/ or **/.\n // but ending in ** will match files as well.\n this.matches.add(t, absolute, rp === '' || rp === '.')\n } else {\n if (rp === '..') {\n // this would mean you're matching **/.. at the fs root,\n // and no thanks, I'm not gonna test that specific case.\n /* c8 ignore start */\n const tp = t.parent || t\n /* c8 ignore stop */\n if (!rrest) this.matches.add(tp, absolute, true)\n else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {\n this.subwalks.add(tp, rrest)\n }\n }\n }\n } else if (p instanceof RegExp) {\n this.subwalks.add(t, pattern)\n }\n }\n\n return this\n }\n\n subwalkTargets(): Path[] {\n return this.subwalks.keys()\n }\n\n child() {\n return new Processor(this.opts, this.hasWalkedCache)\n }\n\n // return a new Processor containing the subwalks for each\n // child entry, and a set of matches, and\n // a hasWalkedCache that's a copy of this one\n // then we're going to call\n filterEntries(parent: Path, entries: Path[]): Processor {\n const patterns = this.subwalks.get(parent)\n // put matches and entry walks into the results processor\n const results = this.child()\n for (const e of entries) {\n for (const pattern of patterns) {\n const absolute = pattern.isAbsolute()\n const p = pattern.pattern()\n const rest = pattern.rest()\n if (p === GLOBSTAR) {\n results.testGlobstar(e, pattern, rest, absolute)\n } else if (p instanceof RegExp) {\n results.testRegExp(e, p, rest, absolute)\n } else {\n results.testString(e, p, rest, absolute)\n }\n }\n }\n return results\n }\n\n testGlobstar(\n e: Path,\n pattern: Pattern,\n rest: Pattern | null,\n absolute: boolean,\n ) {\n if (this.dot || !e.name.startsWith('.')) {\n if (!pattern.hasMore()) {\n this.matches.add(e, absolute, false)\n }\n if (e.canReaddir()) {\n // if we're in follow mode or it's not a symlink, just keep\n // testing the same pattern. If there's more after the globstar,\n // then this symlink consumes the globstar. If not, then we can\n // follow at most ONE symlink along the way, so we mark it, which\n // also checks to ensure that it wasn't already marked.\n if (this.follow || !e.isSymbolicLink()) {\n this.subwalks.add(e, pattern)\n } else if (e.isSymbolicLink()) {\n if (rest && pattern.checkFollowGlobstar()) {\n this.subwalks.add(e, rest)\n } else if (pattern.markFollowGlobstar()) {\n this.subwalks.add(e, pattern)\n }\n }\n }\n }\n // if the NEXT thing matches this entry, then also add\n // the rest.\n if (rest) {\n const rp = rest.pattern()\n if (\n typeof rp === 'string' &&\n // dots and empty were handled already\n rp !== '..' &&\n rp !== '' &&\n rp !== '.'\n ) {\n this.testString(e, rp, rest.rest(), absolute)\n } else if (rp === '..') {\n /* c8 ignore start */\n const ep = e.parent || e\n /* c8 ignore stop */\n this.subwalks.add(ep, rest)\n } else if (rp instanceof RegExp) {\n this.testRegExp(e, rp, rest.rest(), absolute)\n }\n }\n }\n\n testRegExp(\n e: Path,\n p: MMRegExp,\n rest: Pattern | null,\n absolute: boolean,\n ) {\n if (!p.test(e.name)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n\n testString(e: Path, p: string, rest: Pattern | null, absolute: boolean) {\n // should never happen?\n if (!e.isNamed(p)) return\n if (!rest) {\n this.matches.add(e, absolute, false)\n } else {\n this.subwalks.add(e, rest)\n }\n }\n}\n"]}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/walker.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Single-use utility classes to provide functionality to the {@link Glob}
|
| 3 |
+
* methods.
|
| 4 |
+
*
|
| 5 |
+
* @module
|
| 6 |
+
*/
|
| 7 |
+
import { Minipass } from 'minipass';
|
| 8 |
+
import { Path } from 'path-scurry';
|
| 9 |
+
import { IgnoreLike } from './ignore.js';
|
| 10 |
+
import { Pattern } from './pattern.js';
|
| 11 |
+
import { Processor } from './processor.js';
|
| 12 |
+
export interface GlobWalkerOpts {
|
| 13 |
+
absolute?: boolean;
|
| 14 |
+
allowWindowsEscape?: boolean;
|
| 15 |
+
cwd?: string | URL;
|
| 16 |
+
dot?: boolean;
|
| 17 |
+
dotRelative?: boolean;
|
| 18 |
+
follow?: boolean;
|
| 19 |
+
ignore?: string | string[] | IgnoreLike;
|
| 20 |
+
mark?: boolean;
|
| 21 |
+
matchBase?: boolean;
|
| 22 |
+
maxDepth?: number;
|
| 23 |
+
nobrace?: boolean;
|
| 24 |
+
nocase?: boolean;
|
| 25 |
+
nodir?: boolean;
|
| 26 |
+
noext?: boolean;
|
| 27 |
+
noglobstar?: boolean;
|
| 28 |
+
platform?: NodeJS.Platform;
|
| 29 |
+
posix?: boolean;
|
| 30 |
+
realpath?: boolean;
|
| 31 |
+
root?: string;
|
| 32 |
+
stat?: boolean;
|
| 33 |
+
signal?: AbortSignal;
|
| 34 |
+
windowsPathsNoEscape?: boolean;
|
| 35 |
+
withFileTypes?: boolean;
|
| 36 |
+
includeChildMatches?: boolean;
|
| 37 |
+
}
|
| 38 |
+
export type GWOFileTypesTrue = GlobWalkerOpts & {
|
| 39 |
+
withFileTypes: true;
|
| 40 |
+
};
|
| 41 |
+
export type GWOFileTypesFalse = GlobWalkerOpts & {
|
| 42 |
+
withFileTypes: false;
|
| 43 |
+
};
|
| 44 |
+
export type GWOFileTypesUnset = GlobWalkerOpts & {
|
| 45 |
+
withFileTypes?: undefined;
|
| 46 |
+
};
|
| 47 |
+
export type Result<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Path : O extends GWOFileTypesFalse ? string : O extends GWOFileTypesUnset ? string : Path | string;
|
| 48 |
+
export type Matches<O extends GlobWalkerOpts> = O extends GWOFileTypesTrue ? Set<Path> : O extends GWOFileTypesFalse ? Set<string> : O extends GWOFileTypesUnset ? Set<string> : Set<Path | string>;
|
| 49 |
+
export type MatchStream<O extends GlobWalkerOpts> = Minipass<Result<O>, Result<O>>;
|
| 50 |
+
/**
|
| 51 |
+
* basic walking utilities that all the glob walker types use
|
| 52 |
+
*/
|
| 53 |
+
export declare abstract class GlobUtil<O extends GlobWalkerOpts = GlobWalkerOpts> {
|
| 54 |
+
#private;
|
| 55 |
+
path: Path;
|
| 56 |
+
patterns: Pattern[];
|
| 57 |
+
opts: O;
|
| 58 |
+
seen: Set<Path>;
|
| 59 |
+
paused: boolean;
|
| 60 |
+
aborted: boolean;
|
| 61 |
+
signal?: AbortSignal;
|
| 62 |
+
maxDepth: number;
|
| 63 |
+
includeChildMatches: boolean;
|
| 64 |
+
constructor(patterns: Pattern[], path: Path, opts: O);
|
| 65 |
+
pause(): void;
|
| 66 |
+
resume(): void;
|
| 67 |
+
onResume(fn: () => any): void;
|
| 68 |
+
matchCheck(e: Path, ifDir: boolean): Promise<Path | undefined>;
|
| 69 |
+
matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined;
|
| 70 |
+
matchCheckSync(e: Path, ifDir: boolean): Path | undefined;
|
| 71 |
+
abstract matchEmit(p: Result<O>): void;
|
| 72 |
+
abstract matchEmit(p: string | Path): void;
|
| 73 |
+
matchFinish(e: Path, absolute: boolean): void;
|
| 74 |
+
match(e: Path, absolute: boolean, ifDir: boolean): Promise<void>;
|
| 75 |
+
matchSync(e: Path, absolute: boolean, ifDir: boolean): void;
|
| 76 |
+
walkCB(target: Path, patterns: Pattern[], cb: () => any): void;
|
| 77 |
+
walkCB2(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
| 78 |
+
walkCB3(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
| 79 |
+
walkCBSync(target: Path, patterns: Pattern[], cb: () => any): void;
|
| 80 |
+
walkCB2Sync(target: Path, patterns: Pattern[], processor: Processor, cb: () => any): any;
|
| 81 |
+
walkCB3Sync(target: Path, entries: Path[], processor: Processor, cb: () => any): void;
|
| 82 |
+
}
|
| 83 |
+
export declare class GlobWalker<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
| 84 |
+
matches: Set<Result<O>>;
|
| 85 |
+
constructor(patterns: Pattern[], path: Path, opts: O);
|
| 86 |
+
matchEmit(e: Result<O>): void;
|
| 87 |
+
walk(): Promise<Set<Result<O>>>;
|
| 88 |
+
walkSync(): Set<Result<O>>;
|
| 89 |
+
}
|
| 90 |
+
export declare class GlobStream<O extends GlobWalkerOpts = GlobWalkerOpts> extends GlobUtil<O> {
|
| 91 |
+
results: Minipass<Result<O>, Result<O>>;
|
| 92 |
+
constructor(patterns: Pattern[], path: Path, opts: O);
|
| 93 |
+
matchEmit(e: Result<O>): void;
|
| 94 |
+
stream(): MatchStream<O>;
|
| 95 |
+
streamSync(): MatchStream<O>;
|
| 96 |
+
}
|
| 97 |
+
//# sourceMappingURL=walker.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/walker.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"walker.d.ts","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAU,UAAU,EAAE,MAAM,aAAa,CAAA;AAOhD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE1C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,CAAA;IACvC,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,OAAO,CAAA;IAGnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,UAAU,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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"use strict";
|
| 2 |
+
Object.defineProperty(exports, "__esModule", { value: true });
|
| 3 |
+
exports.GlobStream = exports.GlobWalker = exports.GlobUtil = void 0;
|
| 4 |
+
/**
|
| 5 |
+
* Single-use utility classes to provide functionality to the {@link Glob}
|
| 6 |
+
* methods.
|
| 7 |
+
*
|
| 8 |
+
* @module
|
| 9 |
+
*/
|
| 10 |
+
const minipass_1 = require("minipass");
|
| 11 |
+
const ignore_js_1 = require("./ignore.js");
|
| 12 |
+
const processor_js_1 = require("./processor.js");
|
| 13 |
+
const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new ignore_js_1.Ignore([ignore], opts)
|
| 14 |
+
: Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts)
|
| 15 |
+
: ignore;
|
| 16 |
+
/**
|
| 17 |
+
* basic walking utilities that all the glob walker types use
|
| 18 |
+
*/
|
| 19 |
+
class GlobUtil {
|
| 20 |
+
path;
|
| 21 |
+
patterns;
|
| 22 |
+
opts;
|
| 23 |
+
seen = new Set();
|
| 24 |
+
paused = false;
|
| 25 |
+
aborted = false;
|
| 26 |
+
#onResume = [];
|
| 27 |
+
#ignore;
|
| 28 |
+
#sep;
|
| 29 |
+
signal;
|
| 30 |
+
maxDepth;
|
| 31 |
+
includeChildMatches;
|
| 32 |
+
constructor(patterns, path, opts) {
|
| 33 |
+
this.patterns = patterns;
|
| 34 |
+
this.path = path;
|
| 35 |
+
this.opts = opts;
|
| 36 |
+
this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/';
|
| 37 |
+
this.includeChildMatches = opts.includeChildMatches !== false;
|
| 38 |
+
if (opts.ignore || !this.includeChildMatches) {
|
| 39 |
+
this.#ignore = makeIgnore(opts.ignore ?? [], opts);
|
| 40 |
+
if (!this.includeChildMatches &&
|
| 41 |
+
typeof this.#ignore.add !== 'function') {
|
| 42 |
+
const m = 'cannot ignore child matches, ignore lacks add() method.';
|
| 43 |
+
throw new Error(m);
|
| 44 |
+
}
|
| 45 |
+
}
|
| 46 |
+
// ignore, always set with maxDepth, but it's optional on the
|
| 47 |
+
// GlobOptions type
|
| 48 |
+
/* c8 ignore start */
|
| 49 |
+
this.maxDepth = opts.maxDepth || Infinity;
|
| 50 |
+
/* c8 ignore stop */
|
| 51 |
+
if (opts.signal) {
|
| 52 |
+
this.signal = opts.signal;
|
| 53 |
+
this.signal.addEventListener('abort', () => {
|
| 54 |
+
this.#onResume.length = 0;
|
| 55 |
+
});
|
| 56 |
+
}
|
| 57 |
+
}
|
| 58 |
+
#ignored(path) {
|
| 59 |
+
return this.seen.has(path) || !!this.#ignore?.ignored?.(path);
|
| 60 |
+
}
|
| 61 |
+
#childrenIgnored(path) {
|
| 62 |
+
return !!this.#ignore?.childrenIgnored?.(path);
|
| 63 |
+
}
|
| 64 |
+
// backpressure mechanism
|
| 65 |
+
pause() {
|
| 66 |
+
this.paused = true;
|
| 67 |
+
}
|
| 68 |
+
resume() {
|
| 69 |
+
/* c8 ignore start */
|
| 70 |
+
if (this.signal?.aborted)
|
| 71 |
+
return;
|
| 72 |
+
/* c8 ignore stop */
|
| 73 |
+
this.paused = false;
|
| 74 |
+
let fn = undefined;
|
| 75 |
+
while (!this.paused && (fn = this.#onResume.shift())) {
|
| 76 |
+
fn();
|
| 77 |
+
}
|
| 78 |
+
}
|
| 79 |
+
onResume(fn) {
|
| 80 |
+
if (this.signal?.aborted)
|
| 81 |
+
return;
|
| 82 |
+
/* c8 ignore start */
|
| 83 |
+
if (!this.paused) {
|
| 84 |
+
fn();
|
| 85 |
+
}
|
| 86 |
+
else {
|
| 87 |
+
/* c8 ignore stop */
|
| 88 |
+
this.#onResume.push(fn);
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
// do the requisite realpath/stat checking, and return the path
|
| 92 |
+
// to add or undefined to filter it out.
|
| 93 |
+
async matchCheck(e, ifDir) {
|
| 94 |
+
if (ifDir && this.opts.nodir)
|
| 95 |
+
return undefined;
|
| 96 |
+
let rpc;
|
| 97 |
+
if (this.opts.realpath) {
|
| 98 |
+
rpc = e.realpathCached() || (await e.realpath());
|
| 99 |
+
if (!rpc)
|
| 100 |
+
return undefined;
|
| 101 |
+
e = rpc;
|
| 102 |
+
}
|
| 103 |
+
const needStat = e.isUnknown() || this.opts.stat;
|
| 104 |
+
const s = needStat ? await e.lstat() : e;
|
| 105 |
+
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
|
| 106 |
+
const target = await s.realpath();
|
| 107 |
+
/* c8 ignore start */
|
| 108 |
+
if (target && (target.isUnknown() || this.opts.stat)) {
|
| 109 |
+
await target.lstat();
|
| 110 |
+
}
|
| 111 |
+
/* c8 ignore stop */
|
| 112 |
+
}
|
| 113 |
+
return this.matchCheckTest(s, ifDir);
|
| 114 |
+
}
|
| 115 |
+
matchCheckTest(e, ifDir) {
|
| 116 |
+
return (e &&
|
| 117 |
+
(this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
|
| 118 |
+
(!ifDir || e.canReaddir()) &&
|
| 119 |
+
(!this.opts.nodir || !e.isDirectory()) &&
|
| 120 |
+
(!this.opts.nodir ||
|
| 121 |
+
!this.opts.follow ||
|
| 122 |
+
!e.isSymbolicLink() ||
|
| 123 |
+
!e.realpathCached()?.isDirectory()) &&
|
| 124 |
+
!this.#ignored(e)) ?
|
| 125 |
+
e
|
| 126 |
+
: undefined;
|
| 127 |
+
}
|
| 128 |
+
matchCheckSync(e, ifDir) {
|
| 129 |
+
if (ifDir && this.opts.nodir)
|
| 130 |
+
return undefined;
|
| 131 |
+
let rpc;
|
| 132 |
+
if (this.opts.realpath) {
|
| 133 |
+
rpc = e.realpathCached() || e.realpathSync();
|
| 134 |
+
if (!rpc)
|
| 135 |
+
return undefined;
|
| 136 |
+
e = rpc;
|
| 137 |
+
}
|
| 138 |
+
const needStat = e.isUnknown() || this.opts.stat;
|
| 139 |
+
const s = needStat ? e.lstatSync() : e;
|
| 140 |
+
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
|
| 141 |
+
const target = s.realpathSync();
|
| 142 |
+
if (target && (target?.isUnknown() || this.opts.stat)) {
|
| 143 |
+
target.lstatSync();
|
| 144 |
+
}
|
| 145 |
+
}
|
| 146 |
+
return this.matchCheckTest(s, ifDir);
|
| 147 |
+
}
|
| 148 |
+
matchFinish(e, absolute) {
|
| 149 |
+
if (this.#ignored(e))
|
| 150 |
+
return;
|
| 151 |
+
// we know we have an ignore if this is false, but TS doesn't
|
| 152 |
+
if (!this.includeChildMatches && this.#ignore?.add) {
|
| 153 |
+
const ign = `${e.relativePosix()}/**`;
|
| 154 |
+
this.#ignore.add(ign);
|
| 155 |
+
}
|
| 156 |
+
const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute;
|
| 157 |
+
this.seen.add(e);
|
| 158 |
+
const mark = this.opts.mark && e.isDirectory() ? this.#sep : '';
|
| 159 |
+
// ok, we have what we need!
|
| 160 |
+
if (this.opts.withFileTypes) {
|
| 161 |
+
this.matchEmit(e);
|
| 162 |
+
}
|
| 163 |
+
else if (abs) {
|
| 164 |
+
const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath();
|
| 165 |
+
this.matchEmit(abs + mark);
|
| 166 |
+
}
|
| 167 |
+
else {
|
| 168 |
+
const rel = this.opts.posix ? e.relativePosix() : e.relative();
|
| 169 |
+
const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?
|
| 170 |
+
'.' + this.#sep
|
| 171 |
+
: '';
|
| 172 |
+
this.matchEmit(!rel ? '.' + mark : pre + rel + mark);
|
| 173 |
+
}
|
| 174 |
+
}
|
| 175 |
+
async match(e, absolute, ifDir) {
|
| 176 |
+
const p = await this.matchCheck(e, ifDir);
|
| 177 |
+
if (p)
|
| 178 |
+
this.matchFinish(p, absolute);
|
| 179 |
+
}
|
| 180 |
+
matchSync(e, absolute, ifDir) {
|
| 181 |
+
const p = this.matchCheckSync(e, ifDir);
|
| 182 |
+
if (p)
|
| 183 |
+
this.matchFinish(p, absolute);
|
| 184 |
+
}
|
| 185 |
+
walkCB(target, patterns, cb) {
|
| 186 |
+
/* c8 ignore start */
|
| 187 |
+
if (this.signal?.aborted)
|
| 188 |
+
cb();
|
| 189 |
+
/* c8 ignore stop */
|
| 190 |
+
this.walkCB2(target, patterns, new processor_js_1.Processor(this.opts), cb);
|
| 191 |
+
}
|
| 192 |
+
walkCB2(target, patterns, processor, cb) {
|
| 193 |
+
if (this.#childrenIgnored(target))
|
| 194 |
+
return cb();
|
| 195 |
+
if (this.signal?.aborted)
|
| 196 |
+
cb();
|
| 197 |
+
if (this.paused) {
|
| 198 |
+
this.onResume(() => this.walkCB2(target, patterns, processor, cb));
|
| 199 |
+
return;
|
| 200 |
+
}
|
| 201 |
+
processor.processPatterns(target, patterns);
|
| 202 |
+
// done processing. all of the above is sync, can be abstracted out.
|
| 203 |
+
// subwalks is a map of paths to the entry filters they need
|
| 204 |
+
// matches is a map of paths to [absolute, ifDir] tuples.
|
| 205 |
+
let tasks = 1;
|
| 206 |
+
const next = () => {
|
| 207 |
+
if (--tasks === 0)
|
| 208 |
+
cb();
|
| 209 |
+
};
|
| 210 |
+
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
| 211 |
+
if (this.#ignored(m))
|
| 212 |
+
continue;
|
| 213 |
+
tasks++;
|
| 214 |
+
this.match(m, absolute, ifDir).then(() => next());
|
| 215 |
+
}
|
| 216 |
+
for (const t of processor.subwalkTargets()) {
|
| 217 |
+
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
| 218 |
+
continue;
|
| 219 |
+
}
|
| 220 |
+
tasks++;
|
| 221 |
+
const childrenCached = t.readdirCached();
|
| 222 |
+
if (t.calledReaddir())
|
| 223 |
+
this.walkCB3(t, childrenCached, processor, next);
|
| 224 |
+
else {
|
| 225 |
+
t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true);
|
| 226 |
+
}
|
| 227 |
+
}
|
| 228 |
+
next();
|
| 229 |
+
}
|
| 230 |
+
walkCB3(target, entries, processor, cb) {
|
| 231 |
+
processor = processor.filterEntries(target, entries);
|
| 232 |
+
let tasks = 1;
|
| 233 |
+
const next = () => {
|
| 234 |
+
if (--tasks === 0)
|
| 235 |
+
cb();
|
| 236 |
+
};
|
| 237 |
+
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
| 238 |
+
if (this.#ignored(m))
|
| 239 |
+
continue;
|
| 240 |
+
tasks++;
|
| 241 |
+
this.match(m, absolute, ifDir).then(() => next());
|
| 242 |
+
}
|
| 243 |
+
for (const [target, patterns] of processor.subwalks.entries()) {
|
| 244 |
+
tasks++;
|
| 245 |
+
this.walkCB2(target, patterns, processor.child(), next);
|
| 246 |
+
}
|
| 247 |
+
next();
|
| 248 |
+
}
|
| 249 |
+
walkCBSync(target, patterns, cb) {
|
| 250 |
+
/* c8 ignore start */
|
| 251 |
+
if (this.signal?.aborted)
|
| 252 |
+
cb();
|
| 253 |
+
/* c8 ignore stop */
|
| 254 |
+
this.walkCB2Sync(target, patterns, new processor_js_1.Processor(this.opts), cb);
|
| 255 |
+
}
|
| 256 |
+
walkCB2Sync(target, patterns, processor, cb) {
|
| 257 |
+
if (this.#childrenIgnored(target))
|
| 258 |
+
return cb();
|
| 259 |
+
if (this.signal?.aborted)
|
| 260 |
+
cb();
|
| 261 |
+
if (this.paused) {
|
| 262 |
+
this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));
|
| 263 |
+
return;
|
| 264 |
+
}
|
| 265 |
+
processor.processPatterns(target, patterns);
|
| 266 |
+
// done processing. all of the above is sync, can be abstracted out.
|
| 267 |
+
// subwalks is a map of paths to the entry filters they need
|
| 268 |
+
// matches is a map of paths to [absolute, ifDir] tuples.
|
| 269 |
+
let tasks = 1;
|
| 270 |
+
const next = () => {
|
| 271 |
+
if (--tasks === 0)
|
| 272 |
+
cb();
|
| 273 |
+
};
|
| 274 |
+
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
| 275 |
+
if (this.#ignored(m))
|
| 276 |
+
continue;
|
| 277 |
+
this.matchSync(m, absolute, ifDir);
|
| 278 |
+
}
|
| 279 |
+
for (const t of processor.subwalkTargets()) {
|
| 280 |
+
if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
|
| 281 |
+
continue;
|
| 282 |
+
}
|
| 283 |
+
tasks++;
|
| 284 |
+
const children = t.readdirSync();
|
| 285 |
+
this.walkCB3Sync(t, children, processor, next);
|
| 286 |
+
}
|
| 287 |
+
next();
|
| 288 |
+
}
|
| 289 |
+
walkCB3Sync(target, entries, processor, cb) {
|
| 290 |
+
processor = processor.filterEntries(target, entries);
|
| 291 |
+
let tasks = 1;
|
| 292 |
+
const next = () => {
|
| 293 |
+
if (--tasks === 0)
|
| 294 |
+
cb();
|
| 295 |
+
};
|
| 296 |
+
for (const [m, absolute, ifDir] of processor.matches.entries()) {
|
| 297 |
+
if (this.#ignored(m))
|
| 298 |
+
continue;
|
| 299 |
+
this.matchSync(m, absolute, ifDir);
|
| 300 |
+
}
|
| 301 |
+
for (const [target, patterns] of processor.subwalks.entries()) {
|
| 302 |
+
tasks++;
|
| 303 |
+
this.walkCB2Sync(target, patterns, processor.child(), next);
|
| 304 |
+
}
|
| 305 |
+
next();
|
| 306 |
+
}
|
| 307 |
+
}
|
| 308 |
+
exports.GlobUtil = GlobUtil;
|
| 309 |
+
class GlobWalker extends GlobUtil {
|
| 310 |
+
matches = new Set();
|
| 311 |
+
constructor(patterns, path, opts) {
|
| 312 |
+
super(patterns, path, opts);
|
| 313 |
+
}
|
| 314 |
+
matchEmit(e) {
|
| 315 |
+
this.matches.add(e);
|
| 316 |
+
}
|
| 317 |
+
async walk() {
|
| 318 |
+
if (this.signal?.aborted)
|
| 319 |
+
throw this.signal.reason;
|
| 320 |
+
if (this.path.isUnknown()) {
|
| 321 |
+
await this.path.lstat();
|
| 322 |
+
}
|
| 323 |
+
await new Promise((res, rej) => {
|
| 324 |
+
this.walkCB(this.path, this.patterns, () => {
|
| 325 |
+
if (this.signal?.aborted) {
|
| 326 |
+
rej(this.signal.reason);
|
| 327 |
+
}
|
| 328 |
+
else {
|
| 329 |
+
res(this.matches);
|
| 330 |
+
}
|
| 331 |
+
});
|
| 332 |
+
});
|
| 333 |
+
return this.matches;
|
| 334 |
+
}
|
| 335 |
+
walkSync() {
|
| 336 |
+
if (this.signal?.aborted)
|
| 337 |
+
throw this.signal.reason;
|
| 338 |
+
if (this.path.isUnknown()) {
|
| 339 |
+
this.path.lstatSync();
|
| 340 |
+
}
|
| 341 |
+
// nothing for the callback to do, because this never pauses
|
| 342 |
+
this.walkCBSync(this.path, this.patterns, () => {
|
| 343 |
+
if (this.signal?.aborted)
|
| 344 |
+
throw this.signal.reason;
|
| 345 |
+
});
|
| 346 |
+
return this.matches;
|
| 347 |
+
}
|
| 348 |
+
}
|
| 349 |
+
exports.GlobWalker = GlobWalker;
|
| 350 |
+
class GlobStream extends GlobUtil {
|
| 351 |
+
results;
|
| 352 |
+
constructor(patterns, path, opts) {
|
| 353 |
+
super(patterns, path, opts);
|
| 354 |
+
this.results = new minipass_1.Minipass({
|
| 355 |
+
signal: this.signal,
|
| 356 |
+
objectMode: true,
|
| 357 |
+
});
|
| 358 |
+
this.results.on('drain', () => this.resume());
|
| 359 |
+
this.results.on('resume', () => this.resume());
|
| 360 |
+
}
|
| 361 |
+
matchEmit(e) {
|
| 362 |
+
this.results.write(e);
|
| 363 |
+
if (!this.results.flowing)
|
| 364 |
+
this.pause();
|
| 365 |
+
}
|
| 366 |
+
stream() {
|
| 367 |
+
const target = this.path;
|
| 368 |
+
if (target.isUnknown()) {
|
| 369 |
+
target.lstat().then(() => {
|
| 370 |
+
this.walkCB(target, this.patterns, () => this.results.end());
|
| 371 |
+
});
|
| 372 |
+
}
|
| 373 |
+
else {
|
| 374 |
+
this.walkCB(target, this.patterns, () => this.results.end());
|
| 375 |
+
}
|
| 376 |
+
return this.results;
|
| 377 |
+
}
|
| 378 |
+
streamSync() {
|
| 379 |
+
if (this.path.isUnknown()) {
|
| 380 |
+
this.path.lstatSync();
|
| 381 |
+
}
|
| 382 |
+
this.walkCBSync(this.path, this.patterns, () => this.results.end());
|
| 383 |
+
return this.results;
|
| 384 |
+
}
|
| 385 |
+
}
|
| 386 |
+
exports.GlobStream = GlobStream;
|
| 387 |
+
//# sourceMappingURL=walker.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/commonjs/walker.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"walker.js","sourceRoot":"","sources":["../../src/walker.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,uCAAmC;AAEnC,2CAAgD;AAQhD,iDAA0C;AA0D1C,MAAM,UAAU,GAAG,CACjB,MAAsC,EACtC,IAAoB,EACR,EAAE,C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CAAC;IAED,SAAS,CAAC,CAAY;QACpB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACrB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO;YAAE,IAAI,CAAC,KAAK,EAAE,CAAA;IACzC,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAA;QACxB,IAAI,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;YACvB,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;gBACvB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;YAC9D,CAAC,CAAC,CAAA;QACJ,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAC9D,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;IAED,UAAU;QACR,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAA;QACvB,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF;AAvCD,gCAuCC","sourcesContent":["/**\n * Single-use utility classes to provide functionality to the {@link Glob}\n * methods.\n *\n * @module\n */\nimport { Minipass } from 'minipass'\nimport { Path } from 'path-scurry'\nimport { Ignore, IgnoreLike } from './ignore.js'\n\n// XXX can we somehow make it so that it NEVER processes a given path more than\n// once, enough that the match set tracking is no longer needed? that'd speed\n// things up a lot. Or maybe bring back nounique, and skip it in that case?\n\n// a single minimatch set entry with 1 or more parts\nimport { Pattern } from './pattern.js'\nimport { Processor } from './processor.js'\n\nexport interface GlobWalkerOpts {\n absolute?: boolean\n allowWindowsEscape?: boolean\n cwd?: string | URL\n dot?: boolean\n dotRelative?: boolean\n follow?: boolean\n ignore?: string | string[] | IgnoreLike\n mark?: boolean\n matchBase?: boolean\n // Note: maxDepth here means \"maximum actual Path.depth()\",\n // not \"maximum depth beyond cwd\"\n maxDepth?: number\n nobrace?: boolean\n nocase?: boolean\n nodir?: boolean\n noext?: boolean\n noglobstar?: boolean\n platform?: NodeJS.Platform\n posix?: boolean\n realpath?: boolean\n root?: string\n stat?: boolean\n signal?: AbortSignal\n windowsPathsNoEscape?: boolean\n withFileTypes?: boolean\n includeChildMatches?: boolean\n}\n\nexport type GWOFileTypesTrue = GlobWalkerOpts & {\n withFileTypes: true\n}\nexport type GWOFileTypesFalse = GlobWalkerOpts & {\n withFileTypes: false\n}\nexport type GWOFileTypesUnset = GlobWalkerOpts & {\n withFileTypes?: undefined\n}\n\nexport type Result<O extends GlobWalkerOpts> =\n O extends GWOFileTypesTrue ? Path\n : O extends GWOFileTypesFalse ? string\n : O extends GWOFileTypesUnset ? string\n : Path | string\n\nexport type Matches<O extends GlobWalkerOpts> =\n O extends GWOFileTypesTrue ? Set<Path>\n : O extends GWOFileTypesFalse ? Set<string>\n : O extends GWOFileTypesUnset ? Set<string>\n : Set<Path | string>\n\nexport type MatchStream<O extends GlobWalkerOpts> = Minipass<\n Result<O>,\n Result<O>\n>\n\nconst makeIgnore = (\n ignore: string | string[] | IgnoreLike,\n opts: GlobWalkerOpts,\n): IgnoreLike =>\n typeof ignore === 'string' ? new Ignore([ignore], opts)\n : Array.isArray(ignore) ? new Ignore(ignore, opts)\n : ignore\n\n/**\n * basic walking utilities that all the glob walker types use\n */\nexport abstract class GlobUtil<O extends GlobWalkerOpts = GlobWalkerOpts> {\n path: Path\n patterns: Pattern[]\n opts: O\n seen: Set<Path> = new Set<Path>()\n paused: boolean = false\n aborted: boolean = false\n #onResume: (() => any)[] = []\n #ignore?: IgnoreLike\n #sep: '\\\\' | '/'\n signal?: AbortSignal\n maxDepth: number\n includeChildMatches: boolean\n\n constructor(patterns: Pattern[], path: Path, opts: O)\n constructor(patterns: Pattern[], path: Path, opts: O) {\n this.patterns = patterns\n this.path = path\n this.opts = opts\n this.#sep = !opts.posix && opts.platform === 'win32' ? '\\\\' : '/'\n this.includeChildMatches = opts.includeChildMatches !== false\n if (opts.ignore || !this.includeChildMatches) {\n this.#ignore = makeIgnore(opts.ignore ?? [], opts)\n if (\n !this.includeChildMatches &&\n typeof this.#ignore.add !== 'function'\n ) {\n const m = 'cannot ignore child matches, ignore lacks add() method.'\n throw new Error(m)\n }\n }\n // ignore, always set with maxDepth, but it's optional on the\n // GlobOptions type\n /* c8 ignore start */\n this.maxDepth = opts.maxDepth || Infinity\n /* c8 ignore stop */\n if (opts.signal) {\n this.signal = opts.signal\n this.signal.addEventListener('abort', () => {\n this.#onResume.length = 0\n })\n }\n }\n\n #ignored(path: Path): boolean {\n return this.seen.has(path) || !!this.#ignore?.ignored?.(path)\n }\n #childrenIgnored(path: Path): boolean {\n return !!this.#ignore?.childrenIgnored?.(path)\n }\n\n // backpressure mechanism\n pause() {\n this.paused = true\n }\n resume() {\n /* c8 ignore start */\n if (this.signal?.aborted) return\n /* c8 ignore stop */\n this.paused = false\n let fn: (() => any) | undefined = undefined\n while (!this.paused && (fn = this.#onResume.shift())) {\n fn()\n }\n }\n onResume(fn: () => any) {\n if (this.signal?.aborted) return\n /* c8 ignore start */\n if (!this.paused) {\n fn()\n } else {\n /* c8 ignore stop */\n this.#onResume.push(fn)\n }\n }\n\n // do the requisite realpath/stat checking, and return the path\n // to add or undefined to filter it out.\n async matchCheck(e: Path, ifDir: boolean): Promise<Path | undefined> {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || (await e.realpath())\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? await e.lstat() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = await s.realpath()\n /* c8 ignore start */\n if (target && (target.isUnknown() || this.opts.stat)) {\n await target.lstat()\n }\n /* c8 ignore stop */\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n matchCheckTest(e: Path | undefined, ifDir: boolean): Path | undefined {\n return (\n e &&\n (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&\n (!ifDir || e.canReaddir()) &&\n (!this.opts.nodir || !e.isDirectory()) &&\n (!this.opts.nodir ||\n !this.opts.follow ||\n !e.isSymbolicLink() ||\n !e.realpathCached()?.isDirectory()) &&\n !this.#ignored(e)\n ) ?\n e\n : undefined\n }\n\n matchCheckSync(e: Path, ifDir: boolean): Path | undefined {\n if (ifDir && this.opts.nodir) return undefined\n let rpc: Path | undefined\n if (this.opts.realpath) {\n rpc = e.realpathCached() || e.realpathSync()\n if (!rpc) return undefined\n e = rpc\n }\n const needStat = e.isUnknown() || this.opts.stat\n const s = needStat ? e.lstatSync() : e\n if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {\n const target = s.realpathSync()\n if (target && (target?.isUnknown() || this.opts.stat)) {\n target.lstatSync()\n }\n }\n return this.matchCheckTest(s, ifDir)\n }\n\n abstract matchEmit(p: Result<O>): void\n abstract matchEmit(p: string | Path): void\n\n matchFinish(e: Path, absolute: boolean) {\n if (this.#ignored(e)) return\n // we know we have an ignore if this is false, but TS doesn't\n if (!this.includeChildMatches && this.#ignore?.add) {\n const ign = `${e.relativePosix()}/**`\n this.#ignore.add(ign)\n }\n const abs =\n this.opts.absolute === undefined ? absolute : this.opts.absolute\n this.seen.add(e)\n const mark = this.opts.mark && e.isDirectory() ? this.#sep : ''\n // ok, we have what we need!\n if (this.opts.withFileTypes) {\n this.matchEmit(e)\n } else if (abs) {\n const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath()\n this.matchEmit(abs + mark)\n } else {\n const rel = this.opts.posix ? e.relativePosix() : e.relative()\n const pre =\n this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?\n '.' + this.#sep\n : ''\n this.matchEmit(!rel ? '.' + mark : pre + rel + mark)\n }\n }\n\n async match(e: Path, absolute: boolean, ifDir: boolean): Promise<void> {\n const p = await this.matchCheck(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n matchSync(e: Path, absolute: boolean, ifDir: boolean): void {\n const p = this.matchCheckSync(e, ifDir)\n if (p) this.matchFinish(p, absolute)\n }\n\n walkCB(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any,\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() => this.walkCB2(target, patterns, processor, cb))\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const childrenCached = t.readdirCached()\n if (t.calledReaddir())\n this.walkCB3(t, childrenCached, processor, next)\n else {\n t.readdirCB(\n (_, entries) => this.walkCB3(t, entries, processor, next),\n true,\n )\n }\n }\n\n next()\n }\n\n walkCB3(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any,\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n tasks++\n this.match(m, absolute, ifDir).then(() => next())\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2(target, patterns, processor.child(), next)\n }\n\n next()\n }\n\n walkCBSync(target: Path, patterns: Pattern[], cb: () => any) {\n /* c8 ignore start */\n if (this.signal?.aborted) cb()\n /* c8 ignore stop */\n this.walkCB2Sync(target, patterns, new Processor(this.opts), cb)\n }\n\n walkCB2Sync(\n target: Path,\n patterns: Pattern[],\n processor: Processor,\n cb: () => any,\n ) {\n if (this.#childrenIgnored(target)) return cb()\n if (this.signal?.aborted) cb()\n if (this.paused) {\n this.onResume(() =>\n this.walkCB2Sync(target, patterns, processor, cb),\n )\n return\n }\n processor.processPatterns(target, patterns)\n\n // done processing. all of the above is sync, can be abstracted out.\n // subwalks is a map of paths to the entry filters they need\n // matches is a map of paths to [absolute, ifDir] tuples.\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n\n for (const t of processor.subwalkTargets()) {\n if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {\n continue\n }\n tasks++\n const children = t.readdirSync()\n this.walkCB3Sync(t, children, processor, next)\n }\n\n next()\n }\n\n walkCB3Sync(\n target: Path,\n entries: Path[],\n processor: Processor,\n cb: () => any,\n ) {\n processor = processor.filterEntries(target, entries)\n\n let tasks = 1\n const next = () => {\n if (--tasks === 0) cb()\n }\n\n for (const [m, absolute, ifDir] of processor.matches.entries()) {\n if (this.#ignored(m)) continue\n this.matchSync(m, absolute, ifDir)\n }\n for (const [target, patterns] of processor.subwalks.entries()) {\n tasks++\n this.walkCB2Sync(target, patterns, processor.child(), next)\n }\n\n next()\n }\n}\n\nexport class GlobWalker<\n O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil<O> {\n matches = new Set<Result<O>>()\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n }\n\n matchEmit(e: Result<O>): void {\n this.matches.add(e)\n }\n\n async walk(): Promise<Set<Result<O>>> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n await this.path.lstat()\n }\n await new Promise((res, rej) => {\n this.walkCB(this.path, this.patterns, () => {\n if (this.signal?.aborted) {\n rej(this.signal.reason)\n } else {\n res(this.matches)\n }\n })\n })\n return this.matches\n }\n\n walkSync(): Set<Result<O>> {\n if (this.signal?.aborted) throw this.signal.reason\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n // nothing for the callback to do, because this never pauses\n this.walkCBSync(this.path, this.patterns, () => {\n if (this.signal?.aborted) throw this.signal.reason\n })\n return this.matches\n }\n}\n\nexport class GlobStream<\n O extends GlobWalkerOpts = GlobWalkerOpts,\n> extends GlobUtil<O> {\n results: Minipass<Result<O>, Result<O>>\n\n constructor(patterns: Pattern[], path: Path, opts: O) {\n super(patterns, path, opts)\n this.results = new Minipass<Result<O>, Result<O>>({\n signal: this.signal,\n objectMode: true,\n })\n this.results.on('drain', () => this.resume())\n this.results.on('resume', () => this.resume())\n }\n\n matchEmit(e: Result<O>): void {\n this.results.write(e)\n if (!this.results.flowing) this.pause()\n }\n\n stream(): MatchStream<O> {\n const target = this.path\n if (target.isUnknown()) {\n target.lstat().then(() => {\n this.walkCB(target, this.patterns, () => this.results.end())\n })\n } else {\n this.walkCB(target, this.patterns, () => this.results.end())\n }\n return this.results\n }\n\n streamSync(): MatchStream<O> {\n if (this.path.isUnknown()) {\n this.path.lstatSync()\n }\n this.walkCBSync(this.path, this.patterns, () => this.results.end())\n return this.results\n }\n}\n"]}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/bin.d.mts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env node
|
| 2 |
+
export {};
|
| 3 |
+
//# sourceMappingURL=bin.d.mts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/bin.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"bin.d.mts","sourceRoot":"","sources":["../../src/bin.mts"],"names":[],"mappings":""}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/bin.mjs
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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';
|
| 3 |
+
import { existsSync } from 'fs';
|
| 4 |
+
import { jack } from 'jackspeak';
|
| 5 |
+
import { loadPackageJson } from 'package-json-from-dist';
|
| 6 |
+
import { join } from 'path';
|
| 7 |
+
import { globStream } from './index.js';
|
| 8 |
+
const { version } = loadPackageJson(import.meta.url, '../package.json');
|
| 9 |
+
const j = jack({
|
| 10 |
+
usage: 'glob [options] [<pattern> [<pattern> ...]]',
|
| 11 |
+
})
|
| 12 |
+
.description(`
|
| 13 |
+
Glob v${version}
|
| 14 |
+
|
| 15 |
+
Expand the positional glob expression arguments into any matching file
|
| 16 |
+
system paths found.
|
| 17 |
+
`)
|
| 18 |
+
.opt({
|
| 19 |
+
cmd: {
|
| 20 |
+
short: 'c',
|
| 21 |
+
hint: 'command',
|
| 22 |
+
description: `Run the command provided, passing the glob expression
|
| 23 |
+
matches as arguments.`,
|
| 24 |
+
},
|
| 25 |
+
})
|
| 26 |
+
.opt({
|
| 27 |
+
default: {
|
| 28 |
+
short: 'p',
|
| 29 |
+
hint: 'pattern',
|
| 30 |
+
description: `If no positional arguments are provided, glob will use
|
| 31 |
+
this pattern`,
|
| 32 |
+
},
|
| 33 |
+
})
|
| 34 |
+
.flag({
|
| 35 |
+
all: {
|
| 36 |
+
short: 'A',
|
| 37 |
+
description: `By default, the glob cli command will not expand any
|
| 38 |
+
arguments that are an exact match to a file on disk.
|
| 39 |
+
|
| 40 |
+
This prevents double-expanding, in case the shell expands
|
| 41 |
+
an argument whose filename is a glob expression.
|
| 42 |
+
|
| 43 |
+
For example, if 'app/*.ts' would match 'app/[id].ts', then
|
| 44 |
+
on Windows powershell or cmd.exe, 'glob app/*.ts' will
|
| 45 |
+
expand to 'app/[id].ts', as expected. However, in posix
|
| 46 |
+
shells such as bash or zsh, the shell will first expand
|
| 47 |
+
'app/*.ts' to a list of filenames. Then glob will look
|
| 48 |
+
for a file matching 'app/[id].ts' (ie, 'app/i.ts' or
|
| 49 |
+
'app/d.ts'), which is unexpected.
|
| 50 |
+
|
| 51 |
+
Setting '--all' prevents this behavior, causing glob
|
| 52 |
+
to treat ALL patterns as glob expressions to be expanded,
|
| 53 |
+
even if they are an exact match to a file on disk.
|
| 54 |
+
|
| 55 |
+
When setting this option, be sure to enquote arguments
|
| 56 |
+
so that the shell will not expand them prior to passing
|
| 57 |
+
them to the glob command process.
|
| 58 |
+
`,
|
| 59 |
+
},
|
| 60 |
+
absolute: {
|
| 61 |
+
short: 'a',
|
| 62 |
+
description: 'Expand to absolute paths',
|
| 63 |
+
},
|
| 64 |
+
'dot-relative': {
|
| 65 |
+
short: 'd',
|
| 66 |
+
description: `Prepend './' on relative matches`,
|
| 67 |
+
},
|
| 68 |
+
mark: {
|
| 69 |
+
short: 'm',
|
| 70 |
+
description: `Append a / on any directories matched`,
|
| 71 |
+
},
|
| 72 |
+
posix: {
|
| 73 |
+
short: 'x',
|
| 74 |
+
description: `Always resolve to posix style paths, using '/' as the
|
| 75 |
+
directory separator, even on Windows. Drive letter
|
| 76 |
+
absolute matches on Windows will be expanded to their
|
| 77 |
+
full resolved UNC maths, eg instead of 'C:\\foo\\bar',
|
| 78 |
+
it will expand to '//?/C:/foo/bar'.
|
| 79 |
+
`,
|
| 80 |
+
},
|
| 81 |
+
follow: {
|
| 82 |
+
short: 'f',
|
| 83 |
+
description: `Follow symlinked directories when expanding '**'`,
|
| 84 |
+
},
|
| 85 |
+
realpath: {
|
| 86 |
+
short: 'R',
|
| 87 |
+
description: `Call 'fs.realpath' on all of the results. In the case
|
| 88 |
+
of an entry that cannot be resolved, the entry is
|
| 89 |
+
omitted. This incurs a slight performance penalty, of
|
| 90 |
+
course, because of the added system calls.`,
|
| 91 |
+
},
|
| 92 |
+
stat: {
|
| 93 |
+
short: 's',
|
| 94 |
+
description: `Call 'fs.lstat' on all entries, whether required or not
|
| 95 |
+
to determine if it's a valid match.`,
|
| 96 |
+
},
|
| 97 |
+
'match-base': {
|
| 98 |
+
short: 'b',
|
| 99 |
+
description: `Perform a basename-only match if the pattern does not
|
| 100 |
+
contain any slash characters. That is, '*.js' would be
|
| 101 |
+
treated as equivalent to '**/*.js', matching js files
|
| 102 |
+
in all directories.
|
| 103 |
+
`,
|
| 104 |
+
},
|
| 105 |
+
dot: {
|
| 106 |
+
description: `Allow patterns to match files/directories that start
|
| 107 |
+
with '.', even if the pattern does not start with '.'
|
| 108 |
+
`,
|
| 109 |
+
},
|
| 110 |
+
nobrace: {
|
| 111 |
+
description: 'Do not expand {...} patterns',
|
| 112 |
+
},
|
| 113 |
+
nocase: {
|
| 114 |
+
description: `Perform a case-insensitive match. This defaults to
|
| 115 |
+
'true' on macOS and Windows platforms, and false on
|
| 116 |
+
all others.
|
| 117 |
+
|
| 118 |
+
Note: 'nocase' should only be explicitly set when it is
|
| 119 |
+
known that the filesystem's case sensitivity differs
|
| 120 |
+
from the platform default. If set 'true' on
|
| 121 |
+
case-insensitive file systems, then the walk may return
|
| 122 |
+
more or less results than expected.
|
| 123 |
+
`,
|
| 124 |
+
},
|
| 125 |
+
nodir: {
|
| 126 |
+
description: `Do not match directories, only files.
|
| 127 |
+
|
| 128 |
+
Note: to *only* match directories, append a '/' at the
|
| 129 |
+
end of the pattern.
|
| 130 |
+
`,
|
| 131 |
+
},
|
| 132 |
+
noext: {
|
| 133 |
+
description: `Do not expand extglob patterns, such as '+(a|b)'`,
|
| 134 |
+
},
|
| 135 |
+
noglobstar: {
|
| 136 |
+
description: `Do not expand '**' against multiple path portions.
|
| 137 |
+
Ie, treat it as a normal '*' instead.`,
|
| 138 |
+
},
|
| 139 |
+
'windows-path-no-escape': {
|
| 140 |
+
description: `Use '\\' as a path separator *only*, and *never* as an
|
| 141 |
+
escape character. If set, all '\\' characters are
|
| 142 |
+
replaced with '/' in the pattern.`,
|
| 143 |
+
},
|
| 144 |
+
})
|
| 145 |
+
.num({
|
| 146 |
+
'max-depth': {
|
| 147 |
+
short: 'D',
|
| 148 |
+
description: `Maximum depth to traverse from the current
|
| 149 |
+
working directory`,
|
| 150 |
+
},
|
| 151 |
+
})
|
| 152 |
+
.opt({
|
| 153 |
+
cwd: {
|
| 154 |
+
short: 'C',
|
| 155 |
+
description: 'Current working directory to execute/match in',
|
| 156 |
+
default: process.cwd(),
|
| 157 |
+
},
|
| 158 |
+
root: {
|
| 159 |
+
short: 'r',
|
| 160 |
+
description: `A string path resolved against the 'cwd', which is
|
| 161 |
+
used as the starting point for absolute patterns that
|
| 162 |
+
start with '/' (but not drive letters or UNC paths
|
| 163 |
+
on Windows).
|
| 164 |
+
|
| 165 |
+
Note that this *doesn't* necessarily limit the walk to
|
| 166 |
+
the 'root' directory, and doesn't affect the cwd
|
| 167 |
+
starting point for non-absolute patterns. A pattern
|
| 168 |
+
containing '..' will still be able to traverse out of
|
| 169 |
+
the root directory, if it is not an actual root directory
|
| 170 |
+
on the filesystem, and any non-absolute patterns will
|
| 171 |
+
still be matched in the 'cwd'.
|
| 172 |
+
|
| 173 |
+
To start absolute and non-absolute patterns in the same
|
| 174 |
+
path, you can use '--root=' to set it to the empty
|
| 175 |
+
string. However, be aware that on Windows systems, a
|
| 176 |
+
pattern like 'x:/*' or '//host/share/*' will *always*
|
| 177 |
+
start in the 'x:/' or '//host/share/' directory,
|
| 178 |
+
regardless of the --root setting.
|
| 179 |
+
`,
|
| 180 |
+
},
|
| 181 |
+
platform: {
|
| 182 |
+
description: `Defaults to the value of 'process.platform' if
|
| 183 |
+
available, or 'linux' if not. Setting --platform=win32
|
| 184 |
+
on non-Windows systems may cause strange behavior!`,
|
| 185 |
+
validOptions: [
|
| 186 |
+
'aix',
|
| 187 |
+
'android',
|
| 188 |
+
'darwin',
|
| 189 |
+
'freebsd',
|
| 190 |
+
'haiku',
|
| 191 |
+
'linux',
|
| 192 |
+
'openbsd',
|
| 193 |
+
'sunos',
|
| 194 |
+
'win32',
|
| 195 |
+
'cygwin',
|
| 196 |
+
'netbsd',
|
| 197 |
+
],
|
| 198 |
+
},
|
| 199 |
+
})
|
| 200 |
+
.optList({
|
| 201 |
+
ignore: {
|
| 202 |
+
short: 'i',
|
| 203 |
+
description: `Glob patterns to ignore`,
|
| 204 |
+
},
|
| 205 |
+
})
|
| 206 |
+
.flag({
|
| 207 |
+
debug: {
|
| 208 |
+
short: 'v',
|
| 209 |
+
description: `Output a huge amount of noisy debug information about
|
| 210 |
+
patterns as they are parsed and used to match files.`,
|
| 211 |
+
},
|
| 212 |
+
version: {
|
| 213 |
+
short: 'V',
|
| 214 |
+
description: `Output the version (${version})`,
|
| 215 |
+
},
|
| 216 |
+
help: {
|
| 217 |
+
short: 'h',
|
| 218 |
+
description: 'Show this usage information',
|
| 219 |
+
},
|
| 220 |
+
});
|
| 221 |
+
try {
|
| 222 |
+
const { positionals, values } = j.parse();
|
| 223 |
+
if (values.version) {
|
| 224 |
+
console.log(version);
|
| 225 |
+
process.exit(0);
|
| 226 |
+
}
|
| 227 |
+
if (values.help) {
|
| 228 |
+
console.log(j.usage());
|
| 229 |
+
process.exit(0);
|
| 230 |
+
}
|
| 231 |
+
if (positionals.length === 0 && !values.default)
|
| 232 |
+
throw 'No patterns provided';
|
| 233 |
+
if (positionals.length === 0 && values.default)
|
| 234 |
+
positionals.push(values.default);
|
| 235 |
+
const patterns = values.all ? positionals : positionals.filter(p => !existsSync(p));
|
| 236 |
+
const matches = values.all ?
|
| 237 |
+
[]
|
| 238 |
+
: positionals.filter(p => existsSync(p)).map(p => join(p));
|
| 239 |
+
const stream = globStream(patterns, {
|
| 240 |
+
absolute: values.absolute,
|
| 241 |
+
cwd: values.cwd,
|
| 242 |
+
dot: values.dot,
|
| 243 |
+
dotRelative: values['dot-relative'],
|
| 244 |
+
follow: values.follow,
|
| 245 |
+
ignore: values.ignore,
|
| 246 |
+
mark: values.mark,
|
| 247 |
+
matchBase: values['match-base'],
|
| 248 |
+
maxDepth: values['max-depth'],
|
| 249 |
+
nobrace: values.nobrace,
|
| 250 |
+
nocase: values.nocase,
|
| 251 |
+
nodir: values.nodir,
|
| 252 |
+
noext: values.noext,
|
| 253 |
+
noglobstar: values.noglobstar,
|
| 254 |
+
platform: values.platform,
|
| 255 |
+
realpath: values.realpath,
|
| 256 |
+
root: values.root,
|
| 257 |
+
stat: values.stat,
|
| 258 |
+
debug: values.debug,
|
| 259 |
+
posix: values.posix,
|
| 260 |
+
});
|
| 261 |
+
const cmd = values.cmd;
|
| 262 |
+
if (!cmd) {
|
| 263 |
+
matches.forEach(m => console.log(m));
|
| 264 |
+
stream.on('data', f => console.log(f));
|
| 265 |
+
}
|
| 266 |
+
else {
|
| 267 |
+
stream.on('data', f => matches.push(f));
|
| 268 |
+
stream.on('end', () => foregroundChild(cmd, matches, { shell: true }));
|
| 269 |
+
}
|
| 270 |
+
}
|
| 271 |
+
catch (e) {
|
| 272 |
+
console.error(j.usage());
|
| 273 |
+
console.error(e instanceof Error ? e.message : String(e));
|
| 274 |
+
process.exit(1);
|
| 275 |
+
}
|
| 276 |
+
//# sourceMappingURL=bin.mjs.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/bin.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"bin.mjs","sourceRoot":"","sources":["../../src/bin.mts"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEvC,MAAM,EAAE,OAAO,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAA;AAEvE,MAAM,CAAC,GAAG,IAAI,CAAC;IACb,KAAK,EAAE,4CAA4C;CACpD,CAAC;KACC,WAA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zD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { foregroundChild } from 'foreground-child'\nimport { existsSync } from 'fs'\nimport { jack } from 'jackspeak'\nimport { loadPackageJson } from 'package-json-from-dist'\nimport { join } from 'path'\nimport { globStream } from './index.js'\n\nconst { version } = loadPackageJson(import.meta.url, '../package.json')\n\nconst j = jack({\n usage: 'glob [options] [<pattern> [<pattern> ...]]',\n})\n .description(\n `\n Glob v${version}\n\n Expand the positional glob expression arguments into any matching file\n system paths found.\n `,\n )\n .opt({\n cmd: {\n short: 'c',\n hint: 'command',\n description: `Run the command provided, passing the glob expression\n matches as arguments.`,\n },\n })\n .opt({\n default: {\n short: 'p',\n hint: 'pattern',\n description: `If no positional arguments are provided, glob will use\n this pattern`,\n },\n })\n .flag({\n all: {\n short: 'A',\n description: `By default, the glob cli command will not expand any\n arguments that are an exact match to a file on disk.\n\n This prevents double-expanding, in case the shell expands\n an argument whose filename is a glob expression.\n\n For example, if 'app/*.ts' would match 'app/[id].ts', then\n on Windows powershell or cmd.exe, 'glob app/*.ts' will\n expand to 'app/[id].ts', as expected. However, in posix\n shells such as bash or zsh, the shell will first expand\n 'app/*.ts' to a list of filenames. Then glob will look\n for a file matching 'app/[id].ts' (ie, 'app/i.ts' or\n 'app/d.ts'), which is unexpected.\n\n Setting '--all' prevents this behavior, causing glob\n to treat ALL patterns as glob expressions to be expanded,\n even if they are an exact match to a file on disk.\n\n When setting this option, be sure to enquote arguments\n so that the shell will not expand them prior to passing\n them to the glob command process.\n `,\n },\n absolute: {\n short: 'a',\n description: 'Expand to absolute paths',\n },\n 'dot-relative': {\n short: 'd',\n description: `Prepend './' on relative matches`,\n },\n mark: {\n short: 'm',\n description: `Append a / on any directories matched`,\n },\n posix: {\n short: 'x',\n description: `Always resolve to posix style paths, using '/' as the\n directory separator, even on Windows. Drive letter\n absolute matches on Windows will be expanded to their\n full resolved UNC maths, eg instead of 'C:\\\\foo\\\\bar',\n it will expand to '//?/C:/foo/bar'.\n `,\n },\n\n follow: {\n short: 'f',\n description: `Follow symlinked directories when expanding '**'`,\n },\n realpath: {\n short: 'R',\n description: `Call 'fs.realpath' on all of the results. In the case\n of an entry that cannot be resolved, the entry is\n omitted. This incurs a slight performance penalty, of\n course, because of the added system calls.`,\n },\n stat: {\n short: 's',\n description: `Call 'fs.lstat' on all entries, whether required or not\n to determine if it's a valid match.`,\n },\n 'match-base': {\n short: 'b',\n description: `Perform a basename-only match if the pattern does not\n contain any slash characters. That is, '*.js' would be\n treated as equivalent to '**/*.js', matching js files\n in all directories.\n `,\n },\n\n dot: {\n description: `Allow patterns to match files/directories that start\n with '.', even if the pattern does not start with '.'\n `,\n },\n nobrace: {\n description: 'Do not expand {...} patterns',\n },\n nocase: {\n description: `Perform a case-insensitive match. This defaults to\n 'true' on macOS and Windows platforms, and false on\n all others.\n\n Note: 'nocase' should only be explicitly set when it is\n known that the filesystem's case sensitivity differs\n from the platform default. If set 'true' on\n case-insensitive file systems, then the walk may return\n more or less results than expected.\n `,\n },\n nodir: {\n description: `Do not match directories, only files.\n\n Note: to *only* match directories, append a '/' at the\n end of the pattern.\n `,\n },\n noext: {\n description: `Do not expand extglob patterns, such as '+(a|b)'`,\n },\n noglobstar: {\n description: `Do not expand '**' against multiple path portions.\n Ie, treat it as a normal '*' instead.`,\n },\n 'windows-path-no-escape': {\n description: `Use '\\\\' as a path separator *only*, and *never* as an\n escape character. If set, all '\\\\' characters are\n replaced with '/' in the pattern.`,\n },\n })\n .num({\n 'max-depth': {\n short: 'D',\n description: `Maximum depth to traverse from the current\n working directory`,\n },\n })\n .opt({\n cwd: {\n short: 'C',\n description: 'Current working directory to execute/match in',\n default: process.cwd(),\n },\n root: {\n short: 'r',\n description: `A string path resolved against the 'cwd', which is\n used as the starting point for absolute patterns that\n start with '/' (but not drive letters or UNC paths\n on Windows).\n\n Note that this *doesn't* necessarily limit the walk to\n the 'root' directory, and doesn't affect the cwd\n starting point for non-absolute patterns. A pattern\n containing '..' will still be able to traverse out of\n the root directory, if it is not an actual root directory\n on the filesystem, and any non-absolute patterns will\n still be matched in the 'cwd'.\n\n To start absolute and non-absolute patterns in the same\n path, you can use '--root=' to set it to the empty\n string. However, be aware that on Windows systems, a\n pattern like 'x:/*' or '//host/share/*' will *always*\n start in the 'x:/' or '//host/share/' directory,\n regardless of the --root setting.\n `,\n },\n platform: {\n description: `Defaults to the value of 'process.platform' if\n available, or 'linux' if not. Setting --platform=win32\n on non-Windows systems may cause strange behavior!`,\n validOptions: [\n 'aix',\n 'android',\n 'darwin',\n 'freebsd',\n 'haiku',\n 'linux',\n 'openbsd',\n 'sunos',\n 'win32',\n 'cygwin',\n 'netbsd',\n ],\n },\n })\n .optList({\n ignore: {\n short: 'i',\n description: `Glob patterns to ignore`,\n },\n })\n .flag({\n debug: {\n short: 'v',\n description: `Output a huge amount of noisy debug information about\n patterns as they are parsed and used to match files.`,\n },\n version: {\n short: 'V',\n description: `Output the version (${version})`,\n },\n help: {\n short: 'h',\n description: 'Show this usage information',\n },\n })\n\ntry {\n const { positionals, values } = j.parse()\n if (values.version) {\n console.log(version)\n process.exit(0)\n }\n if (values.help) {\n console.log(j.usage())\n process.exit(0)\n }\n if (positionals.length === 0 && !values.default)\n throw 'No patterns provided'\n if (positionals.length === 0 && values.default)\n positionals.push(values.default)\n const patterns =\n values.all ? positionals : positionals.filter(p => !existsSync(p))\n const matches =\n values.all ?\n []\n : positionals.filter(p => existsSync(p)).map(p => join(p))\n const stream = globStream(patterns, {\n absolute: values.absolute,\n cwd: values.cwd,\n dot: values.dot,\n dotRelative: values['dot-relative'],\n follow: values.follow,\n ignore: values.ignore,\n mark: values.mark,\n matchBase: values['match-base'],\n maxDepth: values['max-depth'],\n nobrace: values.nobrace,\n nocase: values.nocase,\n nodir: values.nodir,\n noext: values.noext,\n noglobstar: values.noglobstar,\n platform: values.platform as undefined | NodeJS.Platform,\n realpath: values.realpath,\n root: values.root,\n stat: values.stat,\n debug: values.debug,\n posix: values.posix,\n })\n\n const cmd = values.cmd\n if (!cmd) {\n matches.forEach(m => console.log(m))\n stream.on('data', f => console.log(f))\n } else {\n stream.on('data', f => matches.push(f))\n stream.on('end', () => foregroundChild(cmd, matches, { shell: true }))\n }\n} catch (e) {\n console.error(j.usage())\n console.error(e instanceof Error ? e.message : String(e))\n process.exit(1)\n}\n"]}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/glob.d.ts
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Minimatch } from 'minimatch';
|
| 2 |
+
import { Minipass } from 'minipass';
|
| 3 |
+
import { FSOption, Path, PathScurry } from 'path-scurry';
|
| 4 |
+
import { IgnoreLike } from './ignore.js';
|
| 5 |
+
import { Pattern } from './pattern.js';
|
| 6 |
+
export type MatchSet = Minimatch['set'];
|
| 7 |
+
export type GlobParts = Exclude<Minimatch['globParts'], undefined>;
|
| 8 |
+
/**
|
| 9 |
+
* A `GlobOptions` object may be provided to any of the exported methods, and
|
| 10 |
+
* must be provided to the `Glob` constructor.
|
| 11 |
+
*
|
| 12 |
+
* All options are optional, boolean, and false by default, unless otherwise
|
| 13 |
+
* noted.
|
| 14 |
+
*
|
| 15 |
+
* All resolved options are added to the Glob object as properties.
|
| 16 |
+
*
|
| 17 |
+
* If you are running many `glob` operations, you can pass a Glob object as the
|
| 18 |
+
* `options` argument to a subsequent operation to share the previously loaded
|
| 19 |
+
* cache.
|
| 20 |
+
*/
|
| 21 |
+
export interface GlobOptions {
|
| 22 |
+
/**
|
| 23 |
+
* Set to `true` to always receive absolute paths for
|
| 24 |
+
* matched files. Set to `false` to always return relative paths.
|
| 25 |
+
*
|
| 26 |
+
* When this option is not set, absolute paths are returned for patterns
|
| 27 |
+
* that are absolute, and otherwise paths are returned that are relative
|
| 28 |
+
* to the `cwd` setting.
|
| 29 |
+
*
|
| 30 |
+
* This does _not_ make an extra system call to get
|
| 31 |
+
* the realpath, it only does string path resolution.
|
| 32 |
+
*
|
| 33 |
+
* Conflicts with {@link withFileTypes}
|
| 34 |
+
*/
|
| 35 |
+
absolute?: boolean;
|
| 36 |
+
/**
|
| 37 |
+
* Set to false to enable {@link windowsPathsNoEscape}
|
| 38 |
+
*
|
| 39 |
+
* @deprecated
|
| 40 |
+
*/
|
| 41 |
+
allowWindowsEscape?: boolean;
|
| 42 |
+
/**
|
| 43 |
+
* The current working directory in which to search. Defaults to
|
| 44 |
+
* `process.cwd()`.
|
| 45 |
+
*
|
| 46 |
+
* May be eiher a string path or a `file://` URL object or string.
|
| 47 |
+
*/
|
| 48 |
+
cwd?: string | URL;
|
| 49 |
+
/**
|
| 50 |
+
* Include `.dot` files in normal matches and `globstar`
|
| 51 |
+
* matches. Note that an explicit dot in a portion of the pattern
|
| 52 |
+
* will always match dot files.
|
| 53 |
+
*/
|
| 54 |
+
dot?: boolean;
|
| 55 |
+
/**
|
| 56 |
+
* Prepend all relative path strings with `./` (or `.\` on Windows).
|
| 57 |
+
*
|
| 58 |
+
* Without this option, returned relative paths are "bare", so instead of
|
| 59 |
+
* returning `'./foo/bar'`, they are returned as `'foo/bar'`.
|
| 60 |
+
*
|
| 61 |
+
* Relative patterns starting with `'../'` are not prepended with `./`, even
|
| 62 |
+
* if this option is set.
|
| 63 |
+
*/
|
| 64 |
+
dotRelative?: boolean;
|
| 65 |
+
/**
|
| 66 |
+
* Follow symlinked directories when expanding `**`
|
| 67 |
+
* patterns. This can result in a lot of duplicate references in
|
| 68 |
+
* the presence of cyclic links, and make performance quite bad.
|
| 69 |
+
*
|
| 70 |
+
* By default, a `**` in a pattern will follow 1 symbolic link if
|
| 71 |
+
* it is not the first item in the pattern, or none if it is the
|
| 72 |
+
* first item in the pattern, following the same behavior as Bash.
|
| 73 |
+
*/
|
| 74 |
+
follow?: boolean;
|
| 75 |
+
/**
|
| 76 |
+
* string or string[], or an object with `ignored` and `childrenIgnored`
|
| 77 |
+
* methods.
|
| 78 |
+
*
|
| 79 |
+
* If a string or string[] is provided, then this is treated as a glob
|
| 80 |
+
* pattern or array of glob patterns to exclude from matches. To ignore all
|
| 81 |
+
* children within a directory, as well as the entry itself, append `'/**'`
|
| 82 |
+
* to the ignore pattern.
|
| 83 |
+
*
|
| 84 |
+
* **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of
|
| 85 |
+
* any other settings.
|
| 86 |
+
*
|
| 87 |
+
* If an object is provided that has `ignored(path)` and/or
|
| 88 |
+
* `childrenIgnored(path)` methods, then these methods will be called to
|
| 89 |
+
* determine whether any Path is a match or if its children should be
|
| 90 |
+
* traversed, respectively.
|
| 91 |
+
*/
|
| 92 |
+
ignore?: string | string[] | IgnoreLike;
|
| 93 |
+
/**
|
| 94 |
+
* Treat brace expansion like `{a,b}` as a "magic" pattern. Has no
|
| 95 |
+
* effect if {@link nobrace} is set.
|
| 96 |
+
*
|
| 97 |
+
* Only has effect on the {@link hasMagic} function.
|
| 98 |
+
*/
|
| 99 |
+
magicalBraces?: boolean;
|
| 100 |
+
/**
|
| 101 |
+
* Add a `/` character to directory matches. Note that this requires
|
| 102 |
+
* additional stat calls in some cases.
|
| 103 |
+
*/
|
| 104 |
+
mark?: boolean;
|
| 105 |
+
/**
|
| 106 |
+
* Perform a basename-only match if the pattern does not contain any slash
|
| 107 |
+
* characters. That is, `*.js` would be treated as equivalent to
|
| 108 |
+
* `**\/*.js`, matching all js files in all directories.
|
| 109 |
+
*/
|
| 110 |
+
matchBase?: boolean;
|
| 111 |
+
/**
|
| 112 |
+
* Limit the directory traversal to a given depth below the cwd.
|
| 113 |
+
* Note that this does NOT prevent traversal to sibling folders,
|
| 114 |
+
* root patterns, and so on. It only limits the maximum folder depth
|
| 115 |
+
* that the walk will descend, relative to the cwd.
|
| 116 |
+
*/
|
| 117 |
+
maxDepth?: number;
|
| 118 |
+
/**
|
| 119 |
+
* Do not expand `{a,b}` and `{1..3}` brace sets.
|
| 120 |
+
*/
|
| 121 |
+
nobrace?: boolean;
|
| 122 |
+
/**
|
| 123 |
+
* Perform a case-insensitive match. This defaults to `true` on macOS and
|
| 124 |
+
* Windows systems, and `false` on all others.
|
| 125 |
+
*
|
| 126 |
+
* **Note** `nocase` should only be explicitly set when it is
|
| 127 |
+
* known that the filesystem's case sensitivity differs from the
|
| 128 |
+
* platform default. If set `true` on case-sensitive file
|
| 129 |
+
* systems, or `false` on case-insensitive file systems, then the
|
| 130 |
+
* walk may return more or less results than expected.
|
| 131 |
+
*/
|
| 132 |
+
nocase?: boolean;
|
| 133 |
+
/**
|
| 134 |
+
* Do not match directories, only files. (Note: to match
|
| 135 |
+
* _only_ directories, put a `/` at the end of the pattern.)
|
| 136 |
+
*/
|
| 137 |
+
nodir?: boolean;
|
| 138 |
+
/**
|
| 139 |
+
* Do not match "extglob" patterns such as `+(a|b)`.
|
| 140 |
+
*/
|
| 141 |
+
noext?: boolean;
|
| 142 |
+
/**
|
| 143 |
+
* Do not match `**` against multiple filenames. (Ie, treat it as a normal
|
| 144 |
+
* `*` instead.)
|
| 145 |
+
*
|
| 146 |
+
* Conflicts with {@link matchBase}
|
| 147 |
+
*/
|
| 148 |
+
noglobstar?: boolean;
|
| 149 |
+
/**
|
| 150 |
+
* Defaults to value of `process.platform` if available, or `'linux'` if
|
| 151 |
+
* not. Setting `platform:'win32'` on non-Windows systems may cause strange
|
| 152 |
+
* behavior.
|
| 153 |
+
*/
|
| 154 |
+
platform?: NodeJS.Platform;
|
| 155 |
+
/**
|
| 156 |
+
* Set to true to call `fs.realpath` on all of the
|
| 157 |
+
* results. In the case of an entry that cannot be resolved, the
|
| 158 |
+
* entry is omitted. This incurs a slight performance penalty, of
|
| 159 |
+
* course, because of the added system calls.
|
| 160 |
+
*/
|
| 161 |
+
realpath?: boolean;
|
| 162 |
+
/**
|
| 163 |
+
*
|
| 164 |
+
* A string path resolved against the `cwd` option, which
|
| 165 |
+
* is used as the starting point for absolute patterns that start
|
| 166 |
+
* with `/`, (but not drive letters or UNC paths on Windows).
|
| 167 |
+
*
|
| 168 |
+
* Note that this _doesn't_ necessarily limit the walk to the
|
| 169 |
+
* `root` directory, and doesn't affect the cwd starting point for
|
| 170 |
+
* non-absolute patterns. A pattern containing `..` will still be
|
| 171 |
+
* able to traverse out of the root directory, if it is not an
|
| 172 |
+
* actual root directory on the filesystem, and any non-absolute
|
| 173 |
+
* patterns will be matched in the `cwd`. For example, the
|
| 174 |
+
* pattern `/../*` with `{root:'/some/path'}` will return all
|
| 175 |
+
* files in `/some`, not all files in `/some/path`. The pattern
|
| 176 |
+
* `*` with `{root:'/some/path'}` will return all the entries in
|
| 177 |
+
* the cwd, not the entries in `/some/path`.
|
| 178 |
+
*
|
| 179 |
+
* To start absolute and non-absolute patterns in the same
|
| 180 |
+
* path, you can use `{root:''}`. However, be aware that on
|
| 181 |
+
* Windows systems, a pattern like `x:/*` or `//host/share/*` will
|
| 182 |
+
* _always_ start in the `x:/` or `//host/share` directory,
|
| 183 |
+
* regardless of the `root` setting.
|
| 184 |
+
*/
|
| 185 |
+
root?: string;
|
| 186 |
+
/**
|
| 187 |
+
* A [PathScurry](http://npm.im/path-scurry) object used
|
| 188 |
+
* to traverse the file system. If the `nocase` option is set
|
| 189 |
+
* explicitly, then any provided `scurry` object must match this
|
| 190 |
+
* setting.
|
| 191 |
+
*/
|
| 192 |
+
scurry?: PathScurry;
|
| 193 |
+
/**
|
| 194 |
+
* Call `lstat()` on all entries, whether required or not to determine
|
| 195 |
+
* if it's a valid match. When used with {@link withFileTypes}, this means
|
| 196 |
+
* that matches will include data such as modified time, permissions, and
|
| 197 |
+
* so on. Note that this will incur a performance cost due to the added
|
| 198 |
+
* system calls.
|
| 199 |
+
*/
|
| 200 |
+
stat?: boolean;
|
| 201 |
+
/**
|
| 202 |
+
* An AbortSignal which will cancel the Glob walk when
|
| 203 |
+
* triggered.
|
| 204 |
+
*/
|
| 205 |
+
signal?: AbortSignal;
|
| 206 |
+
/**
|
| 207 |
+
* Use `\\` as a path separator _only_, and
|
| 208 |
+
* _never_ as an escape character. If set, all `\\` characters are
|
| 209 |
+
* replaced with `/` in the pattern.
|
| 210 |
+
*
|
| 211 |
+
* Note that this makes it **impossible** to match against paths
|
| 212 |
+
* containing literal glob pattern characters, but allows matching
|
| 213 |
+
* with patterns constructed using `path.join()` and
|
| 214 |
+
* `path.resolve()` on Windows platforms, mimicking the (buggy!)
|
| 215 |
+
* behavior of Glob v7 and before on Windows. Please use with
|
| 216 |
+
* caution, and be mindful of [the caveat below about Windows
|
| 217 |
+
* paths](#windows). (For legacy reasons, this is also set if
|
| 218 |
+
* `allowWindowsEscape` is set to the exact value `false`.)
|
| 219 |
+
*/
|
| 220 |
+
windowsPathsNoEscape?: boolean;
|
| 221 |
+
/**
|
| 222 |
+
* Return [PathScurry](http://npm.im/path-scurry)
|
| 223 |
+
* `Path` objects instead of strings. These are similar to a
|
| 224 |
+
* NodeJS `Dirent` object, but with additional methods and
|
| 225 |
+
* properties.
|
| 226 |
+
*
|
| 227 |
+
* Conflicts with {@link absolute}
|
| 228 |
+
*/
|
| 229 |
+
withFileTypes?: boolean;
|
| 230 |
+
/**
|
| 231 |
+
* An fs implementation to override some or all of the defaults. See
|
| 232 |
+
* http://npm.im/path-scurry for details about what can be overridden.
|
| 233 |
+
*/
|
| 234 |
+
fs?: FSOption;
|
| 235 |
+
/**
|
| 236 |
+
* Just passed along to Minimatch. Note that this makes all pattern
|
| 237 |
+
* matching operations slower and *extremely* noisy.
|
| 238 |
+
*/
|
| 239 |
+
debug?: boolean;
|
| 240 |
+
/**
|
| 241 |
+
* Return `/` delimited paths, even on Windows.
|
| 242 |
+
*
|
| 243 |
+
* On posix systems, this has no effect. But, on Windows, it means that
|
| 244 |
+
* paths will be `/` delimited, and absolute paths will be their full
|
| 245 |
+
* resolved UNC forms, eg instead of `'C:\\foo\\bar'`, it would return
|
| 246 |
+
* `'//?/C:/foo/bar'`
|
| 247 |
+
*/
|
| 248 |
+
posix?: boolean;
|
| 249 |
+
/**
|
| 250 |
+
* Do not match any children of any matches. For example, the pattern
|
| 251 |
+
* `**\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.
|
| 252 |
+
*
|
| 253 |
+
* This is especially useful for cases like "find all `node_modules`
|
| 254 |
+
* folders, but not the ones in `node_modules`".
|
| 255 |
+
*
|
| 256 |
+
* In order to support this, the `Ignore` implementation must support an
|
| 257 |
+
* `add(pattern: string)` method. If using the default `Ignore` class, then
|
| 258 |
+
* this is fine, but if this is set to `false`, and a custom `Ignore` is
|
| 259 |
+
* provided that does not have an `add()` method, then it will throw an
|
| 260 |
+
* error.
|
| 261 |
+
*
|
| 262 |
+
* **Caveat** It *only* ignores matches that would be a descendant of a
|
| 263 |
+
* previous match, and only if that descendant is matched *after* the
|
| 264 |
+
* ancestor is encountered. Since the file system walk happens in
|
| 265 |
+
* indeterminate order, it's possible that a match will already be added
|
| 266 |
+
* before its ancestor, if multiple or braced patterns are used.
|
| 267 |
+
*
|
| 268 |
+
* For example:
|
| 269 |
+
*
|
| 270 |
+
* ```ts
|
| 271 |
+
* const results = await glob([
|
| 272 |
+
* // likely to match first, since it's just a stat
|
| 273 |
+
* 'a/b/c/d/e/f',
|
| 274 |
+
*
|
| 275 |
+
* // this pattern is more complicated! It must to various readdir()
|
| 276 |
+
* // calls and test the results against a regular expression, and that
|
| 277 |
+
* // is certainly going to take a little bit longer.
|
| 278 |
+
* //
|
| 279 |
+
* // So, later on, it encounters a match at 'a/b/c/d/e', but it's too
|
| 280 |
+
* // late to ignore a/b/c/d/e/f, because it's already been emitted.
|
| 281 |
+
* 'a/[bdf]/?/[a-z]/*',
|
| 282 |
+
* ], { includeChildMatches: false })
|
| 283 |
+
* ```
|
| 284 |
+
*
|
| 285 |
+
* It's best to only set this to `false` if you can be reasonably sure that
|
| 286 |
+
* no components of the pattern will potentially match one another's file
|
| 287 |
+
* system descendants, or if the occasional included child entry will not
|
| 288 |
+
* cause problems.
|
| 289 |
+
*
|
| 290 |
+
* @default true
|
| 291 |
+
*/
|
| 292 |
+
includeChildMatches?: boolean;
|
| 293 |
+
}
|
| 294 |
+
export type GlobOptionsWithFileTypesTrue = GlobOptions & {
|
| 295 |
+
withFileTypes: true;
|
| 296 |
+
absolute?: undefined;
|
| 297 |
+
mark?: undefined;
|
| 298 |
+
posix?: undefined;
|
| 299 |
+
};
|
| 300 |
+
export type GlobOptionsWithFileTypesFalse = GlobOptions & {
|
| 301 |
+
withFileTypes?: false;
|
| 302 |
+
};
|
| 303 |
+
export type GlobOptionsWithFileTypesUnset = GlobOptions & {
|
| 304 |
+
withFileTypes?: undefined;
|
| 305 |
+
};
|
| 306 |
+
export type Result<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? Path : Opts extends GlobOptionsWithFileTypesFalse ? string : Opts extends GlobOptionsWithFileTypesUnset ? string : string | Path;
|
| 307 |
+
export type Results<Opts> = Result<Opts>[];
|
| 308 |
+
export type FileTypes<Opts> = Opts extends GlobOptionsWithFileTypesTrue ? true : Opts extends GlobOptionsWithFileTypesFalse ? false : Opts extends GlobOptionsWithFileTypesUnset ? false : boolean;
|
| 309 |
+
/**
|
| 310 |
+
* An object that can perform glob pattern traversals.
|
| 311 |
+
*/
|
| 312 |
+
export declare class Glob<Opts extends GlobOptions> implements GlobOptions {
|
| 313 |
+
absolute?: boolean;
|
| 314 |
+
cwd: string;
|
| 315 |
+
root?: string;
|
| 316 |
+
dot: boolean;
|
| 317 |
+
dotRelative: boolean;
|
| 318 |
+
follow: boolean;
|
| 319 |
+
ignore?: string | string[] | IgnoreLike;
|
| 320 |
+
magicalBraces: boolean;
|
| 321 |
+
mark?: boolean;
|
| 322 |
+
matchBase: boolean;
|
| 323 |
+
maxDepth: number;
|
| 324 |
+
nobrace: boolean;
|
| 325 |
+
nocase: boolean;
|
| 326 |
+
nodir: boolean;
|
| 327 |
+
noext: boolean;
|
| 328 |
+
noglobstar: boolean;
|
| 329 |
+
pattern: string[];
|
| 330 |
+
platform: NodeJS.Platform;
|
| 331 |
+
realpath: boolean;
|
| 332 |
+
scurry: PathScurry;
|
| 333 |
+
stat: boolean;
|
| 334 |
+
signal?: AbortSignal;
|
| 335 |
+
windowsPathsNoEscape: boolean;
|
| 336 |
+
withFileTypes: FileTypes<Opts>;
|
| 337 |
+
includeChildMatches: boolean;
|
| 338 |
+
/**
|
| 339 |
+
* The options provided to the constructor.
|
| 340 |
+
*/
|
| 341 |
+
opts: Opts;
|
| 342 |
+
/**
|
| 343 |
+
* An array of parsed immutable {@link Pattern} objects.
|
| 344 |
+
*/
|
| 345 |
+
patterns: Pattern[];
|
| 346 |
+
/**
|
| 347 |
+
* All options are stored as properties on the `Glob` object.
|
| 348 |
+
*
|
| 349 |
+
* See {@link GlobOptions} for full options descriptions.
|
| 350 |
+
*
|
| 351 |
+
* Note that a previous `Glob` object can be passed as the
|
| 352 |
+
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
| 353 |
+
* and caches with a new pattern.
|
| 354 |
+
*
|
| 355 |
+
* Traversal functions can be called multiple times to run the walk
|
| 356 |
+
* again.
|
| 357 |
+
*/
|
| 358 |
+
constructor(pattern: string | string[], opts: Opts);
|
| 359 |
+
/**
|
| 360 |
+
* Returns a Promise that resolves to the results array.
|
| 361 |
+
*/
|
| 362 |
+
walk(): Promise<Results<Opts>>;
|
| 363 |
+
/**
|
| 364 |
+
* synchronous {@link Glob.walk}
|
| 365 |
+
*/
|
| 366 |
+
walkSync(): Results<Opts>;
|
| 367 |
+
/**
|
| 368 |
+
* Stream results asynchronously.
|
| 369 |
+
*/
|
| 370 |
+
stream(): Minipass<Result<Opts>, Result<Opts>>;
|
| 371 |
+
/**
|
| 372 |
+
* Stream results synchronously.
|
| 373 |
+
*/
|
| 374 |
+
streamSync(): Minipass<Result<Opts>, Result<Opts>>;
|
| 375 |
+
/**
|
| 376 |
+
* Default sync iteration function. Returns a Generator that
|
| 377 |
+
* iterates over the results.
|
| 378 |
+
*/
|
| 379 |
+
iterateSync(): Generator<Result<Opts>, void, void>;
|
| 380 |
+
[Symbol.iterator](): Generator<Result<Opts>, void, void>;
|
| 381 |
+
/**
|
| 382 |
+
* Default async iteration function. Returns an AsyncGenerator that
|
| 383 |
+
* iterates over the results.
|
| 384 |
+
*/
|
| 385 |
+
iterate(): AsyncGenerator<Result<Opts>, void, void>;
|
| 386 |
+
[Symbol.asyncIterator](): AsyncGenerator<Result<Opts>, void, void>;
|
| 387 |
+
}
|
| 388 |
+
//# sourceMappingURL=glob.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/glob.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAEnC,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,UAAU,EAIX,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAGtC,MAAM,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;AACvC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC,CAAA;AAalE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,W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path-scurry';
|
| 4 |
+
import { Pattern } from './pattern.js';
|
| 5 |
+
import { GlobStream, GlobWalker } from './walker.js';
|
| 6 |
+
// if no process global, just call it linux.
|
| 7 |
+
// so we default to case-sensitive, / separators
|
| 8 |
+
const defaultPlatform = (typeof process === 'object' &&
|
| 9 |
+
process &&
|
| 10 |
+
typeof process.platform === 'string') ?
|
| 11 |
+
process.platform
|
| 12 |
+
: 'linux';
|
| 13 |
+
/**
|
| 14 |
+
* An object that can perform glob pattern traversals.
|
| 15 |
+
*/
|
| 16 |
+
export class Glob {
|
| 17 |
+
absolute;
|
| 18 |
+
cwd;
|
| 19 |
+
root;
|
| 20 |
+
dot;
|
| 21 |
+
dotRelative;
|
| 22 |
+
follow;
|
| 23 |
+
ignore;
|
| 24 |
+
magicalBraces;
|
| 25 |
+
mark;
|
| 26 |
+
matchBase;
|
| 27 |
+
maxDepth;
|
| 28 |
+
nobrace;
|
| 29 |
+
nocase;
|
| 30 |
+
nodir;
|
| 31 |
+
noext;
|
| 32 |
+
noglobstar;
|
| 33 |
+
pattern;
|
| 34 |
+
platform;
|
| 35 |
+
realpath;
|
| 36 |
+
scurry;
|
| 37 |
+
stat;
|
| 38 |
+
signal;
|
| 39 |
+
windowsPathsNoEscape;
|
| 40 |
+
withFileTypes;
|
| 41 |
+
includeChildMatches;
|
| 42 |
+
/**
|
| 43 |
+
* The options provided to the constructor.
|
| 44 |
+
*/
|
| 45 |
+
opts;
|
| 46 |
+
/**
|
| 47 |
+
* An array of parsed immutable {@link Pattern} objects.
|
| 48 |
+
*/
|
| 49 |
+
patterns;
|
| 50 |
+
/**
|
| 51 |
+
* All options are stored as properties on the `Glob` object.
|
| 52 |
+
*
|
| 53 |
+
* See {@link GlobOptions} for full options descriptions.
|
| 54 |
+
*
|
| 55 |
+
* Note that a previous `Glob` object can be passed as the
|
| 56 |
+
* `GlobOptions` to another `Glob` instantiation to re-use settings
|
| 57 |
+
* and caches with a new pattern.
|
| 58 |
+
*
|
| 59 |
+
* Traversal functions can be called multiple times to run the walk
|
| 60 |
+
* again.
|
| 61 |
+
*/
|
| 62 |
+
constructor(pattern, opts) {
|
| 63 |
+
/* c8 ignore start */
|
| 64 |
+
if (!opts)
|
| 65 |
+
throw new TypeError('glob options required');
|
| 66 |
+
/* c8 ignore stop */
|
| 67 |
+
this.withFileTypes = !!opts.withFileTypes;
|
| 68 |
+
this.signal = opts.signal;
|
| 69 |
+
this.follow = !!opts.follow;
|
| 70 |
+
this.dot = !!opts.dot;
|
| 71 |
+
this.dotRelative = !!opts.dotRelative;
|
| 72 |
+
this.nodir = !!opts.nodir;
|
| 73 |
+
this.mark = !!opts.mark;
|
| 74 |
+
if (!opts.cwd) {
|
| 75 |
+
this.cwd = '';
|
| 76 |
+
}
|
| 77 |
+
else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
|
| 78 |
+
opts.cwd = fileURLToPath(opts.cwd);
|
| 79 |
+
}
|
| 80 |
+
this.cwd = opts.cwd || '';
|
| 81 |
+
this.root = opts.root;
|
| 82 |
+
this.magicalBraces = !!opts.magicalBraces;
|
| 83 |
+
this.nobrace = !!opts.nobrace;
|
| 84 |
+
this.noext = !!opts.noext;
|
| 85 |
+
this.realpath = !!opts.realpath;
|
| 86 |
+
this.absolute = opts.absolute;
|
| 87 |
+
this.includeChildMatches = opts.includeChildMatches !== false;
|
| 88 |
+
this.noglobstar = !!opts.noglobstar;
|
| 89 |
+
this.matchBase = !!opts.matchBase;
|
| 90 |
+
this.maxDepth =
|
| 91 |
+
typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;
|
| 92 |
+
this.stat = !!opts.stat;
|
| 93 |
+
this.ignore = opts.ignore;
|
| 94 |
+
if (this.withFileTypes && this.absolute !== undefined) {
|
| 95 |
+
throw new Error('cannot set absolute and withFileTypes:true');
|
| 96 |
+
}
|
| 97 |
+
if (typeof pattern === 'string') {
|
| 98 |
+
pattern = [pattern];
|
| 99 |
+
}
|
| 100 |
+
this.windowsPathsNoEscape =
|
| 101 |
+
!!opts.windowsPathsNoEscape ||
|
| 102 |
+
opts.allowWindowsEscape ===
|
| 103 |
+
false;
|
| 104 |
+
if (this.windowsPathsNoEscape) {
|
| 105 |
+
pattern = pattern.map(p => p.replace(/\\/g, '/'));
|
| 106 |
+
}
|
| 107 |
+
if (this.matchBase) {
|
| 108 |
+
if (opts.noglobstar) {
|
| 109 |
+
throw new TypeError('base matching requires globstar');
|
| 110 |
+
}
|
| 111 |
+
pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));
|
| 112 |
+
}
|
| 113 |
+
this.pattern = pattern;
|
| 114 |
+
this.platform = opts.platform || defaultPlatform;
|
| 115 |
+
this.opts = { ...opts, platform: this.platform };
|
| 116 |
+
if (opts.scurry) {
|
| 117 |
+
this.scurry = opts.scurry;
|
| 118 |
+
if (opts.nocase !== undefined &&
|
| 119 |
+
opts.nocase !== opts.scurry.nocase) {
|
| 120 |
+
throw new Error('nocase option contradicts provided scurry option');
|
| 121 |
+
}
|
| 122 |
+
}
|
| 123 |
+
else {
|
| 124 |
+
const Scurry = opts.platform === 'win32' ? PathScurryWin32
|
| 125 |
+
: opts.platform === 'darwin' ? PathScurryDarwin
|
| 126 |
+
: opts.platform ? PathScurryPosix
|
| 127 |
+
: PathScurry;
|
| 128 |
+
this.scurry = new Scurry(this.cwd, {
|
| 129 |
+
nocase: opts.nocase,
|
| 130 |
+
fs: opts.fs,
|
| 131 |
+
});
|
| 132 |
+
}
|
| 133 |
+
this.nocase = this.scurry.nocase;
|
| 134 |
+
// If you do nocase:true on a case-sensitive file system, then
|
| 135 |
+
// we need to use regexps instead of strings for non-magic
|
| 136 |
+
// path portions, because statting `aBc` won't return results
|
| 137 |
+
// for the file `AbC` for example.
|
| 138 |
+
const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32';
|
| 139 |
+
const mmo = {
|
| 140 |
+
// default nocase based on platform
|
| 141 |
+
...opts,
|
| 142 |
+
dot: this.dot,
|
| 143 |
+
matchBase: this.matchBase,
|
| 144 |
+
nobrace: this.nobrace,
|
| 145 |
+
nocase: this.nocase,
|
| 146 |
+
nocaseMagicOnly,
|
| 147 |
+
nocomment: true,
|
| 148 |
+
noext: this.noext,
|
| 149 |
+
nonegate: true,
|
| 150 |
+
optimizationLevel: 2,
|
| 151 |
+
platform: this.platform,
|
| 152 |
+
windowsPathsNoEscape: this.windowsPathsNoEscape,
|
| 153 |
+
debug: !!this.opts.debug,
|
| 154 |
+
};
|
| 155 |
+
const mms = this.pattern.map(p => new Minimatch(p, mmo));
|
| 156 |
+
const [matchSet, globParts] = mms.reduce((set, m) => {
|
| 157 |
+
set[0].push(...m.set);
|
| 158 |
+
set[1].push(...m.globParts);
|
| 159 |
+
return set;
|
| 160 |
+
}, [[], []]);
|
| 161 |
+
this.patterns = matchSet.map((set, i) => {
|
| 162 |
+
const g = globParts[i];
|
| 163 |
+
/* c8 ignore start */
|
| 164 |
+
if (!g)
|
| 165 |
+
throw new Error('invalid pattern object');
|
| 166 |
+
/* c8 ignore stop */
|
| 167 |
+
return new Pattern(set, g, 0, this.platform);
|
| 168 |
+
});
|
| 169 |
+
}
|
| 170 |
+
async walk() {
|
| 171 |
+
// Walkers always return array of Path objects, so we just have to
|
| 172 |
+
// coerce them into the right shape. It will have already called
|
| 173 |
+
// realpath() if the option was set to do so, so we know that's cached.
|
| 174 |
+
// start out knowing the cwd, at least
|
| 175 |
+
return [
|
| 176 |
+
...(await new GlobWalker(this.patterns, this.scurry.cwd, {
|
| 177 |
+
...this.opts,
|
| 178 |
+
maxDepth: this.maxDepth !== Infinity ?
|
| 179 |
+
this.maxDepth + this.scurry.cwd.depth()
|
| 180 |
+
: Infinity,
|
| 181 |
+
platform: this.platform,
|
| 182 |
+
nocase: this.nocase,
|
| 183 |
+
includeChildMatches: this.includeChildMatches,
|
| 184 |
+
}).walk()),
|
| 185 |
+
];
|
| 186 |
+
}
|
| 187 |
+
walkSync() {
|
| 188 |
+
return [
|
| 189 |
+
...new GlobWalker(this.patterns, this.scurry.cwd, {
|
| 190 |
+
...this.opts,
|
| 191 |
+
maxDepth: this.maxDepth !== Infinity ?
|
| 192 |
+
this.maxDepth + this.scurry.cwd.depth()
|
| 193 |
+
: Infinity,
|
| 194 |
+
platform: this.platform,
|
| 195 |
+
nocase: this.nocase,
|
| 196 |
+
includeChildMatches: this.includeChildMatches,
|
| 197 |
+
}).walkSync(),
|
| 198 |
+
];
|
| 199 |
+
}
|
| 200 |
+
stream() {
|
| 201 |
+
return new GlobStream(this.patterns, this.scurry.cwd, {
|
| 202 |
+
...this.opts,
|
| 203 |
+
maxDepth: this.maxDepth !== Infinity ?
|
| 204 |
+
this.maxDepth + this.scurry.cwd.depth()
|
| 205 |
+
: Infinity,
|
| 206 |
+
platform: this.platform,
|
| 207 |
+
nocase: this.nocase,
|
| 208 |
+
includeChildMatches: this.includeChildMatches,
|
| 209 |
+
}).stream();
|
| 210 |
+
}
|
| 211 |
+
streamSync() {
|
| 212 |
+
return new GlobStream(this.patterns, this.scurry.cwd, {
|
| 213 |
+
...this.opts,
|
| 214 |
+
maxDepth: this.maxDepth !== Infinity ?
|
| 215 |
+
this.maxDepth + this.scurry.cwd.depth()
|
| 216 |
+
: Infinity,
|
| 217 |
+
platform: this.platform,
|
| 218 |
+
nocase: this.nocase,
|
| 219 |
+
includeChildMatches: this.includeChildMatches,
|
| 220 |
+
}).streamSync();
|
| 221 |
+
}
|
| 222 |
+
/**
|
| 223 |
+
* Default sync iteration function. Returns a Generator that
|
| 224 |
+
* iterates over the results.
|
| 225 |
+
*/
|
| 226 |
+
iterateSync() {
|
| 227 |
+
return this.streamSync()[Symbol.iterator]();
|
| 228 |
+
}
|
| 229 |
+
[Symbol.iterator]() {
|
| 230 |
+
return this.iterateSync();
|
| 231 |
+
}
|
| 232 |
+
/**
|
| 233 |
+
* Default async iteration function. Returns an AsyncGenerator that
|
| 234 |
+
* iterates over the results.
|
| 235 |
+
*/
|
| 236 |
+
iterate() {
|
| 237 |
+
return this.stream()[Symbol.asyncIterator]();
|
| 238 |
+
}
|
| 239 |
+
[Symbol.asyncIterator]() {
|
| 240 |
+
return this.iterate();
|
| 241 |
+
}
|
| 242 |
+
}
|
| 243 |
+
//# sourceMappingURL=glob.js.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/glob.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"glob.js","sourceRoot":"","sources":["../../src/glob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,WAAW,CAAA;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAGL,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,eAAe,GAChB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAKpD,4CAA4C;AAC5C,gDAAgD;AAChD,MAAM,eAAe,GACnB,CACE,OAAO,OAAO,KAAK,QAAQ;IAC3B,OAAO;IACP,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CACrC,CAAC,CAAC;IACD,OAAO,CAAC,QAAQ;IAClB,CAAC,CAAC,OAAO,CAAA;AAyVX;;GAEG;AACH,MAAM,OAAO,IAAI;IACf,QAAQ,CAAU;IAClB,GAAG,CAAQ;IACX,IAAI,CAAS;IACb,GAAG,CAAS;IACZ,WAAW,CAAS;IACpB,MAAM,CAAS;IACf,MAAM,CAAiC;IACvC,aAAa,CAAS;IACtB,IAAI,CAAU;IACd,SAAS,CAAS;IAClB,QAAQ,CAAQ;IAChB,OAAO,CAAS;IAChB,MAAM,CAAS;IACf,KAAK,CAAS;IACd,KAAK,CAAS;IACd,UAAU,CAAS;IACnB,OAAO,CAAU;IACjB,QAAQ,CAAiB;IACzB,QAAQ,CAAS;IACjB,MAAM,CAAY;IAClB,IAAI,CA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WAAW;QACT,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;IAC7C,CAAC;IACD,CAAC,MAAM,CAAC,QAAQ,CAAC;QACf,OAAO,IAAI,CAAC,WAAW,EAAE,CAAA;IAC3B,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,CAAA;IAC9C,CAAC;IACD,CAAC,MAAM,CAAC,aAAa,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACvB,CAAC;CACF","sourcesContent":["import { Minimatch, MinimatchOptions } from 'minimatch'\nimport { Minipass } from 'minipass'\nimport { fileURLToPath } from 'node:url'\nimport {\n FSOption,\n Path,\n PathScurry,\n PathScurryDarwin,\n PathScurryPosix,\n PathScurryWin32,\n} from 'path-scurry'\nimport { IgnoreLike } from './ignore.js'\nimport { Pattern } from './pattern.js'\nimport { GlobStream, GlobWalker } from './walker.js'\n\nexport type MatchSet = Minimatch['set']\nexport type GlobParts = Exclude<Minimatch['globParts'], undefined>\n\n// if no process global, just call it linux.\n// so we default to case-sensitive, / separators\nconst defaultPlatform: NodeJS.Platform =\n (\n typeof process === 'object' &&\n process &&\n typeof process.platform === 'string'\n ) ?\n process.platform\n : 'linux'\n\n/**\n * A `GlobOptions` object may be provided to any of the exported methods, and\n * must be provided to the `Glob` constructor.\n *\n * All options are optional, boolean, and false by default, unless otherwise\n * noted.\n *\n * All resolved options are added to the Glob object as properties.\n *\n * If you are running many `glob` operations, you can pass a Glob object as the\n * `options` argument to a subsequent operation to share the previously loaded\n * cache.\n */\nexport interface GlobOptions {\n /**\n * Set to `true` to always receive absolute paths for\n * matched files. Set to `false` to always return relative paths.\n *\n * When this option is not set, absolute paths are returned for patterns\n * that are absolute, and otherwise paths are returned that are relative\n * to the `cwd` setting.\n *\n * This does _not_ make an extra system call to get\n * the realpath, it only does string path resolution.\n *\n * Conflicts with {@link withFileTypes}\n */\n absolute?: boolean\n\n /**\n * Set to false to enable {@link windowsPathsNoEscape}\n *\n * @deprecated\n */\n allowWindowsEscape?: boolean\n\n /**\n * The current working directory in which to search. Defaults to\n * `process.cwd()`.\n *\n * May be eiher a string path or a `file://` URL object or string.\n */\n cwd?: string | URL\n\n /**\n * Include `.dot` files in normal matches and `globstar`\n * matches. Note that an explicit dot in a portion of the pattern\n * will always match dot files.\n */\n dot?: boolean\n\n /**\n * Prepend all relative path strings with `./` (or `.\\` on Windows).\n *\n * Without this option, returned relative paths are \"bare\", so instead of\n * returning `'./foo/bar'`, they are returned as `'foo/bar'`.\n *\n * Relative patterns starting with `'../'` are not prepended with `./`, even\n * if this option is set.\n */\n dotRelative?: boolean\n\n /**\n * Follow symlinked directories when expanding `**`\n * patterns. This can result in a lot of duplicate references in\n * the presence of cyclic links, and make performance quite bad.\n *\n * By default, a `**` in a pattern will follow 1 symbolic link if\n * it is not the first item in the pattern, or none if it is the\n * first item in the pattern, following the same behavior as Bash.\n */\n follow?: boolean\n\n /**\n * string or string[], or an object with `ignored` and `childrenIgnored`\n * methods.\n *\n * If a string or string[] is provided, then this is treated as a glob\n * pattern or array of glob patterns to exclude from matches. To ignore all\n * children within a directory, as well as the entry itself, append `'/**'`\n * to the ignore pattern.\n *\n * **Note** `ignore` patterns are _always_ in `dot:true` mode, regardless of\n * any other settings.\n *\n * If an object is provided that has `ignored(path)` and/or\n * `childrenIgnored(path)` methods, then these methods will be called to\n * determine whether any Path is a match or if its children should be\n * traversed, respectively.\n */\n ignore?: string | string[] | IgnoreLike\n\n /**\n * Treat brace expansion like `{a,b}` as a \"magic\" pattern. Has no\n * effect if {@link nobrace} is set.\n *\n * Only has effect on the {@link hasMagic} function.\n */\n magicalBraces?: boolean\n\n /**\n * Add a `/` character to directory matches. Note that this requires\n * additional stat calls in some cases.\n */\n mark?: boolean\n\n /**\n * Perform a basename-only match if the pattern does not contain any slash\n * characters. That is, `*.js` would be treated as equivalent to\n * `**\\/*.js`, matching all js files in all directories.\n */\n matchBase?: boolean\n\n /**\n * Limit the directory traversal to a given depth below the cwd.\n * Note that this does NOT prevent traversal to sibling folders,\n * root patterns, and so on. It only limits the maximum folder depth\n * that the walk will descend, relative to the cwd.\n */\n maxDepth?: number\n\n /**\n * Do not expand `{a,b}` and `{1..3}` brace sets.\n */\n nobrace?: boolean\n\n /**\n * Perform a case-insensitive match. This defaults to `true` on macOS and\n * Windows systems, and `false` on all others.\n *\n * **Note** `nocase` should only be explicitly set when it is\n * known that the filesystem's case sensitivity differs from the\n * platform default. If set `true` on case-sensitive file\n * systems, or `false` on case-insensitive file systems, then the\n * walk may return more or less results than expected.\n */\n nocase?: boolean\n\n /**\n * Do not match directories, only files. (Note: to match\n * _only_ directories, put a `/` at the end of the pattern.)\n */\n nodir?: boolean\n\n /**\n * Do not match \"extglob\" patterns such as `+(a|b)`.\n */\n noext?: boolean\n\n /**\n * Do not match `**` against multiple filenames. (Ie, treat it as a normal\n * `*` instead.)\n *\n * Conflicts with {@link matchBase}\n */\n noglobstar?: boolean\n\n /**\n * Defaults to value of `process.platform` if available, or `'linux'` if\n * not. Setting `platform:'win32'` on non-Windows systems may cause strange\n * behavior.\n */\n platform?: NodeJS.Platform\n\n /**\n * Set to true to call `fs.realpath` on all of the\n * results. In the case of an entry that cannot be resolved, the\n * entry is omitted. This incurs a slight performance penalty, of\n * course, because of the added system calls.\n */\n realpath?: boolean\n\n /**\n *\n * A string path resolved against the `cwd` option, which\n * is used as the starting point for absolute patterns that start\n * with `/`, (but not drive letters or UNC paths on Windows).\n *\n * Note that this _doesn't_ necessarily limit the walk to the\n * `root` directory, and doesn't affect the cwd starting point for\n * non-absolute patterns. A pattern containing `..` will still be\n * able to traverse out of the root directory, if it is not an\n * actual root directory on the filesystem, and any non-absolute\n * patterns will be matched in the `cwd`. For example, the\n * pattern `/../*` with `{root:'/some/path'}` will return all\n * files in `/some`, not all files in `/some/path`. The pattern\n * `*` with `{root:'/some/path'}` will return all the entries in\n * the cwd, not the entries in `/some/path`.\n *\n * To start absolute and non-absolute patterns in the same\n * path, you can use `{root:''}`. However, be aware that on\n * Windows systems, a pattern like `x:/*` or `//host/share/*` will\n * _always_ start in the `x:/` or `//host/share` directory,\n * regardless of the `root` setting.\n */\n root?: string\n\n /**\n * A [PathScurry](http://npm.im/path-scurry) object used\n * to traverse the file system. If the `nocase` option is set\n * explicitly, then any provided `scurry` object must match this\n * setting.\n */\n scurry?: PathScurry\n\n /**\n * Call `lstat()` on all entries, whether required or not to determine\n * if it's a valid match. When used with {@link withFileTypes}, this means\n * that matches will include data such as modified time, permissions, and\n * so on. Note that this will incur a performance cost due to the added\n * system calls.\n */\n stat?: boolean\n\n /**\n * An AbortSignal which will cancel the Glob walk when\n * triggered.\n */\n signal?: AbortSignal\n\n /**\n * Use `\\\\` as a path separator _only_, and\n * _never_ as an escape character. If set, all `\\\\` characters are\n * replaced with `/` in the pattern.\n *\n * Note that this makes it **impossible** to match against paths\n * containing literal glob pattern characters, but allows matching\n * with patterns constructed using `path.join()` and\n * `path.resolve()` on Windows platforms, mimicking the (buggy!)\n * behavior of Glob v7 and before on Windows. Please use with\n * caution, and be mindful of [the caveat below about Windows\n * paths](#windows). (For legacy reasons, this is also set if\n * `allowWindowsEscape` is set to the exact value `false`.)\n */\n windowsPathsNoEscape?: boolean\n\n /**\n * Return [PathScurry](http://npm.im/path-scurry)\n * `Path` objects instead of strings. These are similar to a\n * NodeJS `Dirent` object, but with additional methods and\n * properties.\n *\n * Conflicts with {@link absolute}\n */\n withFileTypes?: boolean\n\n /**\n * An fs implementation to override some or all of the defaults. See\n * http://npm.im/path-scurry for details about what can be overridden.\n */\n fs?: FSOption\n\n /**\n * Just passed along to Minimatch. Note that this makes all pattern\n * matching operations slower and *extremely* noisy.\n */\n debug?: boolean\n\n /**\n * Return `/` delimited paths, even on Windows.\n *\n * On posix systems, this has no effect. But, on Windows, it means that\n * paths will be `/` delimited, and absolute paths will be their full\n * resolved UNC forms, eg instead of `'C:\\\\foo\\\\bar'`, it would return\n * `'//?/C:/foo/bar'`\n */\n posix?: boolean\n\n /**\n * Do not match any children of any matches. For example, the pattern\n * `**\\/foo` would match `a/foo`, but not `a/foo/b/foo` in this mode.\n *\n * This is especially useful for cases like \"find all `node_modules`\n * folders, but not the ones in `node_modules`\".\n *\n * In order to support this, the `Ignore` implementation must support an\n * `add(pattern: string)` method. If using the default `Ignore` class, then\n * this is fine, but if this is set to `false`, and a custom `Ignore` is\n * provided that does not have an `add()` method, then it will throw an\n * error.\n *\n * **Caveat** It *only* ignores matches that would be a descendant of a\n * previous match, and only if that descendant is matched *after* the\n * ancestor is encountered. Since the file system walk happens in\n * indeterminate order, it's possible that a match will already be added\n * before its ancestor, if multiple or braced patterns are used.\n *\n * For example:\n *\n * ```ts\n * const results = await glob([\n * // likely to match first, since it's just a stat\n * 'a/b/c/d/e/f',\n *\n * // this pattern is more complicated! It must to various readdir()\n * // calls and test the results against a regular expression, and that\n * // is certainly going to take a little bit longer.\n * //\n * // So, later on, it encounters a match at 'a/b/c/d/e', but it's too\n * // late to ignore a/b/c/d/e/f, because it's already been emitted.\n * 'a/[bdf]/?/[a-z]/*',\n * ], { includeChildMatches: false })\n * ```\n *\n * It's best to only set this to `false` if you can be reasonably sure that\n * no components of the pattern will potentially match one another's file\n * system descendants, or if the occasional included child entry will not\n * cause problems.\n *\n * @default true\n */\n includeChildMatches?: boolean\n}\n\nexport type GlobOptionsWithFileTypesTrue = GlobOptions & {\n withFileTypes: true\n // string options not relevant if returning Path objects.\n absolute?: undefined\n mark?: undefined\n posix?: undefined\n}\n\nexport type GlobOptionsWithFileTypesFalse = GlobOptions & {\n withFileTypes?: false\n}\n\nexport type GlobOptionsWithFileTypesUnset = GlobOptions & {\n withFileTypes?: undefined\n}\n\nexport type Result<Opts> =\n Opts extends GlobOptionsWithFileTypesTrue ? Path\n : Opts extends GlobOptionsWithFileTypesFalse ? string\n : Opts extends GlobOptionsWithFileTypesUnset ? string\n : string | Path\nexport type Results<Opts> = Result<Opts>[]\n\nexport type FileTypes<Opts> =\n Opts extends GlobOptionsWithFileTypesTrue ? true\n : Opts extends GlobOptionsWithFileTypesFalse ? false\n : Opts extends GlobOptionsWithFileTypesUnset ? false\n : boolean\n\n/**\n * An object that can perform glob pattern traversals.\n */\nexport class Glob<Opts extends GlobOptions> implements GlobOptions {\n absolute?: boolean\n cwd: string\n root?: string\n dot: boolean\n dotRelative: boolean\n follow: boolean\n ignore?: string | string[] | IgnoreLike\n magicalBraces: boolean\n mark?: boolean\n matchBase: boolean\n maxDepth: number\n nobrace: boolean\n nocase: boolean\n nodir: boolean\n noext: boolean\n noglobstar: boolean\n pattern: string[]\n platform: NodeJS.Platform\n realpath: boolean\n scurry: PathScurry\n stat: boolean\n signal?: AbortSignal\n windowsPathsNoEscape: boolean\n withFileTypes: FileTypes<Opts>\n includeChildMatches: boolean\n\n /**\n * The options provided to the constructor.\n */\n opts: Opts\n\n /**\n * An array of parsed immutable {@link Pattern} objects.\n */\n patterns: Pattern[]\n\n /**\n * All options are stored as properties on the `Glob` object.\n *\n * See {@link GlobOptions} for full options descriptions.\n *\n * Note that a previous `Glob` object can be passed as the\n * `GlobOptions` to another `Glob` instantiation to re-use settings\n * and caches with a new pattern.\n *\n * Traversal functions can be called multiple times to run the walk\n * again.\n */\n constructor(pattern: string | string[], opts: Opts) {\n /* c8 ignore start */\n if (!opts) throw new TypeError('glob options required')\n /* c8 ignore stop */\n this.withFileTypes = !!opts.withFileTypes as FileTypes<Opts>\n this.signal = opts.signal\n this.follow = !!opts.follow\n this.dot = !!opts.dot\n this.dotRelative = !!opts.dotRelative\n this.nodir = !!opts.nodir\n this.mark = !!opts.mark\n if (!opts.cwd) {\n this.cwd = ''\n } else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {\n opts.cwd = fileURLToPath(opts.cwd)\n }\n this.cwd = opts.cwd || ''\n this.root = opts.root\n this.magicalBraces = !!opts.magicalBraces\n this.nobrace = !!opts.nobrace\n this.noext = !!opts.noext\n this.realpath = !!opts.realpath\n this.absolute = opts.absolute\n this.includeChildMatches = opts.includeChildMatches !== false\n\n this.noglobstar = !!opts.noglobstar\n this.matchBase = !!opts.matchBase\n this.maxDepth =\n typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity\n this.stat = !!opts.stat\n this.ignore = opts.ignore\n\n if (this.withFileTypes && this.absolute !== undefined) {\n throw new Error('cannot set absolute and withFileTypes:true')\n }\n\n if (typeof pattern === 'string') {\n pattern = [pattern]\n }\n\n this.windowsPathsNoEscape =\n !!opts.windowsPathsNoEscape ||\n (opts as { allowWindowsEscape?: boolean }).allowWindowsEscape ===\n false\n\n if (this.windowsPathsNoEscape) {\n pattern = pattern.map(p => p.replace(/\\\\/g, '/'))\n }\n\n if (this.matchBase) {\n if (opts.noglobstar) {\n throw new TypeError('base matching requires globstar')\n }\n pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`))\n }\n\n this.pattern = pattern\n\n this.platform = opts.platform || defaultPlatform\n this.opts = { ...opts, platform: this.platform }\n if (opts.scurry) {\n this.scurry = opts.scurry\n if (\n opts.nocase !== undefined &&\n opts.nocase !== opts.scurry.nocase\n ) {\n throw new Error('nocase option contradicts provided scurry option')\n }\n } else {\n const Scurry =\n opts.platform === 'win32' ? PathScurryWin32\n : opts.platform === 'darwin' ? PathScurryDarwin\n : opts.platform ? PathScurryPosix\n : PathScurry\n this.scurry = new Scurry(this.cwd, {\n nocase: opts.nocase,\n fs: opts.fs,\n })\n }\n this.nocase = this.scurry.nocase\n\n // If you do nocase:true on a case-sensitive file system, then\n // we need to use regexps instead of strings for non-magic\n // path portions, because statting `aBc` won't return results\n // for the file `AbC` for example.\n const nocaseMagicOnly =\n this.platform === 'darwin' || this.platform === 'win32'\n\n const mmo: MinimatchOptions = {\n // default nocase based on platform\n ...opts,\n dot: this.dot,\n matchBase: this.matchBase,\n nobrace: this.nobrace,\n nocase: this.nocase,\n nocaseMagicOnly,\n nocomment: true,\n noext: this.noext,\n nonegate: true,\n optimizationLevel: 2,\n platform: this.platform,\n windowsPathsNoEscape: this.windowsPathsNoEscape,\n debug: !!this.opts.debug,\n }\n\n const mms = this.pattern.map(p => new Minimatch(p, mmo))\n const [matchSet, globParts] = mms.reduce(\n (set: [MatchSet, GlobParts], m) => {\n set[0].push(...m.set)\n set[1].push(...m.globParts)\n return set\n },\n [[], []],\n )\n this.patterns = matchSet.map((set, i) => {\n const g = globParts[i]\n /* c8 ignore start */\n if (!g) throw new Error('invalid pattern object')\n /* c8 ignore stop */\n return new Pattern(set, g, 0, this.platform)\n })\n }\n\n /**\n * Returns a Promise that resolves to the results array.\n */\n async walk(): Promise<Results<Opts>>\n async walk(): Promise<(string | Path)[]> {\n // Walkers always return array of Path objects, so we just have to\n // coerce them into the right shape. It will have already called\n // realpath() if the option was set to do so, so we know that's cached.\n // start out knowing the cwd, at least\n return [\n ...(await new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walk()),\n ]\n }\n\n /**\n * synchronous {@link Glob.walk}\n */\n walkSync(): Results<Opts>\n walkSync(): (string | Path)[] {\n return [\n ...new GlobWalker(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).walkSync(),\n ]\n }\n\n /**\n * Stream results asynchronously.\n */\n stream(): Minipass<Result<Opts>, Result<Opts>>\n stream(): Minipass<string | Path, string | Path> {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).stream()\n }\n\n /**\n * Stream results synchronously.\n */\n streamSync(): Minipass<Result<Opts>, Result<Opts>>\n streamSync(): Minipass<string | Path, string | Path> {\n return new GlobStream(this.patterns, this.scurry.cwd, {\n ...this.opts,\n maxDepth:\n this.maxDepth !== Infinity ?\n this.maxDepth + this.scurry.cwd.depth()\n : Infinity,\n platform: this.platform,\n nocase: this.nocase,\n includeChildMatches: this.includeChildMatches,\n }).streamSync()\n }\n\n /**\n * Default sync iteration function. Returns a Generator that\n * iterates over the results.\n */\n iterateSync(): Generator<Result<Opts>, void, void> {\n return this.streamSync()[Symbol.iterator]()\n }\n [Symbol.iterator]() {\n return this.iterateSync()\n }\n\n /**\n * Default async iteration function. Returns an AsyncGenerator that\n * iterates over the results.\n */\n iterate(): AsyncGenerator<Result<Opts>, void, void> {\n return this.stream()[Symbol.asyncIterator]()\n }\n [Symbol.asyncIterator]() {\n return this.iterate()\n }\n}\n"]}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/has-magic.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { GlobOptions } from './glob.js';
|
| 2 |
+
/**
|
| 3 |
+
* Return true if the patterns provided contain any magic glob characters,
|
| 4 |
+
* given the options provided.
|
| 5 |
+
*
|
| 6 |
+
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
| 7 |
+
* is set, as brace expansion just turns one string into an array of strings.
|
| 8 |
+
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
| 9 |
+
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
| 10 |
+
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
| 11 |
+
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
| 12 |
+
*/
|
| 13 |
+
export declare const hasMagic: (pattern: string | string[], options?: GlobOptions) => boolean;
|
| 14 |
+
//# sourceMappingURL=has-magic.d.ts.map
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/has-magic.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"version":3,"file":"has-magic.d.ts","sourceRoot":"","sources":["../../src/has-magic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,YACV,MAAM,GAAG,MAAM,EAAE,YACjB,WAAW,KACnB,OAQF,CAAA"}
|
platform/aiml/elizabeth/e-1-first_session/claude-code-router/node_modules/glob/dist/esm/has-magic.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Minimatch } from 'minimatch';
|
| 2 |
+
/**
|
| 3 |
+
* Return true if the patterns provided contain any magic glob characters,
|
| 4 |
+
* given the options provided.
|
| 5 |
+
*
|
| 6 |
+
* Brace expansion is not considered "magic" unless the `magicalBraces` option
|
| 7 |
+
* is set, as brace expansion just turns one string into an array of strings.
|
| 8 |
+
* So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
|
| 9 |
+
* `'xby'` both do not contain any magic glob characters, and it's treated the
|
| 10 |
+
* same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
|
| 11 |
+
* is in the options, brace expansion _is_ treated as a pattern having magic.
|
| 12 |
+
*/
|
| 13 |
+
export const hasMagic = (pattern, options = {}) => {
|
| 14 |
+
if (!Array.isArray(pattern)) {
|
| 15 |
+
pattern = [pattern];
|
| 16 |
+
}
|
| 17 |
+
for (const p of pattern) {
|
| 18 |
+
if (new Minimatch(p, options).hasMagic())
|
| 19 |
+
return true;
|
| 20 |
+
}
|
| 21 |
+
return false;
|
| 22 |
+
};
|
| 23 |
+
//# sourceMappingURL=has-magic.js.map
|