overlane 0.1.142 → 0.1.144

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/dist/overlane.mjs CHANGED
@@ -21068,6 +21068,121 @@ var init_code_index = __esm({
21068
21068
  }
21069
21069
  });
21070
21070
 
21071
+ // ../contracts/src/code-nav.ts
21072
+ var CodeNavFreshness, CodeNavMeta, CodeNavSymbol, CodeNavTextHit, CodeFindAnswer, CodeOutlineAnswer, CodeRefsAnswer, CodeSpanAnswer;
21073
+ var init_code_nav = __esm({
21074
+ "../contracts/src/code-nav.ts"() {
21075
+ "use strict";
21076
+ init_zod();
21077
+ CodeNavFreshness = external_exports.enum(["fresh", "partial", "stale", "unavailable"]);
21078
+ CodeNavMeta = external_exports.object({
21079
+ /** The commit the index describes; null with no index. */
21080
+ indexedCommit: external_exports.string().nullable(),
21081
+ /** The commit the caller asked about (the checkout's HEAD for the local source); null when unknown. */
21082
+ requestedCommit: external_exports.string().nullable(),
21083
+ coverage: external_exports.object({
21084
+ /** Files the index parsed. */
21085
+ files: external_exports.number().int().nonnegative(),
21086
+ symbols: external_exports.number().int().nonnegative(),
21087
+ /** Files that could not be parsed (unsupported language, too large). */
21088
+ uncovered: external_exports.number().int().nonnegative(),
21089
+ /** Files that differ between the indexed and the requested commit; their answers come from a pattern scan or are missing. */
21090
+ changedSinceIndex: external_exports.number().int().nonnegative()
21091
+ }).strict(),
21092
+ freshness: CodeNavFreshness,
21093
+ /** True when an empty or short answer may be missing results (stale, partial or uncovered files), as opposed to a certain "no match". */
21094
+ incomplete: external_exports.boolean(),
21095
+ notice: external_exports.string().optional(),
21096
+ /** The cloud index only: saved, uncommitted work merged over the snapshot, as `overlay <session> <age>` (ADR 0062). Absent when nothing is merged. */
21097
+ overlay: external_exports.string().optional()
21098
+ }).strict();
21099
+ CodeNavSymbol = external_exports.object({ kind: external_exports.string(), qualified: external_exports.string(), path: external_exports.string(), line: external_exports.number().int().positive(), endLine: external_exports.number().int().positive().optional() }).strict();
21100
+ CodeNavTextHit = external_exports.object({ path: external_exports.string(), line: external_exports.number().int().positive(), text: external_exports.string() }).strict();
21101
+ CodeFindAnswer = CodeNavMeta.extend({
21102
+ source: external_exports.enum(["index", "search"]),
21103
+ matches: external_exports.array(CodeNavSymbol),
21104
+ more: external_exports.boolean(),
21105
+ /** Literal-search lines, when the index could not answer. */
21106
+ lines: external_exports.array(CodeNavTextHit).optional()
21107
+ }).strict();
21108
+ CodeOutlineAnswer = CodeNavMeta.extend({
21109
+ path: external_exports.string(),
21110
+ source: external_exports.enum(["index", "pattern"]),
21111
+ symbols: external_exports.array(external_exports.object({ line: external_exports.number().int().positive(), kind: external_exports.string(), name: external_exports.string() }).strict())
21112
+ }).strict();
21113
+ CodeRefsAnswer = CodeNavMeta.extend({
21114
+ name: external_exports.string(),
21115
+ source: external_exports.enum(["index", "search"]),
21116
+ callers: external_exports.array(CodeNavSymbol),
21117
+ matches: external_exports.array(CodeNavTextHit),
21118
+ skippedImports: external_exports.number().int().nonnegative(),
21119
+ more: external_exports.number().int().nonnegative()
21120
+ }).strict();
21121
+ CodeSpanAnswer = CodeNavMeta.extend({
21122
+ found: external_exports.boolean(),
21123
+ path: external_exports.string(),
21124
+ kind: external_exports.string(),
21125
+ qualified: external_exports.string(),
21126
+ start: external_exports.number().int().nonnegative(),
21127
+ end: external_exports.number().int().nonnegative(),
21128
+ /** Other definitions of the same name, best first. */
21129
+ also: external_exports.array(CodeNavSymbol)
21130
+ }).strict();
21131
+ }
21132
+ });
21133
+
21134
+ // ../contracts/src/code-overlay.ts
21135
+ var NAV_TOOLS, NavTool, CodeShowAnswer, OVERLAY_TTL_MS, OVERLAY_MAX_FILES, OVERLAY_MAX_SYMBOLS_PER_FILE, OVERLAY_MAX_BYTES, SessionName, OverlayFile, OverlayPut, OverlayAck, OverlaySummary;
21136
+ var init_code_overlay = __esm({
21137
+ "../contracts/src/code-overlay.ts"() {
21138
+ "use strict";
21139
+ init_zod();
21140
+ init_common();
21141
+ init_code_index();
21142
+ init_code_nav();
21143
+ NAV_TOOLS = ["find", "outline", "refs", "span"];
21144
+ NavTool = external_exports.enum(NAV_TOOLS);
21145
+ CodeShowAnswer = CodeNavMeta.extend({
21146
+ path: external_exports.string(),
21147
+ start: external_exports.number().int().positive(),
21148
+ end: external_exports.number().int().nonnegative(),
21149
+ text: external_exports.string(),
21150
+ truncated: external_exports.boolean().optional()
21151
+ }).strict();
21152
+ OVERLAY_TTL_MS = 24 * 60 * 60 * 1e3;
21153
+ OVERLAY_MAX_FILES = 500;
21154
+ OVERLAY_MAX_SYMBOLS_PER_FILE = 2e3;
21155
+ OVERLAY_MAX_BYTES = 1024 * 1024;
21156
+ SessionName = external_exports.string().regex(/^[A-Za-z0-9._-]{1,64}$/, "a session is 1 to 64 letters, digits, dots, dashes or underscores");
21157
+ OverlayFile = external_exports.object({
21158
+ path: external_exports.string().min(1).max(1024),
21159
+ language: external_exports.string().min(1).max(32),
21160
+ /** Hash of the dirty bytes; lets a client skip a repost of an unchanged file. */
21161
+ contentHash: Sha256Digest,
21162
+ symbols: external_exports.array(IndexedSymbol).max(OVERLAY_MAX_SYMBOLS_PER_FILE)
21163
+ }).strict();
21164
+ OverlayPut = external_exports.object({
21165
+ session: SessionName,
21166
+ branch: external_exports.string().min(1).max(255),
21167
+ baseCommit: CommitSha,
21168
+ files: external_exports.array(OverlayFile).max(OVERLAY_MAX_FILES).default([]),
21169
+ deleted: external_exports.array(external_exports.string().min(1).max(1024)).max(OVERLAY_MAX_FILES).default([]),
21170
+ clean: external_exports.array(external_exports.string().min(1).max(1024)).max(OVERLAY_MAX_FILES).default([]),
21171
+ replace: external_exports.boolean().default(false)
21172
+ }).strict();
21173
+ OverlayAck = external_exports.object({
21174
+ session: external_exports.string(),
21175
+ branch: external_exports.string(),
21176
+ baseCommit: CommitSha,
21177
+ files: external_exports.number().int().nonnegative(),
21178
+ tombstones: external_exports.number().int().nonnegative(),
21179
+ bytes: external_exports.number().int().nonnegative(),
21180
+ expiresAt: external_exports.string()
21181
+ }).strict();
21182
+ OverlaySummary = external_exports.object({ session: external_exports.string(), branch: external_exports.string(), baseCommit: CommitSha, files: external_exports.number().int().nonnegative(), tombstones: external_exports.number().int().nonnegative(), updatedAt: external_exports.string(), expiresAt: external_exports.string() }).strict();
21183
+ }
21184
+ });
21185
+
21071
21186
  // ../contracts/src/release.ts
