omnius 1.0.842 → 1.0.845

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 (42) hide show
  1. package/dist/api/py-embed.js +651 -91
  2. package/dist/computer-use/models.lock.yaml +495 -0
  3. package/dist/index.js +2 -2
  4. package/dist/library.d.ts +1 -0
  5. package/dist/library.js +176498 -55325
  6. package/dist/scripts/rapid-computer-use/gpu_lease.py +64 -0
  7. package/dist/scripts/rapid-computer-use/laya_service.py +483 -0
  8. package/dist/scripts/rapid-computer-use/model_gate.py +755 -0
  9. package/dist/scripts/rapid-computer-use/photon_service.py +700 -0
  10. package/dist/scripts/rapid-computer-use/point_benchmark.py +278 -0
  11. package/dist/update-worker.js +651 -91
  12. package/docs/DISCOVERY.json +1781 -808
  13. package/docs/DISCOVERY.md +25 -0
  14. package/docs/guides/bring-your-own-inference.md +128 -0
  15. package/docs/reference/slash-commands.md +138 -22
  16. package/docs/work-orders/WO-active-inference-route-and-telegram-review-20261012.md +94 -0
  17. package/docs/work-orders/WO-inference-fallback-20261012.md +89 -0
  18. package/docs/work-orders/WO-primary-checkout-fallback-delivery-20261012.md +94 -0
  19. package/docs/work-orders/WO-telegram-fallback-20261012.md +83 -0
  20. package/docs/work-orders/active-inference-route-remote-probes-20261012.json +34 -0
  21. package/docs/work-orders/inference-fallback-bundle-20261012.json +75 -0
  22. package/docs/work-orders/inference-fallback-live-20261012.json +39 -0
  23. package/docs/work-orders/primary-inference-fallback-bundle-20261012.json +88 -0
  24. package/docs/work-orders/rapid-computer-use-20261011/README.md +125 -0
  25. package/docs/work-orders/rapid-computer-use-20261011/WO-01-native-save-recovery.md +86 -0
  26. package/docs/work-orders/rapid-computer-use-20261011/WO-02-semantic-control.md +93 -0
  27. package/docs/work-orders/rapid-computer-use-20261011/WO-03-policy-workflows.md +130 -0
  28. package/docs/work-orders/rapid-computer-use-20261011/WO-04-live-model-gates.md +322 -0
  29. package/docs/work-orders/rapid-computer-use-20261011/WO-05-verification-delivery.md +389 -0
  30. package/docs/work-orders/rapid-computer-use-20261011/WO-06-medium-horizon-runtime.md +166 -0
  31. package/docs/work-orders/rapid-computer-use-20261011/WO-07-tool-routing-prompts.md +81 -0
  32. package/docs/work-orders/rapid-computer-use-20261011/WO-08-cross-application-desktop.md +214 -0
  33. package/docs/work-orders/rapid-computer-use-20261011/architecture-source.md +871 -0
  34. package/docs/work-orders/telegram-progress-browser-20261011/README.md +79 -0
  35. package/docs/work-orders/telegram-progress-browser-20261011/WO-01-diagnostic-visibility.md +64 -0
  36. package/docs/work-orders/telegram-progress-browser-20261011/WO-02-task-narration.md +127 -0
  37. package/docs/work-orders/telegram-progress-browser-20261011/WO-03-browser-observation.md +51 -0
  38. package/docs/work-orders/telegram-progress-browser-20261011/WO-04-download-desktop-handoff.md +96 -0
  39. package/docs/work-orders/telegram-progress-browser-20261011/WO-05-verification-delivery.md +129 -0
  40. package/npm-shrinkwrap.json +2 -2
  41. package/package.json +1 -1
  42. package/prompts/agentic/system-common.md +7 -0
@@ -3158,7 +3158,7 @@ var require_util = __commonJS({
3158
3158
  }
3159
3159
  path3 = url.path;
3160
3160
  }
3161
- var isAbsolute5 = exports.isAbsolute(path3);
3161
+ var isAbsolute6 = exports.isAbsolute(path3);
3162
3162
  var parts = path3.split(/\/+/);
3163
3163
  for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
3164
3164
  part = parts[i];
