bantamkit-mcp 0.26.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/LICENSE +21 -0
- package/README.md +398 -0
- package/assets/contracts/default.yaml +90 -0
- package/assets/evals/devteam/manifest.yaml +351 -0
- package/assets/evals/devteam/repo/HISTORY.md +18 -0
- package/assets/evals/devteam/repo/README.md +12 -0
- package/assets/evals/devteam/repo/docs/architecture.md +17 -0
- package/assets/evals/devteam/repo/docs/runbook.md +10 -0
- package/assets/evals/devteam/repo/issues/142-settlement-timeout.md +23 -0
- package/assets/evals/devteam/repo/patches/0009-retry-budget.patch +38 -0
- package/assets/evals/devteam/repo/src/ledger/__init__.py +3 -0
- package/assets/evals/devteam/repo/src/ledger/config.py +35 -0
- package/assets/evals/devteam/repo/src/ledger/errors.py +13 -0
- package/assets/evals/devteam/repo/src/ledger/posting.py +12 -0
- package/assets/evals/devteam/repo/src/ledger/registry.py +7 -0
- package/assets/evals/devteam/repo/src/ledger/report.py +9 -0
- package/assets/evals/devteam/repo/src/ledger/retry.py +17 -0
- package/assets/evals/devteam/repo/src/ledger/settle.py +16 -0
- package/assets/evals/devteam/repo/src/ledger/validate.py +14 -0
- package/assets/evals/devteam/repo/tests/test_posting.py +13 -0
- package/assets/evals/devteam/repo/tests/test_settle.py +9 -0
- package/assets/evals/devteam/tasks/dt-error-contract.yaml +186 -0
- package/assets/evals/devteam/tasks/dt-handler-map.yaml +183 -0
- package/assets/evals/devteam/tasks/dt-patch-before-after.yaml +182 -0
- package/assets/evals/devteam/tasks/dt-retry-attempts.yaml +181 -0
- package/assets/evals/devteam/tasks/dt-settlement-config.yaml +185 -0
- package/assets/evals/devteam/tasks/dt-symbol-home.yaml +181 -0
- package/assets/evals/devteam/tasks/dt-trace-blame.yaml +182 -0
- package/assets/evals/devteam/tasks/dt-unread-key.yaml +180 -0
- package/assets/evals/document/tasks/doc-large-in-137.yaml +38 -0
- package/assets/evals/document/tasks/doc-large-in-359.yaml +44 -0
- package/assets/evals/document/tasks/doc-large-in-372.yaml +38 -0
- package/assets/evals/document/tasks/doc-large-out-11764.yaml +37 -0
- package/assets/evals/document/tasks/doc-large-out-4137.yaml +37 -0
- package/assets/evals/document/tasks/doc-large-out-8022.yaml +37 -0
- package/assets/evals/document/tasks/doc-small-137.yaml +37 -0
- package/assets/evals/document/tasks/doc-small-261.yaml +37 -0
- package/assets/evals/document/tasks/doc-small-388.yaml +37 -0
- package/assets/evals/fixtures/.gitkeep +0 -0
- package/assets/evals/fixtures/catalog.json +6 -0
- package/assets/evals/perturbations/task-completion.yaml +576 -0
- package/assets/evals/tasks/.gitkeep +0 -0
- package/assets/evals/tasks/extract-contact.yaml +14 -0
- package/assets/evals/tasks/extract-invoice.yaml +14 -0
- package/assets/evals/tasks/extract-order.yaml +15 -0
- package/assets/evals/tasks/extract-schedule.yaml +14 -0
- package/assets/evals/tasks/extract-versions.yaml +17 -0
- package/assets/evals/tasks/nav-prod-port.yaml +84 -0
- package/assets/evals/tasks/nav-release-bundle.yaml +87 -0
- package/assets/evals/tasks/recall-audit-retention.yaml +17 -0
- package/assets/evals/tasks/recall-cache-ttl.yaml +13 -0
- package/assets/evals/tasks/recall-db-port.yaml +17 -0
- package/assets/evals/tasks/recall-deploy.yaml +13 -0
- package/assets/evals/tasks/recall-env-endpoint.yaml +18 -0
- package/assets/evals/tasks/recall-oncall-rotation.yaml +21 -0
- package/assets/evals/tasks/recall-oncall.yaml +13 -0
- package/assets/evals/tasks/recall-org-quota.yaml +18 -0
- package/assets/evals/tasks/recall-owner.yaml +13 -0
- package/assets/evals/tasks/shop-basket-total.yaml +10 -0
- package/assets/evals/tasks/shop-cheapest.yaml +9 -0
- package/assets/evals/tasks/shop-compare.yaml +9 -0
- package/assets/evals/tasks/shop-gadget-value.yaml +9 -0
- package/assets/evals/tasks/shop-stock-total.yaml +9 -0
- package/assets/evals/tasks/shop-total.yaml +9 -0
- package/assets/profiles/default.yaml +31 -0
- package/assets/profiles/patient.yaml +31 -0
- package/assets/rubrics/.gitkeep +0 -0
- package/assets/rubrics/code-quality.yaml +20 -0
- package/assets/rubrics/grounded-completion.yaml +37 -0
- package/assets/rubrics/task-completion.yaml +28 -0
- package/assets/schemas/shiftwork-checkpoint.json +188 -0
- package/assets/skills/.gitkeep +0 -0
- package/assets/skills/file-graph.md +7 -0
- package/assets/skills/memory.md +35 -0
- package/assets/tools/.gitkeep +0 -0
- package/assets/tools/bantamkit_read.json +48 -0
- package/assets/tools/bantamkit_status.json +25 -0
- package/assets/tools/build_identity.json +17 -0
- package/assets/tools/document_list.json +12 -0
- package/assets/tools/document_read.json +31 -0
- package/assets/tools/file_graph.json +12 -0
- package/assets/tools/memory_compact.json +31 -0
- package/assets/tools/memory_recall.json +38 -0
- package/assets/tools/memory_save.json +61 -0
- package/assets/tools/shiftwork_clock_in.json +25 -0
- package/assets/tools/shiftwork_clock_out.json +60 -0
- package/assets/tools/shiftwork_status.json +25 -0
- package/assets/tools/skill_audit.json +70 -0
- package/assets/tools/validate_json.json +31 -0
- package/dist/assets.d.ts +48 -0
- package/dist/assets.js +109 -0
- package/dist/charsets.d.ts +17 -0
- package/dist/charsets.js +580 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.js +280 -0
- package/dist/contract.d.ts +145 -0
- package/dist/contract.js +608 -0
- package/dist/docread.d.ts +357 -0
- package/dist/docread.js +3315 -0
- package/dist/errors.d.ts +11 -0
- package/dist/errors.js +14 -0
- package/dist/eventlog.d.ts +137 -0
- package/dist/eventlog.js +294 -0
- package/dist/htmlentities.d.ts +2 -0
- package/dist/htmlentities.js +16 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +13 -0
- package/dist/mcp/identity.d.ts +25 -0
- package/dist/mcp/identity.js +275 -0
- package/dist/mcp/pyargs.d.ts +80 -0
- package/dist/mcp/pyargs.js +362 -0
- package/dist/mcp/sdkjson.d.ts +56 -0
- package/dist/mcp/sdkjson.js +91 -0
- package/dist/mcp/server.d.ts +45 -0
- package/dist/mcp/server.js +740 -0
- package/dist/mcp/status.d.ts +210 -0
- package/dist/mcp/status.js +357 -0
- package/dist/mcp/transport.d.ts +68 -0
- package/dist/mcp/transport.js +111 -0
- package/dist/mcpreport.d.ts +214 -0
- package/dist/mcpreport.js +758 -0
- package/dist/memory/cli.d.ts +2 -0
- package/dist/memory/cli.js +396 -0
- package/dist/memory/component.d.ts +256 -0
- package/dist/memory/component.js +497 -0
- package/dist/memory/factfile.d.ts +120 -0
- package/dist/memory/factfile.js +406 -0
- package/dist/memory/layers.d.ts +92 -0
- package/dist/memory/layers.js +410 -0
- package/dist/memory/pyfs.d.ts +521 -0
- package/dist/memory/pyfs.js +1608 -0
- package/dist/memory/pyyaml.d.ts +155 -0
- package/dist/memory/pyyaml.js +868 -0
- package/dist/memory/store.d.ts +478 -0
- package/dist/memory/store.js +1034 -0
- package/dist/pyargparse.d.ts +141 -0
- package/dist/pyargparse.js +813 -0
- package/dist/pyjson.d.ts +110 -0
- package/dist/pyjson.js +524 -0
- package/dist/pyjsonschema.d.ts +50 -0
- package/dist/pyjsonschema.js +951 -0
- package/dist/shiftwork.d.ts +60 -0
- package/dist/shiftwork.js +324 -0
- package/dist/skillaudit.d.ts +172 -0
- package/dist/skillaudit.js +914 -0
- package/dist/statusline.d.ts +106 -0
- package/dist/statusline.js +281 -0
- package/package.json +45 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/** One `subs.add_parser(name, help=...)` under an `add_subparsers()` action. */
|
|
2
|
+
export interface Subcommand {
|
|
3
|
+
/** The word the operator types, and the `dest=` of the pseudo-action in the help table. */
|
|
4
|
+
readonly name: string;
|
|
5
|
+
/** `help=`, which is what the PARENT prints beside the name. The sub-parser never shows it. */
|
|
6
|
+
readonly help: string;
|
|
7
|
+
/** The parser this name dispatches to. Its `prog` is `'<parent prog> <name>'`. */
|
|
8
|
+
readonly parser: ParserSpec;
|
|
9
|
+
}
|
|
10
|
+
/** One `parser.add_argument(...)`. */
|
|
11
|
+
export interface ActionSpec {
|
|
12
|
+
/** `-h`, `--help`, … in the order they were given. `option_strings[0]` leads the usage.
|
|
13
|
+
* EMPTY for a positional — that emptiness is what argparse itself keys every branch on. */
|
|
14
|
+
readonly optionStrings: readonly string[];
|
|
15
|
+
/** argparse's `dest`; the default metavar for an OPTIONAL upper-cases it, a positional does not. */
|
|
16
|
+
readonly dest: string;
|
|
17
|
+
/** `metavar=`, when the default is not what the reference prints. */
|
|
18
|
+
readonly metavar?: string;
|
|
19
|
+
/**
|
|
20
|
+
* `store_true` and `help` take no value (`nargs == 0`); `store` and `positional` take one
|
|
21
|
+
* (`nargs is None`); `subparsers` is `nargs == PARSER`. NOT PORTED: every other `nargs`
|
|
22
|
+
* (`?`, `*`, `+`, `REMAINDER`, `SUPPRESS`, an integer count) — no parser in this runtime
|
|
23
|
+
* declares one, and `_get_nargs_pattern` is where they would go.
|
|
24
|
+
*/
|
|
25
|
+
readonly kind: 'help' | 'storeTrue' | 'store' | 'positional' | 'subparsers';
|
|
26
|
+
/**
|
|
27
|
+
* `help=`. THE EMPTY STRING IS argparse's `help=None`, not a blank help line: both are
|
|
28
|
+
* falsy, and `_format_action` branches on the truth of `action.help` — the header gets a
|
|
29
|
+
* line to itself and no help text follows. `add_subparsers()` takes no `help=` in the
|
|
30
|
+
* reference, so the choices row prints bare above its indented children.
|
|
31
|
+
*/
|
|
32
|
+
readonly help: string;
|
|
33
|
+
/** `type=`. Throws on a value `int()` would reject; the caller renders the sentence. */
|
|
34
|
+
readonly convert?: (raw: string) => unknown;
|
|
35
|
+
/** `__name__` of `type=`, for `invalid %(type)s value: %(value)r`. */
|
|
36
|
+
readonly typeName?: string;
|
|
37
|
+
readonly defaultValue: unknown;
|
|
38
|
+
/** `add_subparsers()`'s parsers, in `add_parser` order. Only ever set on `kind: 'subparsers'`. */
|
|
39
|
+
readonly subcommands?: readonly Subcommand[];
|
|
40
|
+
}
|
|
41
|
+
export interface ParserSpec {
|
|
42
|
+
readonly prog: string;
|
|
43
|
+
/** `description=`. EMPTY means the reference passed none — `add_text(None)` adds nothing. */
|
|
44
|
+
readonly description: string;
|
|
45
|
+
readonly actions: readonly ActionSpec[];
|
|
46
|
+
/**
|
|
47
|
+
* One entry per `add_mutually_exclusive_group()`, holding indices into `actions`. argparse
|
|
48
|
+
* only brackets a group whose members are CONTIGUOUS in `actions`; a non-contiguous group
|
|
49
|
+
* is skipped in the usage line (and still enforced when parsing), which this reproduces.
|
|
50
|
+
*/
|
|
51
|
+
readonly groups: readonly (readonly number[])[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* `argparse.ArgumentParser.error`: the usage block, one sentence, stderr, exit 2.
|
|
55
|
+
*
|
|
56
|
+
* `spec` is WHOSE usage block, and it is not decoration. A sub-parser reports its own prog
|
|
57
|
+
* and its own usage (`python -m bantamkit.memory status: error: …`) while an unrecognized
|
|
58
|
+
* argument that a sub-parser handed back reports the TOP parser's — measured, both.
|
|
59
|
+
*/
|
|
60
|
+
export declare class ArgvError extends Error {
|
|
61
|
+
readonly spec: ParserSpec | null;
|
|
62
|
+
constructor(spec: ParserSpec | null, message: string);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A `-h`/`--help` action fired mid-parse. argparse prints and exits 0 THERE, not after.
|
|
66
|
+
*
|
|
67
|
+
* `spec` is whose help: `restore -h` prints the sub-parser's, not the top parser's.
|
|
68
|
+
*/
|
|
69
|
+
export declare class HelpRequested extends Error {
|
|
70
|
+
readonly spec: ParserSpec | null;
|
|
71
|
+
constructor(spec?: ParserSpec | null);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* `argparse.ArgumentTypeError`: a `type=` callable's own sentence, printed VERBATIM.
|
|
75
|
+
*
|
|
76
|
+
* The distinction is wire-visible and it is the whole reason this class exists:
|
|
77
|
+
* `--budget 0` is `argument --budget: must be >= 1` (the callable's message) while
|
|
78
|
+
* `--budget x` is `argument --budget: invalid _positive value: 'x'` (argparse's, because
|
|
79
|
+
* `int()` raised `ValueError`). One `catch` for both would print the wrong one half the time.
|
|
80
|
+
*/
|
|
81
|
+
export declare class ArgumentTypeError extends Error {
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* `int(text)`, which is what `type=int` is — and the first half of `type=_positive`.
|
|
85
|
+
*
|
|
86
|
+
* It rejects everything `int()` rejects, and the caller reports that as an ARGUMENT error
|
|
87
|
+
* (exit 2). It lives here rather than beside one parser because two parsers now need it and
|
|
88
|
+
* a second hand-written copy of a conversion rule is the defect this module was built from.
|
|
89
|
+
*/
|
|
90
|
+
export declare function pyIntStrict(text: string): number;
|
|
91
|
+
/** What both `_split_lines` and `_fill_text` do before they wrap. */
|
|
92
|
+
export declare const collapseWhitespace: (text: string) => string;
|
|
93
|
+
/** `textwrap.wrap(text, width)`. `text` must already be collapsed. */
|
|
94
|
+
export declare function wrap(text: string, width: number): string[];
|
|
95
|
+
/** `textwrap.fill(text, width)` at indent 0. */
|
|
96
|
+
export declare const fill: (text: string, width: number) => string;
|
|
97
|
+
/**
|
|
98
|
+
* `shutil.get_terminal_size().columns`, which is what `HelpFormatter` asks for.
|
|
99
|
+
*
|
|
100
|
+
* `COLUMNS` wins when it parses to a positive integer; otherwise the size of STDOUT's
|
|
101
|
+
* terminal; otherwise 80. `spawnSync` hands a child pipes rather than a tty, so 80 is the
|
|
102
|
+
* width the conformance suite and every MCP host actually see — the DEFAULT help is the
|
|
103
|
+
* wrapped form, not the wide one.
|
|
104
|
+
*/
|
|
105
|
+
export declare function terminalColumns(): number;
|
|
106
|
+
/** `HelpFormatter.__init__`: `width = shutil.get_terminal_size().columns - 2`. */
|
|
107
|
+
export declare const helpWidth: () => number;
|
|
108
|
+
/** `HelpFormatter._format_usage`, which ends in a BLANK line (`'\n\n'`). */
|
|
109
|
+
export declare function formatUsage(spec: ParserSpec, width: number, prefix?: string): string;
|
|
110
|
+
/** `ArgumentParser.format_usage` — the usage block alone, one trailing newline. */
|
|
111
|
+
export declare const formatUsageBlock: (spec: ParserSpec, width: number) => string;
|
|
112
|
+
/** `ArgumentParser.format_help`. */
|
|
113
|
+
export declare function formatHelp(spec: ParserSpec, width: number): string;
|
|
114
|
+
/**
|
|
115
|
+
* `ArgumentParser.parse_known_args`: the namespace keyed by `dest`, plus what it could not
|
|
116
|
+
* place.
|
|
117
|
+
*
|
|
118
|
+
* Throws `HelpRequested` where argparse would `parser.exit(0)` mid-parse — which is DURING
|
|
119
|
+
* the scan, not after it, so `-h --nope` prints help and exits 0 exactly as the reference
|
|
120
|
+
* does, and `restore -h --nope` prints the SUB-parser's help for the same reason.
|
|
121
|
+
*
|
|
122
|
+
* EXTRAS ARE RETURNED RATHER THAN RAISED, and that is the whole reason this function is
|
|
123
|
+
* separate from `parseArgs`. A subparser hands its leftovers BACK to the parser that
|
|
124
|
+
* dispatched to it (`_UNRECOGNIZED_ARGS_ATTR`), so `... status extra` reports
|
|
125
|
+
* `unrecognized arguments: extra` under the TOP parser's prog and usage, not under
|
|
126
|
+
* `status`'s — measured against the reference, both ways round.
|
|
127
|
+
*
|
|
128
|
+
* NOT PORTED: `parse_intermixed_args`, `fromfile_prefix_chars`, `choices` on anything but a
|
|
129
|
+
* subparsers action, required mutually exclusive groups (`one of the arguments … is
|
|
130
|
+
* required`), and every `nargs` outside the three `_getNargsPattern` names.
|
|
131
|
+
*/
|
|
132
|
+
export declare function parseKnownArgs(spec: ParserSpec, argv: readonly string[]): {
|
|
133
|
+
values: Record<string, unknown>;
|
|
134
|
+
extras: string[];
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* `ArgumentParser.parse_args`: `parse_known_args`, and an error for anything left over.
|
|
138
|
+
*
|
|
139
|
+
* Returns the namespace as a plain record keyed by `dest`.
|
|
140
|
+
*/
|
|
141
|
+
export declare function parseArgs(spec: ParserSpec, argv: readonly string[]): Record<string, unknown>;
|