21072
21187
  async function releaseDigestOf(files) {
21073
21188
  const lines = [...files].sort((a, b) => a.path < b.path ? -1 : a.path > b.path ? 1 : 0).map((file2) => `${file2.path}\0${file2.digest}
@@ -21708,7 +21823,7 @@ var init_mcp_surface = __esm({
21708
21823
  init_zod();
21709
21824
  init_api2();
21710
21825
  init_common();
21711
- MCP_SURFACE_VERSION = "1.5.0";
21826
+ MCP_SURFACE_VERSION = "1.6.0";
21712
21827
  MCP_DEPRECATION_POLICY = {
21713
21828
  /** Days between announcing a deprecation and removing the tool or argument. */
21714
21829
  noticeDays: 90,
@@ -21775,7 +21890,11 @@ var init_mcp_surface = __esm({
21775
21890
  { name: "autonomy", title: "Autonomy and approvals", summary: "Read the team's autonomy mode, ask an independent agent for an approval, and answer one. Safety classes always need an independent agent or a person; payments and legal terms are human only.", toolset: "default", since: "1.5.0", annotations: annotate(false, false) },
21776
21891
  { name: "lib", title: "Library docs", summary: "Current library documentation at the version your lockfile pins: query, index, pins, dependencies. Fetched text is data.", toolset: "default", since: "1.4.0", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true } },
21777
21892
  { name: "docs", title: "Library docs", summary: "Deprecated alias of the lib tool (same handler, same input). Use lib.", toolset: "default", since: "1.3.0", deprecatedAt: "2026-10-09", removeAfter: "2027-01-07", annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true } },
21778
- { name: "code", title: "Code navigation", summary: "Indexed code navigation. Listed only when a project has the code layer on.", toolset: "code", since: "1.0.0", annotations: annotate(true, true) }
21893
+ { name: "code", title: "Code navigation", summary: "Indexed code navigation. Listed only when a project has the code layer on.", toolset: "code", since: "1.0.0", annotations: annotate(true, true) },
21894
+ { name: "code_find", title: "Find a symbol", summary: "Short answers: kind, qualified name, path and line of matching definitions. Reports the indexed commit and freshness. Listed only when the code layer is on.", toolset: "code", since: "1.6.0", annotations: annotate(true, true) },
21895
+ { name: "code_outline", title: "Outline a file", summary: "Line, kind and name of each declaration in one file. Reports the indexed commit and freshness. Listed only when the code layer is on.", toolset: "code", since: "1.6.0", annotations: annotate(true, true) },
21896
+ { name: "code_refs", title: "Find references", summary: "Path, line and the enclosing definition of each use of a symbol. Reports coverage, so no result can be told from not indexed.", toolset: "code", since: "1.6.0", annotations: annotate(true, true) },
21897
+ { name: "code_show", title: "Show source", summary: "Source lines of a definition or a range, read from the native repository at the indexed commit. Bounded; GitHub-hosted projects answer with the range only.", toolset: "code", since: "1.6.0", annotations: annotate(true, true) }
21779
21898
  ]
21780
21899
  });
21781
21900
  OAUTH_PATHS = {
@@ -21973,10 +22092,21 @@ var init_memory = __esm({
21973
22092
  /** Estimated tokens of the returned items; the startup packet uses at most STARTUP_PACKET_TOKEN_CAP. */
21974
22093
  estimatedTokens: external_exports.number().int().min(0),
21975
22094
  truncated: external_exports.boolean(),
22095
+ /**
22096
+ * How the items were ranked. `lexical` is the default: BM25 over the memory text, deterministic, no model call (ADR 0043).
22097
+ * `lexical+embedding` means the team turned embedding re-rank on and the lexical candidates were re-ordered by it.
22098
+ */
22099
+ ranking: external_exports.enum(["lexical", "lexical+embedding"]).default("lexical"),
21976
22100
  /** Present with `format=data`: the same items rendered as a labelled, quoted data block. */
21977
22101
  rendered: external_exports.string().optional()
21978
22102
  }).strict();
21979
- MemorySettings = external_exports.object({ tenantId: TenantId, globalContribution: external_exports.boolean(), updatedAt: Timestamp.nullable() }).strict();
22103
+ MemorySettings = external_exports.object({
22104
+ tenantId: TenantId,
22105
+ globalContribution: external_exports.boolean(),
22106
+ /** Off by default. When on, a search embeds the query and re-orders the lexical candidates; recall is still decided by the lexical match. */
22107
+ embeddingRerank: external_exports.boolean().default(false),
22108
+ updatedAt: Timestamp.nullable()
22109
+ }).strict();
21980
22110
  MemoryUnlearnRecord = external_exports.object({
21981
22111
  tenantId: TenantId,
21982
22112
  id: Id,
@@ -22026,7 +22156,7 @@ var init_memory = __esm({
22026
22156
  contributions: external_exports.record(external_exports.string(), external_exports.number().int().min(0)),
22027
22157
  pendingJobs: external_exports.number().int().min(0)
22028
22158
  }).strict();
22029
- MemorySettingsRequest = external_exports.object({ globalContribution: external_exports.boolean() }).strict();
22159
+ MemorySettingsRequest = external_exports.object({ globalContribution: external_exports.boolean().optional(), embeddingRerank: external_exports.boolean().optional() }).strict().refine((value) => value.globalContribution !== void 0 || value.embeddingRerank !== void 0, { message: "send globalContribution, embeddingRerank or both" });
22030
22160
  MEMORY_EVENT_TYPES = [
22031
22161
  "memory.candidate_created",
22032
22162
  "memory.confirmed",
@@ -27154,67 +27284,6 @@ var init_observability = __esm({
27154
27284
  }
27155
27285
  });
27156
27286
 
27157
- // ../contracts/src/code-nav.ts
27158
- var CodeNavFreshness, CodeNavMeta, CodeNavSymbol, CodeNavTextHit, CodeFindAnswer, CodeOutlineAnswer, CodeRefsAnswer, CodeSpanAnswer;
27159
- var init_code_nav = __esm({
27160
- "../contracts/src/code-nav.ts"() {
27161
- "use strict";
27162
- init_zod();
27163
- CodeNavFreshness = external_exports.enum(["fresh", "partial", "stale", "unavailable"]);
27164
- CodeNavMeta = external_exports.object({
27165
- /** The commit the index describes; null with no index. */
27166
- indexedCommit: external_exports.string().nullable(),
27167
- /** The commit the caller asked about (the checkout's HEAD for the local source); null when unknown. */
27168
- requestedCommit: external_exports.string().nullable(),
27169
- coverage: external_exports.object({
27170
- /** Files the index parsed. */
27171
- files: external_exports.number().int().nonnegative(),
27172
- symbols: external_exports.number().int().nonnegative(),
27173
- /** Files that could not be parsed (unsupported language, too large). */
27174
- uncovered: external_exports.number().int().nonnegative(),
27175
- /** Files that differ between the indexed and the requested commit; their answers come from a pattern scan or are missing. */
27176
- changedSinceIndex: external_exports.number().int().nonnegative()
27177
- }).strict(),
27178
- freshness: CodeNavFreshness,
27179
- /** True when an empty or short answer may be missing results (stale, partial or uncovered files), as opposed to a certain "no match". */
27180
- incomplete: external_exports.boolean(),
27181
- notice: external_exports.string().optional()
27182
- }).strict();
27183
- CodeNavSymbol = external_exports.object({ kind: external_exports.string(), qualified: external_exports.string(), path: external_exports.string(), line: external_exports.number().int().positive(), endLine: external_exports.number().int().positive().optional() }).strict();
27184
- CodeNavTextHit = external_exports.object({ path: external_exports.string(), line: external_exports.number().int().positive(), text: external_exports.string() }).strict();
27185
- CodeFindAnswer = CodeNavMeta.extend({
27186
- source: external_exports.enum(["index", "search"]),
27187
- matches: external_exports.array(CodeNavSymbol),
27188
- more: external_exports.boolean(),
27189
- /** Literal-search lines, when the index could not answer. */
27190
- lines: external_exports.array(CodeNavTextHit).optional()
27191
- }).strict();
27192
- CodeOutlineAnswer = CodeNavMeta.extend({
27193
- path: external_exports.string(),
27194
- source: external_exports.enum(["index", "pattern"]),
27195
- symbols: external_exports.array(external_exports.object({ line: external_exports.number().int().positive(), kind: external_exports.string(), name: external_exports.string() }).strict())
27196
- }).strict();
27197
- CodeRefsAnswer = CodeNavMeta.extend({
27198
- name: external_exports.string(),
27199
- source: external_exports.enum(["index", "search"]),
27200
- callers: external_exports.array(CodeNavSymbol),
27201
- matches: external_exports.array(CodeNavTextHit),
27202
- skippedImports: external_exports.number().int().nonnegative(),
27203
- more: external_exports.number().int().nonnegative()
27204
- }).strict();
27205
- CodeSpanAnswer = CodeNavMeta.extend({
27206
- found: external_exports.boolean(),
27207
- path: external_exports.string(),
27208
- kind: external_exports.string(),
27209
- qualified: external_exports.string(),
27210
- start: external_exports.number().int().nonnegative(),
27211
- end: external_exports.number().int().nonnegative(),
27212
- /** Other definitions of the same name, best first. */
27213
- also: external_exports.array(CodeNavSymbol)
27214
- }).strict();
27215
- }
27216
- });
27217
-
27218
27287
  // ../contracts/src/index.ts
27219
27288
  var init_src = __esm({
27220
27289
  "../contracts/src/index.ts"() {
@@ -27229,6 +27298,7 @@ var init_src = __esm({
27229
27298
  init_api2();
27230
27299
  init_task_api();
27231
27300
  init_code_index();
27301
+ init_code_overlay();
27232
27302
  init_release();
27233
27303
  init_kit();
27234
27304
  init_identity();
@@ -34619,7 +34689,7 @@ var VERSION;
34619
34689
  var init_assets = __esm({
34620
34690
  "src/assets.ts"() {
34621
34691
  "use strict";
34622
- VERSION = true ? "0.1.142" : "0.0.0-dev";
34692
+ VERSION = true ? "0.1.144" : "0.0.0-dev";
34623
34693
  }
34624
34694
  });
34625
34695
 
@@ -42292,33 +42362,7 @@ ${JSON.stringify(symbolNames, null, 2)}`);
42292
42362
  }