@@ -3178,7 +3178,7 @@ var require_util = __commonJS({
3178
3178
  }
3179
3179
  path3 = parts.join("/");
3180
3180
  if (path3 === "") {
3181
- path3 = isAbsolute5 ? "/" : ".";
3181
+ path3 = isAbsolute6 ? "/" : ".";
3182
3182
  }
3183
3183
  if (url) {
3184
3184
  url.path = path3;
@@ -7641,39 +7641,39 @@ var require_typescript = __commonJS({
7641
7641
  }
7642
7642
  return true;
7643
7643
  }
7644
- function find(array, predicate, startIndex) {
7644
+ function find(array, predicate2, startIndex) {
7645
7645
  if (array === void 0) return void 0;
7646
7646
  for (let i = startIndex ?? 0; i < array.length; i++) {
7647
7647
  const value = array[i];
7648
- if (predicate(value, i)) {
7648
+ if (predicate2(value, i)) {
7649
7649
  return value;
7650
7650
  }
7651
7651
  }
7652
7652
  return void 0;
7653
7653
  }
7654
- function findLast(array, predicate, startIndex) {
7654
+ function findLast(array, predicate2, startIndex) {
7655
7655
  if (array === void 0) return void 0;
7656
7656
  for (let i = startIndex ?? array.length - 1; i >= 0; i--) {
7657
7657
  const value = array[i];
7658
- if (predicate(value, i)) {
7658
+ if (predicate2(value, i)) {
7659
7659
  return value;
7660
7660
  }
7661
7661
  }
7662
7662
  return void 0;
7663
7663
  }
7664
- function findIndex(array, predicate, startIndex) {
7664
+ function findIndex(array, predicate2, startIndex) {
7665
7665
  if (array === void 0) return -1;
7666
7666
  for (let i = startIndex ?? 0; i < array.length; i++) {
7667
- if (predicate(array[i], i)) {
7667
+ if (predicate2(array[i], i)) {
7668
7668
  return i;
7669
7669
  }
7670
7670
  }
7671
7671
  return -1;
7672
7672
  }
7673
- function findLastIndex(array, predicate, startIndex) {
7673
+ function findLastIndex(array, predicate2, startIndex) {
7674
7674
  if (array === void 0) return -1;
7675
7675
  for (let i = startIndex ?? array.length - 1; i >= 0; i--) {
7676
- if (predicate(array[i], i)) {
7676
+ if (predicate2(array[i], i)) {
7677
7677
  return i;
7678
7678
  }
7679
7679
  }
@@ -7697,12 +7697,12 @@ var require_typescript = __commonJS({
7697
7697
  }
7698
7698
  return -1;
7699
7699
  }
7700
- function countWhere(array, predicate) {
7700
+ function countWhere(array, predicate2) {
7701
7701
  let count = 0;
7702
7702
  if (array !== void 0) {
7703
7703
  for (let i = 0; i < array.length; i++) {
7704
7704
  const v = array[i];
7705
- if (predicate(v, i)) {
7705
+ if (predicate2(v, i)) {
7706
7706
  count++;
7707
7707
  }
7708
7708
  }
@@ -7940,11 +7940,11 @@ var require_typescript = __commonJS({
7940
7940
  });
7941
7941
  return result;
7942
7942
  }
7943
- function some(array, predicate) {
7943
+ function some(array, predicate2) {
7944
7944
  if (array !== void 0) {
7945
- if (predicate !== void 0) {
7945
+ if (predicate2 !== void 0) {
7946
7946
  for (let i = 0; i < array.length; i++) {
7947
- if (predicate(array[i])) {
7947
+ if (predicate2(array[i])) {
7948
7948
  return true;
7949
7949
  }
7950
7950
  }
@@ -8883,9 +8883,9 @@ var require_typescript = __commonJS({
8883
8883
  function unorderedRemoveItem(array, item) {
8884
8884
  return unorderedRemoveFirstItemWhere(array, (element) => element === item);
8885
8885
  }
8886
- function unorderedRemoveFirstItemWhere(array, predicate) {
8886
+ function unorderedRemoveFirstItemWhere(array, predicate2) {
8887
8887
  for (let i = 0; i < array.length; i++) {
8888
- if (predicate(array[i])) {
8888
+ if (predicate2(array[i])) {
8889
8889
  unorderedRemoveItemAt(array, i);
8890
8890
  return true;
8891
8891
  }
@@ -9012,21 +9012,21 @@ var require_typescript = __commonJS({
9012
9012
  }
9013
9013
  }
9014
9014
  }
9015
- function takeWhile(array, predicate) {
9015
+ function takeWhile(array, predicate2) {
9016
9016
  if (array !== void 0) {
9017
9017
  const len = array.length;
9018
9018
  let index = 0;
9019
- while (index < len && predicate(array[index])) {
9019
+ while (index < len && predicate2(array[index])) {
9020
9020
  index++;
9021
9021
  }
9022
9022
  return array.slice(0, index);
9023
9023
  }
9024
9024
  }
9025
- function skipWhile(array, predicate) {
9025
+ function skipWhile(array, predicate2) {
9026
9026
  if (array !== void 0) {
9027
9027
  const len = array.length;
9028
9028
  let index = 0;
9029
- while (index < len && predicate(array[index])) {
9029
+ while (index < len && predicate2(array[index])) {
9030
9030
  index++;
9031
9031
  }
9032
9032
  return array.slice(index);
@@ -20998,11 +20998,11 @@ ${lanes.join("\n")}
20998
20998
  false
20999
20999
  );
21000
21000
  }
21001
- function getFirstJSDocTag(node, predicate, noCache) {
21002
- return find(getJSDocTagsWorker(node, noCache), predicate);
21001
+ function getFirstJSDocTag(node, predicate2, noCache) {
21002
+ return find(getJSDocTagsWorker(node, noCache), predicate2);
21003
21003
  }
21004
- function getAllJSDocTags(node, predicate) {
21005
- return getJSDocTags(node).filter(predicate);
21004
+ function getAllJSDocTags(node, predicate2) {
21005
+ return getJSDocTags(node).filter(predicate2);
21006
21006
  }
21007
21007
  function getAllJSDocTagsOfKind(node, kind) {
21008
21008
  return getJSDocTags(node).filter((doc) => doc.kind === kind);
@@ -23829,11 +23829,11 @@ ${lanes.join("\n")}
23829
23829
  function isObjectLiteralOrClassExpressionMethodOrAccessor(node) {
23830
23830
  return (node.kind === 175 || node.kind === 178 || node.kind === 179) && (node.parent.kind === 211 || node.parent.kind === 232);
23831
23831
  }
23832
- function isIdentifierTypePredicate(predicate) {
23833
- return predicate && predicate.kind === 1;
23832
+ function isIdentifierTypePredicate(predicate2) {
23833
+ return predicate2 && predicate2.kind === 1;
23834
23834
  }
23835
- function isThisTypePredicate(predicate) {
23836
- return predicate && predicate.kind === 0;
23835
+ function isThisTypePredicate(predicate2) {
23836
+ return predicate2 && predicate2.kind === 0;
23837
23837
  }
23838
23838
  function forEachPropertyAssignment(objectLiteral, key, callback, key2) {
23839
23839
  return forEach(objectLiteral == null ? void 0 : objectLiteral.properties, (property) => {
@@ -36367,7 +36367,7 @@ ${lanes.join("\n")}
36367
36367
  var _a3;
36368
36368
  return (_a3 = node.emitNode) == null ? void 0 : _a3.helpers;
36369
36369
  }
36370
- function moveEmitHelpers(source, target, predicate) {
36370
+ function moveEmitHelpers(source, target, predicate2) {
36371
36371
  const sourceEmitNode = source.emitNode;
36372
36372
  const sourceEmitHelpers = sourceEmitNode && sourceEmitNode.helpers;
36373
36373
  if (!some(sourceEmitHelpers)) return;
@@ -36375,7 +36375,7 @@ ${lanes.join("\n")}
36375
36375
  let helpersRemoved = 0;
36376
36376
  for (let i = 0; i < sourceEmitHelpers.length; i++) {
36377
36377
  const helper = sourceEmitHelpers[i];
36378
- if (predicate(helper)) {
36378
+ if (predicate2(helper)) {
36379
36379
  helpersRemoved++;
36380
36380
  targetEmitNode.helpers = appendIfUnique(targetEmitNode.helpers, helper);
36381
36381
  } else if (helpersRemoved > 0) {
@@ -60270,8 +60270,8 @@ ${lanes.join("\n")}
60270
60270
  symbolToString: (symbol, enclosingDeclaration, meaning, flags) => {
60271
60271
  return symbolToString(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags);
60272
60272
  },
60273
- typePredicateToString: (predicate, enclosingDeclaration, flags) => {
60274
- return typePredicateToString(predicate, getParseTreeNode(enclosingDeclaration), flags);
60273
+ typePredicateToString: (predicate2, enclosingDeclaration, flags) => {
60274
+ return typePredicateToString(predicate2, getParseTreeNode(enclosingDeclaration), flags);
60275
60275
  },
60276
60276
  writeSignature: (signature, enclosingDeclaration, flags, kind, writer, maximumLength, verbosityLevel, out) => {
60277
60277
  return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer, maximumLength, verbosityLevel, out);
@@ -60282,8 +60282,8 @@ ${lanes.join("\n")}
60282
60282
  writeSymbol: (symbol, enclosingDeclaration, meaning, flags, writer) => {
60283
60283
  return symbolToString(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags, writer);
60284
60284
  },
60285
- writeTypePredicate: (predicate, enclosingDeclaration, flags, writer) => {
60286
- return typePredicateToString(predicate, getParseTreeNode(enclosingDeclaration), flags, writer);
60285
+ writeTypePredicate: (predicate2, enclosingDeclaration, flags, writer) => {
60286
+ return typePredicateToString(predicate2, getParseTreeNode(enclosingDeclaration), flags, writer);
60287
60287
  },
60288
60288
  getAugmentedPropertiesOfType,
60289
60289
  getRootSymbols,
@@ -69727,12 +69727,12 @@ ${lanes.join("\n")}
69727
69727
  return writer ? typePredicateToStringWorker(writer).getText() : usingSingleLineStringWriter(typePredicateToStringWorker);
69728
69728
  function typePredicateToStringWorker(writer2) {
69729
69729
  const nodeBuilderFlags = toNodeBuilderFlags(flags) | 70221824 | 512;
69730
- const predicate = nodeBuilder.typePredicateToTypePredicateNode(typePredicate, enclosingDeclaration, nodeBuilderFlags);
69730
+ const predicate2 = nodeBuilder.typePredicateToTypePredicateNode(typePredicate, enclosingDeclaration, nodeBuilderFlags);
69731
69731
  const printer = createPrinterWithRemoveComments();
69732
69732
  const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
69733
69733
  printer.writeNode(
69734
69734
  4,
69735
- predicate,
69735
+ predicate2,
69736
69736
  /*sourceFile*/
69737
69737
  sourceFile,
69738
69738
  writer2
@@ -78144,8 +78144,8 @@ ${lanes.join("\n")}
78144
78144
  result.target = typeParameter;
78145
78145
  return result;
78146
78146
  }
78147
- function instantiateTypePredicate(predicate, mapper) {
78148
- return createTypePredicate(predicate.kind, predicate.parameterName, predicate.parameterIndex, instantiateType(predicate.type, mapper));
78147
+ function instantiateTypePredicate(predicate2, mapper) {
78148
+ return createTypePredicate(predicate2.kind, predicate2.parameterName, predicate2.parameterIndex, instantiateType(predicate2.type, mapper));
78149
78149
  }
78150
78150
  function instantiateSignature(signature, mapper, eraseTypeParameters) {
78151
78151
  let freshTypeParameters;
@@ -85364,9 +85364,9 @@ ${lanes.join("\n")}
85364
85364
  function hasTypePredicateOrNeverReturnType(signature) {
85365
85365
  return !!(getTypePredicateOfSignature(signature) || signature.declaration && (getReturnTypeFromAnnotation(signature.declaration) || unknownType).flags & 262144);
85366
85366
  }
85367
- function getTypePredicateArgument(predicate, callExpression) {
85368
- if (predicate.kind === 1 || predicate.kind === 3) {
85369
- return callExpression.arguments[predicate.parameterIndex];
85367
+ function getTypePredicateArgument(predicate2, callExpression) {
85368
+ if (predicate2.kind === 1 || predicate2.kind === 3) {
85369
+ return callExpression.arguments[predicate2.parameterIndex];
85370
85370
  }
85371
85371
  const invokedExpression = skipParentheses(callExpression.expression);
85372
85372
  return isAccessExpression(invokedExpression) ? skipParentheses(invokedExpression.expression) : void 0;
@@ -85418,9 +85418,9 @@ ${lanes.join("\n")}
85418
85418
  } else if (flags & 512) {
85419
85419
  const signature = getEffectsSignature(flow.node);
85420
85420
  if (signature) {
85421
- const predicate = getTypePredicateOfSignature(signature);
85422
- if (predicate && predicate.kind === 3 && !predicate.type) {
85423
- const predicateArgument = flow.node.arguments[predicate.parameterIndex];
85421
+ const predicate2 = getTypePredicateOfSignature(signature);
85422
+ if (predicate2 && predicate2.kind === 3 && !predicate2.type) {
85423
+ const predicateArgument = flow.node.arguments[predicate2.parameterIndex];
85424
85424
  if (predicateArgument && isFalseExpression(predicateArgument)) {
85425
85425
  return false;
85426
85426
  }
@@ -85710,17 +85710,17 @@ ${lanes.join("\n")}
85710
85710
  function getTypeAtFlowCall(flow) {
85711
85711
  const signature = getEffectsSignature(flow.node);
85712
85712
  if (signature) {
85713
- const predicate = getTypePredicateOfSignature(signature);
85714
- if (predicate && (predicate.kind === 2 || predicate.kind === 3)) {
85713
+ const predicate2 = getTypePredicateOfSignature(signature);
85714
+ if (predicate2 && (predicate2.kind === 2 || predicate2.kind === 3)) {
85715
85715
  const flowType = getTypeAtFlowNode(flow.antecedent);
85716
85716
  const type = finalizeEvolvingArrayType(getTypeFromFlowType(flowType));
85717
- const narrowedType = predicate.type ? narrowTypeByTypePredicate(
85717
+ const narrowedType = predicate2.type ? narrowTypeByTypePredicate(
85718
85718
  type,
85719
- predicate,
85719
+ predicate2,
85720
85720
  flow.node,
85721
85721
  /*assumeTrue*/
85722
85722
  true
85723
- ) : predicate.kind === 3 && predicate.parameterIndex >= 0 && predicate.parameterIndex < flow.node.arguments.length ? narrowTypeByAssertion(type, flow.node.arguments[predicate.parameterIndex]) : type;
85723
+ ) : predicate2.kind === 3 && predicate2.parameterIndex >= 0 && predicate2.parameterIndex < flow.node.arguments.length ? narrowTypeByAssertion(type, flow.node.arguments[predicate2.parameterIndex]) : type;
85724
85724
  return narrowedType === type ? flowType : createFlowType(narrowedType, isIncomplete(flowType));
85725
85725
  }
85726
85726
  if (getReturnTypeOfSignature(signature).flags & 262144) {
@@ -86532,11 +86532,11 @@ ${lanes.join("\n")}
86532
86532
  return type;
86533
86533
  }
86534
86534
  const signature = getEffectsSignature(expr);
86535
- const predicate = signature && getTypePredicateOfSignature(signature);
86536
- if (predicate && predicate.kind === 1 && predicate.parameterIndex === 0) {
86535
+ const predicate2 = signature && getTypePredicateOfSignature(signature);
86536
+ if (predicate2 && predicate2.kind === 1 && predicate2.parameterIndex === 0) {
86537
86537
  return getNarrowedType(
86538
86538
  type,
86539
- predicate.type,
86539
+ predicate2.type,
86540
86540
  assumeTrue,
86541
86541
  /*checkDerived*/
86542
86542
  true
@@ -86621,9 +86621,9 @@ ${lanes.join("\n")}
86621
86621
  function narrowTypeByCallExpression(type, callExpression, assumeTrue) {
86622
86622
  if (hasMatchingArgument(callExpression, reference)) {
86623
86623
  const signature = assumeTrue || !isCallChain(callExpression) ? getEffectsSignature(callExpression) : void 0;
86624
- const predicate = signature && getTypePredicateOfSignature(signature);
86625
- if (predicate && (predicate.kind === 0 || predicate.kind === 1)) {
86626
- return narrowTypeByTypePredicate(type, predicate, callExpression, assumeTrue);
86624
+ const predicate2 = signature && getTypePredicateOfSignature(signature);
86625
+ if (predicate2 && (predicate2.kind === 0 || predicate2.kind === 1)) {
86626
+ return narrowTypeByTypePredicate(type, predicate2, callExpression, assumeTrue);
86627
86627
  }
86628
86628
  }
86629
86629
  if (containsMissingType(type) && isAccessExpression(reference) && isPropertyAccessExpression(callExpression.expression)) {
@@ -86641,24 +86641,24 @@ ${lanes.join("\n")}
86641
86641
  }
86642
86642
  return type;
86643
86643
  }
86644
- function narrowTypeByTypePredicate(type, predicate, callExpression, assumeTrue) {
86645
- if (predicate.type && !(isTypeAny(type) && (predicate.type === globalObjectType || predicate.type === globalFunctionType))) {
86646
- const predicateArgument = getTypePredicateArgument(predicate, callExpression);
86644
+ function narrowTypeByTypePredicate(type, predicate2, callExpression, assumeTrue) {
86645
+ if (predicate2.type && !(isTypeAny(type) && (predicate2.type === globalObjectType || predicate2.type === globalFunctionType))) {
86646
+ const predicateArgument = getTypePredicateArgument(predicate2, callExpression);
86647
86647
  if (predicateArgument) {
86648
86648
  if (isMatchingReference(reference, predicateArgument)) {
86649
86649
  return getNarrowedType(
86650
86650
  type,
86651
- predicate.type,
86651
+ predicate2.type,
86652
86652
  assumeTrue,
86653
86653
  /*checkDerived*/
86654
86654
  false
86655
86655
  );
86656
86656
  }
86657
86657
  if (strictNullChecks && optionalChainContainsReference(predicateArgument, reference) && (assumeTrue && !hasTypeFacts(
86658
- predicate.type,
86658
+ predicate2.type,
86659
86659
  65536
86660
86660
  /* EQUndefined */
86661
- ) || !assumeTrue && everyType(predicate.type, isNullableType))) {
86661
+ ) || !assumeTrue && everyType(predicate2.type, isNullableType))) {
86662
86662
  type = getAdjustedTypeWithFacts(
86663
86663
  type,
86664
86664
  2097152
@@ -86669,7 +86669,7 @@ ${lanes.join("\n")}
86669
86669
  if (access) {
86670
86670
  return narrowTypeByDiscriminant(type, access, (t) => getNarrowedType(
86671
86671
  t,
86672
- predicate.type,
86672
+ predicate2.type,
86673
86673
  assumeTrue,
86674
86674
  /*checkDerived*/
86675
86675
  false
@@ -176478,8 +176478,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
176478
176478
  }
176479
176479
  }
176480
176480
  function tryGetExportDeclaration(sourceFile, isTypeOnly) {
176481
- const predicate = (node) => isExportDeclaration(node) && (isTypeOnly && node.isTypeOnly || !node.isTypeOnly);
176482
- return findLast(sourceFile.statements, predicate);
176481
+ const predicate2 = (node) => isExportDeclaration(node) && (isTypeOnly && node.isTypeOnly || !node.isTypeOnly);
176482
+ return findLast(sourceFile.statements, predicate2);
176483
176483
  }
176484
176484
  function updateExport(changes, program, sourceFile, node, names) {
176485
176485
  const namedExports = node.exportClause && isNamedExports(node.exportClause) ? node.exportClause.elements : factory.createNodeArray([]);
@@ -194802,10 +194802,10 @@ ${content}
194802
194802
  return mapToDisplayParts((writer) => {
194803
194803
  writer.writePunctuation(":");
194804
194804
  writer.writeSpace(" ");
194805
- const predicate = checker.getTypePredicateOfSignature(candidateSignature);
194806
- if (predicate) {
194805
+ const predicate2 = checker.getTypePredicateOfSignature(candidateSignature);
194806
+ if (predicate2) {
194807
194807
  checker.writeTypePredicate(
194808
- predicate,
194808
+ predicate2,
194809
194809
  enclosingDeclaration,
194810
194810
  /*flags*/
194811
194811
  void 0,
@@ -196477,8 +196477,8 @@ ${content}
196477
196477
  );
196478
196478
  this.replaceJSDocComment(sourceFile, parent2, [...oldTags, ...unmergedNewTags]);
196479
196479
  }
196480
- filterJSDocTags(sourceFile, parent2, predicate) {
196481
- this.replaceJSDocComment(sourceFile, parent2, filter2(flatMapToMutable(parent2.jsDoc, (j) => j.tags), predicate));
196480
+ filterJSDocTags(sourceFile, parent2, predicate2) {
196481
+ this.replaceJSDocComment(sourceFile, parent2, filter2(flatMapToMutable(parent2.jsDoc, (j) => j.tags), predicate2));
196482
196482
  }
196483
196483
  replaceRangeWithText(sourceFile, range2, text2) {
196484
196484
  this.changes.push({ kind: 3, sourceFile, range: range2, text: text2 });
@@ -218793,15 +218793,15 @@ var require_path_browserify = __commonJS({
218793
218793
  normalize: function normalize(path3) {
218794
218794
  assertPath(path3);
218795
218795
  if (path3.length === 0) return ".";
218796
- var isAbsolute5 = path3.charCodeAt(0) === 47;
218796
+ var isAbsolute6 = path3.charCodeAt(0) === 47;
218797
218797
  var trailingSeparator = path3.charCodeAt(path3.length - 1) === 47;
218798
- path3 = normalizeStringPosix(path3, !isAbsolute5);
218799
- if (path3.length === 0 && !isAbsolute5) path3 = ".";
218798
+ path3 = normalizeStringPosix(path3, !isAbsolute6);
218799
+ if (path3.length === 0 && !isAbsolute6) path3 = ".";
218800
218800
  if (path3.length > 0 && trailingSeparator) path3 += "/";
218801
- if (isAbsolute5) return "/" + path3;
218801
+ if (isAbsolute6) return "/" + path3;
218802
218802
  return path3;
218803
218803
  },
218804
- isAbsolute: function isAbsolute5(path3) {
218804
+ isAbsolute: function isAbsolute6(path3) {
218805
218805
  assertPath(path3);
218806
218806
  return path3.length > 0 && path3.charCodeAt(0) === 47;
218807
218807
  },
@@ -219015,9 +219015,9 @@ var require_path_browserify = __commonJS({
219015
219015
  var ret = { root: "", dir: "", base: "", ext: "", name: "" };
219016
219016
  if (path3.length === 0) return ret;
219017
219017
  var code = path3.charCodeAt(0);
219018
- var isAbsolute5 = code === 47;
219018
+ var isAbsolute6 = code === 47;
219019
219019
  var start;
219020
- if (isAbsolute5) {
219020
+ if (isAbsolute6) {
219021
219021
  ret.root = "/";
219022
219022
  start = 1;
219023
219023
  } else {
@@ -219053,11 +219053,11 @@ var require_path_browserify = __commonJS({
219053
219053
  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
219054
219054
  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
219055
219055
  if (end !== -1) {
219056
- if (startPart === 0 && isAbsolute5) ret.base = ret.name = path3.slice(1, end);
219056
+ if (startPart === 0 && isAbsolute6) ret.base = ret.name = path3.slice(1, end);
219057
219057
  else ret.base = ret.name = path3.slice(startPart, end);
219058
219058
  }
219059
219059
  } else {
219060
- if (startPart === 0 && isAbsolute5) {
219060
+ if (startPart === 0 && isAbsolute6) {
219061
219061
  ret.name = path3.slice(1, startDot);
219062
219062
  ret.base = path3.slice(1, end);
219063
219063
  } else {
@@ -219067,7 +219067,7 @@ var require_path_browserify = __commonJS({
219067
219067
  ret.ext = path3.slice(startDot, end);
219068
219068
  }
219069
219069
  if (startPart > 0) ret.dir = path3.slice(0, startPart - 1);
219070
- else if (isAbsolute5) ret.dir = "/";
219070
+ else if (isAbsolute6) ret.dir = "/";
219071
219071
  return ret;
219072
219072
  },
219073
219073
  sep: "/",
@@ -221303,8 +221303,8 @@ var require_dist = __commonJS({
221303
221303
  this.options.normalizePath = true;
221304
221304
  return this;
221305
221305
  }
221306
- filter(predicate) {
221307
- this.options.filters.push(predicate);
221306
+ filter(predicate2) {
221307
+ this.options.filters.push(predicate2);
221308
221308
  return this;
221309
221309
  }
221310
221310
  onlyDirs() {
@@ -221312,8 +221312,8 @@ var require_dist = __commonJS({
221312
221312
  this.options.includeDirs = true;
221313
221313
  return this;
221314
221314
  }
221315
- exclude(predicate) {
221316
- this.options.exclude = predicate;
221315
+ exclude(predicate2) {
221316
+ this.options.exclude = predicate2;
221317
221317
  return this;
221318
221318
  }
221319
221319
  onlyCounts() {
@@ -247053,6 +247053,566 @@ import { createServer as createNetServer } from "node:net";
247053
247053
  import { fileURLToPath as fileURLToPath2 } from "node:url";
247054
247054
  import { dirname as dirname7 } from "node:path";
247055
247055
 
247056
+ // packages/execution/dist/rapid-computer-use/contracts.js
247057
+ var verbs = ["invoke", "focus", "set_value", "set_checked", "select", "scroll", "key_chord"];
247058
+ var UI_STEP_SCHEMA = {
247059
+ type: "object",
247060
+ additionalProperties: false,
247061
+ required: ["id", "verb", "target", "expect"],
247062
+ properties: {
247063
+ id: { type: "string" },
247064
+ verb: { type: "string", enum: verbs },
247065
+ target: { type: "object", additionalProperties: false, properties: Object.fromEntries(["nodeId", "role", "name", "scopeId"].map((k) => [k, { type: "string", ...k !== "name" ? { minLength: 1 } : {} }])) },
247066
+ args: { type: "object", additionalProperties: false, properties: { value: { type: "string" }, checked: { type: "boolean" }, option: { type: "string" }, direction: { type: "string", enum: ["up", "down", "left", "right"] }, keys: { type: "array", items: { type: "string" }, maxItems: 4 } } },
247067
+ expect: { type: "array", minItems: 1, maxItems: 20, items: { type: "object", properties: { kind: { type: "string", enum: ["value", "checked", "selected", "focused", "visible", "text", "url", "download_saved"] }, nodeId: { type: "string" }, value: { type: "string" }, checked: { type: "boolean" }, values: { type: "array", items: { type: "string" } }, role: { type: "string" }, name: { type: "string" }, visible: { type: "boolean" }, text: { type: "string" }, url: { type: "string" }, filename: { type: "string" } } } }
247068
+ }
247069
+ };
247070
+
247071
+ // packages/execution/dist/rapid-computer-use/planner.js
247072
+ var boundedString = { type: "string", maxLength: 2048 };
247073
+ var identityString = { ...boundedString, minLength: 1 };
247074
+ var shape = (properties, required = Object.keys(properties)) => ({ type: "object", additionalProperties: false, properties, required });
247075
+ var predicate = (kind, properties, required = Object.keys(properties)) => shape({ kind: { type: "string", const: kind }, ...properties }, ["kind", ...required]);
247076
+ var actionArgs = {
247077
+ invoke: {},
247078
+ focus: {},
247079
+ set_value: { value: boundedString },
247080
+ set_checked: { checked: { type: "boolean" } },
247081
+ select: { option: boundedString },
247082
+ scroll: { direction: { type: "string", enum: ["up", "down", "left", "right"] } },
247083
+ key_chord: { keys: { type: "array", minItems: 1, maxItems: 4, items: { type: "string", pattern: "^[A-Za-z0-9+_-]{1,30}$" } } }
247084
+ };
247085
+ var UI_PLAN_RESPONSE_SCHEMA = {
247086
+ ...shape({ schema: { type: "string", const: "omnius.ui-plan.v1" }, steps: {
247087
+ type: "array",
247088
+ minItems: 1,
247089
+ maxItems: 50,
247090
+ items: { anyOf: Object.entries(actionArgs).map(([verb, args]) => shape({
247091
+ verb: { type: "string", const: verb },
247092
+ target: { $ref: "#/$defs/target" },
247093
+ args: shape(args),
247094
+ expect: { $ref: "#/$defs/expect" }
247095
+ }, ["verb", "target", "expect", ...Object.keys(args).length ? ["args"] : []])) }
247096
+ } }),
247097
+ $defs: {
247098
+ target: {
247099
+ ...shape({ nodeId: identityString, role: identityString, name: boundedString, scopeId: identityString }, []),
247100
+ anyOf: [{ required: ["nodeId"] }, { required: ["role"] }, { required: ["name"] }]
247101
+ },
247102
+ expect: { type: "array", minItems: 1, maxItems: 20, items: { anyOf: [
247103
+ predicate("value", { nodeId: identityString, value: boundedString }),
247104
+ predicate("checked", { nodeId: identityString, checked: { type: "boolean" } }),
247105
+ predicate("focused", { nodeId: identityString }),
247106
+ predicate("selected", { nodeId: identityString, values: { type: "array", maxItems: 50, items: boundedString } }),
247107
+ {
247108
+ ...predicate("visible", { role: identityString, name: boundedString, visible: { type: "boolean" } }, ["visible"]),
247109
+ anyOf: [{ required: ["role"] }, { required: ["name"] }]
247110
+ },
247111
+ predicate("text", { text: { ...boundedString, minLength: 1 } }),
247112
+ predicate("url", { url: boundedString }),
247113
+ predicate("download_saved", { filename: { type: "string", minLength: 1, maxLength: 127, pattern: "^[^\\\\/]+$" } }, [])
247114
+ ] } }
247115
+ }
247116
+ };
247117
+
247118
+ // packages/execution/dist/rapid-computer-use/artifact-store.js
247119
+ var MAX_UI_ARTIFACT_BYTES = 16 * 1024 * 1024;
247120
+
247121
+ // packages/execution/dist/rapid-computer-use/workflow-store.js
247122
+ var MAX_UI_WORKFLOW_BYTES = 1024 * 1024;
247123
+
247124
+ // packages/execution/dist/rapid-computer-use/native-atspi.js
247125
+ var ATSPI_BRIDGE_SOURCE = String.raw`
247126
+ import sys, json, time, hashlib, uuid, hmac
247127
+ import gi
247128
+ gi.require_version('Atspi', '2.0')
247129
+ from gi.repository import Atspi, GLib
247130
+
247131
+ PROTOCOL = 'omnius.native-accessibility.v1'
247132
+ SESSION = str(uuid.uuid4())
247133
+ KEY = uuid.uuid4().bytes
247134
+ MAX_NODES = 600
247135
+ MAX_CHILDREN = 800
247136
+ # Ordinary GTK4 popovers include nested layout containers beyond depth 32.
247137
+ # Keep traversal bounded without truncating Nautilus's 35-level folder menu.
247138
+ MAX_DEPTH = 64
247139
+ Atspi.init()
247140
+ Atspi.set_timeout(1000, 1000)
247141
+ handles = {}
247142
+ windows = {}
247143
+ generations = {}
247144
+ previous = set()
247145
+
247146
+ class ObservationUnavailable(Exception): pass
247147
+
247148
+ def required(fn):
247149
+ try: return fn()
247150
+ except Exception: raise ObservationUnavailable() from None
247151
+
247152
+ def safe(fn, default=None):
247153
+ try: return fn()
247154
+ except Exception: return default
247155
+
247156
+ def short(value, length=2048):
247157
+ return str(value or '')[:length]
247158
+
247159
+ def raw_identity(node):
247160
+ bus = str(node.app.bus_name)
247161
+ path = str(node.path)
247162
+ if not bus or not path: raise ValueError('missing_native_identity')
247163
+ return bus + ':' + path
247164
+
247165
+ def opaque(raw):
247166
+ return 'atspi:' + hmac.new(KEY, raw.encode(), hashlib.sha256).hexdigest()[:32]
247167
+
247168
+ def role_name(role):
247169
+ return {'push button':'button', 'check box':'checkbox', 'text':'textbox',
247170
+ 'password text':'textbox', 'entry':'textbox', 'label':'text',
247171
+ 'combo box':'combobox', 'list box':'listbox', 'menu item':'menuitem',
247172
+ 'check menu item':'menuitemcheckbox', 'radio button':'radio',
247173
+ 'radio menu item':'menuitemradio', 'frame':'window'}.get(role, role.replace(' ', '_'))
247174
+
247175
+ def action_index(node):
247176
+ iface = safe(node.get_action_iface)
247177
+ if not iface: return None
247178
+ count = safe(iface.get_n_actions, 0)
247179
+ for idx in range(min(count, 32)):
247180
+ name = short(safe(lambda: iface.get_action_name(idx), ''), 100).lower()
247181
+ if name in ('click', 'press', 'activate', 'toggle', 'open', 'default'):
247182
+ return idx
247183
+ return None
247184
+
247185
+ def interactive_state(state):
247186
+ # AT-SPI SENSITIVE expresses whether user interaction is accepted. GTK4
247187
+ # exposes it without ENABLED even on actionable buttons; requiring both
247188
+ # incorrectly disables the entire Nautilus accessibility tree. A disabled
247189
+ # control lacks SENSITIVE. Recheck the same predicate before dispatch.
247190
+ return state.contains(Atspi.StateType.SENSITIVE) and not state.contains(Atspi.StateType.DEFUNCT)
247191
+
247192
+ def child_count(node):
247193
+ count = required(node.get_child_count)
247194
+ if not isinstance(count, int) or count < 0: raise ObservationUnavailable()
247195
+ return count
247196
+
247197
+ def child_at(node, index):
247198
+ child = required(lambda: node.get_child_at_index(index))
247199
+ if child is None: raise ObservationUnavailable()
247200
+ return child
247201
+
247202
+ def observe():
247203
+ global handles, windows, previous, generations
247204
+ # Drain a bounded event batch so libatspi caches observe pending focus/data changes.
247205
+ context = GLib.MainContext.default()
247206
+ for _ in range(100):
247207
+ if not context.pending(): break
247208
+ context.iteration(False)
247209
+ desktop = required(lambda: Atspi.get_desktop(0))
247210
+ if desktop is None: raise ObservationUnavailable()
247211
+ required(desktop.clear_cache_single)
247212
+ nodes, fresh, active_windows, applications, fresh_windows = [], {}, set(), {}, {}
247213
+ fresh_generations = dict(generations)
247214
+ seen, truncated = set(), False
247215
+ def visit(node, window_raw=None, depth=0, application=None):
247216
+ nonlocal truncated
247217
+ if len(seen) >= MAX_NODES or depth > MAX_DEPTH:
247218
+ truncated = True
247219
+ return
247220
+ raw = required(lambda: raw_identity(node))
247221
+ if raw in seen: return
247222
+ seen.add(raw)
247223
+ required(node.clear_cache_single)
247224
+ state = required(node.get_state_set)
247225
+ if state is None: raise ObservationUnavailable()
247226
+ if state.contains(Atspi.StateType.DEFUNCT):
247227
+ # libatspi also returns DEFUNCT when GetState RPC fails. A fresh
247228
+ # parent enumeration must establish absence, never a failed read.
247229
+ raise ObservationUnavailable()
247230
+ role = short(required(node.get_role_name), 100)
247231
+ if not role: raise ObservationUnavailable()
247232
+ if role == 'application':
247233
+ process_id = required(node.get_process_id)
247234
+ app_name = short(safe(node.get_name, ''), 200)
247235
+ bus_name = short(node.app.bus_name, 100)
247236
+ if not process_id or not bus_name: raise ObservationUnavailable()
247237
+ application = 'atspi:' + str(process_id) + ':' + bus_name + ':' + app_name
247238
+ if window_raw is None and role in ('frame', 'dialog', 'window', 'alert', 'file chooser', 'font chooser', 'color chooser'):
247239
+ window_raw = raw
247240
+ # Components outside a known top-level window may be observed, never acted on.
247241
+ window_id = opaque(window_raw) if window_raw else ''
247242
+ if raw == window_raw: fresh_windows[window_id] = node
247243
+ if raw == window_raw and state.contains(Atspi.StateType.ACTIVE):
247244
+ active_windows.add(window_id)
247245
+ if application: applications[window_id] = application
247246
+ generation = generations.get(raw, 0)
247247
+ if raw not in previous: generation += 1
247248
+ fresh_generations[raw] = generation
247249
+ identity = opaque(raw + ':' + str(generation))
247250
+ interfaces = safe(node.get_interfaces, [])
247251
+ enabled = interactive_state(state)
247252
+ visible = state.contains(Atspi.StateType.SHOWING) and state.contains(Atspi.StateType.VISIBLE)
247253
+ inactive_window = raw == window_raw and not state.contains(Atspi.StateType.ACTIVE)
247254
+ children_count = 0 if inactive_window else child_count(node)
247255
+ # Hidden leaf controls cannot be acted on. Recent-document menus rebuild
247256
+ # them asynchronously; their churn must not invalidate an unchanged
247257
+ # visible editor. Still traverse hidden ancestors with visible children,
247258
+ # and bound visited identities independently of the emitted node count.
247259
+ if not visible and children_count == 0 and role != 'application' and raw != window_raw: return
247260
+ secret = role == 'password text'
247261
+ ops = []
247262
+ index = action_index(node) if 'Action' in interfaces else None
247263
+ if index is not None: ops.append('invoke')
247264
+ if 'EditableText' in interfaces and state.contains(Atspi.StateType.EDITABLE) and not state.contains(Atspi.StateType.READ_ONLY) and not secret:
247265
+ ops.append('set_value')
247266
+ checkable = state.contains(Atspi.StateType.CHECKABLE) or role in ('check box', 'check menu item', 'toggle button')
247267
+ if checkable and index is not None: ops.append('set_checked')
247268
+ if 'Selection' in interfaces: ops.append('select')
247269
+ if 'Component' in interfaces and state.contains(Atspi.StateType.FOCUSABLE): ops.append('focus')
247270
+ item = dict(id=identity, generation=generation, windowId=window_id,
247271
+ role=role_name(role), name=short(safe(node.get_name, ''), 500),
247272
+ enabled=enabled, visible=visible, focused=state.contains(Atspi.StateType.FOCUSED),
247273
+ secret=secret, operations=ops)
247274
+ if checkable:
247275
+ # GTK4 toggle buttons expose PRESSED; checkboxes expose CHECKED.
247276
+ item['checked'] = state.contains(Atspi.StateType.CHECKED) or (role == 'toggle button' and state.contains(Atspi.StateType.PRESSED))
247277
+ if not secret and 'Text' in interfaces:
247278
+ text_iface = safe(node.get_text_iface)
247279
+ if text_iface:
247280
+ count = min(safe(lambda: Atspi.Text.get_character_count(text_iface), 0), 2048)
247281
+ # Accessible.get_text() is the deprecated interface getter in GI;
247282
+ # call the Text interface explicitly to read actual field bytes.
247283
+ text_value = safe(lambda: Atspi.Text.get_text(text_iface, 0, count))
247284
+ if text_value is not None: item['value'] = short(text_value)
247285
+ if not secret and 'Selection' in interfaces:
247286
+ selection = safe(node.get_selection_iface)
247287
+ if selection:
247288
+ selected = min(safe(selection.get_n_selected_children, 0), 20)
247289
+ names = []
247290
+ for idx in range(selected):
247291
+ child = safe(lambda: selection.get_selected_child(idx))
247292
+ if child: names.append(short(safe(child.get_name, ''), 100))
247293
+ item['selected'] = names
247294
+ if names: item['value'] = ', '.join(names)
247295
+ # Unrealized GTK widgets may expose Component but cannot provide screen
247296
+ # extents. Avoid querying their geometry; retain hidden layout ancestors.
247297
+ if visible and 'Component' in interfaces:
247298
+ component = safe(node.get_component_iface)
247299
+ rect = safe(lambda: component.get_extents(Atspi.CoordType.SCREEN)) if component else None
247300
+ if rect and rect.width > 0 and rect.height > 0 and abs(rect.x) < 1000000 and abs(rect.y) < 1000000:
247301
+ item['bounds'] = dict(x=rect.x, y=rect.y, width=rect.width, height=rect.height)
247302
+ nodes.append(item)
247303
+ fresh[identity] = (node, item, index)
247304
+ # Actions are restricted to the active top-level window. Keep inactive
247305
+ # window identities, but their menus must not consume the foreground's
247306
+ # bounded observation budget.
247307
+ if inactive_window: return
247308
+ if children_count > MAX_CHILDREN: truncated = True
247309
+ for idx in range(min(children_count, MAX_CHILDREN)):
247310
+ if len(seen) >= MAX_NODES:
247311
+ truncated = True
247312
+ break
247313
+ visit(child_at(node, idx), window_raw, depth + 1, application)
247314
+ app_count = child_count(desktop)
247315
+ if app_count > MAX_CHILDREN: truncated = True
247316
+ apps = min(app_count, MAX_CHILDREN)
247317
+ for idx in range(apps):
247318
+ visit(child_at(desktop, idx))
247319
+ handles = fresh
247320
+ windows = fresh_windows
247321
+ previous = seen
247322
+ generations = fresh_generations
247323
+ payload = dict(schema=PROTOCOL, sessionId=SESSION, platform='linux', provider='atspi2',
247324
+ capabilities=['semantic_action', 'editable_text', 'selection', 'component_focus'],
247325
+ nodes=nodes, truncated=truncated)
247326
+ if len(active_windows) == 1:
247327
+ payload['activeWindowId'] = next(iter(active_windows))
247328
+ if payload['activeWindowId'] in applications: payload['activeApplication'] = applications[payload['activeWindowId']]
247329
+ payload['capabilities'].append('active_window')
247330
+ payload['revision'] = hashlib.sha256(json.dumps(payload, sort_keys=True, separators=(',', ':')).encode()).hexdigest()
247331
+ payload['capturedAt'] = int(time.time() * 1000)
247332
+ return payload
247333
+
247334
+ def perform(request):
247335
+ before = observe()
247336
+ if request.get('revision') != before['revision']: return dict(status='rejected', reason='stale_native_revision')
247337
+ active = before.get('activeWindowId')
247338
+ if not active or active != request.get('activeWindowId'): return dict(status='rejected', reason='active_window_unavailable_or_changed')
247339
+ record = handles.get(request.get('nodeId'))
247340
+ if not record: return dict(status='rejected', reason='native_target_invalidated')
247341
+ node, item, index = record
247342
+ if item['generation'] != request.get('generation'): return dict(status='rejected', reason='native_target_generation_changed')
247343
+ if item['windowId'] != active: return dict(status='rejected', reason='target_is_not_in_active_window')
247344
+ if not item['enabled'] or not item['visible']: return dict(status='rejected', reason='native_target_not_eligible')
247345
+ operation = request.get('operation')
247346
+ if operation not in item['operations']: return dict(status='rejected', reason='native_operation_unsupported')
247347
+ window = windows.get(active)
247348
+ if not window: return dict(status='rejected', reason='active_window_unavailable_or_changed')
247349
+ window.clear_cache_single()
247350
+ if not window.get_state_set().contains(Atspi.StateType.ACTIVE): return dict(status='rejected', reason='active_window_changed_before_dispatch')
247351
+ node.clear_cache_single()
247352
+ live_state = node.get_state_set()
247353
+ if not interactive_state(live_state) or not all(live_state.contains(s) for s in (Atspi.StateType.VISIBLE, Atspi.StateType.SHOWING)):
247354
+ return dict(status='rejected', reason='native_target_changed_before_dispatch')
247355
+ if operation == 'invoke':
247356
+ ok = node.get_action_iface().do_action(index)
247357
+ elif operation == 'set_value':
247358
+ value = request.get('value')
247359
+ if not isinstance(value, str) or len(value) > 8192: return dict(status='rejected', reason='invalid_native_value')
247360
+ ok = node.get_editable_text_iface().set_text_contents(value)
247361
+ elif operation == 'set_checked':
247362
+ wanted = request.get('checked')
247363
+ if not isinstance(wanted, bool): return dict(status='rejected', reason='invalid_native_checked_value')
247364
+ ok = True if item.get('checked') == wanted else node.get_action_iface().do_action(index)
247365
+ elif operation == 'select':
247366
+ option = request.get('option')
247367
+ if not isinstance(option, str) or len(option) > 2048: return dict(status='rejected', reason='invalid_native_option')
247368
+ matches = []
247369
+ count = node.get_child_count()
247370
+ if count < 0 or count > MAX_CHILDREN: return dict(status='rejected', reason='native_selection_truncated')
247371
+ for idx in range(count):
247372
+ child = node.get_child_at_index(idx)
247373
+ if child and child.get_name() == option: matches.append(idx)
247374
+ if len(matches) != 1: return dict(status='rejected', reason='native_option_not_unique')
247375
+ selection = node.get_selection_iface()
247376
+ # The finite contract accepts one option: replace an existing selection,
247377
+ # rather than adding a second file to a multi-select container. Validate
247378
+ # uniqueness before clearing. Once clear is attempted, a declined or
247379
+ # throwing second pattern may leave partial input and is never absence.
247380
+ try:
247381
+ if not selection.clear_selection():
247382
+ return dict(status='dispatched', reason='native_selection_clear_unverified')
247383
+ if not selection.select_child(matches[0]):
247384
+ return dict(status='dispatched', reason='native_selection_pattern_incomplete')
247385
+ except Exception:
247386
+ return dict(status='dispatched', reason='native_selection_pattern_incomplete')
247387
+ ok = True
247388
+ elif operation == 'focus':
247389
+ ok = node.get_component_iface().grab_focus()
247390
+ else: return dict(status='rejected', reason='native_operation_unsupported')
247391
+ return dict(status='dispatched' if ok else 'rejected', reason='native_pattern_invoked' if ok else 'native_pattern_declined')
247392
+
247393
+ while True:
247394
+ line = sys.stdin.buffer.readline(65537)
247395
+ if not line: break
247396
+ if len(line) > 65536: break
247397
+ request_id = None
247398
+ try:
247399
+ request = json.loads(line)
247400
+ request_id = request.get('id')
247401
+ if request.get('schema') != PROTOCOL or not isinstance(request_id, str): raise ValueError('invalid_protocol')
247402
+ op = request.get('op')
247403
+ if op == 'observe': result = observe()
247404
+ elif op == 'perform': result = perform(request)
247405
+ else: raise ValueError('unsupported_operation')
247406
+ response = dict(schema=PROTOCOL, id=request_id, ok=True, result=result)
247407
+ except Exception as error:
247408
+ code = 'native_observation_unavailable' if isinstance(error, ObservationUnavailable) else 'native_provider_unavailable_or_operation_failed'
247409
+ response = dict(schema=PROTOCOL, id=request_id, ok=False, error=code)
247410
+ sys.stdout.write(json.dumps(response, separators=(',', ':')) + '\n')
247411
+ sys.stdout.flush()
247412
+ `;
247413
+
247414
+ // packages/execution/dist/rapid-computer-use/native-uia.js
247415
+ var UIA_BRIDGE_SOURCE = String.raw`
247416
+ $ErrorActionPreference = 'Stop'
247417
+ [Console]::InputEncoding = New-Object System.Text.UTF8Encoding($false)
247418
+ [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
247419
+ Add-Type -AssemblyName UIAutomationClient
247420
+ Add-Type -AssemblyName UIAutomationTypes
247421
+ Add-Type -TypeDefinition @'
247422
+ using System;
247423
+ using System.Diagnostics;
247424
+ using System.Runtime.InteropServices;
247425
+ public static class OmniusUiaBoundary {
247426
+ [DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow();
247427
+ [DllImport("user32.dll")] public static extern uint GetWindowThreadProcessId(IntPtr h, out uint p);
247428
+ [DllImport("kernel32.dll")] static extern IntPtr OpenProcess(uint access, bool inherit, uint pid);
247429
+ [DllImport("kernel32.dll")] static extern bool CloseHandle(IntPtr h);
247430
+ [DllImport("advapi32.dll")] static extern bool OpenProcessToken(IntPtr h, uint access, out IntPtr t);
247431
+ [DllImport("advapi32.dll")] static extern bool GetTokenInformation(IntPtr t, int c, IntPtr b, int n, out int needed);
247432
+ [DllImport("advapi32.dll")] static extern IntPtr GetSidSubAuthorityCount(IntPtr sid);
247433
+ [DllImport("advapi32.dll")] static extern IntPtr GetSidSubAuthority(IntPtr sid, uint i);
247434
+ public static int Integrity(uint pid) {
247435
+ IntPtr p=IntPtr.Zero, t=IntPtr.Zero, b=IntPtr.Zero;
247436
+ try {
247437
+ p=OpenProcess(0x1000,false,pid);
247438
+ if(p==IntPtr.Zero || !OpenProcessToken(p,8,out t)) return -1;
247439
+ int n=0; GetTokenInformation(t,25,IntPtr.Zero,0,out n);
247440
+ if(n<=0 || n>65536) return -1;
247441
+ b=Marshal.AllocHGlobal(n);
247442
+ if(!GetTokenInformation(t,25,b,n,out n)) return -1;
247443
+ IntPtr sid=Marshal.ReadIntPtr(b);
247444
+ byte count=Marshal.ReadByte(GetSidSubAuthorityCount(sid));
247445
+ return count==0 ? -1 : Marshal.ReadInt32(GetSidSubAuthority(sid,(uint)(count-1)));
247446
+ } catch { return -1; }
247447
+ finally { if(b!=IntPtr.Zero) Marshal.FreeHGlobal(b); if(t!=IntPtr.Zero) CloseHandle(t); if(p!=IntPtr.Zero) CloseHandle(p); }
247448
+ }
247449
+ }
247450
+ '@
247451
+ $script:protocol = 'omnius.native-accessibility.v1'
247452
+ $script:session = [Guid]::NewGuid().ToString()
247453
+ $script:key = [Guid]::NewGuid().ToByteArray()
247454
+ $script:handles = @{}
247455
+ $script:generations = @{}
247456
+ $script:previous = @{}
247457
+ $script:walker = [System.Windows.Automation.TreeWalker]::ControlViewWalker
247458
+ function Short([object]$value, [int]$limit=2048) {
247459
+ $text = [string]$value
247460
+ if($text.Length -gt $limit) { return $text.Substring(0,$limit) }
247461
+ return $text
247462
+ }
247463
+ function Opaque([string]$raw) {
247464
+ $hmac = New-Object System.Security.Cryptography.HMACSHA256
247465
+ try { $hmac.Key=$script:key; return 'uia:' + ([BitConverter]::ToString($hmac.ComputeHash([Text.Encoding]::UTF8.GetBytes($raw)))).Replace('-','').Substring(0,32).ToLowerInvariant() }
247466
+ finally { $hmac.Dispose() }
247467
+ }
247468
+ function Pattern($element, $pattern) {
247469
+ $found=$null
247470
+ if($element.TryGetCurrentPattern($pattern,[ref]$found)) { return $found }
247471
+ return $null
247472
+ }
247473
+ function Observe {
247474
+ $nativeWindow=[OmniusUiaBoundary]::GetForegroundWindow()
247475
+ $script:observedWindow=$nativeWindow
247476
+ if($nativeWindow -eq [IntPtr]::Zero) { throw 'foreground_window_unavailable' }
247477
+ [uint32]$nativeProcessId=0
247478
+ [void][OmniusUiaBoundary]::GetWindowThreadProcessId($nativeWindow,[ref]$nativeProcessId)
247479
+ $processBirth=''
247480
+ try { $processBirth=[string][Diagnostics.Process]::GetProcessById($nativeProcessId).StartTime.ToUniversalTime().Ticks } catch {}
247481
+ $element=[System.Windows.Automation.AutomationElement]::FromHandle($nativeWindow)
247482
+ if($null -eq $element) { throw 'foreground_accessibility_unavailable' }
247483
+ $windowId=Opaque("window:"+$nativeProcessId+":"+$processBirth+":"+$nativeWindow.ToInt64())
247484
+ $targetIntegrity=[OmniusUiaBoundary]::Integrity($nativeProcessId)
247485
+ $ownIntegrity=[OmniusUiaBoundary]::Integrity([uint32][Diagnostics.Process]::GetCurrentProcess().Id)
247486
+ $permitted=($processBirth -ne '' -and $targetIntegrity -ge 0 -and $ownIntegrity -ge 0 -and $targetIntegrity -le $ownIntegrity)
247487
+ $nodes=New-Object 'System.Collections.Generic.List[object]'
247488
+ $script:fresh=@{}
247489
+ $script:seen=@{}
247490
+ $script:truncated=$false
247491
+ function Visit($node,[int]$depth) {
247492
+ if($nodes.Count -ge 600 -or $depth -gt 32) { $script:truncated=$true; return }
247493
+ try {
247494
+ $current=$node.Current
247495
+ $raw=[string]$current.ProcessId+':'+$processBirth+':'+$nativeWindow.ToInt64()+':'+($node.GetRuntimeId() -join '.')
247496
+ if($script:seen.ContainsKey($raw)) { return }
247497
+ $script:seen[$raw]=$true
247498
+ $generation=1
247499
+ if($script:generations.ContainsKey($raw)) { $generation=$script:generations[$raw]; if(-not $script:previous.ContainsKey($raw)) { $generation++ } }
247500
+ $script:generations[$raw]=$generation
247501
+ $identity=Opaque($raw+':'+$generation)
247502
+ $role=$current.ControlType.ProgrammaticName.Replace('ControlType.','').ToLowerInvariant()
247503
+ if($role -eq 'edit') { $role='textbox' }
247504
+ if($role -eq 'list') { $role='listbox' }
247505
+ if($role -eq 'radiobutton') { $role='radio' }
247506
+ if($role -eq 'hyperlink') { $role='link' }
247507
+ $secret=[bool]$current.IsPassword
247508
+ $ops=New-Object 'System.Collections.Generic.List[string]'
247509
+ $invoke=Pattern $node ([System.Windows.Automation.InvokePattern]::Pattern)
247510
+ $value=Pattern $node ([System.Windows.Automation.ValuePattern]::Pattern)
247511
+ $toggle=Pattern $node ([System.Windows.Automation.TogglePattern]::Pattern)
247512
+ $selection=Pattern $node ([System.Windows.Automation.SelectionPattern]::Pattern)
247513
+ $nodePermitted=$permitted
247514
+ if($current.ProcessId -ne $nativeProcessId) { $nodeIntegrity=[OmniusUiaBoundary]::Integrity([uint32]$current.ProcessId); $nodePermitted=($permitted -and $nodeIntegrity -ge 0 -and $nodeIntegrity -le $ownIntegrity) }
247515
+ if($nodePermitted -and -not $secret) {
247516
+ if($null -ne $invoke) { $ops.Add('invoke') }
247517
+ if($null -ne $value -and -not $value.Current.IsReadOnly) { $ops.Add('set_value') }
247518
+ if($null -ne $toggle -and $toggle.Current.ToggleState -ne [System.Windows.Automation.ToggleState]::Indeterminate) { $ops.Add('set_checked') }
247519
+ if($null -ne $selection) { $ops.Add('select') }
247520
+ if($current.IsKeyboardFocusable) { $ops.Add('focus') }
247521
+ }
247522
+ $item=[ordered]@{id=$identity;generation=$generation;windowId=$windowId;role=$role;name=(Short $current.Name 500);enabled=[bool]$current.IsEnabled;visible=(-not $current.IsOffscreen);focused=[bool]$current.HasKeyboardFocus;secret=$secret;operations=@($ops.ToArray())}
247523
+ if(-not $secret -and $null -ne $value) { $item.value=Short $value.Current.Value }
247524
+ if($null -ne $toggle -and $toggle.Current.ToggleState -ne [System.Windows.Automation.ToggleState]::Indeterminate) { $item.checked=($toggle.Current.ToggleState -eq [System.Windows.Automation.ToggleState]::On) }
247525
+ if(-not $secret -and $null -ne $selection) { $item.selected=@($selection.GetCurrentSelection() | Select-Object -First 20 | ForEach-Object { Short $_.Current.Name 100 }) }
247526
+ $rect=$current.BoundingRectangle
247527
+ if(-not $rect.IsEmpty -and $rect.Width -gt 0 -and $rect.Height -gt 0 -and [Math]::Abs($rect.X) -lt 1000000 -and [Math]::Abs($rect.Y) -lt 1000000) { $item.bounds=@{x=$rect.X;y=$rect.Y;width=$rect.Width;height=$rect.Height} }
247528
+ $nodes.Add($item)
247529
+ $script:fresh[$identity]=@{element=$node;item=$item}
247530
+ $child=$script:walker.GetFirstChild($node)
247531
+ $index=0
247532
+ while($null -ne $child -and $index -lt 800) {
247533
+ Visit $child ($depth+1)
247534
+ if($nodes.Count -ge 600) { $script:truncated=$true; break }
247535
+ $child=$script:walker.GetNextSibling($child); $index++
247536
+ }
247537
+ if($index -ge 800) { $script:truncated=$true }
247538
+ } catch { $script:truncated=$true }
247539
+ }
247540
+ Visit $element 0
247541
+ $script:handles=$script:fresh
247542
+ $script:previous=$script:seen
247543
+ $capabilities=@('semantic_action','value_pattern','toggle_pattern','selection_pattern','component_focus','active_window')
247544
+ if(-not $permitted) { $capabilities+= 'integrity_boundary_denied' }
247545
+ $appName=''
247546
+ try { $appName=Short ([Diagnostics.Process]::GetProcessById($nativeProcessId).ProcessName) 200 } catch {}
247547
+ $result=[ordered]@{schema=$script:protocol;sessionId=$script:session;platform='win32';provider='uia';activeWindowId=$windowId;activeApplication=('uia:'+$nativeProcessId+':'+$processBirth+':'+$appName);capabilities=$capabilities;truncated=$script:truncated;nodes=@($nodes.ToArray())}
247548
+ $sha=[Security.Cryptography.SHA256]::Create()
247549
+ try { $result.revision=([BitConverter]::ToString($sha.ComputeHash([Text.Encoding]::UTF8.GetBytes(($result | ConvertTo-Json -Depth 12 -Compress))))).Replace('-','').ToLowerInvariant() }
247550
+ finally { $sha.Dispose() }
247551
+ $result.capturedAt=[DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds()
247552
+ return $result
247553
+ }
247554
+ function Reject([string]$reason) { return @{status='rejected';reason=$reason} }
247555
+ function Perform($request) {
247556
+ $before=Observe
247557
+ if($before.revision -ne $request.revision) { return Reject 'stale_native_revision' }
247558
+ if($before.activeWindowId -ne $request.activeWindowId) { return Reject 'active_window_changed' }
247559
+ if($before.capabilities -contains 'integrity_boundary_denied') { return Reject 'integrity_boundary_denied' }
247560
+ $record=$script:handles[$request.nodeId]
247561
+ if($null -eq $record -or $record.item.generation -ne $request.generation) { return Reject 'native_target_invalidated' }
247562
+ $item=$record.item; $node=$record.element
247563
+ if(-not $item.enabled -or -not $item.visible -or $item.secret) { return Reject 'native_target_not_eligible' }
247564
+ if($item.operations -notcontains $request.operation) { return Reject 'native_operation_unsupported' }
247565
+ if([OmniusUiaBoundary]::GetForegroundWindow() -ne $script:observedWindow) { return Reject 'active_window_changed_before_dispatch' }
247566
+ $current=$node.Current
247567
+ $nodeIntegrity=[OmniusUiaBoundary]::Integrity([uint32]$current.ProcessId)
247568
+ $ownIntegrity=[OmniusUiaBoundary]::Integrity([uint32][Diagnostics.Process]::GetCurrentProcess().Id)
247569
+ if($nodeIntegrity -lt 0 -or $ownIntegrity -lt 0 -or $nodeIntegrity -gt $ownIntegrity) { return Reject 'integrity_boundary_denied' }
247570
+ if(-not $current.IsEnabled -or $current.IsOffscreen -or $current.IsPassword) { return Reject 'native_target_changed_before_dispatch' }
247571
+ switch($request.operation) {
247572
+ 'invoke' { (Pattern $node ([System.Windows.Automation.InvokePattern]::Pattern)).Invoke() }
247573
+ 'set_value' {
247574
+ if($request.value -isnot [string] -or $request.value.Length -gt 8192) { return Reject 'invalid_native_value' }
247575
+ (Pattern $node ([System.Windows.Automation.ValuePattern]::Pattern)).SetValue($request.value)
247576
+ }
247577
+ 'set_checked' {
247578
+ if($request.checked -isnot [bool]) { return Reject 'invalid_native_checked_value' }
247579
+ if($item.checked -ne $request.checked) { (Pattern $node ([System.Windows.Automation.TogglePattern]::Pattern)).Toggle() }
247580
+ }
247581
+ 'select' {
247582
+ if($request.option -isnot [string] -or $request.option.Length -gt 2048) { return Reject 'invalid_native_option' }
247583
+ $matches=New-Object 'System.Collections.Generic.List[object]'
247584
+ $child=$script:walker.GetFirstChild($node); $index=0
247585
+ while($null -ne $child -and $index -lt 800) {
247586
+ if($child.Current.Name -ceq $request.option) { $matches.Add($child) }
247587
+ $child=$script:walker.GetNextSibling($child); $index++
247588
+ }
247589
+ if($null -ne $child) { return Reject 'native_selection_truncated' }
247590
+ if($matches.Count -ne 1) { return Reject 'native_option_not_unique' }
247591
+ $selectItem=Pattern $matches[0] ([System.Windows.Automation.SelectionItemPattern]::Pattern)
247592
+ if($null -eq $selectItem -or -not $matches[0].Current.IsEnabled) { return Reject 'native_option_not_selectable' }
247593
+ $selectItem.Select()
247594
+ }
247595
+ 'focus' { $node.SetFocus() }
247596
+ default { return Reject 'native_operation_unsupported' }
247597
+ }
247598
+ return @{status='dispatched';reason='native_pattern_invoked'}
247599
+ }
247600
+ while($null -ne ($line=[Console]::ReadLine())) {
247601
+ if([Text.Encoding]::UTF8.GetByteCount($line) -gt 65536) { break }
247602
+ $requestId=$null
247603
+ try {
247604
+ $request=$line | ConvertFrom-Json
247605
+ $requestId=$request.id
247606
+ if($request.schema -cne $script:protocol -or $requestId -isnot [string]) { throw 'invalid_protocol' }
247607
+ if($request.op -ceq 'observe') { $result=Observe }
247608
+ elseif($request.op -ceq 'perform') { $result=Perform $request }
247609
+ else { throw 'unsupported_operation' }
247610
+ $response=@{schema=$script:protocol;id=$requestId;ok=$true;result=$result}
247611
+ } catch { $response=@{schema=$script:protocol;id=$requestId;ok=$false;error='native_provider_unavailable_or_operation_failed'} }
247612
+ [Console]::WriteLine(($response | ConvertTo-Json -Depth 16 -Compress))
247613
+ }
247614
+ `;
247615
+
247056
247616
  // packages/execution/dist/index.js
247057
247617
  init_model_broker();
247058
247618
  init_gpu_selection2();
@@ -295179,9 +295739,9 @@ import { homedir as homedir4 } from "node:os";
295179
295739
  import { join as join3 } from "node:path";
295180
295740
 
295181
295741
  // packages/execution/dist/tools/playwright-browser.js
295182
- init_process_async();
295183
295742
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
295184
- import { dirname as dirname2, join as join2, resolve as resolve2 } from "node:path";
295743
+ init_process_async();
295744
+ import { dirname as dirname2, isAbsolute as isAbsolute2, join as join2, resolve as resolve2 } from "node:path";
295185
295745
  import { homedir as homedir3 } from "node:os";
295186
295746
  init_vision();
295187
295747
  var browserSessionScope = new AsyncLocalStorage2();
@@ -295673,13 +296233,13 @@ var CRLParser = class {
295673
296233
  if (this.peek() === ":")
295674
296234
  this.pos++;
295675
296235
  this.skipWhitespace();
295676
- const predicate = this.parseNode();
296236
+ const predicate2 = this.parseNode();
295677
296237
  return {
295678
296238
  type: "quantifier",
295679
296239
  quantifier,
295680
296240
  variable,
295681
296241
  domain,
295682
- predicate,
296242
+ predicate: predicate2,
295683
296243
  raw: this.input.substring(start, this.pos),
295684
296244
  position: { start, end: this.pos }
295685
296245
  };
@@ -298433,7 +298993,7 @@ var MESH_VENV = "/tmp/mesh-venv";
298433
298993
  var MESH_CLI = `${MESH_VENV}/bin/meshtastic`;
298434
298994
 
298435
298995
  // packages/execution/dist/tools/audio-analyze.js
298436
- import { basename as basename3, isAbsolute as isAbsolute2, join as join6, resolve as resolve5 } from "node:path";
298996
+ import { basename as basename3, isAbsolute as isAbsolute3, join as join6, resolve as resolve5 } from "node:path";
298437
298997
  import { homedir as homedir6, tmpdir as tmpdir2 } from "node:os";
298438
298998
  init_cuda_device_filter();
298439
298999
  init_process_async();
@@ -298724,7 +299284,7 @@ init_secret_quarantine();
298724
299284
  init_agent_tools();
298725
299285
 
298726
299286
  // packages/execution/dist/tools/video-understand.js
298727
- import { join as join9, basename as basename4, isAbsolute as isAbsolute3, resolve as resolve6 } from "node:path";
299287
+ import { join as join9, basename as basename4, isAbsolute as isAbsolute4, resolve as resolve6 } from "node:path";
298728
299288
  import { homedir as homedir9 } from "node:os";
298729
299289
  init_model_broker();
298730
299290
  init_vision();
@@ -298741,7 +299301,7 @@ var CONFIG_PATH = join10(homedir10(), ".omnius", "video-scan.json");
298741
299301
  init_process_async();
298742
299302
  init_venv_paths();
298743
299303
  import { homedir as homedir11, tmpdir as tmpdir5 } from "node:os";
298744
- import { basename as basename6, isAbsolute as isAbsolute4, join as join11, resolve as resolve8 } from "node:path";
299304
+ import { basename as basename6, isAbsolute as isAbsolute5, join as join11, resolve as resolve8 } from "node:path";
298745
299305
  init_camera_capture();
298746
299306
  var LIVE_MEDIA_ROOT = join11(homedir11(), ".omnius", "runtimes", "live-media");
298747
299307
  var YOLO26_VENV = join11(LIVE_MEDIA_ROOT, ".venv-yolo26");