@quandev104/pi-style 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +2 -2
- package/dist/extensions/pi-style.js +240 -243
- package/dist/extensions/pi-style.js.map +1 -1
- package/extension-src/pi-style/domain/config-authorization.ts +6 -3
- package/extension-src/pi-style/pi/compatibility-coordinator.ts +16 -12
- package/extension-src/pi-style/pi/compatibility-probe.ts +296 -254
- package/extension-src/pi-style/pi/index.ts +3 -2
- package/package.json +9 -9
|
@@ -9299,7 +9299,7 @@ var grepTool = {
|
|
|
9299
9299
|
|
|
9300
9300
|
// extension-src/pi-style/domain/config-authorization.ts
|
|
9301
9301
|
function isTierCAuthorized(input) {
|
|
9302
|
-
if (!input.
|
|
9302
|
+
if (!input.coreFlag || !input.surfaceFlag || !input.config.enabled) return false;
|
|
9303
9303
|
if (input.surface === "tools") return input.config.tools.enabled;
|
|
9304
9304
|
if (input.surface === "assistantMessage")
|
|
9305
9305
|
return input.config.messages.enabled && input.config.messages.assistantPrefix;
|
|
@@ -10591,133 +10591,100 @@ function installDelegatingPatch(options) {
|
|
|
10591
10591
|
}
|
|
10592
10592
|
|
|
10593
10593
|
// extension-src/pi-style/pi/compatibility-probe.ts
|
|
10594
|
-
var
|
|
10595
|
-
var
|
|
10596
|
-
var
|
|
10597
|
-
|
|
10598
|
-
|
|
10599
|
-
"native-assistant-message:updateContent": "4a2f15ff",
|
|
10600
|
-
"native-compaction-message:updateDisplay": "f8c44e78",
|
|
10601
|
-
"native-branch-message:updateDisplay": "415d57b7",
|
|
10602
|
-
"native-skill-message:updateDisplay": "48099ea6",
|
|
10603
|
-
"native-custom-message:rebuild": "76ae2e3a",
|
|
10604
|
-
"tool-call-renderer:getCallRenderer": "951ea0e0",
|
|
10605
|
-
"tool-result-renderer:getResultRenderer": "8a25cd71",
|
|
10606
|
-
"native-bash-execution:render": "a5b5abca"
|
|
10607
|
-
});
|
|
10608
|
-
var CERTIFICATION_TABLE = Object.freeze({
|
|
10609
|
-
"0.83.0": Object.freeze({
|
|
10610
|
-
"native-assistant-message:render": Object.freeze({
|
|
10611
|
-
feature: "messages",
|
|
10612
|
-
subtype: "native-assistant-message",
|
|
10613
|
-
target: AssistantMessageComponent.prototype,
|
|
10614
|
-
method: "render",
|
|
10615
|
-
writable: true,
|
|
10616
|
-
configurable: true,
|
|
10594
|
+
var SUPPORTED_VERSION_RANGE = ">=0.83.0 <0.85.0";
|
|
10595
|
+
var SUPPORTED_PI_VERSIONS = Object.freeze(["0.83.0", "0.84.0"]);
|
|
10596
|
+
var KNOWN_NATIVE_IDENTITIES = Object.freeze({
|
|
10597
|
+
"native-assistant-message:render": Object.freeze([
|
|
10598
|
+
Object.freeze({
|
|
10617
10599
|
name: "render",
|
|
10618
10600
|
arity: 1,
|
|
10619
|
-
fingerprint:
|
|
10620
|
-
|
|
10621
|
-
|
|
10601
|
+
fingerprint: "2a39243f",
|
|
10602
|
+
versions: Object.freeze(["0.83.0", "0.84.0"])
|
|
10603
|
+
})
|
|
10604
|
+
]),
|
|
10605
|
+
"native-assistant-message:updateContent": Object.freeze([
|
|
10606
|
+
Object.freeze({
|
|
10607
|
+
name: "updateContent",
|
|
10608
|
+
arity: 1,
|
|
10609
|
+
fingerprint: "4a2f15ff",
|
|
10610
|
+
versions: Object.freeze(["0.83.0"])
|
|
10622
10611
|
}),
|
|
10623
|
-
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
|
|
10628
|
-
|
|
10629
|
-
|
|
10612
|
+
// 0.84.0 adds an `isStreaming` default parameter and per-part markdown
|
|
10613
|
+
// transforms; default parameters do not count toward Function.length, so
|
|
10614
|
+
// the arity stays 1 while the source fingerprint changes.
|
|
10615
|
+
Object.freeze({
|
|
10616
|
+
name: "updateContent",
|
|
10617
|
+
arity: 1,
|
|
10618
|
+
fingerprint: "d2114491",
|
|
10619
|
+
versions: Object.freeze(["0.84.0"])
|
|
10620
|
+
})
|
|
10621
|
+
]),
|
|
10622
|
+
"native-compaction-message:updateDisplay": Object.freeze([
|
|
10623
|
+
Object.freeze({
|
|
10624
|
+
name: "updateDisplay",
|
|
10625
|
+
arity: 0,
|
|
10626
|
+
fingerprint: "f8c44e78",
|
|
10627
|
+
versions: Object.freeze(["0.83.0", "0.84.0"])
|
|
10628
|
+
})
|
|
10629
|
+
]),
|
|
10630
|
+
"native-branch-message:updateDisplay": Object.freeze([
|
|
10631
|
+
Object.freeze({
|
|
10632
|
+
name: "updateDisplay",
|
|
10633
|
+
arity: 0,
|
|
10634
|
+
fingerprint: "415d57b7",
|
|
10635
|
+
versions: Object.freeze(["0.83.0", "0.84.0"])
|
|
10636
|
+
})
|
|
10637
|
+
]),
|
|
10638
|
+
"native-skill-message:updateDisplay": Object.freeze([
|
|
10639
|
+
Object.freeze({
|
|
10640
|
+
name: "updateDisplay",
|
|
10641
|
+
arity: 0,
|
|
10642
|
+
fingerprint: "48099ea6",
|
|
10643
|
+
versions: Object.freeze(["0.83.0", "0.84.0"])
|
|
10644
|
+
})
|
|
10645
|
+
]),
|
|
10646
|
+
"native-custom-message:rebuild": Object.freeze([
|
|
10647
|
+
Object.freeze({
|
|
10648
|
+
name: "rebuild",
|
|
10649
|
+
arity: 0,
|
|
10650
|
+
fingerprint: "76ae2e3a",
|
|
10651
|
+
versions: Object.freeze(["0.83.0", "0.84.0"])
|
|
10652
|
+
})
|
|
10653
|
+
]),
|
|
10654
|
+
"tool-call-renderer:getCallRenderer": Object.freeze([
|
|
10655
|
+
Object.freeze({
|
|
10630
10656
|
name: "getCallRenderer",
|
|
10631
10657
|
arity: 0,
|
|
10632
|
-
fingerprint:
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
subtype: "tool-result-renderer",
|
|
10639
|
-
target: ToolExecutionComponent.prototype,
|
|
10640
|
-
method: "getResultRenderer",
|
|
10641
|
-
writable: true,
|
|
10642
|
-
configurable: true,
|
|
10658
|
+
fingerprint: "951ea0e0",
|
|
10659
|
+
versions: Object.freeze(["0.83.0", "0.84.0"])
|
|
10660
|
+
})
|
|
10661
|
+
]),
|
|
10662
|
+
"tool-result-renderer:getResultRenderer": Object.freeze([
|
|
10663
|
+
Object.freeze({
|
|
10643
10664
|
name: "getResultRenderer",
|
|
10644
10665
|
arity: 0,
|
|
10645
|
-
fingerprint:
|
|
10646
|
-
|
|
10647
|
-
|
|
10648
|
-
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
subtype: "native-assistant-message",
|
|
10652
|
-
target: AssistantMessageComponent.prototype,
|
|
10653
|
-
method: "updateContent",
|
|
10654
|
-
writable: true,
|
|
10655
|
-
configurable: true,
|
|
10656
|
-
name: "updateContent",
|
|
10657
|
-
arity: 1,
|
|
10658
|
-
fingerprint: TRUSTED_NATIVE_FINGERPRINTS["native-assistant-message:updateContent"],
|
|
10659
|
-
adapterId: "message-thinking-collapse-v1",
|
|
10660
|
-
status: "certified"
|
|
10661
|
-
}),
|
|
10662
|
-
"native-compaction-message:updateDisplay": Object.freeze({
|
|
10663
|
-
feature: "messages",
|
|
10664
|
-
subtype: "native-compaction-message",
|
|
10665
|
-
target: CompactionSummaryMessageComponent.prototype,
|
|
10666
|
-
method: "updateDisplay",
|
|
10667
|
-
writable: true,
|
|
10668
|
-
configurable: true,
|
|
10669
|
-
adapterId: "message-block-boxed-v1",
|
|
10670
|
-
status: "certified"
|
|
10671
|
-
}),
|
|
10672
|
-
"native-branch-message:updateDisplay": Object.freeze({
|
|
10673
|
-
feature: "messages",
|
|
10674
|
-
subtype: "native-branch-message",
|
|
10675
|
-
target: BranchSummaryMessageComponent.prototype,
|
|
10676
|
-
method: "updateDisplay",
|
|
10677
|
-
writable: true,
|
|
10678
|
-
configurable: true,
|
|
10679
|
-
adapterId: "message-block-boxed-v1",
|
|
10680
|
-
status: "certified"
|
|
10681
|
-
}),
|
|
10682
|
-
"native-skill-message:updateDisplay": Object.freeze({
|
|
10683
|
-
feature: "messages",
|
|
10684
|
-
subtype: "native-skill-message",
|
|
10685
|
-
target: SkillInvocationMessageComponent.prototype,
|
|
10686
|
-
method: "updateDisplay",
|
|
10687
|
-
writable: true,
|
|
10688
|
-
configurable: true,
|
|
10689
|
-
adapterId: "message-block-boxed-v1",
|
|
10690
|
-
status: "certified"
|
|
10691
|
-
}),
|
|
10692
|
-
"native-custom-message:rebuild": Object.freeze({
|
|
10693
|
-
feature: "messages",
|
|
10694
|
-
subtype: "native-custom-message",
|
|
10695
|
-
target: CustomMessageComponent.prototype,
|
|
10696
|
-
method: "rebuild",
|
|
10697
|
-
writable: true,
|
|
10698
|
-
configurable: true,
|
|
10699
|
-
adapterId: "message-block-boxed-v1",
|
|
10700
|
-
status: "certified"
|
|
10701
|
-
}),
|
|
10702
|
-
"native-bash-execution:render": Object.freeze({
|
|
10703
|
-
feature: "tools",
|
|
10704
|
-
subtype: "native-bash-execution",
|
|
10705
|
-
target: BashExecutionComponent.prototype,
|
|
10706
|
-
method: "render",
|
|
10707
|
-
writable: true,
|
|
10708
|
-
configurable: true,
|
|
10666
|
+
fingerprint: "8a25cd71",
|
|
10667
|
+
versions: Object.freeze(["0.83.0", "0.84.0"])
|
|
10668
|
+
})
|
|
10669
|
+
]),
|
|
10670
|
+
"native-bash-execution:render": Object.freeze([
|
|
10671
|
+
Object.freeze({
|
|
10709
10672
|
// The additive render patch is certified by the class constructor identity
|
|
10710
10673
|
// (name/arity/source fingerprint): the class defines no own `render`, so
|
|
10711
10674
|
// the installed own method is the only one and the inherited Container
|
|
10712
10675
|
// render is the native fallback.
|
|
10713
10676
|
name: "BashExecutionComponent",
|
|
10714
10677
|
arity: 2,
|
|
10715
|
-
fingerprint:
|
|
10716
|
-
|
|
10717
|
-
status: "certified"
|
|
10678
|
+
fingerprint: "a5b5abca",
|
|
10679
|
+
versions: Object.freeze(["0.83.0", "0.84.0"])
|
|
10718
10680
|
})
|
|
10719
|
-
|
|
10681
|
+
])
|
|
10720
10682
|
});
|
|
10683
|
+
var TRUSTED_NATIVE_FINGERPRINTS = Object.freeze(
|
|
10684
|
+
Object.fromEntries(
|
|
10685
|
+
Object.entries(KNOWN_NATIVE_IDENTITIES).map(([key, identities]) => [key, identities[0].fingerprint])
|
|
10686
|
+
)
|
|
10687
|
+
);
|
|
10721
10688
|
function fingerprint(value) {
|
|
10722
10689
|
if (typeof value !== "function") return void 0;
|
|
10723
10690
|
let hash = 2166136261;
|
|
@@ -10727,102 +10694,33 @@ function fingerprint(value) {
|
|
|
10727
10694
|
}
|
|
10728
10695
|
return hash.toString(16).padStart(8, "0");
|
|
10729
10696
|
}
|
|
10730
|
-
function
|
|
10731
|
-
if (
|
|
10697
|
+
function knownIdentityMatches(spec, value) {
|
|
10698
|
+
if (typeof value !== "function") return void 0;
|
|
10699
|
+
const hash = fingerprint(value);
|
|
10700
|
+
const key = `${spec.subtype}:${spec.method}`;
|
|
10701
|
+
return (KNOWN_NATIVE_IDENTITIES[key] ?? []).find(
|
|
10702
|
+
(identity) => value.name === identity.name && value.length === identity.arity && hash === identity.fingerprint
|
|
10703
|
+
);
|
|
10704
|
+
}
|
|
10705
|
+
function matchedNativeIdentity(spec) {
|
|
10732
10706
|
if (spec.kind === "add-method") {
|
|
10733
10707
|
if (Object.getOwnPropertyDescriptor(spec.target, spec.method)) return void 0;
|
|
10734
10708
|
const ctor = Object.getOwnPropertyDescriptor(spec.target, "constructor")?.value;
|
|
10735
|
-
|
|
10736
|
-
if (typeof ctor !== "function" || ctor.name !== (spec.identityName ?? spec.method) || ctor.length !== (spec.arity ?? 0) || fingerprint(ctor) !== TRUSTED_NATIVE_FINGERPRINTS[key2])
|
|
10737
|
-
return void 0;
|
|
10738
|
-
const inherited = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(spec.target), spec.method)?.value;
|
|
10739
|
-
return typeof inherited === "function" ? inherited : void 0;
|
|
10709
|
+
return knownIdentityMatches(spec, ctor);
|
|
10740
10710
|
}
|
|
10741
10711
|
const descriptor = Object.getOwnPropertyDescriptor(spec.target, spec.method);
|
|
10742
|
-
|
|
10743
|
-
|
|
10744
|
-
const expectedArity = spec.arity ?? (spec.method === "render" || spec.method === "updateContent" ? 1 : 0);
|
|
10745
|
-
if (descriptor?.writable !== true || descriptor.configurable !== true || typeof value !== "function" || value.name !== (spec.identityName ?? spec.method) || value.length !== expectedArity || fingerprint(value) !== TRUSTED_NATIVE_FINGERPRINTS[key])
|
|
10746
|
-
return void 0;
|
|
10747
|
-
return value;
|
|
10712
|
+
if (descriptor?.writable !== true || descriptor.configurable !== true) return void 0;
|
|
10713
|
+
return knownIdentityMatches(spec, descriptor.value);
|
|
10748
10714
|
}
|
|
10749
|
-
|
|
10750
|
-
|
|
10751
|
-
|
|
10752
|
-
|
|
10753
|
-
target
|
|
10754
|
-
|
|
10755
|
-
adapterId: "message-prefix-osc133-v1",
|
|
10756
|
-
status: "certified"
|
|
10757
|
-
},
|
|
10758
|
-
{
|
|
10759
|
-
feature: "messages",
|
|
10760
|
-
subtype: "native-assistant-message",
|
|
10761
|
-
target: AssistantMessageComponent.prototype,
|
|
10762
|
-
method: "updateContent",
|
|
10763
|
-
adapterId: "message-thinking-collapse-v1",
|
|
10764
|
-
status: "certified"
|
|
10765
|
-
},
|
|
10766
|
-
{
|
|
10767
|
-
feature: "messages",
|
|
10768
|
-
subtype: "native-compaction-message",
|
|
10769
|
-
target: CompactionSummaryMessageComponent.prototype,
|
|
10770
|
-
method: "updateDisplay",
|
|
10771
|
-
adapterId: "message-block-boxed-v1",
|
|
10772
|
-
status: "certified"
|
|
10773
|
-
},
|
|
10774
|
-
{
|
|
10775
|
-
feature: "messages",
|
|
10776
|
-
subtype: "native-branch-message",
|
|
10777
|
-
target: BranchSummaryMessageComponent.prototype,
|
|
10778
|
-
method: "updateDisplay",
|
|
10779
|
-
adapterId: "message-block-boxed-v1",
|
|
10780
|
-
status: "certified"
|
|
10781
|
-
},
|
|
10782
|
-
{
|
|
10783
|
-
feature: "messages",
|
|
10784
|
-
subtype: "native-skill-message",
|
|
10785
|
-
target: SkillInvocationMessageComponent.prototype,
|
|
10786
|
-
method: "updateDisplay",
|
|
10787
|
-
adapterId: "message-block-boxed-v1",
|
|
10788
|
-
status: "certified"
|
|
10789
|
-
},
|
|
10790
|
-
{
|
|
10791
|
-
feature: "messages",
|
|
10792
|
-
subtype: "native-custom-message",
|
|
10793
|
-
target: CustomMessageComponent.prototype,
|
|
10794
|
-
method: "rebuild",
|
|
10795
|
-
adapterId: "message-block-boxed-v1",
|
|
10796
|
-
status: "certified"
|
|
10797
|
-
},
|
|
10798
|
-
{
|
|
10799
|
-
feature: "tools",
|
|
10800
|
-
subtype: "tool-call-renderer",
|
|
10801
|
-
target: ToolExecutionComponent.prototype,
|
|
10802
|
-
method: "getCallRenderer",
|
|
10803
|
-
adapterId: "tool-renderer-component-v1",
|
|
10804
|
-
status: "certified"
|
|
10805
|
-
},
|
|
10806
|
-
{
|
|
10807
|
-
feature: "tools",
|
|
10808
|
-
subtype: "tool-result-renderer",
|
|
10809
|
-
target: ToolExecutionComponent.prototype,
|
|
10810
|
-
method: "getResultRenderer",
|
|
10811
|
-
adapterId: "tool-renderer-component-v1",
|
|
10812
|
-
status: "certified"
|
|
10813
|
-
},
|
|
10814
|
-
{
|
|
10815
|
-
feature: "tools",
|
|
10816
|
-
subtype: "native-bash-execution",
|
|
10817
|
-
target: BashExecutionComponent.prototype,
|
|
10818
|
-
method: "render",
|
|
10819
|
-
kind: "add-method",
|
|
10820
|
-
identityName: "BashExecutionComponent",
|
|
10821
|
-
arity: 2,
|
|
10822
|
-
adapterId: "bash-execution-box-v1",
|
|
10823
|
-
status: "certified"
|
|
10715
|
+
function trustedNativeIdentity(spec) {
|
|
10716
|
+
const identity = matchedNativeIdentity(spec);
|
|
10717
|
+
if (!identity) return void 0;
|
|
10718
|
+
if (spec.kind === "add-method") {
|
|
10719
|
+
const inherited = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(spec.target), spec.method)?.value;
|
|
10720
|
+
return typeof inherited === "function" ? inherited : void 0;
|
|
10824
10721
|
}
|
|
10825
|
-
|
|
10722
|
+
return Object.getOwnPropertyDescriptor(spec.target, spec.method)?.value;
|
|
10723
|
+
}
|
|
10826
10724
|
function detectPiVersion(resolution = {}) {
|
|
10827
10725
|
const resolvePackageEntry = resolution.resolvePackageEntry ?? ((name) => {
|
|
10828
10726
|
try {
|
|
@@ -10875,15 +10773,14 @@ function descriptorSnapshot(descriptor) {
|
|
|
10875
10773
|
}
|
|
10876
10774
|
);
|
|
10877
10775
|
}
|
|
10878
|
-
function certificationRecord(spec, attemptedVersion, evidence = Object.getOwnPropertyDescriptor(spec.target, spec.method)) {
|
|
10776
|
+
function certificationRecord(spec, attemptedVersion, matchedIdentity, evidence = Object.getOwnPropertyDescriptor(spec.target, spec.method)) {
|
|
10879
10777
|
const descriptor = evidence;
|
|
10880
10778
|
const value = descriptor?.value;
|
|
10881
10779
|
return {
|
|
10882
10780
|
version: attemptedVersion ?? "unknown",
|
|
10883
10781
|
attemptedVersion: attemptedVersion ?? "unknown",
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
actualPreinstall: descriptorSnapshot(descriptor),
|
|
10782
|
+
matchedIdentity,
|
|
10783
|
+
knownIdentities: KNOWN_NATIVE_IDENTITIES[`${spec.subtype}:${spec.method}`] ?? [],
|
|
10887
10784
|
feature: spec.feature,
|
|
10888
10785
|
subtype: spec.subtype,
|
|
10889
10786
|
target: spec.target,
|
|
@@ -10897,9 +10794,6 @@ function certificationRecord(spec, attemptedVersion, evidence = Object.getOwnPro
|
|
|
10897
10794
|
...spec.fallbackReason ? { fallbackReason: spec.fallbackReason } : {}
|
|
10898
10795
|
};
|
|
10899
10796
|
}
|
|
10900
|
-
function versionInRange(version) {
|
|
10901
|
-
return version === TRUSTED_PI_VERSION;
|
|
10902
|
-
}
|
|
10903
10797
|
function shape(spec) {
|
|
10904
10798
|
const descriptor = Object.getOwnPropertyDescriptor(spec.target, spec.method);
|
|
10905
10799
|
if (spec.kind === "add-method") return descriptor === void 0;
|
|
@@ -10917,7 +10811,7 @@ function createFallbackRecord(spec, piVersion, generation2, reason) {
|
|
|
10917
10811
|
method: spec.method,
|
|
10918
10812
|
originalIdentity: Reflect.get(spec.target, spec.method),
|
|
10919
10813
|
piVersion: piVersion ?? "unknown",
|
|
10920
|
-
versionRange:
|
|
10814
|
+
versionRange: SUPPORTED_VERSION_RANGE,
|
|
10921
10815
|
shape: "unsupported",
|
|
10922
10816
|
diagnostic: reason,
|
|
10923
10817
|
generation: generation2,
|
|
@@ -10926,10 +10820,10 @@ function createFallbackRecord(spec, piVersion, generation2, reason) {
|
|
|
10926
10820
|
}
|
|
10927
10821
|
};
|
|
10928
10822
|
}
|
|
10929
|
-
function probeDiagnostic(spec,
|
|
10930
|
-
if (!versionInRange(piVersion)) return "Pi version is unknown or outside the recorded 0.83.0 support build";
|
|
10823
|
+
function probeDiagnostic(spec, identity) {
|
|
10931
10824
|
if (!shape(spec)) return "target method shape is not an own writable/configurable function";
|
|
10932
|
-
if (identity === void 0)
|
|
10825
|
+
if (identity === void 0)
|
|
10826
|
+
return "runtime native identity (name, arity, or source fingerprint) matched no recorded Pi surface";
|
|
10933
10827
|
return "exact native identity verified; certified guarded decoration enabled";
|
|
10934
10828
|
}
|
|
10935
10829
|
function surfaceDisabled(spec, config) {
|
|
@@ -10944,8 +10838,8 @@ function surfaceDisabled(spec, config) {
|
|
|
10944
10838
|
}
|
|
10945
10839
|
function probeSpec(options) {
|
|
10946
10840
|
const { spec, piVersion, generation: generation2, markers, config, toolOwner, messageSnapshot } = options;
|
|
10947
|
-
const identity = trustedNativeIdentity(spec
|
|
10948
|
-
const diagnostic = probeDiagnostic(spec,
|
|
10841
|
+
const identity = trustedNativeIdentity(spec);
|
|
10842
|
+
const diagnostic = probeDiagnostic(spec, identity);
|
|
10949
10843
|
const disabled = surfaceDisabled(spec, config);
|
|
10950
10844
|
if (disabled) {
|
|
10951
10845
|
const reason = "native fallback: surface disabled by normalized configuration";
|
|
@@ -10957,8 +10851,8 @@ function probeSpec(options) {
|
|
|
10957
10851
|
target: spec.target,
|
|
10958
10852
|
method: spec.method,
|
|
10959
10853
|
piVersion: piVersion ?? "unknown",
|
|
10960
|
-
versionRange:
|
|
10961
|
-
shape: identity !== void 0 &&
|
|
10854
|
+
versionRange: SUPPORTED_VERSION_RANGE,
|
|
10855
|
+
shape: identity !== void 0 && shape(spec),
|
|
10962
10856
|
generation: generation2,
|
|
10963
10857
|
expectedIdentity: identity,
|
|
10964
10858
|
hasExpectedIdentity: true,
|
|
@@ -10988,12 +10882,126 @@ function probeSpec(options) {
|
|
|
10988
10882
|
fallback: result.status === "skipped"
|
|
10989
10883
|
};
|
|
10990
10884
|
}
|
|
10885
|
+
var targetSpecs = [
|
|
10886
|
+
{
|
|
10887
|
+
feature: "messages",
|
|
10888
|
+
subtype: "native-assistant-message",
|
|
10889
|
+
target: AssistantMessageComponent.prototype,
|
|
10890
|
+
method: "render",
|
|
10891
|
+
adapterId: "message-prefix-osc133-v1",
|
|
10892
|
+
status: "certified"
|
|
10893
|
+
},
|
|
10894
|
+
{
|
|
10895
|
+
feature: "messages",
|
|
10896
|
+
subtype: "native-assistant-message",
|
|
10897
|
+
target: AssistantMessageComponent.prototype,
|
|
10898
|
+
method: "updateContent",
|
|
10899
|
+
adapterId: "message-thinking-collapse-v1",
|
|
10900
|
+
status: "certified"
|
|
10901
|
+
},
|
|
10902
|
+
{
|
|
10903
|
+
feature: "messages",
|
|
10904
|
+
subtype: "native-compaction-message",
|
|
10905
|
+
target: CompactionSummaryMessageComponent.prototype,
|
|
10906
|
+
method: "updateDisplay",
|
|
10907
|
+
adapterId: "message-block-boxed-v1",
|
|
10908
|
+
status: "certified"
|
|
10909
|
+
},
|
|
10910
|
+
{
|
|
10911
|
+
feature: "messages",
|
|
10912
|
+
subtype: "native-branch-message",
|
|
10913
|
+
target: BranchSummaryMessageComponent.prototype,
|
|
10914
|
+
method: "updateDisplay",
|
|
10915
|
+
adapterId: "message-block-boxed-v1",
|
|
10916
|
+
status: "certified"
|
|
10917
|
+
},
|
|
10918
|
+
{
|
|
10919
|
+
feature: "messages",
|
|
10920
|
+
subtype: "native-skill-message",
|
|
10921
|
+
target: SkillInvocationMessageComponent.prototype,
|
|
10922
|
+
method: "updateDisplay",
|
|
10923
|
+
adapterId: "message-block-boxed-v1",
|
|
10924
|
+
status: "certified"
|
|
10925
|
+
},
|
|
10926
|
+
{
|
|
10927
|
+
feature: "messages",
|
|
10928
|
+
subtype: "native-custom-message",
|
|
10929
|
+
target: CustomMessageComponent.prototype,
|
|
10930
|
+
method: "rebuild",
|
|
10931
|
+
adapterId: "message-block-boxed-v1",
|
|
10932
|
+
status: "certified"
|
|
10933
|
+
},
|
|
10934
|
+
{
|
|
10935
|
+
feature: "tools",
|
|
10936
|
+
subtype: "tool-call-renderer",
|
|
10937
|
+
target: ToolExecutionComponent.prototype,
|
|
10938
|
+
method: "getCallRenderer",
|
|
10939
|
+
adapterId: "tool-renderer-component-v1",
|
|
10940
|
+
status: "certified"
|
|
10941
|
+
},
|
|
10942
|
+
{
|
|
10943
|
+
feature: "tools",
|
|
10944
|
+
subtype: "tool-result-renderer",
|
|
10945
|
+
target: ToolExecutionComponent.prototype,
|
|
10946
|
+
method: "getResultRenderer",
|
|
10947
|
+
adapterId: "tool-renderer-component-v1",
|
|
10948
|
+
status: "certified"
|
|
10949
|
+
},
|
|
10950
|
+
{
|
|
10951
|
+
feature: "tools",
|
|
10952
|
+
subtype: "native-bash-execution",
|
|
10953
|
+
target: BashExecutionComponent.prototype,
|
|
10954
|
+
method: "render",
|
|
10955
|
+
kind: "add-method",
|
|
10956
|
+
identityName: "BashExecutionComponent",
|
|
10957
|
+
arity: 2,
|
|
10958
|
+
adapterId: "bash-execution-box-v1",
|
|
10959
|
+
status: "certified"
|
|
10960
|
+
}
|
|
10961
|
+
];
|
|
10962
|
+
var CERTIFICATION_TABLE = Object.freeze(
|
|
10963
|
+
Object.fromEntries(
|
|
10964
|
+
SUPPORTED_PI_VERSIONS.map((version) => [
|
|
10965
|
+
version,
|
|
10966
|
+
Object.freeze(
|
|
10967
|
+
Object.fromEntries(
|
|
10968
|
+
targetSpecs.flatMap((spec) => {
|
|
10969
|
+
const key = `${spec.subtype}:${spec.method}`;
|
|
10970
|
+
const identity = (KNOWN_NATIVE_IDENTITIES[key] ?? []).find(
|
|
10971
|
+
(candidate) => candidate.versions.includes(version)
|
|
10972
|
+
);
|
|
10973
|
+
if (!identity) return [];
|
|
10974
|
+
return [
|
|
10975
|
+
[
|
|
10976
|
+
key,
|
|
10977
|
+
Object.freeze({
|
|
10978
|
+
feature: spec.feature,
|
|
10979
|
+
subtype: spec.subtype,
|
|
10980
|
+
target: spec.target,
|
|
10981
|
+
method: spec.method,
|
|
10982
|
+
writable: true,
|
|
10983
|
+
configurable: true,
|
|
10984
|
+
name: identity.name,
|
|
10985
|
+
arity: identity.arity,
|
|
10986
|
+
fingerprint: identity.fingerprint,
|
|
10987
|
+
adapterId: spec.adapterId,
|
|
10988
|
+
status: "certified"
|
|
10989
|
+
})
|
|
10990
|
+
]
|
|
10991
|
+
];
|
|
10992
|
+
})
|
|
10993
|
+
)
|
|
10994
|
+
)
|
|
10995
|
+
])
|
|
10996
|
+
)
|
|
10997
|
+
);
|
|
10998
|
+
var reportStates = /* @__PURE__ */ new WeakMap();
|
|
10991
10999
|
function probePiCompatibility(piVersion, options = /* @__PURE__ */ new Set()) {
|
|
10992
11000
|
const markers = options instanceof Set ? options : options.markers ?? /* @__PURE__ */ new Set();
|
|
10993
11001
|
const generation2 = nextGeneration();
|
|
10994
11002
|
const toolSpecs = targetSpecs.filter((spec) => spec.feature === "tools");
|
|
10995
11003
|
let toolOwner;
|
|
10996
|
-
if (toolSpecs.some((spec) => trustedNativeIdentity(spec
|
|
11004
|
+
if (toolSpecs.some((spec) => trustedNativeIdentity(spec) !== void 0) && (options instanceof Set || options.config?.tools.enabled !== false)) {
|
|
10997
11005
|
toolOwner = createToolDecorationOwner(options instanceof Set ? {} : options.toolSnapshot);
|
|
10998
11006
|
}
|
|
10999
11007
|
const evidence = Object.freeze(
|
|
@@ -11014,6 +11022,7 @@ function probePiCompatibility(piVersion, options = /* @__PURE__ */ new Set()) {
|
|
|
11014
11022
|
for (const spec of targetSpecs) {
|
|
11015
11023
|
const captured = evidenceByKey.get(`${spec.subtype}:${String(spec.method)}`);
|
|
11016
11024
|
const preinstallDescriptor = captured?.descriptor;
|
|
11025
|
+
const matchedIdentity = matchedNativeIdentity(spec);
|
|
11017
11026
|
const result = probeSpec({
|
|
11018
11027
|
messageSnapshot: options instanceof Set ? void 0 : options.messageSnapshot,
|
|
11019
11028
|
spec,
|
|
@@ -11024,12 +11033,10 @@ function probePiCompatibility(piVersion, options = /* @__PURE__ */ new Set()) {
|
|
|
11024
11033
|
toolOwner
|
|
11025
11034
|
});
|
|
11026
11035
|
records.push(result.record);
|
|
11027
|
-
const certificate = certificationRecord(spec, piVersion, preinstallDescriptor);
|
|
11036
|
+
const certificate = certificationRecord(spec, piVersion, matchedIdentity, preinstallDescriptor);
|
|
11028
11037
|
certification.push({
|
|
11029
11038
|
...certificate,
|
|
11030
11039
|
attemptedVersion: piVersion ?? "unknown",
|
|
11031
|
-
matchedCertifiedVersion: piVersion === TRUSTED_PI_VERSION ? TRUSTED_PI_VERSION : void 0,
|
|
11032
|
-
expected: CERTIFICATION_TABLE[TRUSTED_PI_VERSION][`${spec.subtype}:${spec.method}`],
|
|
11033
11040
|
actualPreinstall: descriptorSnapshot(preinstallDescriptor),
|
|
11034
11041
|
status: result.fallback ? "native-fallback" : "certified",
|
|
11035
11042
|
...result.fallback ? { fallbackReason: result.reason } : {}
|
|
@@ -11038,10 +11045,10 @@ function probePiCompatibility(piVersion, options = /* @__PURE__ */ new Set()) {
|
|
|
11038
11045
|
}
|
|
11039
11046
|
const report = {
|
|
11040
11047
|
attemptedVersion: piVersion ?? "unknown",
|
|
11041
|
-
|
|
11048
|
+
supportedVersions: SUPPORTED_PI_VERSIONS,
|
|
11042
11049
|
certificationTable: CERTIFICATION_TABLE,
|
|
11043
11050
|
piVersion: piVersion ?? "unknown",
|
|
11044
|
-
versionRange:
|
|
11051
|
+
versionRange: SUPPORTED_VERSION_RANGE,
|
|
11045
11052
|
generation: currentGeneration(),
|
|
11046
11053
|
recordSnapshots: Object.freeze(
|
|
11047
11054
|
records.map(
|
|
@@ -11060,14 +11067,7 @@ function probePiCompatibility(piVersion, options = /* @__PURE__ */ new Set()) {
|
|
|
11060
11067
|
),
|
|
11061
11068
|
unsupported: Object.freeze(unsupported.map((item) => Object.freeze({ ...item }))),
|
|
11062
11069
|
delegationMarkers: Object.freeze([...markers]),
|
|
11063
|
-
certification: Object.freeze(
|
|
11064
|
-
certification.map(
|
|
11065
|
-
(item) => Object.freeze({
|
|
11066
|
-
...item,
|
|
11067
|
-
actualPreinstall: item.actualPreinstall
|
|
11068
|
-
})
|
|
11069
|
-
)
|
|
11070
|
-
),
|
|
11070
|
+
certification: Object.freeze(certification.map((item) => Object.freeze({ ...item }))),
|
|
11071
11071
|
getRuntimeDiagnostics: () => toolOwner?.getDiagnostics() ?? /* @__PURE__ */ new Map(),
|
|
11072
11072
|
getFinalDiagnostics: () => toolOwner?.getFinalArchive(),
|
|
11073
11073
|
getActiveToolRecordCount: () => toolOwner?.getActiveRecordCount() ?? 0,
|
|
@@ -11118,8 +11118,8 @@ function createCompatibilityCoordinator(dispose = disposePiCompatibilityProbe) {
|
|
|
11118
11118
|
const records = report?.unsupported.filter(
|
|
11119
11119
|
(item) => feature === "messages" ? item.subtype.includes("message") : item.subtype.includes("tool")
|
|
11120
11120
|
) ?? [];
|
|
11121
|
-
const failed = records.some((item) => /
|
|
11122
|
-
const fallback = records.some((item) => /fallback|authorization|disabled/i.test(item.reason));
|
|
11121
|
+
const failed = records.some((item) => /failed|rejected|rolled back|shape is not/i.test(item.reason));
|
|
11122
|
+
const fallback = records.some((item) => /fallback|authorization|disabled|identity/i.test(item.reason));
|
|
11123
11123
|
const authorized = Boolean(authorization?.core && surfaceAuthorized);
|
|
11124
11124
|
const installedRecord = report?.recordSnapshots.some(
|
|
11125
11125
|
(item) => item.feature === feature && !item.disposed && (subtype === void 0 || item.subtype === subtype)
|
|
@@ -11127,7 +11127,7 @@ function createCompatibilityCoordinator(dispose = disposePiCompatibilityProbe) {
|
|
|
11127
11127
|
return {
|
|
11128
11128
|
configured,
|
|
11129
11129
|
authorized,
|
|
11130
|
-
installed: Boolean(installedRecord &&
|
|
11130
|
+
installed: Boolean(installedRecord && authorized && configured),
|
|
11131
11131
|
conflicted: records.some((item) => item.reason.includes("owner")),
|
|
11132
11132
|
failed,
|
|
11133
11133
|
cleanupPending,
|
|
@@ -11139,12 +11139,13 @@ function createCompatibilityCoordinator(dispose = disposePiCompatibilityProbe) {
|
|
|
11139
11139
|
configured: messagesConfigured || toolsConfigured,
|
|
11140
11140
|
authorized: authorization?.core ?? false,
|
|
11141
11141
|
installed: report !== void 0,
|
|
11142
|
-
conflicted: report?.unsupported.some((item) => item.reason.includes("
|
|
11143
|
-
failed: report?.unsupported.some((item) => item.reason
|
|
11142
|
+
conflicted: report?.unsupported.some((item) => item.reason.includes("owner")) ?? false,
|
|
11143
|
+
failed: report?.unsupported.some((item) => /failed|rejected|rolled back/i.test(item.reason)) ?? false,
|
|
11144
11144
|
cleanupPending,
|
|
11145
|
-
nativeFallbacks: report?.unsupported.filter((item) => item.reason
|
|
11145
|
+
nativeFallbacks: report?.unsupported.filter((item) => /fallback|identity/i.test(item.reason)).length ?? 0,
|
|
11146
11146
|
piVersion: version.version ?? report?.piVersion ?? "unknown",
|
|
11147
|
-
versionRange: report?.versionRange ??
|
|
11147
|
+
versionRange: report?.versionRange ?? SUPPORTED_VERSION_RANGE,
|
|
11148
|
+
supportedVersions: report?.supportedVersions ?? [],
|
|
11148
11149
|
assistantMessage: surface(
|
|
11149
11150
|
"messages",
|
|
11150
11151
|
config.enabled && config.messages.enabled && config.messages.assistantPrefix,
|
|
@@ -11163,16 +11164,13 @@ function createCompatibilityCoordinator(dispose = disposePiCompatibilityProbe) {
|
|
|
11163
11164
|
const productDenied = productGate === "deny";
|
|
11164
11165
|
if (cleanupPending && !report) cleanupPending = false;
|
|
11165
11166
|
if (cleanupPending || !tui || !config.enabled || !authorization?.core || productDenied) return void 0;
|
|
11166
|
-
const certifiedHost = detectPiVersion().version === "0.83.0";
|
|
11167
11167
|
const assistantEnabled = authorization.assistant && isTierCAuthorized({
|
|
11168
|
-
certifiedHost,
|
|
11169
11168
|
coreFlag: authorization.core,
|
|
11170
11169
|
surfaceFlag: true,
|
|
11171
11170
|
surface: "assistantMessage",
|
|
11172
11171
|
config
|
|
11173
11172
|
});
|
|
11174
11173
|
const specialBlocksEnabled = authorization.specialBlocks && isTierCAuthorized({
|
|
11175
|
-
certifiedHost,
|
|
11176
11174
|
coreFlag: authorization.core,
|
|
11177
11175
|
surfaceFlag: true,
|
|
11178
11176
|
surface: "specialBlocks",
|
|
@@ -11181,14 +11179,13 @@ function createCompatibilityCoordinator(dispose = disposePiCompatibilityProbe) {
|
|
|
11181
11179
|
const messagesEnabled = (assistantEnabled || specialBlocksEnabled) && config.messages.enabled;
|
|
11182
11180
|
const thinkingCollapseEnabled = Boolean(
|
|
11183
11181
|
authorization.assistant && config.messages.enabled && config.messages.hideThinkingLabel && isTierCAuthorized({
|
|
11184
|
-
certifiedHost,
|
|
11185
11182
|
coreFlag: authorization.core,
|
|
11186
11183
|
surfaceFlag: true,
|
|
11187
11184
|
surface: "messages",
|
|
11188
11185
|
config
|
|
11189
11186
|
})
|
|
11190
11187
|
);
|
|
11191
|
-
const toolsEnabled = authorization.tools && isTierCAuthorized({
|
|
11188
|
+
const toolsEnabled = authorization.tools && isTierCAuthorized({ coreFlag: authorization.core, surfaceFlag: true, surface: "tools", config });
|
|
11192
11189
|
if (!messagesEnabled && !toolsEnabled) return void 0;
|
|
11193
11190
|
const detected = detectPiVersion();
|
|
11194
11191
|
report = probePiCompatibility(detected.version, {
|