42293
42363
  });
42294
42364
 
42295
- // ../index-builder/src/treesitter.ts
42296
- import { createHash as createHash5 } from "node:crypto";
42297
- import { createRequire } from "node:module";
42298
- function ensureInit() {
42299
- initialised ??= Parser.init({ locateFile: (name2) => assetFile(name2) });
42300
- return initialised;
42301
- }
42302
- function parserFor(language) {
42303
- let cached2 = parsers.get(language);
42304
- if (!cached2) {
42305
- const grammar = GRAMMAR_FILES[language];
42306
- if (!grammar) throw new Error(`no grammar for ${language}`);
42307
- cached2 = (async () => {
42308
- await ensureInit();
42309
- const loaded2 = await Language2.load(assetFile(grammar));
42310
- const parser = new Parser();
42311
- parser.setLanguage(loaded2);
42312
- return parser;
42313
- })();
42314
- parsers.set(language, cached2);
42315
- cached2.catch(() => parsers.delete(language));
42316
- }
42317
- return cached2;
42318
- }
42319
- function sha256Of2(content) {
42320
- return `sha256:${createHash5("sha256").update(content, "utf8").digest("hex")}`;
42321
- }
42365
+ // ../index-builder/src/treesitter-core.ts
42322
42366
  function rangeOf(node2) {
42323
42367
  return [node2.startPosition.row, node2.startPosition.column, node2.endPosition.row, node2.endPosition.column];
42324
42368
  }
