@cchistory/lite 0.4.5 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INSTALL.md +1 -1
- package/apps/lite-cli/dist/agent-contract.d.ts +4 -5
- package/apps/lite-cli/dist/agent-contract.d.ts.map +1 -1
- package/apps/lite-cli/dist/agent-contract.js +32 -25
- package/apps/lite-cli/dist/agent-contract.js.map +1 -1
- package/apps/lite-cli/dist/bin.js +3 -3
- package/apps/lite-cli/dist/bin.js.map +1 -1
- package/apps/lite-cli/dist/index.d.ts.map +1 -1
- package/apps/lite-cli/dist/index.js +147 -66
- package/apps/lite-cli/dist/index.js.map +1 -1
- package/apps/lite-cli/dist/index.test.js +76 -60
- package/apps/lite-cli/dist/index.test.js.map +1 -1
- package/apps/lite-cli/dist/query.d.ts +4 -1
- package/apps/lite-cli/dist/query.d.ts.map +1 -1
- package/apps/lite-cli/dist/query.js +45 -29
- package/apps/lite-cli/dist/query.js.map +1 -1
- package/apps/lite-cli/dist/resource-errors.d.ts +3 -0
- package/apps/lite-cli/dist/resource-errors.d.ts.map +1 -0
- package/apps/lite-cli/dist/resource-errors.js +17 -0
- package/apps/lite-cli/dist/resource-errors.js.map +1 -0
- package/apps/lite-cli/dist/shell.d.ts +12 -2
- package/apps/lite-cli/dist/shell.d.ts.map +1 -1
- package/apps/lite-cli/dist/shell.js +129 -57
- package/apps/lite-cli/dist/shell.js.map +1 -1
- package/apps/lite-cli/dist/sql-query.test.d.ts +2 -0
- package/apps/lite-cli/dist/sql-query.test.d.ts.map +1 -0
- package/apps/lite-cli/dist/sql-query.test.js +290 -0
- package/apps/lite-cli/dist/sql-query.test.js.map +1 -0
- package/apps/lite-cli/dist/version.d.ts +1 -1
- package/apps/lite-cli/dist/version.js +1 -1
- package/apps/lite-tui/dist/bin.js +3 -3
- package/apps/lite-tui/dist/bin.js.map +1 -1
- package/apps/lite-tui/dist/index.d.ts.map +1 -1
- package/apps/lite-tui/dist/index.js +2 -2
- package/apps/lite-tui/dist/index.js.map +1 -1
- package/apps/lite-tui/dist/index.test.js +5 -3
- package/apps/lite-tui/dist/index.test.js.map +1 -1
- package/apps/lite-tui/dist/render.d.ts +1 -1
- package/apps/lite-tui/dist/version.d.ts +1 -1
- package/apps/lite-tui/dist/version.js +1 -1
- package/bin/cchistory-lite-tui.mjs +3 -3
- package/bin/cchistory-lite.mjs +3 -3
- package/docs/guide/for-agents.md +65 -46
- package/docs/guide/lite.md +49 -11
- package/docs/guide/queries/latest-sessions.sql +4 -0
- package/docs/guide/queries/latest-turns.sql +1 -0
- package/docs/guide/queries/list-sessions.sql +2 -0
- package/docs/guide/query.md +153 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.d.ts +7 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/directory-scope.js +11 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/index.d.ts +5 -1
- package/node_modules/@cchistory/canonical/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/index.js +5 -1
- package/node_modules/@cchistory/canonical/dist/index.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/query.d.ts +15 -0
- package/node_modules/@cchistory/canonical/dist/query.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/query.js +208 -0
- package/node_modules/@cchistory/canonical/dist/query.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-family.d.ts +1 -0
- package/node_modules/@cchistory/canonical/dist/session-family.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/session-family.js +3 -0
- package/node_modules/@cchistory/canonical/dist/session-family.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/session-family.test.js +61 -0
- package/node_modules/@cchistory/canonical/dist/session-family.test.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts +30 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.js +713 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.d.ts +2 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.js +56 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.js.map +1 -0
- package/node_modules/@cchistory/canonical/package.json +1 -1
- package/node_modules/@cchistory/domain/dist/evidence-atoms.d.ts +7 -0
- package/node_modules/@cchistory/domain/dist/evidence-atoms.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/evidence-atoms.js +36 -0
- package/node_modules/@cchistory/domain/dist/evidence-atoms.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.d.ts +26 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.js +80 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/index.d.ts +6 -0
- package/node_modules/@cchistory/domain/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/domain/dist/index.js +5 -0
- package/node_modules/@cchistory/domain/dist/index.js.map +1 -1
- package/node_modules/@cchistory/domain/dist/masks.d.ts +31 -0
- package/node_modules/@cchistory/domain/dist/masks.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/masks.js +342 -0
- package/node_modules/@cchistory/domain/dist/masks.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.d.ts +58 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.js +2 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/query.d.ts +67 -0
- package/node_modules/@cchistory/domain/dist/query.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/query.js +2 -0
- package/node_modules/@cchistory/domain/dist/query.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.d.ts +14 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.js +247 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.js.map +1 -0
- package/node_modules/@cchistory/domain/package.json +1 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.d.ts +0 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.js +0 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/index.d.ts +30 -9
- package/node_modules/@cchistory/live-runtime/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/index.js +263 -142
- package/node_modules/@cchistory/live-runtime/dist/index.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/index.test.js +177 -20
- package/node_modules/@cchistory/live-runtime/dist/index.test.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.d.ts +16 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.js +55 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.js +192 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.d.ts +21 -22
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.js +53 -41
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.test.js +266 -57
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.test.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts +47 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.js +15 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.js +166 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.d.ts +37 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.js +301 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.js +67 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.js +14 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.d.ts +13 -10
- package/node_modules/@cchistory/live-runtime/dist/system-memory.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/system-memory.js +61 -34
- package/node_modules/@cchistory/live-runtime/dist/system-memory.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.js +76 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/package.json +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/factories.d.ts +2 -4
- package/node_modules/@cchistory/source-adapters/dist/core/factories.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/factories.js +1 -23
- package/node_modules/@cchistory/source-adapters/dist/core/factories.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.d.ts +25 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.js +80 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.js +122 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.js +2 -11
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.js +4 -4
- package/node_modules/@cchistory/source-adapters/dist/core/parser.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts +8 -6
- package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/probe.js +54 -36
- package/node_modules/@cchistory/source-adapters/dist/core/probe.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.d.ts +2 -28
- package/node_modules/@cchistory/source-adapters/dist/core/projections.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.js +2 -695
- package/node_modules/@cchistory/source-adapters/dist/core/projections.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts +18 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js +27 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js +75 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts +6 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.d.ts +1 -13
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.js +1 -246
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.d.ts +1 -25
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.js +1 -79
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts +6 -35
- package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.js +14 -10
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.d.ts +6 -0
- package/node_modules/@cchistory/source-adapters/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.js +4 -0
- package/node_modules/@cchistory/source-adapters/dist/index.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.test.js +2 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/masks.d.ts +1 -30
- package/node_modules/@cchistory/source-adapters/dist/masks.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/masks.js +1 -341
- package/node_modules/@cchistory/source-adapters/dist/masks.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.d.ts +14 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.js +103 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.js +5 -3
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.js +24 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js +11 -9
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.d.ts +8 -0
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.js +7 -0
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/test-helpers.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/package.json +1 -1
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +428 -0
- package/node_modules/commander/index.js +1224 -0
- package/node_modules/commander/package.json +38 -0
- package/node_modules/commander/typings/index.d.ts +310 -0
- package/node_modules/discontinuous-range/.npmignore +28 -0
- package/node_modules/discontinuous-range/.travis.yml +4 -0
- package/node_modules/discontinuous-range/LICENSE +21 -0
- package/node_modules/discontinuous-range/README.md +23 -0
- package/node_modules/discontinuous-range/index.js +144 -0
- package/node_modules/discontinuous-range/package.json +27 -0
- package/node_modules/discontinuous-range/test/main-test.js +96 -0
- package/node_modules/moo/LICENSE +29 -0
- package/node_modules/moo/README.md +385 -0
- package/node_modules/moo/moo.js +645 -0
- package/node_modules/moo/package.json +29 -0
- package/node_modules/nearley/LICENSE.txt +21 -0
- package/node_modules/nearley/README.md +80 -0
- package/node_modules/nearley/bin/nearley-railroad.js +121 -0
- package/node_modules/nearley/bin/nearley-test.js +64 -0
- package/node_modules/nearley/bin/nearley-unparse.js +29 -0
- package/node_modules/nearley/bin/nearleyc.js +38 -0
- package/node_modules/nearley/builtin/cow.ne +2 -0
- package/node_modules/nearley/builtin/number.ne +51 -0
- package/node_modules/nearley/builtin/postprocessors.ne +36 -0
- package/node_modules/nearley/builtin/string.ne +26 -0
- package/node_modules/nearley/builtin/whitespace.ne +5 -0
- package/node_modules/nearley/lib/compile.js +307 -0
- package/node_modules/nearley/lib/generate.js +244 -0
- package/node_modules/nearley/lib/lint.js +28 -0
- package/node_modules/nearley/lib/nearley-language-bootstrapped.js +132 -0
- package/node_modules/nearley/lib/nearley-language-bootstrapped.ne +126 -0
- package/node_modules/nearley/lib/nearley.js +564 -0
- package/node_modules/nearley/lib/stream.js +18 -0
- package/node_modules/nearley/lib/unparse.js +139 -0
- package/node_modules/nearley/package.json +63 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.d.ts +237 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.d.ts +33 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/index.d.ts +11 -0
- package/node_modules/pgsql-ast-parser/index.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/index.js +6484 -0
- package/node_modules/pgsql-ast-parser/index.js.map +1 -0
- package/node_modules/pgsql-ast-parser/interfaces.d.ts +1 -0
- package/node_modules/pgsql-ast-parser/interfaces.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/keywords.d.ts +2 -0
- package/node_modules/pgsql-ast-parser/keywords.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/lexer.d.ts +15 -0
- package/node_modules/pgsql-ast-parser/lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/lexer.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/lexer.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-builder.d.ts +10 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-builder.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/package.json +69 -0
- package/node_modules/pgsql-ast-parser/parser.d.ts +33 -0
- package/node_modules/pgsql-ast-parser/parser.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/pg-escape.d.ts +2 -0
- package/node_modules/pgsql-ast-parser/pg-escape.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/readme.md +255 -0
- package/node_modules/pgsql-ast-parser/src/ast-mapper.spec.ts +296 -0
- package/node_modules/pgsql-ast-parser/src/ast-mapper.ts +1378 -0
- package/node_modules/pgsql-ast-parser/src/ast-visitor.spec.ts +57 -0
- package/node_modules/pgsql-ast-parser/src/ast-visitor.ts +101 -0
- package/node_modules/pgsql-ast-parser/src/index.ts +10 -0
- package/node_modules/pgsql-ast-parser/src/interfaces.ts +0 -0
- package/node_modules/pgsql-ast-parser/src/keywords.ts +8 -0
- package/node_modules/pgsql-ast-parser/src/lexer.spec.ts +245 -0
- package/node_modules/pgsql-ast-parser/src/lexer.ts +267 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array-lexer.ts +27 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array.ne +18 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array.spec.ts +55 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric-lexer.ts +26 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric.ne +88 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric.spec.ts +131 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-builder.ts +148 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-iso-lexer.ts +17 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-iso.ne +53 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-lexer.ts +26 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval.ne +54 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval.spec.ts +106 -0
- package/node_modules/pgsql-ast-parser/src/parser.ts +142 -0
- package/node_modules/pgsql-ast-parser/src/pg-escape.ts +14 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-index.ne +29 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-index.spec.ts +35 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-table.ne +123 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-table.spec.ts +476 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-type.ne +33 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-type.spec.ts +29 -0
- package/node_modules/pgsql-ast-parser/src/syntax/ast.ts +1150 -0
- package/node_modules/pgsql-ast-parser/src/syntax/base.ne +369 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-extension.ne +17 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-extension.spec.ts +37 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-index.ne +62 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-index.spec.ts +245 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-table.ne +174 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-table.spec.ts +761 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-type.ne +40 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-type.spec.ts +32 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-view.ne +68 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-view.spec.ts +187 -0
- package/node_modules/pgsql-ast-parser/src/syntax/deallocate.ne +13 -0
- package/node_modules/pgsql-ast-parser/src/syntax/deallocate.spec.ts +19 -0
- package/node_modules/pgsql-ast-parser/src/syntax/delete.ne +36 -0
- package/node_modules/pgsql-ast-parser/src/syntax/delete.spec.ts +71 -0
- package/node_modules/pgsql-ast-parser/src/syntax/drop.ne +28 -0
- package/node_modules/pgsql-ast-parser/src/syntax/drop.spec.ts +77 -0
- package/node_modules/pgsql-ast-parser/src/syntax/edge-cases.spec.ts +41 -0
- package/node_modules/pgsql-ast-parser/src/syntax/expr.ne +350 -0
- package/node_modules/pgsql-ast-parser/src/syntax/expr.spec.ts +1638 -0
- package/node_modules/pgsql-ast-parser/src/syntax/functions.ne +114 -0
- package/node_modules/pgsql-ast-parser/src/syntax/functions.spec.ts +235 -0
- package/node_modules/pgsql-ast-parser/src/syntax/insert.ne +63 -0
- package/node_modules/pgsql-ast-parser/src/syntax/insert.spec.ts +292 -0
- package/node_modules/pgsql-ast-parser/src/syntax/main.ne +77 -0
- package/node_modules/pgsql-ast-parser/src/syntax/nearley.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/src/syntax/prepare.ne +8 -0
- package/node_modules/pgsql-ast-parser/src/syntax/prepare.spec.ts +44 -0
- package/node_modules/pgsql-ast-parser/src/syntax/refresh-materialized-view.ne +19 -0
- package/node_modules/pgsql-ast-parser/src/syntax/refresh-materialized-view.spec.ts +42 -0
- package/node_modules/pgsql-ast-parser/src/syntax/select.ne +223 -0
- package/node_modules/pgsql-ast-parser/src/syntax/select.spec.ts +1063 -0
- package/node_modules/pgsql-ast-parser/src/syntax/sequence.ne +101 -0
- package/node_modules/pgsql-ast-parser/src/syntax/sequence.spec.ts +103 -0
- package/node_modules/pgsql-ast-parser/src/syntax/simple-statements.ne +168 -0
- package/node_modules/pgsql-ast-parser/src/syntax/simple-statements.spec.ts +327 -0
- package/node_modules/pgsql-ast-parser/src/syntax/spec-utils.ts +333 -0
- package/node_modules/pgsql-ast-parser/src/syntax/union.ne +18 -0
- package/node_modules/pgsql-ast-parser/src/syntax/union.spec.ts +125 -0
- package/node_modules/pgsql-ast-parser/src/syntax/update.ne +56 -0
- package/node_modules/pgsql-ast-parser/src/syntax/update.spec.ts +87 -0
- package/node_modules/pgsql-ast-parser/src/syntax/with.ne +41 -0
- package/node_modules/pgsql-ast-parser/src/syntax/with.spec.ts +155 -0
- package/node_modules/pgsql-ast-parser/src/to-sql.spec.ts +85 -0
- package/node_modules/pgsql-ast-parser/src/to-sql.ts +1555 -0
- package/node_modules/pgsql-ast-parser/src/utils.ts +47 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-index.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-index.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-table.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-table.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-type.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-type.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/ast.d.ts +826 -0
- package/node_modules/pgsql-ast-parser/syntax/ast.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-extension.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-extension.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-index.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-index.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-table.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-table.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-type.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-type.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-view.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-view.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/deallocate.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/deallocate.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/delete.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/delete.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/drop.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/drop.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/edge-cases.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/edge-cases.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/expr.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/expr.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/functions.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/functions.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/insert.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/insert.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/main.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/syntax/main.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/prepare.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/prepare.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/refresh-materialized-view.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/refresh-materialized-view.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/select.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/select.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/sequence.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/sequence.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/simple-statements.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/simple-statements.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/spec-utils.d.ts +35 -0
- package/node_modules/pgsql-ast-parser/syntax/spec-utils.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/union.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/union.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/update.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/update.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/with.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/with.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/to-sql.d.ts +7 -0
- package/node_modules/pgsql-ast-parser/to-sql.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/to-sql.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/to-sql.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/utils.d.ts +16 -0
- package/node_modules/pgsql-ast-parser/utils.d.ts.map +1 -0
- package/node_modules/railroad-diagrams/.gitattributes +22 -0
- package/node_modules/railroad-diagrams/.npmignore +163 -0
- package/node_modules/railroad-diagrams/README.md +86 -0
- package/node_modules/railroad-diagrams/css-example.py-js +183 -0
- package/node_modules/railroad-diagrams/example.html +141 -0
- package/node_modules/railroad-diagrams/generator.html +59 -0
- package/node_modules/railroad-diagrams/package.json +23 -0
- package/node_modules/railroad-diagrams/railroad-diagrams.css +23 -0
- package/node_modules/railroad-diagrams/railroad-diagrams.js +524 -0
- package/node_modules/railroad-diagrams/railroad_diagrams.py +427 -0
- package/node_modules/randexp/LICENSE +19 -0
- package/node_modules/randexp/README.md +134 -0
- package/node_modules/randexp/lib/randexp.js +245 -0
- package/node_modules/randexp/package.json +48 -0
- package/node_modules/ret/LICENSE +19 -0
- package/node_modules/ret/README.md +183 -0
- package/node_modules/ret/lib/index.js +282 -0
- package/node_modules/ret/lib/positions.js +17 -0
- package/node_modules/ret/lib/sets.js +82 -0
- package/node_modules/ret/lib/types.js +10 -0
- package/node_modules/ret/lib/util.js +111 -0
- package/node_modules/ret/package.json +35 -0
- package/package.json +22 -6
- package/schemas/cchistory-lite-agent-v1.schema.json +6 -7
- package/schemas/cchistory-lite-error-v1.schema.json +58 -8
- package/schemas/cchistory-lite-query-result-v2.schema.json +66 -11
- package/schemas/cchistory-lite-query-result-v3.schema.json +219 -0
- package/schemas/cchistory-lite-query-v3.schema.json +57 -0
- package/schemas/cchistory-lite-source-inventory-v1.schema.json +72 -0
- package/skills/using-cchistory-lite/SKILL.md +125 -55
- package/node_modules/@cchistory/live-runtime/dist/node-memory.d.ts +0 -8
- package/node_modules/@cchistory/live-runtime/dist/node-memory.d.ts.map +0 -1
- package/node_modules/@cchistory/live-runtime/dist/node-memory.js +0 -110
- package/node_modules/@cchistory/live-runtime/dist/node-memory.js.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "commander",
|
|
3
|
+
"version": "2.20.3",
|
|
4
|
+
"description": "the complete solution for node.js command-line programs",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"commander",
|
|
7
|
+
"command",
|
|
8
|
+
"option",
|
|
9
|
+
"parser"
|
|
10
|
+
],
|
|
11
|
+
"author": "TJ Holowaychuk <tj@vision-media.ca>",
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/tj/commander.js.git"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"lint": "eslint index.js",
|
|
19
|
+
"test": "node test/run.js && npm run test-typings",
|
|
20
|
+
"test-typings": "tsc -p tsconfig.json"
|
|
21
|
+
},
|
|
22
|
+
"main": "index",
|
|
23
|
+
"files": [
|
|
24
|
+
"index.js",
|
|
25
|
+
"typings/index.d.ts"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/node": "^12.7.8",
|
|
30
|
+
"eslint": "^6.4.0",
|
|
31
|
+
"should": "^13.2.3",
|
|
32
|
+
"sinon": "^7.5.0",
|
|
33
|
+
"standard": "^14.3.1",
|
|
34
|
+
"ts-node": "^8.4.1",
|
|
35
|
+
"typescript": "^3.6.3"
|
|
36
|
+
},
|
|
37
|
+
"typings": "typings/index.d.ts"
|
|
38
|
+
}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
// Type definitions for commander 2.11
|
|
2
|
+
// Project: https://github.com/visionmedia/commander.js
|
|
3
|
+
// Definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>
|
|
4
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
+
|
|
6
|
+
declare namespace local {
|
|
7
|
+
|
|
8
|
+
class Option {
|
|
9
|
+
flags: string;
|
|
10
|
+
required: boolean;
|
|
11
|
+
optional: boolean;
|
|
12
|
+
bool: boolean;
|
|
13
|
+
short?: string;
|
|
14
|
+
long: string;
|
|
15
|
+
description: string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Initialize a new `Option` with the given `flags` and `description`.
|
|
19
|
+
*
|
|
20
|
+
* @param {string} flags
|
|
21
|
+
* @param {string} [description]
|
|
22
|
+
*/
|
|
23
|
+
constructor(flags: string, description?: string);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class Command extends NodeJS.EventEmitter {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
|
|
29
|
+
args: string[];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Initialize a new `Command`.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} [name]
|
|
35
|
+
*/
|
|
36
|
+
constructor(name?: string);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Set the program version to `str`.
|
|
40
|
+
*
|
|
41
|
+
* This method auto-registers the "-V, --version" flag
|
|
42
|
+
* which will print the version number when passed.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} str
|
|
45
|
+
* @param {string} [flags]
|
|
46
|
+
* @returns {Command} for chaining
|
|
47
|
+
*/
|
|
48
|
+
version(str: string, flags?: string): Command;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Add command `name`.
|
|
52
|
+
*
|
|
53
|
+
* The `.action()` callback is invoked when the
|
|
54
|
+
* command `name` is specified via __ARGV__,
|
|
55
|
+
* and the remaining arguments are applied to the
|
|
56
|
+
* function for access.
|
|
57
|
+
*
|
|
58
|
+
* When the `name` is "*" an un-matched command
|
|
59
|
+
* will be passed as the first arg, followed by
|
|
60
|
+
* the rest of __ARGV__ remaining.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* program
|
|
64
|
+
* .version('0.0.1')
|
|
65
|
+
* .option('-C, --chdir <path>', 'change the working directory')
|
|
66
|
+
* .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
|
|
67
|
+
* .option('-T, --no-tests', 'ignore test hook')
|
|
68
|
+
*
|
|
69
|
+
* program
|
|
70
|
+
* .command('setup')
|
|
71
|
+
* .description('run remote setup commands')
|
|
72
|
+
* .action(function() {
|
|
73
|
+
* console.log('setup');
|
|
74
|
+
* });
|
|
75
|
+
*
|
|
76
|
+
* program
|
|
77
|
+
* .command('exec <cmd>')
|
|
78
|
+
* .description('run the given remote command')
|
|
79
|
+
* .action(function(cmd) {
|
|
80
|
+
* console.log('exec "%s"', cmd);
|
|
81
|
+
* });
|
|
82
|
+
*
|
|
83
|
+
* program
|
|
84
|
+
* .command('teardown <dir> [otherDirs...]')
|
|
85
|
+
* .description('run teardown commands')
|
|
86
|
+
* .action(function(dir, otherDirs) {
|
|
87
|
+
* console.log('dir "%s"', dir);
|
|
88
|
+
* if (otherDirs) {
|
|
89
|
+
* otherDirs.forEach(function (oDir) {
|
|
90
|
+
* console.log('dir "%s"', oDir);
|
|
91
|
+
* });
|
|
92
|
+
* }
|
|
93
|
+
* });
|
|
94
|
+
*
|
|
95
|
+
* program
|
|
96
|
+
* .command('*')
|
|
97
|
+
* .description('deploy the given env')
|
|
98
|
+
* .action(function(env) {
|
|
99
|
+
* console.log('deploying "%s"', env);
|
|
100
|
+
* });
|
|
101
|
+
*
|
|
102
|
+
* program.parse(process.argv);
|
|
103
|
+
*
|
|
104
|
+
* @param {string} name
|
|
105
|
+
* @param {string} [desc] for git-style sub-commands
|
|
106
|
+
* @param {CommandOptions} [opts] command options
|
|
107
|
+
* @returns {Command} the new command
|
|
108
|
+
*/
|
|
109
|
+
command(name: string, desc?: string, opts?: commander.CommandOptions): Command;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Define argument syntax for the top-level command.
|
|
113
|
+
*
|
|
114
|
+
* @param {string} desc
|
|
115
|
+
* @returns {Command} for chaining
|
|
116
|
+
*/
|
|
117
|
+
arguments(desc: string): Command;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Parse expected `args`.
|
|
121
|
+
*
|
|
122
|
+
* For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
|
|
123
|
+
*
|
|
124
|
+
* @param {string[]} args
|
|
125
|
+
* @returns {Command} for chaining
|
|
126
|
+
*/
|
|
127
|
+
parseExpectedArgs(args: string[]): Command;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Register callback `fn` for the command.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* program
|
|
134
|
+
* .command('help')
|
|
135
|
+
* .description('display verbose help')
|
|
136
|
+
* .action(function() {
|
|
137
|
+
* // output help here
|
|
138
|
+
* });
|
|
139
|
+
*
|
|
140
|
+
* @param {(...args: any[]) => void} fn
|
|
141
|
+
* @returns {Command} for chaining
|
|
142
|
+
*/
|
|
143
|
+
action(fn: (...args: any[]) => void): Command;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Define option with `flags`, `description` and optional
|
|
147
|
+
* coercion `fn`.
|
|
148
|
+
*
|
|
149
|
+
* The `flags` string should contain both the short and long flags,
|
|
150
|
+
* separated by comma, a pipe or space. The following are all valid
|
|
151
|
+
* all will output this way when `--help` is used.
|
|
152
|
+
*
|
|
153
|
+
* "-p, --pepper"
|
|
154
|
+
* "-p|--pepper"
|
|
155
|
+
* "-p --pepper"
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* // simple boolean defaulting to false
|
|
159
|
+
* program.option('-p, --pepper', 'add pepper');
|
|
160
|
+
*
|
|
161
|
+
* --pepper
|
|
162
|
+
* program.pepper
|
|
163
|
+
* // => Boolean
|
|
164
|
+
*
|
|
165
|
+
* // simple boolean defaulting to true
|
|
166
|
+
* program.option('-C, --no-cheese', 'remove cheese');
|
|
167
|
+
*
|
|
168
|
+
* program.cheese
|
|
169
|
+
* // => true
|
|
170
|
+
*
|
|
171
|
+
* --no-cheese
|
|
172
|
+
* program.cheese
|
|
173
|
+
* // => false
|
|
174
|
+
*
|
|
175
|
+
* // required argument
|
|
176
|
+
* program.option('-C, --chdir <path>', 'change the working directory');
|
|
177
|
+
*
|
|
178
|
+
* --chdir /tmp
|
|
179
|
+
* program.chdir
|
|
180
|
+
* // => "/tmp"
|
|
181
|
+
*
|
|
182
|
+
* // optional argument
|
|
183
|
+
* program.option('-c, --cheese [type]', 'add cheese [marble]');
|
|
184
|
+
*
|
|
185
|
+
* @param {string} flags
|
|
186
|
+
* @param {string} [description]
|
|
187
|
+
* @param {((arg1: any, arg2: any) => void) | RegExp} [fn] function or default
|
|
188
|
+
* @param {*} [defaultValue]
|
|
189
|
+
* @returns {Command} for chaining
|
|
190
|
+
*/
|
|
191
|
+
option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command;
|
|
192
|
+
option(flags: string, description?: string, defaultValue?: any): Command;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Allow unknown options on the command line.
|
|
196
|
+
*
|
|
197
|
+
* @param {boolean} [arg] if `true` or omitted, no error will be thrown for unknown options.
|
|
198
|
+
* @returns {Command} for chaining
|
|
199
|
+
*/
|
|
200
|
+
allowUnknownOption(arg?: boolean): Command;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Parse `argv`, settings options and invoking commands when defined.
|
|
204
|
+
*
|
|
205
|
+
* @param {string[]} argv
|
|
206
|
+
* @returns {Command} for chaining
|
|
207
|
+
*/
|
|
208
|
+
parse(argv: string[]): Command;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Parse options from `argv` returning `argv` void of these options.
|
|
212
|
+
*
|
|
213
|
+
* @param {string[]} argv
|
|
214
|
+
* @returns {ParseOptionsResult}
|
|
215
|
+
*/
|
|
216
|
+
parseOptions(argv: string[]): commander.ParseOptionsResult;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Return an object containing options as key-value pairs
|
|
220
|
+
*
|
|
221
|
+
* @returns {{[key: string]: any}}
|
|
222
|
+
*/
|
|
223
|
+
opts(): { [key: string]: any };
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Set the description to `str`.
|
|
227
|
+
*
|
|
228
|
+
* @param {string} str
|
|
229
|
+
* @param {{[argName: string]: string}} argsDescription
|
|
230
|
+
* @return {(Command | string)}
|
|
231
|
+
*/
|
|
232
|
+
description(str: string, argsDescription?: {[argName: string]: string}): Command;
|
|
233
|
+
description(): string;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Set an alias for the command.
|
|
237
|
+
*
|
|
238
|
+
* @param {string} alias
|
|
239
|
+
* @return {(Command | string)}
|
|
240
|
+
*/
|
|
241
|
+
alias(alias: string): Command;
|
|
242
|
+
alias(): string;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Set or get the command usage.
|
|
246
|
+
*
|
|
247
|
+
* @param {string} str
|
|
248
|
+
* @return {(Command | string)}
|
|
249
|
+
*/
|
|
250
|
+
usage(str: string): Command;
|
|
251
|
+
usage(): string;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Set the name of the command.
|
|
255
|
+
*
|
|
256
|
+
* @param {string} str
|
|
257
|
+
* @return {Command}
|
|
258
|
+
*/
|
|
259
|
+
name(str: string): Command;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Get the name of the command.
|
|
263
|
+
*
|
|
264
|
+
* @return {string}
|
|
265
|
+
*/
|
|
266
|
+
name(): string;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Output help information for this command.
|
|
270
|
+
*
|
|
271
|
+
* @param {(str: string) => string} [cb]
|
|
272
|
+
*/
|
|
273
|
+
outputHelp(cb?: (str: string) => string): void;
|
|
274
|
+
|
|
275
|
+
/** Output help information and exit.
|
|
276
|
+
*
|
|
277
|
+
* @param {(str: string) => string} [cb]
|
|
278
|
+
*/
|
|
279
|
+
help(cb?: (str: string) => string): never;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
declare namespace commander {
|
|
285
|
+
|
|
286
|
+
type Command = local.Command
|
|
287
|
+
|
|
288
|
+
type Option = local.Option
|
|
289
|
+
|
|
290
|
+
interface CommandOptions {
|
|
291
|
+
noHelp?: boolean;
|
|
292
|
+
isDefault?: boolean;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
interface ParseOptionsResult {
|
|
296
|
+
args: string[];
|
|
297
|
+
unknown: string[];
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
interface CommanderStatic extends Command {
|
|
301
|
+
Command: typeof local.Command;
|
|
302
|
+
Option: typeof local.Option;
|
|
303
|
+
CommandOptions: CommandOptions;
|
|
304
|
+
ParseOptionsResult: ParseOptionsResult;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
declare const commander: commander.CommanderStatic;
|
|
310
|
+
export = commander;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
|
|
5
|
+
# Runtime data
|
|
6
|
+
pids
|
|
7
|
+
*.pid
|
|
8
|
+
*.seed
|
|
9
|
+
|
|
10
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
11
|
+
lib-cov
|
|
12
|
+
|
|
13
|
+
# Coverage directory used by tools like istanbul
|
|
14
|
+
coverage
|
|
15
|
+
|
|
16
|
+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
|
17
|
+
.grunt
|
|
18
|
+
|
|
19
|
+
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
|
20
|
+
build/Release
|
|
21
|
+
|
|
22
|
+
# Dependency directory
|
|
23
|
+
# Commenting this out is preferred by some people, see
|
|
24
|
+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
|
|
25
|
+
node_modules
|
|
26
|
+
|
|
27
|
+
# Users Environment Variables
|
|
28
|
+
.lock-wscript
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 David Tudury
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
discontinuous-range
|
|
2
|
+
===================
|
|
3
|
+
|
|
4
|
+
```
|
|
5
|
+
DiscontinuousRange(1, 10).subtract(4, 6); // [ 1-3, 7-10 ]
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
[](https://travis-ci.org/dtudury/discontinuous-range)
|
|
9
|
+
|
|
10
|
+
this is a pretty simple module, but it exists to service another project
|
|
11
|
+
so this'll be pretty lacking documentation.
|
|
12
|
+
reading the test to see how this works may help. otherwise, here's an example
|
|
13
|
+
that I think pretty much sums it up
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
###Example
|
|
17
|
+
```
|
|
18
|
+
var all_numbers = new DiscontinuousRange(1, 100);
|
|
19
|
+
var bad_numbers = DiscontinuousRange(13).add(8).add(60,80);
|
|
20
|
+
var good_numbers = all_numbers.clone().subtract(bad_numbers);
|
|
21
|
+
console.log(good_numbers.toString()); //[ 1-7, 9-12, 14-59, 81-100 ]
|
|
22
|
+
var random_good_number = good_numbers.index(Math.floor(Math.random() * good_numbers.length));
|
|
23
|
+
```
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
//protected helper class
|
|
2
|
+
function _SubRange(low, high) {
|
|
3
|
+
this.low = low;
|
|
4
|
+
this.high = high;
|
|
5
|
+
this.length = 1 + high - low;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
_SubRange.prototype.overlaps = function (range) {
|
|
9
|
+
return !(this.high < range.low || this.low > range.high);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
_SubRange.prototype.touches = function (range) {
|
|
13
|
+
return !(this.high + 1 < range.low || this.low - 1 > range.high);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//returns inclusive combination of _SubRanges as a _SubRange
|
|
17
|
+
_SubRange.prototype.add = function (range) {
|
|
18
|
+
return this.touches(range) && new _SubRange(Math.min(this.low, range.low), Math.max(this.high, range.high));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
//returns subtraction of _SubRanges as an array of _SubRanges (there's a case where subtraction divides it in 2)
|
|
22
|
+
_SubRange.prototype.subtract = function (range) {
|
|
23
|
+
if (!this.overlaps(range)) return false;
|
|
24
|
+
if (range.low <= this.low && range.high >= this.high) return [];
|
|
25
|
+
if (range.low > this.low && range.high < this.high) return [new _SubRange(this.low, range.low - 1), new _SubRange(range.high + 1, this.high)];
|
|
26
|
+
if (range.low <= this.low) return [new _SubRange(range.high + 1, this.high)];
|
|
27
|
+
return [new _SubRange(this.low, range.low - 1)];
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
_SubRange.prototype.toString = function () {
|
|
31
|
+
if (this.low == this.high) return this.low.toString();
|
|
32
|
+
return this.low + '-' + this.high;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
_SubRange.prototype.clone = function () {
|
|
36
|
+
return new _SubRange(this.low, this.high);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
function DiscontinuousRange(a, b) {
|
|
43
|
+
if (this instanceof DiscontinuousRange) {
|
|
44
|
+
this.ranges = [];
|
|
45
|
+
this.length = 0;
|
|
46
|
+
if (a !== undefined) this.add(a, b);
|
|
47
|
+
} else {
|
|
48
|
+
return new DiscontinuousRange(a, b);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function _update_length(self) {
|
|
53
|
+
self.length = self.ranges.reduce(function (previous, range) {return previous + range.length}, 0);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
DiscontinuousRange.prototype.add = function (a, b) {
|
|
57
|
+
var self = this;
|
|
58
|
+
function _add(subrange) {
|
|
59
|
+
var new_ranges = [];
|
|
60
|
+
var i = 0;
|
|
61
|
+
while (i < self.ranges.length && !subrange.touches(self.ranges[i])) {
|
|
62
|
+
new_ranges.push(self.ranges[i].clone());
|
|
63
|
+
i++;
|
|
64
|
+
}
|
|
65
|
+
while (i < self.ranges.length && subrange.touches(self.ranges[i])) {
|
|
66
|
+
subrange = subrange.add(self.ranges[i]);
|
|
67
|
+
i++;
|
|
68
|
+
}
|
|
69
|
+
new_ranges.push(subrange);
|
|
70
|
+
while (i < self.ranges.length) {
|
|
71
|
+
new_ranges.push(self.ranges[i].clone());
|
|
72
|
+
i++;
|
|
73
|
+
}
|
|
74
|
+
self.ranges = new_ranges;
|
|
75
|
+
_update_length(self);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (a instanceof DiscontinuousRange) {
|
|
79
|
+
a.ranges.forEach(_add);
|
|
80
|
+
} else {
|
|
81
|
+
if (a instanceof _SubRange) {
|
|
82
|
+
_add(a);
|
|
83
|
+
} else {
|
|
84
|
+
if (b === undefined) b = a;
|
|
85
|
+
_add(new _SubRange(a, b));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return this;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
DiscontinuousRange.prototype.subtract = function (a, b) {
|
|
92
|
+
var self = this;
|
|
93
|
+
function _subtract(subrange) {
|
|
94
|
+
var new_ranges = [];
|
|
95
|
+
var i = 0;
|
|
96
|
+
while (i < self.ranges.length && !subrange.overlaps(self.ranges[i])) {
|
|
97
|
+
new_ranges.push(self.ranges[i].clone());
|
|
98
|
+
i++;
|
|
99
|
+
}
|
|
100
|
+
while (i < self.ranges.length && subrange.overlaps(self.ranges[i])) {
|
|
101
|
+
new_ranges = new_ranges.concat(self.ranges[i].subtract(subrange));
|
|
102
|
+
i++;
|
|
103
|
+
}
|
|
104
|
+
while (i < self.ranges.length) {
|
|
105
|
+
new_ranges.push(self.ranges[i].clone());
|
|
106
|
+
i++;
|
|
107
|
+
}
|
|
108
|
+
self.ranges = new_ranges;
|
|
109
|
+
_update_length(self);
|
|
110
|
+
}
|
|
111
|
+
if (a instanceof DiscontinuousRange) {
|
|
112
|
+
a.ranges.forEach(_subtract);
|
|
113
|
+
} else {
|
|
114
|
+
if (a instanceof _SubRange) {
|
|
115
|
+
_subtract(a);
|
|
116
|
+
} else {
|
|
117
|
+
if (b === undefined) b = a;
|
|
118
|
+
_subtract(new _SubRange(a, b));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return this;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
DiscontinuousRange.prototype.index = function (index) {
|
|
126
|
+
var i = 0;
|
|
127
|
+
while (i < this.ranges.length && this.ranges[i].length <= index) {
|
|
128
|
+
index -= this.ranges[i].length;
|
|
129
|
+
i++;
|
|
130
|
+
}
|
|
131
|
+
if (i >= this.ranges.length) return null;
|
|
132
|
+
return this.ranges[i].low + index;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
DiscontinuousRange.prototype.toString = function () {
|
|
137
|
+
return '[ ' + this.ranges.join(', ') + ' ]'
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
DiscontinuousRange.prototype.clone = function () {
|
|
141
|
+
return new DiscontinuousRange(this);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
module.exports = DiscontinuousRange;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "discontinuous-range",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "for adding, subtracting, and indexing discontinuous ranges of numbers",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "./node_modules/mocha/bin/mocha -R spec test/*-test.js"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/dtudury/discontinuous-range.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"discontinuous",
|
|
15
|
+
"range",
|
|
16
|
+
"set"
|
|
17
|
+
],
|
|
18
|
+
"author": "David Tudury <david.tudury@gmail.com>",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/dtudury/discontinuous-range/issues"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/dtudury/discontinuous-range",
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"mocha": "^1.21.4"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var assert = require('assert');
|
|
2
|
+
|
|
3
|
+
var DRange = require('../index.js');
|
|
4
|
+
|
|
5
|
+
describe('add sets', function() {
|
|
6
|
+
it('should allow adding numbers', function () {
|
|
7
|
+
var drange = DRange(5);
|
|
8
|
+
assert.equal('[ 5 ]', drange.toString());
|
|
9
|
+
drange.add(6);
|
|
10
|
+
assert.equal('[ 5-6 ]', drange.toString());
|
|
11
|
+
drange.add(8);
|
|
12
|
+
assert.equal('[ 5-6, 8 ]', drange.toString());
|
|
13
|
+
drange.add(7);
|
|
14
|
+
assert.equal('[ 5-8 ]', drange.toString());
|
|
15
|
+
assert.equal(drange.length, 4);
|
|
16
|
+
});
|
|
17
|
+
it('should allow adding ranges of numbers', function () {
|
|
18
|
+
var drange = DRange(1,5);
|
|
19
|
+
assert.equal('[ 1-5 ]', drange.toString());
|
|
20
|
+
drange.add(6,10);
|
|
21
|
+
assert.equal('[ 1-10 ]', drange.toString());
|
|
22
|
+
drange.add(15,20);
|
|
23
|
+
assert.equal('[ 1-10, 15-20 ]', drange.toString());
|
|
24
|
+
drange.add(0,14);
|
|
25
|
+
assert.equal('[ 0-20 ]', drange.toString());
|
|
26
|
+
assert.equal(drange.length, 21);
|
|
27
|
+
});
|
|
28
|
+
it('should allow adding another DiscontinuousRange', function () {
|
|
29
|
+
var drange = DRange(1,5);
|
|
30
|
+
drange.add(15,20);
|
|
31
|
+
var erange = DRange(6);
|
|
32
|
+
erange.add(17, 30);
|
|
33
|
+
drange.add(erange);
|
|
34
|
+
assert.equal('[ 1-6, 15-30 ]', drange.toString());
|
|
35
|
+
assert.equal(drange.length, 22);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
describe('subtract sets', function() {
|
|
40
|
+
it('should allow subtracting numbers', function () {
|
|
41
|
+
var drange = DRange(1, 10);
|
|
42
|
+
drange.subtract(5);
|
|
43
|
+
assert.equal('[ 1-4, 6-10 ]', drange.toString());
|
|
44
|
+
drange.subtract(7);
|
|
45
|
+
assert.equal('[ 1-4, 6, 8-10 ]', drange.toString());
|
|
46
|
+
drange.subtract(6);
|
|
47
|
+
assert.equal('[ 1-4, 8-10 ]', drange.toString());
|
|
48
|
+
assert.equal(drange.length, 7);
|
|
49
|
+
});
|
|
50
|
+
it('should allow subtracting ranges of numbers', function () {
|
|
51
|
+
var drange = DRange(1, 100);
|
|
52
|
+
drange.subtract(5, 15);
|
|
53
|
+
assert.equal('[ 1-4, 16-100 ]', drange.toString());
|
|
54
|
+
drange.subtract(90, 200);
|
|
55
|
+
assert.equal('[ 1-4, 16-89 ]', drange.toString());
|
|
56
|
+
assert.equal(drange.length, 78);
|
|
57
|
+
});
|
|
58
|
+
it('should allow subtracting another DiscontinuousRange', function () {
|
|
59
|
+
var drange = DRange(0,100);
|
|
60
|
+
var erange = DRange(6);
|
|
61
|
+
erange.add(17, 30);
|
|
62
|
+
drange.subtract(erange);
|
|
63
|
+
assert.equal('[ 0-5, 7-16, 31-100 ]', drange.toString());
|
|
64
|
+
assert.equal(drange.length, 86);
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
describe('index sets', function() {
|
|
70
|
+
it('should appropriately retrieve numbers in range by index', function () {
|
|
71
|
+
var drange = DRange(0, 9);
|
|
72
|
+
drange.add(20, 29);
|
|
73
|
+
drange.add(40, 49);
|
|
74
|
+
assert.equal(drange.index(5), 5);
|
|
75
|
+
assert.equal(drange.index(15), 25);
|
|
76
|
+
assert.equal(drange.index(25), 45);
|
|
77
|
+
assert.equal(drange.length, 30);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
describe('clone sets', function() {
|
|
82
|
+
it('should be able to clone a DiscontinuousRange that doesn\'t affect the original', function () {
|
|
83
|
+
var drange = DRange(0, 9);
|
|
84
|
+
var erange = drange.clone();
|
|
85
|
+
erange.subtract(5);
|
|
86
|
+
assert.equal('[ 0-9 ]', drange.toString());
|
|
87
|
+
assert.equal('[ 0-4, 6-9 ]', erange.toString());
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
var all_numbers = new DRange(1, 100);
|
|
92
|
+
var bad_numbers = DRange(13).add(8).add(60,80);
|
|
93
|
+
var good_numbers = all_numbers.clone().subtract(bad_numbers);
|
|
94
|
+
console.log(good_numbers.toString());
|
|
95
|
+
var random_good_number = good_numbers.index(Math.floor(Math.random() * good_numbers.length));
|
|
96
|
+
console.log(random_good_number);
|