@nathapp/nax 0.84.0 → 0.85.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.
Files changed (2) hide show
  1. package/dist/nax.js +58 -12
  2. package/package.json +2 -2
package/dist/nax.js CHANGED
@@ -3931,6 +3931,20 @@ var init_model_resolver = __esm(() => {
3931
3931
  init_client();
3932
3932
  });
3933
3933
 
3934
+ // ../nax-agent/src/native/provider-models.ts
3935
+ async function listProviderModels(providerId, catalogOverrides = []) {
3936
+ const client = await getNativeClient(catalogOverrides);
3937
+ const models = await client.listModels(providerId);
3938
+ return models.filter((model) => model.supportsTools).map((model) => ({
3939
+ id: model.id,
3940
+ contextWindow: model.contextWindow,
3941
+ ...model.maxTokens !== undefined ? { maxTokens: model.maxTokens } : {}
3942
+ })).sort((a, b) => byCodePoint(a.id, b.id));
3943
+ }
3944
+ var init_provider_models = __esm(() => {
3945
+ init_client();
3946
+ });
3947
+
3934
3948
  // ../nax-agent/src/native/session/memory-transcript-store.ts
3935
3949
  function createMemoryTranscriptStore() {
3936
3950
  const live = new Map;
@@ -21169,11 +21183,24 @@ function flagFromBoolean(input, field, subcommand, validVerbs, flag) {
21169
21183
  function looksLikeFlag(value) {
21170
21184
  return value.startsWith("-");
21171
21185
  }
21186
+ function buildGitRootArgv(input) {
21187
+ const extraFields = Object.keys(input).filter((field) => field !== "subcommand");
21188
+ if (extraFields.length > 0) {
21189
+ return { error: `rev-parse accepts no additional fields (received: ${extraFields.join(", ")})` };
21190
+ }
21191
+ return ["rev-parse", "--show-toplevel"];
21192
+ }
21193
+ function defaultGitExcludes(subcommand, excludes) {
21194
+ return subcommand === "blame" ? [] : excludes;
21195
+ }
21172
21196
  function buildGitArgv(input, defaultExcludes = []) {
21173
21197
  const subcommand = input.subcommand;
21174
21198
  if (typeof subcommand !== "string" || !GIT_READ_VERBS.includes(subcommand)) {
21175
21199
  return { error: `subcommand must be one of: ${GIT_READ_VERBS.join(", ")}` };
21176
21200
  }
21201
+ if (subcommand === "rev-parse") {
21202
+ return buildGitRootArgv(input);
21203
+ }
21177
21204
  const refs = Array.isArray(input.refs) ? input.refs : [];
21178
21205
  const paths = Array.isArray(input.paths) ? input.paths : [];
21179
21206
  const argv = [subcommand];
@@ -21239,8 +21266,7 @@ function buildGitArgv(input, defaultExcludes = []) {
21239
21266
  argv.push("--");
21240
21267
  if (paths.length === 0) {
21241
21268
  argv.push(".");
21242
- if (subcommand !== "blame")
21243
- argv.push(...defaultExcludes);
21269
+ argv.push(...defaultGitExcludes(subcommand, defaultExcludes));
21244
21270
  return argv;
21245
21271
  }
21246
21272
  for (const path of paths) {
@@ -21258,7 +21284,7 @@ var init_git = __esm(() => {
21258
21284
  init_git_exec();
21259
21285
  init_truncate();
21260
21286
  init_git_flags();
21261
- GIT_READ_VERBS = ["diff", "log", "show", "status", "blame"];
21287
+ GIT_READ_VERBS = ["diff", "log", "show", "status", "blame", "rev-parse"];
21262
21288
  GIT_DIFF_FILTERS = ["A", "M", "D", "R"];
21263
21289
  GIT_NAME_ONLY_VERBS = ["diff", "log", "show"];
21264
21290
  GIT_DIFF_FILTER_VERBS = ["diff", "log", "show"];
@@ -21267,11 +21293,15 @@ var init_git = __esm(() => {
21267
21293
  GIT_FULL_MESSAGE_VERBS = ["log"];
21268
21294
  gitTool = {
21269
21295
  name: "Git",
21270
- description: "Run a read-only git command (diff, log, show, status, blame) in the repository. Supply refs and pathspecs as arrays, not as a command line. Command-line flags are not accepted in any field; use the nameOnly, diffFilter, oneline, fullMessage and maxCount fields instead.",
21296
+ description: "Run a read-only git command (diff, log, show, status, blame, rev-parse) in the repository. rev-parse is fixed to `git rev-parse --show-toplevel` and accepts no other fields. Supply refs and pathspecs as arrays, not as a command line. Command-line flags are not accepted in any field; use the nameOnly, diffFilter, oneline, fullMessage and maxCount fields instead.",
21271
21297
  inputSchema: {
21272
21298
  type: "object",
21273
21299
  properties: {
21274
- subcommand: { type: "string", enum: [...GIT_READ_VERBS], description: "Read-only git subcommand" },
21300
+ subcommand: {
21301
+ type: "string",
21302
+ enum: [...GIT_READ_VERBS],
21303
+ description: "Read-only git subcommand; rev-parse is fixed to --show-toplevel"
21304
+ },
21275
21305
  refs: { type: "array", items: { type: "string" }, description: "Refs, e.g. ['HEAD~1','HEAD']" },
21276
21306
  paths: { type: "array", items: { type: "string" }, description: "Pathspecs, relative to the permitted root" },
21277
21307
  nameOnly: {
@@ -23971,7 +24001,7 @@ function redirectForVerb(deniedTool, verb, available, declaredCommands) {
23971
24001
  }
23972
24002
  var GIT_READ_VERBS2, GIT_COMMIT_VERBS, GIT_REVERT_VERBS, NAX_OWNED_RUN_STATE_EXPLANATION = "`.nax/` is nax's own run state, written by the harness during this run. It is not part of your diff and must not be reverted.", GLOB, GREP, READ, DELETE, GIT, GIT_COMMIT2, TEST_SCOPED, BASH, HEAD_INTENTS, TASK_RUNNERS, INSTALL_VERBS;
23973
24003
  var init_denial_redirect = __esm(() => {
23974
- GIT_READ_VERBS2 = new Set(["diff", "log", "show", "status", "blame"]);
24004
+ GIT_READ_VERBS2 = new Set(["diff", "log", "show", "status", "blame", "rev-parse"]);
23975
24005
  GIT_COMMIT_VERBS = new Set(["add", "commit"]);
23976
24006
  GIT_REVERT_VERBS = new Set(["checkout", "restore"]);
23977
24007
  GLOB = { tool: "Glob", how: "Glob lists repository paths by pattern" };
@@ -26514,6 +26544,7 @@ var init_native = __esm(() => {
26514
26544
  init_errors();
26515
26545
  init_model_resolver();
26516
26546
  init_models();
26547
+ init_provider_models();
26517
26548
  init_transcript_store();
26518
26549
  init_session_adapter();
26519
26550
  init_session_affinity();
@@ -29841,6 +29872,7 @@ __export(exports_internal, {
29841
29872
  listCredentialFiles: () => listCredentialFiles,
29842
29873
  listGitGuardFiles: () => listGitGuardFiles,
29843
29874
  listNaxEntries: () => listNaxEntries,
29875
+ listProviderModels: () => listProviderModels,
29844
29876
  listStoredProviders: () => listStoredProviders,
29845
29877
  loadTranscript: () => loadTranscript,
29846
29878
  loginProviderIds: () => loginProviderIds,
@@ -30023,6 +30055,7 @@ var init_internal = __esm(() => {
30023
30055
  init_errors();
30024
30056
  init_model_resolver();
30025
30057
  init_models();
30058
+ init_provider_models();
30026
30059
  init_external_handler();
30027
30060
  init_loop_events();
30028
30061
  init_session();
@@ -32922,7 +32955,7 @@ function isLegacyFlatModels(val) {
32922
32955
  }
32923
32956
  return false;
32924
32957
  }
32925
- var ConfigPricingTierSchema, ConfigPricingSchema, ThinkingLevelSchema, CatalogPricingSchema, OpenRouterRoutingSchema, CatalogModelOverrideSchema, LOOPBACK_HOSTS2, BASE_URL_MESSAGE = "baseUrl must be an https URL (http allowed only for localhost/127.0.0.1) and must not embed credentials", ProviderCatalogOverrideSchema, ModelDefSchema, ModelEntrySchema, PerAgentModelMapSchema, ModelMapSchema, ModelTierSchema, ConfiguredModelObjectSchema, ConfiguredModelSchema, TierConfigSchema;
32958
+ var ConfigPricingTierSchema, ConfigPricingSchema, ThinkingLevelSchema, CatalogPricingSchema, PercentileCutoffSchema, PercentileTargetSchema, OpenRouterRoutingSchema, CatalogModelOverrideSchema, LOOPBACK_HOSTS2, BASE_URL_MESSAGE = "baseUrl must be an https URL (http allowed only for localhost/127.0.0.1) and must not embed credentials", ProviderCatalogOverrideSchema, ModelDefSchema, ModelEntrySchema, PerAgentModelMapSchema, ModelMapSchema, ModelTierSchema, ConfiguredModelObjectSchema, ConfiguredModelSchema, TierConfigSchema;
32926
32959
  var init_schemas_model = __esm(() => {
32927
32960
  init_zod();
32928
32961
  ConfigPricingTierSchema = exports_external.object({
@@ -32946,6 +32979,13 @@ var init_schemas_model = __esm(() => {
32946
32979
  cacheRead: exports_external.number().min(0),
32947
32980
  cacheWrite: exports_external.number().min(0)
32948
32981
  }).strict();
32982
+ PercentileCutoffSchema = exports_external.object({
32983
+ p50: exports_external.number().positive().optional(),
32984
+ p75: exports_external.number().positive().optional(),
32985
+ p90: exports_external.number().positive().optional(),
32986
+ p99: exports_external.number().positive().optional()
32987
+ }).strict().refine((v) => Object.keys(v).length > 0, { message: "a percentile cutoff object must not be empty" });
32988
+ PercentileTargetSchema = exports_external.union([exports_external.number().positive(), PercentileCutoffSchema]);
32949
32989
  OpenRouterRoutingSchema = exports_external.object({
32950
32990
  allow_fallbacks: exports_external.boolean().optional(),
32951
32991
  require_parameters: exports_external.boolean().optional(),
@@ -32955,7 +32995,9 @@ var init_schemas_model = __esm(() => {
32955
32995
  only: exports_external.array(exports_external.string().min(1)).optional(),
32956
32996
  ignore: exports_external.array(exports_external.string().min(1)).optional(),
32957
32997
  quantizations: exports_external.array(exports_external.string().min(1)).optional(),
32958
- sort: exports_external.enum(["price", "throughput", "latency"]).optional()
32998
+ sort: exports_external.enum(["price", "throughput", "latency"]).optional(),
32999
+ preferred_min_throughput: PercentileTargetSchema.optional(),
33000
+ preferred_max_latency: PercentileTargetSchema.optional()
32959
33001
  }).strict().refine((v) => Object.keys(v).length > 0, {
32960
33002
  message: "openRouterRouting must not be empty \u2014 omit the key to leave the model's routing unset"
32961
33003
  });
@@ -38851,7 +38893,7 @@ var package_default;
38851
38893
  var init_package = __esm(() => {
38852
38894
  package_default = {
38853
38895
  name: "@nathapp/nax",
38854
- version: "0.84.0",
38896
+ version: "0.85.0",
38855
38897
  description: "AI Coding Agent Orchestrator \u2014 loops until done",
38856
38898
  type: "module",
38857
38899
  bin: {
@@ -38938,7 +38980,7 @@ var init_package = __esm(() => {
38938
38980
  "@agentclientprotocol/sdk": "~1.7.0",
38939
38981
  "@anthropic-ai/sandbox-runtime": "0.0.77",
38940
38982
  "@modelcontextprotocol/sdk": "^1.30.0",
38941
- "@nathapp/nax-ai": "0.84.0",
38983
+ "@nathapp/nax-ai": "0.85.0",
38942
38984
  chalk: "^5.6.2",
38943
38985
  commander: "^13.1.0",
38944
38986
  ink: "^6.7.0",
@@ -44842,6 +44884,8 @@ function buildAgentScopeSection(root, workdirLabel) {
44842
44884
  return [
44843
44885
  "## Your file scope",
44844
44886
  "",
44887
+ `**Execution repository/worktree root:** \`${root}\``,
44888
+ "",
44845
44889
  "Your file tools (Read, Write, Edit, Glob, Grep, Git) are rooted at the repository root.",
44846
44890
  "Every path you pass them is resolved from there."
44847
44891
  ].join(`
@@ -44850,6 +44894,8 @@ function buildAgentScopeSection(root, workdirLabel) {
44850
44894
  return [
44851
44895
  "## Your file scope",
44852
44896
  "",
44897
+ `**Execution repository/worktree root:** \`${root}\``,
44898
+ "",
44853
44899
  "Your file tools (Read, Write, Edit, Glob, Grep, Git) are rooted at the repository root, NOT at your package.",
44854
44900
  `Your story's package is \`${workdirLabel}\`. Spell every path repo-rooted from the repository root: write`,
44855
44901
  `\`${workdirLabel}/src/index.ts\`, never \`src/index.ts\`.`,
@@ -57353,8 +57399,8 @@ var init_version = __esm(() => {
57353
57399
  NAX_AI_VERSION = CATALOG_VERSION;
57354
57400
  NAX_COMMIT = (() => {
57355
57401
  try {
57356
- if (/^[0-9a-f]{6,10}$/.test("eeb09eb"))
57357
- return "eeb09eb";
57402
+ if (/^[0-9a-f]{6,10}$/.test("dafafae"))
57403
+ return "dafafae";
57358
57404
  } catch {}
57359
57405
  try {
57360
57406
  const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nathapp/nax",
3
- "version": "0.84.0",
3
+ "version": "0.85.0",
4
4
  "description": "AI Coding Agent Orchestrator — loops until done",
5
5
  "type": "module",
6
6
  "bin": {
@@ -87,7 +87,7 @@
87
87
  "@agentclientprotocol/sdk": "~1.7.0",
88
88
  "@anthropic-ai/sandbox-runtime": "0.0.77",
89
89
  "@modelcontextprotocol/sdk": "^1.30.0",
90
- "@nathapp/nax-ai": "0.84.0",
90
+ "@nathapp/nax-ai": "0.85.0",
91
91
  "chalk": "^5.6.2",
92
92
  "commander": "^13.1.0",
93
93
  "ink": "^6.7.0",