@@ -42352,12 +42396,9 @@ function collect(extract, nodes, scope, parentId, prefix, path, symbols2, occurr
42352
42396
  }
42353
42397
  }
42354
42398
  }
42355
- async function parseDeclarations(path, content) {
42356
- const language = languageForPath(path);
42357
- if (language === null) return null;
42399
+ function extractShard(path, language, content, contentHash, parser) {
42358
42400
  const extract = EXTRACTORS[language];
42359
42401
  if (!extract) return null;
42360
- const parser = await parserFor(language);
42361
42402
  const tree = parser.parse(content);
42362
42403
  if (!tree) throw new Error(`tree-sitter could not parse ${path}`);
42363
42404
  try {
@@ -42367,7 +42408,7 @@ async function parseDeclarations(path, content) {
42367
42408
  return {
42368
42409
  schemaVersion: "1",
42369
42410
  path,
42370
- contentHash: sha256Of2(content),
42411
+ contentHash,
42371
42412
  language,
42372
42413
  precision: "declaration",
42373
42414
  symbols: [...symbols2.values()].sort((a, b) => compareRanges(a.range, b.range)),
@@ -42377,23 +42418,14 @@ async function parseDeclarations(path, content) {
42377
42418
  tree.delete();
42378
42419
  }
42379
42420
  }
42380
- var GRAMMAR_FILES, require2, initialised, parsers, NAME_NODE_TYPES, TS_FUNCTIONS, TS_CLASSES, TS_METHODS, TS_PROPERTIES, FUNCTION_VALUES, typescriptDecls, pythonDecls, ZIG_STRUCTS, zigDecls, EXTRACTORS;
42381
- var init_treesitter = __esm({
42382
- "../index-builder/src/treesitter.ts"() {
42421
+ var MAX_PARSE_BYTES, TREE_SITTER_INDEXER, NAME_NODE_TYPES, TS_FUNCTIONS, TS_CLASSES, TS_METHODS, TS_PROPERTIES, FUNCTION_VALUES, typescriptDecls, pythonDecls, ZIG_STRUCTS, zigDecls, EXTRACTORS;
42422
+ var init_treesitter_core = __esm({
42423
+ "../index-builder/src/treesitter-core.ts"() {
42383
42424
  "use strict";
42384
- init_assets();
42385
- init_web_tree_sitter();
42386
42425
  init_languages();
42387
42426
  init_ranges();
42388
- GRAMMAR_FILES = {
42389
- typescript: "@vscode/tree-sitter-wasm/wasm/tree-sitter-typescript.wasm",
42390
- tsx: "@vscode/tree-sitter-wasm/wasm/tree-sitter-tsx.wasm",
42391
- javascript: "@vscode/tree-sitter-wasm/wasm/tree-sitter-javascript.wasm",
42392
- python: "@vscode/tree-sitter-wasm/wasm/tree-sitter-python.wasm",
42393
- zig: "@tree-sitter-grammars/tree-sitter-zig/tree-sitter-zig.wasm"
42394
- };
42395
- require2 = createRequire(import.meta.url);
42396
- parsers = /* @__PURE__ */ new Map();
42427
+ MAX_PARSE_BYTES = 2e6;
42428
+ TREE_SITTER_INDEXER = { name: "web-tree-sitter", version: "0.27.0" };
42397
42429
  NAME_NODE_TYPES = /* @__PURE__ */ new Set(["identifier", "type_identifier", "property_identifier", "private_property_identifier", "nested_identifier"]);
42398
42430
  TS_FUNCTIONS = /* @__PURE__ */ new Set(["function_declaration", "generator_function_declaration", "function_signature"]);
42399
42431
  TS_CLASSES = /* @__PURE__ */ new Set(["class_declaration", "abstract_class_declaration"]);
@@ -42544,6 +42576,59 @@ var init_treesitter = __esm({
42544
42576
  }
42545
42577
  });
42546
42578
 
42579
+ // ../index-builder/src/treesitter.ts
42580
+ import { createHash as createHash5 } from "node:crypto";
42581
+ import { createRequire } from "node:module";
42582
+ function ensureInit() {
42583
+ initialised ??= Parser.init({ locateFile: (name2) => assetFile(name2) });
42584
+ return initialised;
42585
+ }
42586
+ function parserFor(language) {
42587
+ let cached2 = parsers.get(language);
42588
+ if (!cached2) {
42589
+ const grammar = GRAMMAR_FILES[language];
42590
+ if (!grammar) throw new Error(`no grammar for ${language}`);
42591
+ cached2 = (async () => {
42592
+ await ensureInit();
42593
+ const loaded2 = await Language2.load(assetFile(grammar));
42594
+ const parser = new Parser();
42595
+ parser.setLanguage(loaded2);
42596
+ return parser;
42597
+ })();
42598
+ parsers.set(language, cached2);
42599
+ cached2.catch(() => parsers.delete(language));
42600
+ }
42601
+ return cached2;
42602
+ }
42603
+ function sha256Of2(content) {
42604
+ return `sha256:${createHash5("sha256").update(content, "utf8").digest("hex")}`;
42605
+ }
42606
+ async function parseDeclarations(path, content) {
42607
+ const language = languageForPath(path);
42608
+ if (language === null) return null;
42609
+ const parser = await parserFor(language);
42610
+ return extractShard(path, language, content, sha256Of2(content), parser);
42611
+ }
42612
+ var GRAMMAR_FILES, require2, initialised, parsers;
42613
+ var init_treesitter = __esm({
42614
+ "../index-builder/src/treesitter.ts"() {
42615
+ "use strict";
42616
+ init_assets();
42617
+ init_web_tree_sitter();
42618
+ init_languages();
42619
+ init_treesitter_core();
42620
+ GRAMMAR_FILES = {
42621
+ typescript: "@vscode/tree-sitter-wasm/wasm/tree-sitter-typescript.wasm",
42622
+ tsx: "@vscode/tree-sitter-wasm/wasm/tree-sitter-tsx.wasm",
42623
+ javascript: "@vscode/tree-sitter-wasm/wasm/tree-sitter-javascript.wasm",
42624
+ python: "@vscode/tree-sitter-wasm/wasm/tree-sitter-python.wasm",
42625
+ zig: "@tree-sitter-grammars/tree-sitter-zig/tree-sitter-zig.wasm"
42626
+ };
42627
+ require2 = createRequire(import.meta.url);
42628
+ parsers = /* @__PURE__ */ new Map();
42629
+ }
42630
+ });
42631
+
42547
42632
  // ../index-builder/src/snapshot.ts
42548
42633
  import { execFile as execFile2 } from "node:child_process";
42549
42634
  import { createHash as createHash6 } from "node:crypto";
@@ -42642,7 +42727,7 @@ async function buildSnapshot(options) {
42642
42727
  function compareStrings(a, b) {
42643
42728
  return a < b ? -1 : a > b ? 1 : 0;
42644
42729
  }
42645
- var execFileAsync, MAX_PARSE_BYTES, TREE_SITTER_INDEXER;
42730
+ var execFileAsync;
42646
42731
  var init_snapshot = __esm({
42647
42732
  "../index-builder/src/snapshot.ts"() {
42648
42733
  "use strict";
@@ -42650,13 +42735,27 @@ var init_snapshot = __esm({
42650
42735
  init_languages();
42651
42736
  init_scip();
42652
42737
  init_treesitter();
42738
+ init_treesitter_core();
42653
42739
  execFileAsync = promisify(execFile2);
42654
- MAX_PARSE_BYTES = 2e6;
42655
- TREE_SITTER_INDEXER = { name: "web-tree-sitter", version: "0.27.0" };
42656
42740
  }
42657
42741
  });
42658
42742
 
42659
42743
  // ../index-builder/src/upload.ts
42744
+ function refusalHint(status, body2) {
42745
+ let code2 = "";
42746
+ try {
42747
+ code2 = String(JSON.parse(body2).error?.code ?? "");
42748
+ } catch {
42749
+ }
42750
+ if (status === 401) return "the service did not accept the credential; an Actions token needs permissions: id-token: write and an audience equal to the service origin (scheme and host, no path)";
42751
+ if (status === 403 && code2 === "insufficient_scope") return "the token cannot write; mint one that includes harness:write";
42752
+ if (status === 403) return "the repository is not a connected project of this tenant, or the tenant is wrong; check HARNESS_TENANT (gh-<repository owner id>) and that the project has this repository";
42753
+ if (status === 404 && code2 === "code_layer_off") return "the project has the code layer off; turn it on for the project, then run the upload again";
42754
+ if (status === 404 && code2 === "not_found") return "no such project in this tenant";
42755
+ if (status === 409) return "shards are missing at publish; run the upload again";
42756
+ if (status === 413) return "the request was larger than the service accepts";
42757
+ return null;
42758
+ }
42660
42759
  async function uploadSnapshot(options) {
42661
42760
  const doFetch = options.fetch ?? fetch;
42662
42761
  const base5 = options.serviceUrl.replace(/\/+$/, "");
@@ -42673,7 +42772,10 @@ async function uploadSnapshot(options) {
42673
42772
  if (response.ok) return response;
42674
42773
  const retryable = response.status === 429 || response.status >= 500;
42675
42774
  if (!retryable || attempt2 >= ATTEMPTS) {
42676
- throw new HttpError(`POST ${path} failed with status ${response.status}: ${(await response.text()).slice(0, 300)}`);
42775
+ const text = await response.text();
42776
+ const hint = refusalHint(response.status, text);
42777
+ throw new HttpError(`POST ${path} failed with status ${response.status}: ${text.slice(0, 300)}${hint === null ? "" : `
42778
+ ${hint}`}`);
42677
42779
  }
42678
42780
  failure4 = `status ${response.status}`;
42679
42781
  } catch (error62) {
@@ -43220,6 +43322,13 @@ import { mkdir as mkdir4, readdir as readdir4, rm as rm2, writeFile as writeFile
43220
43322
  import { join as join34, resolve as resolve18 } from "node:path";
43221
43323
  import { parseArgs as parseArgs2 } from "node:util";
43222
43324
  import { promisify as promisify3 } from "node:util";
43325
+ function originOf(url2) {
43326
+ try {
43327
+ return new URL(url2).origin;
43328
+ } catch {
43329
+ throw new UsageError2(`--service must be a URL, got "${url2}"`);
43330
+ }
43331
+ }
43223
43332
  async function git6(root, args2) {
43224
43333
  const { stdout } = await execFileAsync3("git", args2, { cwd: root, encoding: "utf8" });
43225
43334
  return stdout.trim();
@@ -43244,7 +43353,7 @@ async function snapshotFromArgs(values, env) {
43244
43353
  const repoText = projectId !== void 0 ? typeof values["repo"] === "string" ? values["repo"] : void 0 : (typeof values["repo"] === "string" ? values["repo"] : void 0) ?? env["GITHUB_REPOSITORY"] ?? await repositoryFromRemote(root);
43245
43354
  if (!repoText && projectId === void 0) throw new UsageError2("cannot determine the repository; pass --project ID, or --repo owner/name");
43246
43355
  const commit = (typeof values["commit"] === "string" ? values["commit"] : void 0) ?? env["GITHUB_SHA"] ?? await git6(root, ["rev-parse", "HEAD"]);
43247
- const branch = typeof values["branch"] === "string" ? values["branch"] : void 0;
43356
+ const branch = (typeof values["branch"] === "string" ? values["branch"] : void 0) ?? (env["GITHUB_REF_TYPE"] === "branch" ? env["GITHUB_REF_NAME"] : void 0);
43248
43357
  const tenant = (typeof values["tenant"] === "string" ? values["tenant"] : void 0) ?? env["HARNESS_TENANT"];
43249
43358
  if (!tenant) throw new UsageError2("missing --tenant (or HARNESS_TENANT)");
43250
43359
  const scip = Array.isArray(values["scip"]) ? values["scip"] : [];
@@ -43283,7 +43392,7 @@ async function runCli2(argv, env, out2 = console.log, err2 = console.error) {
43283
43392
  if (!service) throw new UsageError2("upload needs --service URL");
43284
43393
  const built = await snapshotFromArgs(values, env);
43285
43394
  const byProject = values.project !== void 0;
43286
- const token = !byProject && env["ACTIONS_ID_TOKEN_REQUEST_URL"] ? await getOidcToken(values.audience ?? service, env) : env["HARNESS_TOKEN"];
43395
+ const token = !byProject && env["ACTIONS_ID_TOKEN_REQUEST_URL"] ? await getOidcToken(values.audience ?? originOf(service), env) : env["HARNESS_TOKEN"];
43287
43396
  if (!token) throw new UsageError2(byProject ? "no credentials: set HARNESS_TOKEN" : "no credentials: run in GitHub Actions with id-token: write, or set HARNESS_TOKEN");
43288
43397
  const result = await uploadSnapshot({ serviceUrl: service, token, manifest: built.manifest, shards: built.shards, ...byProject ? { byProject: true } : {} });
43289
43398
  out2(`published ${built.manifest.commitSha}: ${built.shards.length} shards, ${result.missing} new, ${result.batches} batches`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "overlane",
3
- "version": "0.1.142",
3
+ "version": "0.1.144",
4
4
  "description": "Overlane: connect a GitHub project to your coding agents. One portable CLI with project memory, tasks, a code index, guardrails and the Claude Code and Codex plugin.",
5
5
  "keywords": [
6
6
  "overlane",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mvrx-harness",
3
- "version": "0.1.142",
3
+ "version": "0.1.144",
4
4
  "description": "Overlane context at session start and the shared Overlane skills.",
5
5
  "author": {
6
6
  "name": "owenob1"