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
@@ -2639,7 +2639,7 @@ var require_util = __commonJS({
2639
2639
  }
2640
2640
  path3 = url.path;
2641
2641
  }
2642
- var isAbsolute4 = exports.isAbsolute(path3);
2642
+ var isAbsolute5 = exports.isAbsolute(path3);
2643
2643
  var parts = path3.split(/\/+/);
2644
2644
  for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
2645
2645
  part = parts[i];
@@ -2659,7 +2659,7 @@ var require_util = __commonJS({
2659
2659
  }
2660
2660
  path3 = parts.join("/");
2661
2661
  if (path3 === "") {
2662
- path3 = isAbsolute4 ? "/" : ".";
2662
+ path3 = isAbsolute5 ? "/" : ".";
2663
2663
  }
2664
2664
  if (url) {
2665
2665
  url.path = path3;
@@ -7122,39 +7122,39 @@ var require_typescript = __commonJS({
7122
7122
  }
7123
7123
  return true;
7124
7124
  }
7125
- function find(array, predicate, startIndex) {
7125
+ function find(array, predicate2, startIndex) {
7126
7126
  if (array === void 0) return void 0;
7127
7127
  for (let i = startIndex ?? 0; i < array.length; i++) {
7128
7128
  const value = array[i];
7129
- if (predicate(value, i)) {
7129
+ if (predicate2(value, i)) {
7130
7130
  return value;
7131
7131
  }
7132
7132
  }
7133
7133
  return void 0;
7134
7134
  }
7135
- function findLast(array, predicate, startIndex) {
7135
+ function findLast(array, predicate2, startIndex) {
7136
7136
  if (array === void 0) return void 0;
7137
7137
  for (let i = startIndex ?? array.length - 1; i >= 0; i--) {
7138
7138
  const value = array[i];
7139
- if (predicate(value, i)) {
7139
+ if (predicate2(value, i)) {
7140
7140
  return value;
7141
7141
  }
7142
7142
  }
7143
7143
  return void 0;
7144
7144
  }
7145
- function findIndex(array, predicate, startIndex) {
7145
+ function findIndex(array, predicate2, startIndex) {
7146
7146
  if (array === void 0) return -1;
7147
7147
  for (let i = startIndex ?? 0; i < array.length; i++) {
7148
- if (predicate(array[i], i)) {
7148
+ if (predicate2(array[i], i)) {
7149
7149
  return i;
7150
7150
  }
7151
7151
  }
7152
7152
  return -1;
7153
7153
  }
7154
- function findLastIndex(array, predicate, startIndex) {
7154
+ function findLastIndex(array, predicate2, startIndex) {
7155
7155
  if (array === void 0) return -1;
7156
7156
  for (let i = startIndex ?? array.length - 1; i >= 0; i--) {
7157
- if (predicate(array[i], i)) {
7157
+ if (predicate2(array[i], i)) {
7158
7158
  return i;
7159
7159
  }
7160
7160
  }
@@ -7178,12 +7178,12 @@ var require_typescript = __commonJS({
7178
7178
  }
7179
7179
  return -1;
7180
7180
  }
7181
- function countWhere(array, predicate) {
7181
+ function countWhere(array, predicate2) {
7182
7182
  let count = 0;
7183
7183
  if (array !== void 0) {
7184
7184
  for (let i = 0; i < array.length; i++) {
7185
7185
  const v = array[i];
7186
- if (predicate(v, i)) {
7186
+ if (predicate2(v, i)) {
7187
7187
  count++;
7188
7188
  }
7189
7189
  }
@@ -7421,11 +7421,11 @@ var require_typescript = __commonJS({
7421
7421
  });
7422
7422
  return result;
7423
7423
  }
7424
- function some(array, predicate) {
7424
+ function some(array, predicate2) {
7425
7425
  if (array !== void 0) {
7426
- if (predicate !== void 0) {
7426
+ if (predicate2 !== void 0) {
7427
7427
  for (let i = 0; i < array.length; i++) {
7428
- if (predicate(array[i])) {
7428
+ if (predicate2(array[i])) {
7429
7429
  return true;
7430
7430
  }
7431
7431
  }
@@ -8364,9 +8364,9 @@ var require_typescript = __commonJS({
8364
8364
  function unorderedRemoveItem(array, item) {
8365
8365
  return unorderedRemoveFirstItemWhere(array, (element) => element === item);
8366
8366
  }
8367
- function unorderedRemoveFirstItemWhere(array, predicate) {
8367
+ function unorderedRemoveFirstItemWhere(array, predicate2) {
8368
8368
  for (let i = 0; i < array.length; i++) {
8369
- if (predicate(array[i])) {
8369
+ if (predicate2(array[i])) {
8370
8370
  unorderedRemoveItemAt(array, i);
8371
8371
  return true;
8372
8372
  }
@@ -8493,21 +8493,21 @@ var require_typescript = __commonJS({
8493
8493
  }
8494
8494
  }
8495
8495
  }
8496
- function takeWhile(array, predicate) {
8496
+ function takeWhile(array, predicate2) {
8497
8497
  if (array !== void 0) {
8498
8498
  const len = array.length;
8499
8499
  let index = 0;
8500
- while (index < len && predicate(array[index])) {
8500
+ while (index < len && predicate2(array[index])) {
8501
8501
  index++;
8502
8502
  }
8503
8503
  return array.slice(0, index);
8504
8504
  }
8505
8505
  }
8506
- function skipWhile(array, predicate) {
8506
+ function skipWhile(array, predicate2) {
8507
8507
  if (array !== void 0) {
8508
8508
  const len = array.length;
8509
8509
  let index = 0;
8510
- while (index < len && predicate(array[index])) {
8510
+ while (index < len && predicate2(array[index])) {
8511
8511
  index++;
8512
8512
  }
8513
8513
  return array.slice(index);
@@ -20479,11 +20479,11 @@ ${lanes.join("\n")}
20479
20479
  false
20480
20480
  );
20481
20481
  }
20482
- function getFirstJSDocTag(node, predicate, noCache) {
20483
- return find(getJSDocTagsWorker(node, noCache), predicate);
20482
+ function getFirstJSDocTag(node, predicate2, noCache) {
20483
+ return find(getJSDocTagsWorker(node, noCache), predicate2);
20484
20484
  }
20485
- function getAllJSDocTags(node, predicate) {
20486
- return getJSDocTags(node).filter(predicate);
20485
+ function getAllJSDocTags(node, predicate2) {
20486
+ return getJSDocTags(node).filter(predicate2);
20487
20487
  }
20488
20488
  function getAllJSDocTagsOfKind(node, kind) {
20489
20489
  return getJSDocTags(node).filter((doc) => doc.kind === kind);
@@ -23310,11 +23310,11 @@ ${lanes.join("\n")}
23310
23310
  function isObjectLiteralOrClassExpressionMethodOrAccessor(node) {
23311
23311
  return (node.kind === 175 || node.kind === 178 || node.kind === 179) && (node.parent.kind === 211 || node.parent.kind === 232);
23312
23312
  }
23313
- function isIdentifierTypePredicate(predicate) {
23314
- return predicate && predicate.kind === 1;
23313
+ function isIdentifierTypePredicate(predicate2) {
23314
+ return predicate2 && predicate2.kind === 1;
23315
23315
  }
23316
- function isThisTypePredicate(predicate) {
23317
- return predicate && predicate.kind === 0;
23316
+ function isThisTypePredicate(predicate2) {
23317
+ return predicate2 && predicate2.kind === 0;
23318
23318
  }
23319
23319
  function forEachPropertyAssignment(objectLiteral, key, callback, key2) {
23320
23320
  return forEach(objectLiteral == null ? void 0 : objectLiteral.properties, (property) => {
@@ -35848,7 +35848,7 @@ ${lanes.join("\n")}
35848
35848
  var _a3;
35849
35849
  return (_a3 = node.emitNode) == null ? void 0 : _a3.helpers;
35850
35850
  }
35851
- function moveEmitHelpers(source, target, predicate) {
35851
+ function moveEmitHelpers(source, target, predicate2) {
35852
35852
  const sourceEmitNode = source.emitNode;
35853
35853
  const sourceEmitHelpers = sourceEmitNode && sourceEmitNode.helpers;
35854
35854
  if (!some(sourceEmitHelpers)) return;
@@ -35856,7 +35856,7 @@ ${lanes.join("\n")}
35856
35856
  let helpersRemoved = 0;
35857
35857
  for (let i = 0; i < sourceEmitHelpers.length; i++) {
35858
35858
  const helper = sourceEmitHelpers[i];
35859
- if (predicate(helper)) {
35859
+ if (predicate2(helper)) {
35860
35860
  helpersRemoved++;
35861
35861
  targetEmitNode.helpers = appendIfUnique(targetEmitNode.helpers, helper);
35862
35862
  } else if (helpersRemoved > 0) {
@@ -59751,8 +59751,8 @@ ${lanes.join("\n")}
59751
59751
  symbolToString: (symbol, enclosingDeclaration, meaning, flags) => {
59752
59752
  return symbolToString(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags);
59753
59753
  },
59754
- typePredicateToString: (predicate, enclosingDeclaration, flags) => {
59755
- return typePredicateToString(predicate, getParseTreeNode(enclosingDeclaration), flags);
59754
+ typePredicateToString: (predicate2, enclosingDeclaration, flags) => {
59755
+ return typePredicateToString(predicate2, getParseTreeNode(enclosingDeclaration), flags);
59756
59756
  },
59757
59757
  writeSignature: (signature, enclosingDeclaration, flags, kind, writer, maximumLength, verbosityLevel, out) => {
59758
59758
  return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer, maximumLength, verbosityLevel, out);
@@ -59763,8 +59763,8 @@ ${lanes.join("\n")}
59763
59763
  writeSymbol: (symbol, enclosingDeclaration, meaning, flags, writer) => {
59764
59764
  return symbolToString(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags, writer);
59765
59765
  },
59766
- writeTypePredicate: (predicate, enclosingDeclaration, flags, writer) => {
59767
- return typePredicateToString(predicate, getParseTreeNode(enclosingDeclaration), flags, writer);
59766
+ writeTypePredicate: (predicate2, enclosingDeclaration, flags, writer) => {
59767
+ return typePredicateToString(predicate2, getParseTreeNode(enclosingDeclaration), flags, writer);
59768
59768
  },
59769
59769
  getAugmentedPropertiesOfType,
59770
59770
  getRootSymbols,
@@ -69208,12 +69208,12 @@ ${lanes.join("\n")}
69208
69208
  return writer ? typePredicateToStringWorker(writer).getText() : usingSingleLineStringWriter(typePredicateToStringWorker);
69209
69209
  function typePredicateToStringWorker(writer2) {
69210
69210
  const nodeBuilderFlags = toNodeBuilderFlags(flags) | 70221824 | 512;
69211
- const predicate = nodeBuilder.typePredicateToTypePredicateNode(typePredicate, enclosingDeclaration, nodeBuilderFlags);
69211
+ const predicate2 = nodeBuilder.typePredicateToTypePredicateNode(typePredicate, enclosingDeclaration, nodeBuilderFlags);
69212
69212
  const printer = createPrinterWithRemoveComments();
69213
69213
  const sourceFile = enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration);
69214
69214
  printer.writeNode(
69215
69215
  4,
69216
- predicate,
69216
+ predicate2,
69217
69217
  /*sourceFile*/
69218
69218
  sourceFile,
69219
69219
  writer2
@@ -77625,8 +77625,8 @@ ${lanes.join("\n")}
77625
77625
  result.target = typeParameter;
77626
77626
  return result;
77627
77627
  }
77628
- function instantiateTypePredicate(predicate, mapper) {
77629
- return createTypePredicate(predicate.kind, predicate.parameterName, predicate.parameterIndex, instantiateType(predicate.type, mapper));
77628
+ function instantiateTypePredicate(predicate2, mapper) {
77629
+ return createTypePredicate(predicate2.kind, predicate2.parameterName, predicate2.parameterIndex, instantiateType(predicate2.type, mapper));
77630
77630
  }
77631
77631
  function instantiateSignature(signature, mapper, eraseTypeParameters) {
77632
77632
  let freshTypeParameters;
@@ -84845,9 +84845,9 @@ ${lanes.join("\n")}
84845
84845
  function hasTypePredicateOrNeverReturnType(signature) {
84846
84846
  return !!(getTypePredicateOfSignature(signature) || signature.declaration && (getReturnTypeFromAnnotation(signature.declaration) || unknownType).flags & 262144);
84847
84847
  }
84848
- function getTypePredicateArgument(predicate, callExpression) {
84849
- if (predicate.kind === 1 || predicate.kind === 3) {
84850
- return callExpression.arguments[predicate.parameterIndex];
84848
+ function getTypePredicateArgument(predicate2, callExpression) {
84849
+ if (predicate2.kind === 1 || predicate2.kind === 3) {
84850
+ return callExpression.arguments[predicate2.parameterIndex];
84851
84851
  }
84852
84852
  const invokedExpression = skipParentheses(callExpression.expression);
84853
84853
  return isAccessExpression(invokedExpression) ? skipParentheses(invokedExpression.expression) : void 0;
@@ -84899,9 +84899,9 @@ ${lanes.join("\n")}
84899
84899
  } else if (flags & 512) {
84900
84900
  const signature = getEffectsSignature(flow.node);
84901
84901
  if (signature) {
84902
- const predicate = getTypePredicateOfSignature(signature);
84903
- if (predicate && predicate.kind === 3 && !predicate.type) {
84904
- const predicateArgument = flow.node.arguments[predicate.parameterIndex];
84902
+ const predicate2 = getTypePredicateOfSignature(signature);
84903
+ if (predicate2 && predicate2.kind === 3 && !predicate2.type) {
84904
+ const predicateArgument = flow.node.arguments[predicate2.parameterIndex];
84905
84905
  if (predicateArgument && isFalseExpression(predicateArgument)) {
84906
84906
  return false;
84907
84907
  }
@@ -85191,17 +85191,17 @@ ${lanes.join("\n")}
85191
85191
  function getTypeAtFlowCall(flow) {
85192
85192
  const signature = getEffectsSignature(flow.node);
85193
85193
  if (signature) {
85194
- const predicate = getTypePredicateOfSignature(signature);
85195
- if (predicate && (predicate.kind === 2 || predicate.kind === 3)) {
85194
+ const predicate2 = getTypePredicateOfSignature(signature);
85195
+ if (predicate2 && (predicate2.kind === 2 || predicate2.kind === 3)) {
85196
85196
  const flowType = getTypeAtFlowNode(flow.antecedent);
85197
85197
  const type = finalizeEvolvingArrayType(getTypeFromFlowType(flowType));
85198
- const narrowedType = predicate.type ? narrowTypeByTypePredicate(
85198
+ const narrowedType = predicate2.type ? narrowTypeByTypePredicate(
85199
85199
  type,
85200
- predicate,
85200
+ predicate2,
85201
85201
  flow.node,
85202
85202
  /*assumeTrue*/
85203
85203
  true
85204
- ) : predicate.kind === 3 && predicate.parameterIndex >= 0 && predicate.parameterIndex < flow.node.arguments.length ? narrowTypeByAssertion(type, flow.node.arguments[predicate.parameterIndex]) : type;
85204
+ ) : predicate2.kind === 3 && predicate2.parameterIndex >= 0 && predicate2.parameterIndex < flow.node.arguments.length ? narrowTypeByAssertion(type, flow.node.arguments[predicate2.parameterIndex]) : type;
85205
85205
  return narrowedType === type ? flowType : createFlowType(narrowedType, isIncomplete(flowType));
85206
85206
  }
85207
85207
  if (getReturnTypeOfSignature(signature).flags & 262144) {
@@ -86013,11 +86013,11 @@ ${lanes.join("\n")}
86013
86013
  return type;
86014
86014
  }
86015
86015
  const signature = getEffectsSignature(expr);
86016
- const predicate = signature && getTypePredicateOfSignature(signature);
86017
- if (predicate && predicate.kind === 1 && predicate.parameterIndex === 0) {
86016
+ const predicate2 = signature && getTypePredicateOfSignature(signature);
86017
+ if (predicate2 && predicate2.kind === 1 && predicate2.parameterIndex === 0) {
86018
86018
  return getNarrowedType(
86019
86019
  type,
86020
- predicate.type,
86020
+ predicate2.type,
86021
86021
  assumeTrue,
86022
86022
  /*checkDerived*/
86023
86023
  true
@@ -86102,9 +86102,9 @@ ${lanes.join("\n")}
86102
86102
  function narrowTypeByCallExpression(type, callExpression, assumeTrue) {
86103
86103
  if (hasMatchingArgument(callExpression, reference)) {
86104
86104
  const signature = assumeTrue || !isCallChain(callExpression) ? getEffectsSignature(callExpression) : void 0;
86105
- const predicate = signature && getTypePredicateOfSignature(signature);
86106
- if (predicate && (predicate.kind === 0 || predicate.kind === 1)) {
86107
- return narrowTypeByTypePredicate(type, predicate, callExpression, assumeTrue);
86105
+ const predicate2 = signature && getTypePredicateOfSignature(signature);
86106
+ if (predicate2 && (predicate2.kind === 0 || predicate2.kind === 1)) {
86107
+ return narrowTypeByTypePredicate(type, predicate2, callExpression, assumeTrue);
86108
86108
  }
86109
86109
  }
86110
86110
  if (containsMissingType(type) && isAccessExpression(reference) && isPropertyAccessExpression(callExpression.expression)) {
@@ -86122,24 +86122,24 @@ ${lanes.join("\n")}
86122
86122
  }
86123
86123
  return type;
86124
86124
  }
86125
- function narrowTypeByTypePredicate(type, predicate, callExpression, assumeTrue) {
86126
- if (predicate.type && !(isTypeAny(type) && (predicate.type === globalObjectType || predicate.type === globalFunctionType))) {
86127
- const predicateArgument = getTypePredicateArgument(predicate, callExpression);
86125
+ function narrowTypeByTypePredicate(type, predicate2, callExpression, assumeTrue) {
86126
+ if (predicate2.type && !(isTypeAny(type) && (predicate2.type === globalObjectType || predicate2.type === globalFunctionType))) {
86127
+ const predicateArgument = getTypePredicateArgument(predicate2, callExpression);
86128
86128
  if (predicateArgument) {
86129
86129
  if (isMatchingReference(reference, predicateArgument)) {
86130
86130
  return getNarrowedType(
86131
86131
  type,
86132
- predicate.type,
86132
+ predicate2.type,
86133
86133
  assumeTrue,
86134
86134
  /*checkDerived*/
86135
86135
  false
86136
86136
  );
86137
86137
  }
86138
86138
  if (strictNullChecks && optionalChainContainsReference(predicateArgument, reference) && (assumeTrue && !hasTypeFacts(
86139
- predicate.type,
86139
+ predicate2.type,
86140
86140
  65536
86141
86141
  /* EQUndefined */
86142
- ) || !assumeTrue && everyType(predicate.type, isNullableType))) {
86142
+ ) || !assumeTrue && everyType(predicate2.type, isNullableType))) {
86143
86143
  type = getAdjustedTypeWithFacts(
86144
86144
  type,
86145
86145
  2097152
@@ -86150,7 +86150,7 @@ ${lanes.join("\n")}
86150
86150
  if (access) {
86151
86151
  return narrowTypeByDiscriminant(type, access, (t) => getNarrowedType(
86152
86152
  t,
86153
- predicate.type,
86153
+ predicate2.type,
86154
86154
  assumeTrue,
86155
86155
  /*checkDerived*/
86156
86156
  false
@@ -175959,8 +175959,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
175959
175959
  }
175960
175960
  }
175961
175961
  function tryGetExportDeclaration(sourceFile, isTypeOnly) {
175962
- const predicate = (node) => isExportDeclaration(node) && (isTypeOnly && node.isTypeOnly || !node.isTypeOnly);
175963
- return findLast(sourceFile.statements, predicate);
175962
+ const predicate2 = (node) => isExportDeclaration(node) && (isTypeOnly && node.isTypeOnly || !node.isTypeOnly);
175963
+ return findLast(sourceFile.statements, predicate2);
175964
175964
  }
175965
175965
  function updateExport(changes, program, sourceFile, node, names) {
175966
175966
  const namedExports = node.exportClause && isNamedExports(node.exportClause) ? node.exportClause.elements : factory.createNodeArray([]);
@@ -194283,10 +194283,10 @@ ${content}
194283
194283
  return mapToDisplayParts((writer) => {
194284
194284
  writer.writePunctuation(":");
194285
194285
  writer.writeSpace(" ");
194286
- const predicate = checker.getTypePredicateOfSignature(candidateSignature);
194287
- if (predicate) {
194286
+ const predicate2 = checker.getTypePredicateOfSignature(candidateSignature);
194287
+ if (predicate2) {
194288
194288
  checker.writeTypePredicate(
194289
- predicate,
194289
+ predicate2,
194290
194290
  enclosingDeclaration,
194291
194291
  /*flags*/
194292
194292
  void 0,
@@ -195958,8 +195958,8 @@ ${content}
195958
195958
  );
195959
195959
  this.replaceJSDocComment(sourceFile, parent2, [...oldTags, ...unmergedNewTags]);
195960
195960
  }
195961
- filterJSDocTags(sourceFile, parent2, predicate) {
195962
- this.replaceJSDocComment(sourceFile, parent2, filter2(flatMapToMutable(parent2.jsDoc, (j) => j.tags), predicate));
195961
+ filterJSDocTags(sourceFile, parent2, predicate2) {
195962
+ this.replaceJSDocComment(sourceFile, parent2, filter2(flatMapToMutable(parent2.jsDoc, (j) => j.tags), predicate2));
195963
195963
  }
195964
195964
  replaceRangeWithText(sourceFile, range2, text2) {
195965
195965
  this.changes.push({ kind: 3, sourceFile, range: range2, text: text2 });
@@ -218274,15 +218274,15 @@ var require_path_browserify = __commonJS({
218274
218274
  normalize: function normalize(path3) {
218275
218275
  assertPath(path3);
218276
218276
  if (path3.length === 0) return ".";
218277
- var isAbsolute4 = path3.charCodeAt(0) === 47;
218277
+ var isAbsolute5 = path3.charCodeAt(0) === 47;
218278
218278
  var trailingSeparator = path3.charCodeAt(path3.length - 1) === 47;
218279
- path3 = normalizeStringPosix(path3, !isAbsolute4);
218280
- if (path3.length === 0 && !isAbsolute4) path3 = ".";
218279
+ path3 = normalizeStringPosix(path3, !isAbsolute5);
218280
+ if (path3.length === 0 && !isAbsolute5) path3 = ".";
218281
218281
  if (path3.length > 0 && trailingSeparator) path3 += "/";
218282
- if (isAbsolute4) return "/" + path3;
218282
+ if (isAbsolute5) return "/" + path3;
218283
218283
  return path3;
218284
218284
  },
218285
- isAbsolute: function isAbsolute4(path3) {
218285
+ isAbsolute: function isAbsolute5(path3) {
218286
218286
  assertPath(path3);
218287
218287
  return path3.length > 0 && path3.charCodeAt(0) === 47;
218288
218288
  },
@@ -218496,9 +218496,9 @@ var require_path_browserify = __commonJS({
218496
218496
  var ret = { root: "", dir: "", base: "", ext: "", name: "" };
218497
218497
  if (path3.length === 0) return ret;
218498
218498
  var code = path3.charCodeAt(0);
218499
- var isAbsolute4 = code === 47;
218499
+ var isAbsolute5 = code === 47;
218500
218500
  var start;
218501
- if (isAbsolute4) {
218501
+ if (isAbsolute5) {
218502
218502
  ret.root = "/";
218503
218503
  start = 1;
218504
218504
  } else {
@@ -218534,11 +218534,11 @@ var require_path_browserify = __commonJS({
218534
218534
  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
218535
218535
  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
218536
218536
  if (end !== -1) {
218537
- if (startPart === 0 && isAbsolute4) ret.base = ret.name = path3.slice(1, end);
218537
+ if (startPart === 0 && isAbsolute5) ret.base = ret.name = path3.slice(1, end);
218538
218538
  else ret.base = ret.name = path3.slice(startPart, end);
218539
218539
  }
218540
218540
  } else {
218541
- if (startPart === 0 && isAbsolute4) {
218541
+ if (startPart === 0 && isAbsolute5) {
218542
218542
  ret.name = path3.slice(1, startDot);
218543
218543
  ret.base = path3.slice(1, end);
218544
218544
  } else {
@@ -218548,7 +218548,7 @@ var require_path_browserify = __commonJS({
218548
218548
  ret.ext = path3.slice(startDot, end);
218549
218549
  }
218550
218550
  if (startPart > 0) ret.dir = path3.slice(0, startPart - 1);
218551
- else if (isAbsolute4) ret.dir = "/";
218551
+ else if (isAbsolute5) ret.dir = "/";
218552
218552
  return ret;
218553
218553
  },
218554
218554
  sep: "/",
@@ -220784,8 +220784,8 @@ var require_dist = __commonJS({
220784
220784
  this.options.normalizePath = true;
220785
220785
  return this;
220786
220786
  }
220787
- filter(predicate) {
220788
- this.options.filters.push(predicate);
220787
+ filter(predicate2) {
220788
+ this.options.filters.push(predicate2);
220789
220789
  return this;
220790
220790
  }
220791
220791
  onlyDirs() {
@@ -220793,8 +220793,8 @@ var require_dist = __commonJS({
220793
220793
  this.options.includeDirs = true;
220794
220794
  return this;
220795
220795
  }
220796
- exclude(predicate) {
220797
- this.options.exclude = predicate;
220796
+ exclude(predicate2) {
220797
+ this.options.exclude = predicate2;
220798
220798
  return this;
220799
220799
  }
220800
220800
  onlyCounts() {
@@ -246528,6 +246528,566 @@ import { dirname as dirname6, join as join12 } from "node:path";
246528
246528
  import { homedir as homedir12 } from "node:os";
246529
246529
  import { fileURLToPath as fileURLToPath2 } from "node:url";
246530
246530
 
246531
+ // packages/execution/dist/rapid-computer-use/contracts.js
246532
+ var verbs = ["invoke", "focus", "set_value", "set_checked", "select", "scroll", "key_chord"];
246533
+ var UI_STEP_SCHEMA = {
246534
+ type: "object",
246535
+ additionalProperties: false,
246536
+ required: ["id", "verb", "target", "expect"],
246537
+ properties: {
246538
+ id: { type: "string" },
246539
+ verb: { type: "string", enum: verbs },
246540
+ target: { type: "object", additionalProperties: false, properties: Object.fromEntries(["nodeId", "role", "name", "scopeId"].map((k) => [k, { type: "string", ...k !== "name" ? { minLength: 1 } : {} }])) },
246541
+ 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 } } },
246542
+ 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" } } } }
246543
+ }
246544
+ };
246545
+
246546
+ // packages/execution/dist/rapid-computer-use/planner.js
246547
+ var boundedString = { type: "string", maxLength: 2048 };
246548
+ var identityString = { ...boundedString, minLength: 1 };
246549
+ var shape = (properties, required = Object.keys(properties)) => ({ type: "object", additionalProperties: false, properties, required });
246550
+ var predicate = (kind, properties, required = Object.keys(properties)) => shape({ kind: { type: "string", const: kind }, ...properties }, ["kind", ...required]);
246551
+ var actionArgs = {
246552
+ invoke: {},
246553
+ focus: {},
246554
+ set_value: { value: boundedString },
246555
+ set_checked: { checked: { type: "boolean" } },
246556
+ select: { option: boundedString },
246557
+ scroll: { direction: { type: "string", enum: ["up", "down", "left", "right"] } },
246558
+ key_chord: { keys: { type: "array", minItems: 1, maxItems: 4, items: { type: "string", pattern: "^[A-Za-z0-9+_-]{1,30}$" } } }
246559
+ };
246560
+ var UI_PLAN_RESPONSE_SCHEMA = {
246561
+ ...shape({ schema: { type: "string", const: "omnius.ui-plan.v1" }, steps: {
246562
+ type: "array",
246563
+ minItems: 1,
246564
+ maxItems: 50,
246565
+ items: { anyOf: Object.entries(actionArgs).map(([verb, args]) => shape({
246566
+ verb: { type: "string", const: verb },
246567
+ target: { $ref: "#/$defs/target" },
246568
+ args: shape(args),
246569
+ expect: { $ref: "#/$defs/expect" }
246570
+ }, ["verb", "target", "expect", ...Object.keys(args).length ? ["args"] : []])) }
246571
+ } }),
246572
+ $defs: {
246573
+ target: {
246574
+ ...shape({ nodeId: identityString, role: identityString, name: boundedString, scopeId: identityString }, []),
246575
+ anyOf: [{ required: ["nodeId"] }, { required: ["role"] }, { required: ["name"] }]
246576
+ },
246577
+ expect: { type: "array", minItems: 1, maxItems: 20, items: { anyOf: [
246578
+ predicate("value", { nodeId: identityString, value: boundedString }),
246579
+ predicate("checked", { nodeId: identityString, checked: { type: "boolean" } }),
246580
+ predicate("focused", { nodeId: identityString }),
246581
+ predicate("selected", { nodeId: identityString, values: { type: "array", maxItems: 50, items: boundedString } }),
246582
+ {
246583
+ ...predicate("visible", { role: identityString, name: boundedString, visible: { type: "boolean" } }, ["visible"]),
246584
+ anyOf: [{ required: ["role"] }, { required: ["name"] }]
246585
+ },
246586
+ predicate("text", { text: { ...boundedString, minLength: 1 } }),
246587
+ predicate("url", { url: boundedString }),
246588
+ predicate("download_saved", { filename: { type: "string", minLength: 1, maxLength: 127, pattern: "^[^\\\\/]+$" } }, [])
246589
+ ] } }
246590
+ }
246591
+ };
246592
+
246593
+ // packages/execution/dist/rapid-computer-use/artifact-store.js
246594
+ var MAX_UI_ARTIFACT_BYTES = 16 * 1024 * 1024;
246595
+
246596
+ // packages/execution/dist/rapid-computer-use/workflow-store.js
246597
+ var MAX_UI_WORKFLOW_BYTES = 1024 * 1024;
246598
+
246599
+ // packages/execution/dist/rapid-computer-use/native-atspi.js
246600
+ var ATSPI_BRIDGE_SOURCE = String.raw`
246601
+ import sys, json, time, hashlib, uuid, hmac
246602
+ import gi
246603
+ gi.require_version('Atspi', '2.0')
246604
+ from gi.repository import Atspi, GLib
246605
+
246606
+ PROTOCOL = 'omnius.native-accessibility.v1'
246607
+ SESSION = str(uuid.uuid4())
246608
+ KEY = uuid.uuid4().bytes
246609
+ MAX_NODES = 600
246610
+ MAX_CHILDREN = 800
246611
+ # Ordinary GTK4 popovers include nested layout containers beyond depth 32.
246612
+ # Keep traversal bounded without truncating Nautilus's 35-level folder menu.
246613
+ MAX_DEPTH = 64
246614
+ Atspi.init()
246615
+ Atspi.set_timeout(1000, 1000)
246616
+ handles = {}
246617
+ windows = {}
246618
+ generations = {}
246619
+ previous = set()
246620
+
246621
+ class ObservationUnavailable(Exception): pass
246622
+
246623
+ def required(fn):
246624
+ try: return fn()
246625
+ except Exception: raise ObservationUnavailable() from None
246626
+
246627
+ def safe(fn, default=None):
246628
+ try: return fn()
246629
+ except Exception: return default
246630
+
246631
+ def short(value, length=2048):
246632
+ return str(value or '')[:length]
246633
+
246634
+ def raw_identity(node):
246635
+ bus = str(node.app.bus_name)
246636
+ path = str(node.path)
246637
+ if not bus or not path: raise ValueError('missing_native_identity')
246638
+ return bus + ':' + path
246639
+
246640
+ def opaque(raw):
246641
+ return 'atspi:' + hmac.new(KEY, raw.encode(), hashlib.sha256).hexdigest()[:32]
246642
+
246643
+ def role_name(role):
246644
+ return {'push button':'button', 'check box':'checkbox', 'text':'textbox',
246645
+ 'password text':'textbox', 'entry':'textbox', 'label':'text',
246646
+ 'combo box':'combobox', 'list box':'listbox', 'menu item':'menuitem',
246647
+ 'check menu item':'menuitemcheckbox', 'radio button':'radio',
246648
+ 'radio menu item':'menuitemradio', 'frame':'window'}.get(role, role.replace(' ', '_'))
246649
+
246650
+ def action_index(node):
246651
+ iface = safe(node.get_action_iface)
246652
+ if not iface: return None
246653
+ count = safe(iface.get_n_actions, 0)
246654
+ for idx in range(min(count, 32)):
246655
+ name = short(safe(lambda: iface.get_action_name(idx), ''), 100).lower()
246656
+ if name in ('click', 'press', 'activate', 'toggle', 'open', 'default'):
246657
+ return idx
246658
+ return None
246659
+
246660
+ def interactive_state(state):
246661
+ # AT-SPI SENSITIVE expresses whether user interaction is accepted. GTK4
246662
+ # exposes it without ENABLED even on actionable buttons; requiring both
246663
+ # incorrectly disables the entire Nautilus accessibility tree. A disabled
246664
+ # control lacks SENSITIVE. Recheck the same predicate before dispatch.
246665
+ return state.contains(Atspi.StateType.SENSITIVE) and not state.contains(Atspi.StateType.DEFUNCT)
246666
+
246667
+ def child_count(node):
246668
+ count = required(node.get_child_count)
246669
+ if not isinstance(count, int) or count < 0: raise ObservationUnavailable()
246670
+ return count
246671
+
246672
+ def child_at(node, index):
246673
+ child = required(lambda: node.get_child_at_index(index))
246674
+ if child is None: raise ObservationUnavailable()
246675
+ return child
246676
+
246677
+ def observe():
246678
+ global handles, windows, previous, generations
246679
+ # Drain a bounded event batch so libatspi caches observe pending focus/data changes.
246680
+ context = GLib.MainContext.default()
246681
+ for _ in range(100):
246682
+ if not context.pending(): break
246683
+ context.iteration(False)
246684
+ desktop = required(lambda: Atspi.get_desktop(0))
246685
+ if desktop is None: raise ObservationUnavailable()
246686
+ required(desktop.clear_cache_single)
246687
+ nodes, fresh, active_windows, applications, fresh_windows = [], {}, set(), {}, {}
246688
+ fresh_generations = dict(generations)
246689
+ seen, truncated = set(), False
246690
+ def visit(node, window_raw=None, depth=0, application=None):
246691
+ nonlocal truncated
246692
+ if len(seen) >= MAX_NODES or depth > MAX_DEPTH:
246693
+ truncated = True
246694
+ return
246695
+ raw = required(lambda: raw_identity(node))
246696
+ if raw in seen: return
246697
+ seen.add(raw)
246698
+ required(node.clear_cache_single)
246699
+ state = required(node.get_state_set)
246700
+ if state is None: raise ObservationUnavailable()
246701
+ if state.contains(Atspi.StateType.DEFUNCT):
246702
+ # libatspi also returns DEFUNCT when GetState RPC fails. A fresh
246703
+ # parent enumeration must establish absence, never a failed read.
246704
+ raise ObservationUnavailable()
246705
+ role = short(required(node.get_role_name), 100)
246706
+ if not role: raise ObservationUnavailable()
246707
+ if role == 'application':
246708
+ process_id = required(node.get_process_id)
246709
+ app_name = short(safe(node.get_name, ''), 200)
246710
+ bus_name = short(node.app.bus_name, 100)
246711
+ if not process_id or not bus_name: raise ObservationUnavailable()
246712
+ application = 'atspi:' + str(process_id) + ':' + bus_name + ':' + app_name
246713
+ if window_raw is None and role in ('frame', 'dialog', 'window', 'alert', 'file chooser', 'font chooser', 'color chooser'):
246714
+ window_raw = raw
246715
+ # Components outside a known top-level window may be observed, never acted on.
246716
+ window_id = opaque(window_raw) if window_raw else ''
246717
+ if raw == window_raw: fresh_windows[window_id] = node
246718
+ if raw == window_raw and state.contains(Atspi.StateType.ACTIVE):
246719
+ active_windows.add(window_id)
246720
+ if application: applications[window_id] = application
246721
+ generation = generations.get(raw, 0)
246722
+ if raw not in previous: generation += 1
246723
+ fresh_generations[raw] = generation
246724
+ identity = opaque(raw + ':' + str(generation))
246725
+ interfaces = safe(node.get_interfaces, [])
246726
+ enabled = interactive_state(state)
246727
+ visible = state.contains(Atspi.StateType.SHOWING) and state.contains(Atspi.StateType.VISIBLE)
246728
+ inactive_window = raw == window_raw and not state.contains(Atspi.StateType.ACTIVE)
246729
+ children_count = 0 if inactive_window else child_count(node)
246730
+ # Hidden leaf controls cannot be acted on. Recent-document menus rebuild
246731
+ # them asynchronously; their churn must not invalidate an unchanged
246732
+ # visible editor. Still traverse hidden ancestors with visible children,
246733
+ # and bound visited identities independently of the emitted node count.
246734
+ if not visible and children_count == 0 and role != 'application' and raw != window_raw: return
246735
+ secret = role == 'password text'
246736
+ ops = []
246737
+ index = action_index(node) if 'Action' in interfaces else None
246738
+ if index is not None: ops.append('invoke')
246739
+ if 'EditableText' in interfaces and state.contains(Atspi.StateType.EDITABLE) and not state.contains(Atspi.StateType.READ_ONLY) and not secret:
246740
+ ops.append('set_value')
246741
+ checkable = state.contains(Atspi.StateType.CHECKABLE) or role in ('check box', 'check menu item', 'toggle button')
246742
+ if checkable and index is not None: ops.append('set_checked')
246743
+ if 'Selection' in interfaces: ops.append('select')
246744
+ if 'Component' in interfaces and state.contains(Atspi.StateType.FOCUSABLE): ops.append('focus')
246745
+ item = dict(id=identity, generation=generation, windowId=window_id,
246746
+ role=role_name(role), name=short(safe(node.get_name, ''), 500),
246747
+ enabled=enabled, visible=visible, focused=state.contains(Atspi.StateType.FOCUSED),
246748
+ secret=secret, operations=ops)
246749
+ if checkable:
246750
+ # GTK4 toggle buttons expose PRESSED; checkboxes expose CHECKED.
246751
+ item['checked'] = state.contains(Atspi.StateType.CHECKED) or (role == 'toggle button' and state.contains(Atspi.StateType.PRESSED))
246752
+ if not secret and 'Text' in interfaces:
246753
+ text_iface = safe(node.get_text_iface)
246754
+ if text_iface:
246755
+ count = min(safe(lambda: Atspi.Text.get_character_count(text_iface), 0), 2048)
246756
+ # Accessible.get_text() is the deprecated interface getter in GI;
246757
+ # call the Text interface explicitly to read actual field bytes.
246758
+ text_value = safe(lambda: Atspi.Text.get_text(text_iface, 0, count))
246759
+ if text_value is not None: item['value'] = short(text_value)
246760
+ if not secret and 'Selection' in interfaces:
246761
+ selection = safe(node.get_selection_iface)
246762
+ if selection:
246763
+ selected = min(safe(selection.get_n_selected_children, 0), 20)
246764
+ names = []
246765
+ for idx in range(selected):
246766
+ child = safe(lambda: selection.get_selected_child(idx))
246767
+ if child: names.append(short(safe(child.get_name, ''), 100))
246768
+ item['selected'] = names
246769
+ if names: item['value'] = ', '.join(names)
246770
+ # Unrealized GTK widgets may expose Component but cannot provide screen
246771
+ # extents. Avoid querying their geometry; retain hidden layout ancestors.
246772
+ if visible and 'Component' in interfaces:
246773
+ component = safe(node.get_component_iface)
246774
+ rect = safe(lambda: component.get_extents(Atspi.CoordType.SCREEN)) if component else None
246775
+ if rect and rect.width > 0 and rect.height > 0 and abs(rect.x) < 1000000 and abs(rect.y) < 1000000:
246776
+ item['bounds'] = dict(x=rect.x, y=rect.y, width=rect.width, height=rect.height)
246777
+ nodes.append(item)
246778
+ fresh[identity] = (node, item, index)
246779
+ # Actions are restricted to the active top-level window. Keep inactive
246780
+ # window identities, but their menus must not consume the foreground's
246781
+ # bounded observation budget.
246782
+ if inactive_window: return
246783
+ if children_count > MAX_CHILDREN: truncated = True
246784
+ for idx in range(min(children_count, MAX_CHILDREN)):
246785
+ if len(seen) >= MAX_NODES:
246786
+ truncated = True
246787
+ break
246788
+ visit(child_at(node, idx), window_raw, depth + 1, application)
246789
+ app_count = child_count(desktop)
246790
+ if app_count > MAX_CHILDREN: truncated = True
246791
+ apps = min(app_count, MAX_CHILDREN)
246792
+ for idx in range(apps):
246793
+ visit(child_at(desktop, idx))
246794
+ handles = fresh
246795
+ windows = fresh_windows
246796
+ previous = seen
246797
+ generations = fresh_generations
246798
+ payload = dict(schema=PROTOCOL, sessionId=SESSION, platform='linux', provider='atspi2',
246799
+ capabilities=['semantic_action', 'editable_text', 'selection', 'component_focus'],
246800
+ nodes=nodes, truncated=truncated)
246801
+ if len(active_windows) == 1:
246802
+ payload['activeWindowId'] = next(iter(active_windows))
246803
+ if payload['activeWindowId'] in applications: payload['activeApplication'] = applications[payload['activeWindowId']]
246804
+ payload['capabilities'].append('active_window')
246805
+ payload['revision'] = hashlib.sha256(json.dumps(payload, sort_keys=True, separators=(',', ':')).encode()).hexdigest()
246806
+ payload['capturedAt'] = int(time.time() * 1000)
246807
+ return payload
246808
+
246809
+ def perform(request):
246810
+ before = observe()
246811
+ if request.get('revision') != before['revision']: return dict(status='rejected', reason='stale_native_revision')
246812
+ active = before.get('activeWindowId')
246813
+ if not active or active != request.get('activeWindowId'): return dict(status='rejected', reason='active_window_unavailable_or_changed')
246814
+ record = handles.get(request.get('nodeId'))
246815
+ if not record: return dict(status='rejected', reason='native_target_invalidated')
246816
+ node, item, index = record
246817
+ if item['generation'] != request.get('generation'): return dict(status='rejected', reason='native_target_generation_changed')
246818
+ if item['windowId'] != active: return dict(status='rejected', reason='target_is_not_in_active_window')
246819
+ if not item['enabled'] or not item['visible']: return dict(status='rejected', reason='native_target_not_eligible')
246820
+ operation = request.get('operation')
246821
+ if operation not in item['operations']: return dict(status='rejected', reason='native_operation_unsupported')
246822
+ window = windows.get(active)
246823
+ if not window: return dict(status='rejected', reason='active_window_unavailable_or_changed')
246824
+ window.clear_cache_single()
246825
+ if not window.get_state_set().contains(Atspi.StateType.ACTIVE): return dict(status='rejected', reason='active_window_changed_before_dispatch')
246826
+ node.clear_cache_single()
246827
+ live_state = node.get_state_set()
246828
+ if not interactive_state(live_state) or not all(live_state.contains(s) for s in (Atspi.StateType.VISIBLE, Atspi.StateType.SHOWING)):
246829
+ return dict(status='rejected', reason='native_target_changed_before_dispatch')
246830
+ if operation == 'invoke':
246831
+ ok = node.get_action_iface().do_action(index)
246832
+ elif operation == 'set_value':
246833
+ value = request.get('value')
246834
+ if not isinstance(value, str) or len(value) > 8192: return dict(status='rejected', reason='invalid_native_value')
246835
+ ok = node.get_editable_text_iface().set_text_contents(value)
246836
+ elif operation == 'set_checked':
246837
+ wanted = request.get('checked')
246838
+ if not isinstance(wanted, bool): return dict(status='rejected', reason='invalid_native_checked_value')
246839
+ ok = True if item.get('checked') == wanted else node.get_action_iface().do_action(index)
246840
+ elif operation == 'select':
246841
+ option = request.get('option')
246842
+ if not isinstance(option, str) or len(option) > 2048: return dict(status='rejected', reason='invalid_native_option')
246843
+ matches = []
246844
+ count = node.get_child_count()
246845
+ if count < 0 or count > MAX_CHILDREN: return dict(status='rejected', reason='native_selection_truncated')
246846
+ for idx in range(count):
246847
+ child = node.get_child_at_index(idx)
246848
+ if child and child.get_name() == option: matches.append(idx)
246849
+ if len(matches) != 1: return dict(status='rejected', reason='native_option_not_unique')
246850
+ selection = node.get_selection_iface()
246851
+ # The finite contract accepts one option: replace an existing selection,
246852
+ # rather than adding a second file to a multi-select container. Validate
246853
+ # uniqueness before clearing. Once clear is attempted, a declined or
246854
+ # throwing second pattern may leave partial input and is never absence.
246855
+ try:
246856
+ if not selection.clear_selection():
246857
+ return dict(status='dispatched', reason='native_selection_clear_unverified')
246858
+ if not selection.select_child(matches[0]):
246859
+ return dict(status='dispatched', reason='native_selection_pattern_incomplete')
246860
+ except Exception:
246861
+ return dict(status='dispatched', reason='native_selection_pattern_incomplete')
246862
+ ok = True
246863
+ elif operation == 'focus':
246864
+ ok = node.get_component_iface().grab_focus()
246865
+ else: return dict(status='rejected', reason='native_operation_unsupported')
246866
+ return dict(status='dispatched' if ok else 'rejected', reason='native_pattern_invoked' if ok else 'native_pattern_declined')
246867
+
246868
+ while True:
246869
+ line = sys.stdin.buffer.readline(65537)
246870
+ if not line: break
246871
+ if len(line) > 65536: break
246872
+ request_id = None
246873
+ try:
246874
+ request = json.loads(line)
246875
+ request_id = request.get('id')
246876
+ if request.get('schema') != PROTOCOL or not isinstance(request_id, str): raise ValueError('invalid_protocol')
246877
+ op = request.get('op')
246878
+ if op == 'observe': result = observe()
246879
+ elif op == 'perform': result = perform(request)
246880
+ else: raise ValueError('unsupported_operation')
246881
+ response = dict(schema=PROTOCOL, id=request_id, ok=True, result=result)
246882
+ except Exception as error:
246883
+ code = 'native_observation_unavailable' if isinstance(error, ObservationUnavailable) else 'native_provider_unavailable_or_operation_failed'
246884
+ response = dict(schema=PROTOCOL, id=request_id, ok=False, error=code)
246885
+ sys.stdout.write(json.dumps(response, separators=(',', ':')) + '\n')
246886
+ sys.stdout.flush()
246887
+ `;
246888
+
246889
+ // packages/execution/dist/rapid-computer-use/native-uia.js
246890
+ var UIA_BRIDGE_SOURCE = String.raw`
246891
+ $ErrorActionPreference = 'Stop'
246892
+ [Console]::InputEncoding = New-Object System.Text.UTF8Encoding($false)
246893
+ [Console]::OutputEncoding = New-Object System.Text.UTF8Encoding($false)
246894
+ Add-Type -AssemblyName UIAutomationClient
246895
+ Add-Type -AssemblyName UIAutomationTypes
246896
+ Add-Type -TypeDefinition @'
246897
+ using System;
246898
+ using System.Diagnostics;
246899
+ using System.Runtime.InteropServices;
246900
+ public static class OmniusUiaBoundary {
246901
+ [DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow();
246902
+ [DllImport("user32.dll")] public static extern uint GetWindowThreadProcessId(IntPtr h, out uint p);
246903
+ [DllImport("kernel32.dll")] static extern IntPtr OpenProcess(uint access, bool inherit, uint pid);
246904
+ [DllImport("kernel32.dll")] static extern bool CloseHandle(IntPtr h);
246905
+ [DllImport("advapi32.dll")] static extern bool OpenProcessToken(IntPtr h, uint access, out IntPtr t);
246906
+ [DllImport("advapi32.dll")] static extern bool GetTokenInformation(IntPtr t, int c, IntPtr b, int n, out int needed);
246907
+ [DllImport("advapi32.dll")] static extern IntPtr GetSidSubAuthorityCount(IntPtr sid);
246908
+ [DllImport("advapi32.dll")] static extern IntPtr GetSidSubAuthority(IntPtr sid, uint i);
246909
+ public static int Integrity(uint pid) {
246910
+ IntPtr p=IntPtr.Zero, t=IntPtr.Zero, b=IntPtr.Zero;
246911
+ try {
246912
+ p=OpenProcess(0x1000,false,pid);
246913
+ if(p==IntPtr.Zero || !OpenProcessToken(p,8,out t)) return -1;
246914
+ int n=0; GetTokenInformation(t,25,IntPtr.Zero,0,out n);
246915
+ if(n<=0 || n>65536) return -1;
246916
+ b=Marshal.AllocHGlobal(n);
246917
+ if(!GetTokenInformation(t,25,b,n,out n)) return -1;
246918
+ IntPtr sid=Marshal.ReadIntPtr(b);
246919
+ byte count=Marshal.ReadByte(GetSidSubAuthorityCount(sid));
246920
+ return count==0 ? -1 : Marshal.ReadInt32(GetSidSubAuthority(sid,(uint)(count-1)));
246921
+ } catch { return -1; }
246922
+ finally { if(b!=IntPtr.Zero) Marshal.FreeHGlobal(b); if(t!=IntPtr.Zero) CloseHandle(t); if(p!=IntPtr.Zero) CloseHandle(p); }
246923
+ }
246924
+ }
246925
+ '@
246926
+ $script:protocol = 'omnius.native-accessibility.v1'
246927
+ $script:session = [Guid]::NewGuid().ToString()
246928
+ $script:key = [Guid]::NewGuid().ToByteArray()
246929
+ $script:handles = @{}
246930
+ $script:generations = @{}
246931
+ $script:previous = @{}
246932
+ $script:walker = [System.Windows.Automation.TreeWalker]::ControlViewWalker
246933
+ function Short([object]$value, [int]$limit=2048) {
246934
+ $text = [string]$value
246935
+ if($text.Length -gt $limit) { return $text.Substring(0,$limit) }
246936
+ return $text
246937
+ }
246938
+ function Opaque([string]$raw) {
246939
+ $hmac = New-Object System.Security.Cryptography.HMACSHA256
246940
+ try { $hmac.Key=$script:key; return 'uia:' + ([BitConverter]::ToString($hmac.ComputeHash([Text.Encoding]::UTF8.GetBytes($raw)))).Replace('-','').Substring(0,32).ToLowerInvariant() }
246941
+ finally { $hmac.Dispose() }
246942
+ }
246943
+ function Pattern($element, $pattern) {
246944
+ $found=$null
246945
+ if($element.TryGetCurrentPattern($pattern,[ref]$found)) { return $found }
246946
+ return $null
246947
+ }
246948
+ function Observe {
246949
+ $nativeWindow=[OmniusUiaBoundary]::GetForegroundWindow()
246950
+ $script:observedWindow=$nativeWindow
246951
+ if($nativeWindow -eq [IntPtr]::Zero) { throw 'foreground_window_unavailable' }
246952
+ [uint32]$nativeProcessId=0
246953
+ [void][OmniusUiaBoundary]::GetWindowThreadProcessId($nativeWindow,[ref]$nativeProcessId)
246954
+ $processBirth=''
246955
+ try { $processBirth=[string][Diagnostics.Process]::GetProcessById($nativeProcessId).StartTime.ToUniversalTime().Ticks } catch {}
246956
+ $element=[System.Windows.Automation.AutomationElement]::FromHandle($nativeWindow)
246957
+ if($null -eq $element) { throw 'foreground_accessibility_unavailable' }
246958
+ $windowId=Opaque("window:"+$nativeProcessId+":"+$processBirth+":"+$nativeWindow.ToInt64())
246959
+ $targetIntegrity=[OmniusUiaBoundary]::Integrity($nativeProcessId)
246960
+ $ownIntegrity=[OmniusUiaBoundary]::Integrity([uint32][Diagnostics.Process]::GetCurrentProcess().Id)
246961
+ $permitted=($processBirth -ne '' -and $targetIntegrity -ge 0 -and $ownIntegrity -ge 0 -and $targetIntegrity -le $ownIntegrity)
246962
+ $nodes=New-Object 'System.Collections.Generic.List[object]'
246963
+ $script:fresh=@{}
246964
+ $script:seen=@{}
246965
+ $script:truncated=$false
246966
+ function Visit($node,[int]$depth) {
246967
+ if($nodes.Count -ge 600 -or $depth -gt 32) { $script:truncated=$true; return }
246968
+ try {
246969
+ $current=$node.Current
246970
+ $raw=[string]$current.ProcessId+':'+$processBirth+':'+$nativeWindow.ToInt64()+':'+($node.GetRuntimeId() -join '.')
246971
+ if($script:seen.ContainsKey($raw)) { return }
246972
+ $script:seen[$raw]=$true
246973
+ $generation=1
246974
+ if($script:generations.ContainsKey($raw)) { $generation=$script:generations[$raw]; if(-not $script:previous.ContainsKey($raw)) { $generation++ } }
246975
+ $script:generations[$raw]=$generation
246976
+ $identity=Opaque($raw+':'+$generation)
246977
+ $role=$current.ControlType.ProgrammaticName.Replace('ControlType.','').ToLowerInvariant()
246978
+ if($role -eq 'edit') { $role='textbox' }
246979
+ if($role -eq 'list') { $role='listbox' }
246980
+ if($role -eq 'radiobutton') { $role='radio' }
246981
+ if($role -eq 'hyperlink') { $role='link' }
246982
+ $secret=[bool]$current.IsPassword
246983
+ $ops=New-Object 'System.Collections.Generic.List[string]'
246984
+ $invoke=Pattern $node ([System.Windows.Automation.InvokePattern]::Pattern)
246985
+ $value=Pattern $node ([System.Windows.Automation.ValuePattern]::Pattern)
246986
+ $toggle=Pattern $node ([System.Windows.Automation.TogglePattern]::Pattern)
246987
+ $selection=Pattern $node ([System.Windows.Automation.SelectionPattern]::Pattern)
246988
+ $nodePermitted=$permitted
246989
+ if($current.ProcessId -ne $nativeProcessId) { $nodeIntegrity=[OmniusUiaBoundary]::Integrity([uint32]$current.ProcessId); $nodePermitted=($permitted -and $nodeIntegrity -ge 0 -and $nodeIntegrity -le $ownIntegrity) }
246990
+ if($nodePermitted -and -not $secret) {
246991
+ if($null -ne $invoke) { $ops.Add('invoke') }
246992
+ if($null -ne $value -and -not $value.Current.IsReadOnly) { $ops.Add('set_value') }
246993
+ if($null -ne $toggle -and $toggle.Current.ToggleState -ne [System.Windows.Automation.ToggleState]::Indeterminate) { $ops.Add('set_checked') }
246994
+ if($null -ne $selection) { $ops.Add('select') }
246995
+ if($current.IsKeyboardFocusable) { $ops.Add('focus') }
246996
+ }
246997
+ $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())}
246998
+ if(-not $secret -and $null -ne $value) { $item.value=Short $value.Current.Value }
246999
+ 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) }
247000
+ if(-not $secret -and $null -ne $selection) { $item.selected=@($selection.GetCurrentSelection() | Select-Object -First 20 | ForEach-Object { Short $_.Current.Name 100 }) }
247001
+ $rect=$current.BoundingRectangle
247002
+ 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} }
247003
+ $nodes.Add($item)
247004
+ $script:fresh[$identity]=@{element=$node;item=$item}
247005
+ $child=$script:walker.GetFirstChild($node)
247006
+ $index=0
247007
+ while($null -ne $child -and $index -lt 800) {
247008
+ Visit $child ($depth+1)
247009
+ if($nodes.Count -ge 600) { $script:truncated=$true; break }
247010
+ $child=$script:walker.GetNextSibling($child); $index++
247011
+ }
247012
+ if($index -ge 800) { $script:truncated=$true }
247013
+ } catch { $script:truncated=$true }
247014
+ }
247015
+ Visit $element 0
247016
+ $script:handles=$script:fresh
247017
+ $script:previous=$script:seen
247018
+ $capabilities=@('semantic_action','value_pattern','toggle_pattern','selection_pattern','component_focus','active_window')
247019
+ if(-not $permitted) { $capabilities+= 'integrity_boundary_denied' }
247020
+ $appName=''
247021
+ try { $appName=Short ([Diagnostics.Process]::GetProcessById($nativeProcessId).ProcessName) 200 } catch {}
247022
+ $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())}
247023
+ $sha=[Security.Cryptography.SHA256]::Create()
247024
+ try { $result.revision=([BitConverter]::ToString($sha.ComputeHash([Text.Encoding]::UTF8.GetBytes(($result | ConvertTo-Json -Depth 12 -Compress))))).Replace('-','').ToLowerInvariant() }
247025
+ finally { $sha.Dispose() }
247026
+ $result.capturedAt=[DateTimeOffset]::UtcNow.ToUnixTimeMilliseconds()
247027
+ return $result
247028
+ }
247029
+ function Reject([string]$reason) { return @{status='rejected';reason=$reason} }
247030
+ function Perform($request) {
247031
+ $before=Observe
247032
+ if($before.revision -ne $request.revision) { return Reject 'stale_native_revision' }
247033
+ if($before.activeWindowId -ne $request.activeWindowId) { return Reject 'active_window_changed' }
247034
+ if($before.capabilities -contains 'integrity_boundary_denied') { return Reject 'integrity_boundary_denied' }
247035
+ $record=$script:handles[$request.nodeId]
247036
+ if($null -eq $record -or $record.item.generation -ne $request.generation) { return Reject 'native_target_invalidated' }
247037
+ $item=$record.item; $node=$record.element
247038
+ if(-not $item.enabled -or -not $item.visible -or $item.secret) { return Reject 'native_target_not_eligible' }
247039
+ if($item.operations -notcontains $request.operation) { return Reject 'native_operation_unsupported' }
247040
+ if([OmniusUiaBoundary]::GetForegroundWindow() -ne $script:observedWindow) { return Reject 'active_window_changed_before_dispatch' }
247041
+ $current=$node.Current
247042
+ $nodeIntegrity=[OmniusUiaBoundary]::Integrity([uint32]$current.ProcessId)
247043
+ $ownIntegrity=[OmniusUiaBoundary]::Integrity([uint32][Diagnostics.Process]::GetCurrentProcess().Id)
247044
+ if($nodeIntegrity -lt 0 -or $ownIntegrity -lt 0 -or $nodeIntegrity -gt $ownIntegrity) { return Reject 'integrity_boundary_denied' }
247045
+ if(-not $current.IsEnabled -or $current.IsOffscreen -or $current.IsPassword) { return Reject 'native_target_changed_before_dispatch' }
247046
+ switch($request.operation) {
247047
+ 'invoke' { (Pattern $node ([System.Windows.Automation.InvokePattern]::Pattern)).Invoke() }
247048
+ 'set_value' {
247049
+ if($request.value -isnot [string] -or $request.value.Length -gt 8192) { return Reject 'invalid_native_value' }
247050
+ (Pattern $node ([System.Windows.Automation.ValuePattern]::Pattern)).SetValue($request.value)
247051
+ }
247052
+ 'set_checked' {
247053
+ if($request.checked -isnot [bool]) { return Reject 'invalid_native_checked_value' }
247054
+ if($item.checked -ne $request.checked) { (Pattern $node ([System.Windows.Automation.TogglePattern]::Pattern)).Toggle() }
247055
+ }
247056
+ 'select' {
247057
+ if($request.option -isnot [string] -or $request.option.Length -gt 2048) { return Reject 'invalid_native_option' }
247058
+ $matches=New-Object 'System.Collections.Generic.List[object]'
247059
+ $child=$script:walker.GetFirstChild($node); $index=0
247060
+ while($null -ne $child -and $index -lt 800) {
247061
+ if($child.Current.Name -ceq $request.option) { $matches.Add($child) }
247062
+ $child=$script:walker.GetNextSibling($child); $index++
247063
+ }
247064
+ if($null -ne $child) { return Reject 'native_selection_truncated' }
247065
+ if($matches.Count -ne 1) { return Reject 'native_option_not_unique' }
247066
+ $selectItem=Pattern $matches[0] ([System.Windows.Automation.SelectionItemPattern]::Pattern)
247067
+ if($null -eq $selectItem -or -not $matches[0].Current.IsEnabled) { return Reject 'native_option_not_selectable' }
247068
+ $selectItem.Select()
247069
+ }
247070
+ 'focus' { $node.SetFocus() }
247071
+ default { return Reject 'native_operation_unsupported' }
247072
+ }
247073
+ return @{status='dispatched';reason='native_pattern_invoked'}
247074
+ }
247075
+ while($null -ne ($line=[Console]::ReadLine())) {
247076
+ if([Text.Encoding]::UTF8.GetByteCount($line) -gt 65536) { break }
247077
+ $requestId=$null
247078
+ try {
247079
+ $request=$line | ConvertFrom-Json
247080
+ $requestId=$request.id
247081
+ if($request.schema -cne $script:protocol -or $requestId -isnot [string]) { throw 'invalid_protocol' }
247082
+ if($request.op -ceq 'observe') { $result=Observe }
247083
+ elseif($request.op -ceq 'perform') { $result=Perform $request }
247084
+ else { throw 'unsupported_operation' }
247085
+ $response=@{schema=$script:protocol;id=$requestId;ok=$true;result=$result}
247086
+ } catch { $response=@{schema=$script:protocol;id=$requestId;ok=$false;error='native_provider_unavailable_or_operation_failed'} }
247087
+ [Console]::WriteLine(($response | ConvertTo-Json -Depth 16 -Compress))
247088
+ }
247089
+ `;
247090
+
246531
247091
  // packages/execution/dist/index.js
246532
247092
  init_model_broker();
246533
247093
  init_gpu_selection2();
@@ -294654,9 +295214,9 @@ import { homedir as homedir3 } from "node:os";
294654
295214
  import { join as join2 } from "node:path";
294655
295215
 
294656
295216
  // packages/execution/dist/tools/playwright-browser.js
294657
- init_process_async();
294658
295217
  import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
294659
- import { dirname, join, resolve } from "node:path";
295218
+ init_process_async();
295219
+ import { dirname, isAbsolute, join, resolve } from "node:path";
294660
295220
  import { homedir as homedir2 } from "node:os";
294661
295221
  init_vision();
294662
295222
  var browserSessionScope = new AsyncLocalStorage2();
@@ -295148,13 +295708,13 @@ var CRLParser = class {
295148
295708
  if (this.peek() === ":")
295149
295709
  this.pos++;
295150
295710
  this.skipWhitespace();
295151
- const predicate = this.parseNode();
295711
+ const predicate2 = this.parseNode();
295152
295712
  return {
295153
295713
  type: "quantifier",
295154
295714
  quantifier,
295155
295715
  variable,
295156
295716
  domain,
295157
- predicate,
295717
+ predicate: predicate2,
295158
295718
  raw: this.input.substring(start, this.pos),
295159
295719
  position: { start, end: this.pos }
295160
295720
  };
@@ -297999,7 +298559,7 @@ var MESH_VENV = "/tmp/mesh-venv";
297999
298559
  var MESH_CLI = `${MESH_VENV}/bin/meshtastic`;
298000
298560
 
298001
298561
  // packages/execution/dist/tools/audio-analyze.js
298002
- import { basename as basename3, isAbsolute, join as join5, resolve as resolve4 } from "node:path";
298562
+ import { basename as basename3, isAbsolute as isAbsolute2, join as join5, resolve as resolve4 } from "node:path";
298003
298563
  import { homedir as homedir5, tmpdir as tmpdir2 } from "node:os";
298004
298564
  init_cuda_device_filter();
298005
298565
  init_process_async();
@@ -298331,7 +298891,7 @@ init_secret_quarantine();
298331
298891
  init_agent_tools();
298332
298892
 
298333
298893
  // packages/execution/dist/tools/video-understand.js
298334
- import { join as join8, basename as basename4, isAbsolute as isAbsolute2, resolve as resolve5 } from "node:path";
298894
+ import { join as join8, basename as basename4, isAbsolute as isAbsolute3, resolve as resolve5 } from "node:path";
298335
298895
  import { homedir as homedir8 } from "node:os";
298336
298896
  init_model_broker();
298337
298897
  init_vision();
@@ -298348,7 +298908,7 @@ var CONFIG_PATH = join9(homedir9(), ".omnius", "video-scan.json");
298348
298908
  init_process_async();
298349
298909
  init_venv_paths();
298350
298910
  import { homedir as homedir10, tmpdir as tmpdir5 } from "node:os";
298351
- import { basename as basename6, isAbsolute as isAbsolute3, join as join10, resolve as resolve7 } from "node:path";
298911
+ import { basename as basename6, isAbsolute as isAbsolute4, join as join10, resolve as resolve7 } from "node:path";
298352
298912
  init_camera_capture();
298353
298913
  var LIVE_MEDIA_ROOT = join10(homedir10(), ".omnius", "runtimes", "live-media");
298354
298914
  var YOLO26_VENV = join10(LIVE_MEDIA_ROOT, ".venv-yolo26");