@ixo/editor 5.0.0 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,7 +75,17 @@ var CAN_TO_TYPE = {
75
75
  "pod/entity-single-selection": "qi/pod.entity-single-selection",
76
76
  "pod/governance-config": "qi/pod.governance-config",
77
77
  "pod/member-multi-select": "qi/pod.member-multi-select",
78
- "pod/list-domain-flows": "qi/pod.list-domain-flows"
78
+ "pod/list-domain-flows": "qi/pod.list-domain-flows",
79
+ "wallet/generate": "qi/wallet.generate",
80
+ "wallet/fund": "qi/wallet.fund",
81
+ "iid/create": "qi/iid.create",
82
+ "matrix/register": "qi/matrix.register",
83
+ "entity/createOracle": "qi/entity.createOracle",
84
+ "sandbox/provision": "qi/sandbox.provision",
85
+ "oracle/contract": "qi/oracle.contract",
86
+ "oracle/storeSecrets": "qi/oracle.storeSecrets",
87
+ "oracle/storeConfig": "qi/oracle.storeConfig",
88
+ "oracle/configureOracle": "qi/oracle.configureOracle"
79
89
  };
80
90
  var TYPE_TO_CAN = Object.fromEntries(Object.entries(CAN_TO_TYPE).map(([can, type]) => [type, can]));
81
91
  function canToType(can) {
@@ -148,6 +158,30 @@ function buildServicesFromHandlers(handlers) {
148
158
  } : void 0,
149
159
  matrix: handlers?.storeMatrixCredential ? {
150
160
  storeCredential: async (params) => handlers.storeMatrixCredential(params)
161
+ } : void 0,
162
+ oracle: handlers?.generateWallet ? {
163
+ generateWallet: async () => handlers.generateWallet(),
164
+ fundWallet: async (params) => handlers.fundWallet(params),
165
+ createIidDocument: async (params) => handlers.createIidDocument(params),
166
+ registerMatrixAccount: async (params) => handlers.registerMatrixAccount(params),
167
+ createOracleEntity: async (params) => handlers.createOracleEntity(params),
168
+ contract: async (params) => handlers.oracleContract(params),
169
+ provisionSandbox: async (params) => handlers.provisionSandbox(params),
170
+ storeSecrets: async (params) => handlers.storeSecrets(params),
171
+ storeConfig: async (params) => handlers.storeOracleConfig(params),
172
+ validateMcpServer: handlers.validateMcpServer || (async () => ({ success: false, error: "Handler not configured" })),
173
+ encryptForOracle: async (params) => handlers.encryptSecretForOracle(params),
174
+ readStoredSecrets: async (params) => handlers.readStoredSecrets(params),
175
+ getNetworkConstants: async (params) => handlers.getNetworkConstants(params),
176
+ deploySetup: handlers.deploySetup || (async () => {
177
+ throw new Error("deploySetup handler not configured");
178
+ }),
179
+ deployStart: handlers.deployStart || (async () => {
180
+ throw new Error("deployStart handler not configured");
181
+ }),
182
+ updateOracleDomain: handlers.updateOracleDomain || (async () => {
183
+ throw new Error("updateOracleDomain handler not configured");
184
+ })
151
185
  } : void 0
152
186
  };
153
187
  }
@@ -2702,6 +2736,853 @@ registerAction({
2702
2736
  }
2703
2737
  });
2704
2738
 
2739
+ // src/core/lib/actionRegistry/actions/walletGenerate.ts
2740
+ registerAction({
2741
+ type: "qi/wallet.generate",
2742
+ can: "wallet/generate",
2743
+ sideEffect: false,
2744
+ defaultRequiresConfirmation: false,
2745
+ outputSchema: [
2746
+ { path: "address", displayName: "Wallet Address", type: "string", description: "The generated IXO wallet address" },
2747
+ { path: "did", displayName: "DID", type: "string", description: "The DID derived from the wallet address" },
2748
+ { path: "pubKey", displayName: "Public Key", type: "string", description: "The secp256k1 public key (hex)" },
2749
+ { path: "mnemonic", displayName: "Mnemonic", type: "string", description: "The BIP39 mnemonic seed phrase" }
2750
+ ],
2751
+ run: async (_inputs, ctx) => {
2752
+ if (!ctx.services.oracle?.generateWallet) {
2753
+ throw new Error("oracle.generateWallet handler not available");
2754
+ }
2755
+ const result = await ctx.services.oracle.generateWallet();
2756
+ return { output: result };
2757
+ }
2758
+ });
2759
+
2760
+ // src/core/lib/actionRegistry/actions/walletFund.ts
2761
+ registerAction({
2762
+ type: "qi/wallet.fund",
2763
+ can: "wallet/fund",
2764
+ sideEffect: true,
2765
+ defaultRequiresConfirmation: true,
2766
+ outputSchema: [
2767
+ { path: "transactionHash", displayName: "Transaction Hash", type: "string", description: "The funding transaction hash" }
2768
+ ],
2769
+ run: async (inputs, ctx) => {
2770
+ if (!ctx.services.oracle?.fundWallet) {
2771
+ throw new Error("oracle.fundWallet handler not available");
2772
+ }
2773
+ if (!inputs.address) throw new Error("address is required");
2774
+ const result = await ctx.services.oracle.fundWallet({
2775
+ address: inputs.address,
2776
+ amount: inputs.amount || 25e4
2777
+ });
2778
+ return { output: result };
2779
+ }
2780
+ });
2781
+
2782
+ // src/core/lib/actionRegistry/actions/walletGenerateAndFund.ts
2783
+ registerAction({
2784
+ type: "qi/wallet.generateAndFund",
2785
+ can: "wallet/generateAndFund",
2786
+ sideEffect: true,
2787
+ defaultRequiresConfirmation: false,
2788
+ outputSchema: [
2789
+ { path: "address", displayName: "Wallet Address", type: "string", description: "The generated IXO wallet address" },
2790
+ { path: "did", displayName: "DID", type: "string", description: "The DID derived from the wallet address" },
2791
+ { path: "pubKey", displayName: "Public Key", type: "string", description: "The secp256k1 public key (hex)" },
2792
+ { path: "mnemonic", displayName: "Mnemonic", type: "string", description: "The BIP39 mnemonic seed phrase" },
2793
+ { path: "transactionHash", displayName: "Transaction Hash", type: "string", description: "The funding transaction hash" }
2794
+ ],
2795
+ run: async (inputs, ctx) => {
2796
+ if (!ctx.services.oracle?.generateWallet) {
2797
+ throw new Error("oracle.generateWallet handler not available");
2798
+ }
2799
+ if (!ctx.services.oracle?.fundWallet) {
2800
+ throw new Error("oracle.fundWallet handler not available");
2801
+ }
2802
+ const walletResult = await ctx.services.oracle.generateWallet();
2803
+ if (!walletResult?.address) {
2804
+ throw new Error("generateWallet did not return an address");
2805
+ }
2806
+ const fundResult = await ctx.services.oracle.fundWallet({
2807
+ address: walletResult.address,
2808
+ amount: inputs.amount || 25e4
2809
+ });
2810
+ if (!fundResult?.transactionHash) {
2811
+ throw new Error("fundWallet did not return a transactionHash");
2812
+ }
2813
+ return {
2814
+ output: {
2815
+ address: walletResult.address,
2816
+ did: walletResult.did,
2817
+ pubKey: walletResult.pubKey,
2818
+ mnemonic: walletResult.mnemonic,
2819
+ transactionHash: fundResult.transactionHash
2820
+ }
2821
+ };
2822
+ }
2823
+ });
2824
+
2825
+ // src/core/lib/actionRegistry/actions/iidCreate.ts
2826
+ registerAction({
2827
+ type: "qi/iid.create",
2828
+ can: "iid/create",
2829
+ sideEffect: true,
2830
+ defaultRequiresConfirmation: false,
2831
+ outputSchema: [
2832
+ { path: "did", displayName: "DID", type: "string", description: "The IID document DID" },
2833
+ { path: "transactionHash", displayName: "Transaction Hash", type: "string", description: "The IID creation transaction hash" }
2834
+ ],
2835
+ run: async (inputs, ctx) => {
2836
+ if (!ctx.services.oracle?.createIidDocument) {
2837
+ throw new Error("oracle.createIidDocument handler not available");
2838
+ }
2839
+ if (!inputs.mnemonic) throw new Error("mnemonic is required");
2840
+ if (!inputs.did) throw new Error("did is required");
2841
+ if (!inputs.address) throw new Error("address is required");
2842
+ if (!inputs.pubKey) throw new Error("pubKey is required");
2843
+ const result = await ctx.services.oracle.createIidDocument({
2844
+ mnemonic: inputs.mnemonic,
2845
+ did: inputs.did,
2846
+ address: inputs.address,
2847
+ pubKey: inputs.pubKey
2848
+ });
2849
+ return { output: result };
2850
+ }
2851
+ });
2852
+
2853
+ // src/core/lib/actionRegistry/actions/matrixRegister.ts
2854
+ registerAction({
2855
+ type: "qi/matrix.register",
2856
+ can: "matrix/register",
2857
+ sideEffect: true,
2858
+ defaultRequiresConfirmation: false,
2859
+ outputSchema: [
2860
+ { path: "matrixUserId", displayName: "Matrix User ID", type: "string", description: "The Matrix user ID" },
2861
+ { path: "matrixAccessToken", displayName: "Matrix Access Token", type: "string", description: "The Matrix access token" },
2862
+ { path: "matrixRoomId", displayName: "Matrix Room ID", type: "string", description: "The Matrix room ID" },
2863
+ { path: "matrixDeviceId", displayName: "Matrix Device ID", type: "string", description: "The Matrix device ID" },
2864
+ { path: "matrixMnemonic", displayName: "Matrix Mnemonic", type: "string", description: "The Matrix account mnemonic" },
2865
+ { path: "matrixPassword", displayName: "Matrix Password", type: "string", description: "The Matrix account password" },
2866
+ { path: "matrixRecoveryPhrase", displayName: "Recovery Phrase", type: "string", description: "The Matrix recovery phrase" },
2867
+ { path: "matrixHomeServerUrl", displayName: "Matrix Homeserver", type: "string", description: "The Matrix homeserver URL" }
2868
+ ],
2869
+ run: async (inputs, ctx) => {
2870
+ if (!ctx.services.oracle?.registerMatrixAccount) {
2871
+ throw new Error("oracle.registerMatrixAccount handler not available");
2872
+ }
2873
+ if (!inputs.mnemonic) throw new Error("mnemonic is required");
2874
+ if (!inputs.address) throw new Error("address is required");
2875
+ if (!inputs.did) throw new Error("did is required");
2876
+ if (!inputs.pin) throw new Error("pin is required");
2877
+ if (!inputs.oracleName) throw new Error("oracleName is required");
2878
+ const result = await ctx.services.oracle.registerMatrixAccount({
2879
+ mnemonic: inputs.mnemonic,
2880
+ address: inputs.address,
2881
+ did: inputs.did,
2882
+ pin: inputs.pin,
2883
+ oracleName: inputs.oracleName,
2884
+ avatarUrl: inputs.avatarUrl
2885
+ });
2886
+ return { output: result };
2887
+ }
2888
+ });
2889
+
2890
+ // src/core/lib/actionRegistry/actions/identityCreate.ts
2891
+ registerAction({
2892
+ type: "qi/identity.create",
2893
+ can: "identity/create",
2894
+ sideEffect: true,
2895
+ defaultRequiresConfirmation: false,
2896
+ outputSchema: [
2897
+ { path: "did", displayName: "DID", type: "string", description: "The IID document DID" },
2898
+ { path: "transactionHash", displayName: "Transaction Hash", type: "string", description: "The IID creation transaction hash" },
2899
+ { path: "alreadyExisted", displayName: "Already Existed", type: "boolean", description: "Whether the IID document already existed" },
2900
+ { path: "matrixUserId", displayName: "Matrix User ID", type: "string", description: "The Matrix user ID" },
2901
+ { path: "matrixAccessToken", displayName: "Matrix Access Token", type: "string", description: "The Matrix access token" },
2902
+ { path: "matrixRoomId", displayName: "Matrix Room ID", type: "string", description: "The Matrix room ID" },
2903
+ { path: "matrixDeviceId", displayName: "Matrix Device ID", type: "string", description: "The Matrix device ID" },
2904
+ { path: "matrixMnemonic", displayName: "Matrix Mnemonic", type: "string", description: "The Matrix account mnemonic" },
2905
+ { path: "matrixPassword", displayName: "Matrix Password", type: "string", description: "The Matrix account password" },
2906
+ { path: "matrixRecoveryPhrase", displayName: "Recovery Phrase", type: "string", description: "The Matrix recovery phrase" },
2907
+ { path: "matrixHomeServerUrl", displayName: "Matrix Homeserver", type: "string", description: "The Matrix homeserver URL" }
2908
+ ],
2909
+ run: async (rawInputs, ctx) => {
2910
+ const form = (() => {
2911
+ const raw = rawInputs.formAnswers;
2912
+ if (typeof raw !== "string" || !raw) return {};
2913
+ try {
2914
+ const parsed = JSON.parse(raw);
2915
+ return parsed && typeof parsed === "object" ? parsed : {};
2916
+ } catch {
2917
+ return {};
2918
+ }
2919
+ })();
2920
+ const inputs = {
2921
+ // Rename: form.logoUrl → avatarUrl for the registerMatrixAccount handler
2922
+ avatarUrl: form.logoUrl,
2923
+ ...form,
2924
+ ...rawInputs
2925
+ };
2926
+ if (!ctx.services.oracle?.createIidDocument) {
2927
+ throw new Error("oracle.createIidDocument handler not available");
2928
+ }
2929
+ if (!ctx.services.oracle?.registerMatrixAccount) {
2930
+ throw new Error("oracle.registerMatrixAccount handler not available");
2931
+ }
2932
+ if (!inputs.mnemonic) throw new Error("mnemonic is required");
2933
+ if (!inputs.did) throw new Error("did is required");
2934
+ if (!inputs.address) throw new Error("address is required");
2935
+ if (!inputs.pubKey) throw new Error("pubKey is required");
2936
+ if (!inputs.pin) throw new Error("pin is required");
2937
+ if (!inputs.oracleName) throw new Error("oracleName is required");
2938
+ const iidResult = await ctx.services.oracle.createIidDocument({
2939
+ mnemonic: inputs.mnemonic,
2940
+ did: inputs.did,
2941
+ address: inputs.address,
2942
+ pubKey: inputs.pubKey
2943
+ });
2944
+ if (!iidResult?.transactionHash && !iidResult?.alreadyExisted) {
2945
+ throw new Error("IID creation returned success without a transaction hash or alreadyExisted flag");
2946
+ }
2947
+ const matrixResult = await ctx.services.oracle.registerMatrixAccount({
2948
+ mnemonic: inputs.mnemonic,
2949
+ address: inputs.address,
2950
+ did: inputs.did,
2951
+ pin: inputs.pin,
2952
+ oracleName: inputs.oracleName,
2953
+ avatarUrl: inputs.avatarUrl
2954
+ });
2955
+ if (!matrixResult?.matrixUserId) {
2956
+ throw new Error("Matrix registration returned success without a matrixUserId");
2957
+ }
2958
+ return {
2959
+ output: {
2960
+ did: iidResult.did || inputs.did,
2961
+ transactionHash: iidResult.transactionHash,
2962
+ alreadyExisted: iidResult.alreadyExisted || false,
2963
+ matrixUserId: matrixResult.matrixUserId,
2964
+ matrixAccessToken: matrixResult.matrixAccessToken,
2965
+ matrixRoomId: matrixResult.matrixRoomId,
2966
+ matrixDeviceId: matrixResult.matrixDeviceId,
2967
+ matrixMnemonic: matrixResult.matrixMnemonic,
2968
+ matrixPassword: matrixResult.matrixPassword,
2969
+ matrixRecoveryPhrase: matrixResult.matrixRecoveryPhrase,
2970
+ matrixHomeServerUrl: matrixResult.matrixHomeServerUrl
2971
+ }
2972
+ };
2973
+ }
2974
+ });
2975
+
2976
+ // src/core/lib/actionRegistry/actions/entityCreateOracle.ts
2977
+ registerAction({
2978
+ type: "qi/entity.createOracle",
2979
+ can: "entity/createOracle",
2980
+ sideEffect: true,
2981
+ defaultRequiresConfirmation: false,
2982
+ outputSchema: [
2983
+ { path: "entityDid", displayName: "Entity DID", type: "string", description: "The oracle entity DID" },
2984
+ { path: "transactionHash", displayName: "Transaction Hash", type: "string", description: "The entity creation transaction hash" },
2985
+ { path: "encryptionPublicKeyMultibase", displayName: "Encryption Public Key (multibase)", type: "string", description: "Multibase-encoded P-256 public key registered as a keyAgreement vm on the entity DID" },
2986
+ { path: "encryptionVerificationMethodId", displayName: "Encryption Verification Method ID", type: "string", description: "DID verification method id of the P-256 keyAgreement key" }
2987
+ ],
2988
+ run: async (rawInputs, ctx) => {
2989
+ const form = (() => {
2990
+ const raw = rawInputs.formAnswers;
2991
+ if (typeof raw !== "string" || !raw) return {};
2992
+ try {
2993
+ const parsed = JSON.parse(raw);
2994
+ return parsed && typeof parsed === "object" ? parsed : {};
2995
+ } catch {
2996
+ return {};
2997
+ }
2998
+ })();
2999
+ const inputs = { ...form, ...rawInputs };
3000
+ if (!ctx.services.oracle?.createOracleEntity) {
3001
+ throw new Error("oracle.createOracleEntity handler not available");
3002
+ }
3003
+ if (!inputs.mnemonic) throw new Error("mnemonic is required");
3004
+ if (!inputs.address) throw new Error("address is required");
3005
+ if (!inputs.did) throw new Error("did is required");
3006
+ if (!inputs.pubKey) throw new Error("pubKey is required");
3007
+ if (!inputs.pin) throw new Error("pin is required");
3008
+ if (!inputs.matrixAccessToken) throw new Error("matrixAccessToken is required");
3009
+ if (!inputs.matrixRoomId) throw new Error("matrixRoomId is required");
3010
+ if (!inputs.oracleName) throw new Error("oracleName is required");
3011
+ if (!inputs.apiUrl) throw new Error("apiUrl is required");
3012
+ if (!inputs.price) throw new Error("price is required");
3013
+ const result = await ctx.services.oracle.createOracleEntity({
3014
+ mnemonic: inputs.mnemonic,
3015
+ address: inputs.address,
3016
+ did: inputs.did,
3017
+ pubKey: inputs.pubKey,
3018
+ pin: inputs.pin,
3019
+ matrixAccessToken: inputs.matrixAccessToken,
3020
+ matrixRoomId: inputs.matrixRoomId,
3021
+ oracleName: inputs.oracleName,
3022
+ orgName: inputs.orgName,
3023
+ description: inputs.description,
3024
+ location: inputs.location,
3025
+ logoUrl: inputs.logoUrl,
3026
+ coverImageUrl: inputs.coverImageUrl,
3027
+ apiUrl: inputs.apiUrl,
3028
+ price: inputs.price,
3029
+ llmModel: inputs.llmModel,
3030
+ opening: inputs.opening,
3031
+ communicationStyle: inputs.communicationStyle,
3032
+ capabilities: inputs.capabilities,
3033
+ mcpConfig: inputs.mcpConfig,
3034
+ parentProtocol: inputs.parentProtocol
3035
+ });
3036
+ return { output: result };
3037
+ }
3038
+ });
3039
+
3040
+ // src/core/lib/actionRegistry/actions/sandboxProvision.ts
3041
+ registerAction({
3042
+ type: "qi/sandbox.provision",
3043
+ can: "sandbox/provision",
3044
+ sideEffect: true,
3045
+ defaultRequiresConfirmation: false,
3046
+ outputSchema: [
3047
+ { path: "sandboxUrl", displayName: "Sandbox URL", type: "string", description: "The provisioned sandbox URL" },
3048
+ { path: "status", displayName: "Status", type: "string", description: "Provisioning status" }
3049
+ ],
3050
+ run: async (inputs, ctx) => {
3051
+ if (!ctx.services.oracle?.provisionSandbox) {
3052
+ throw new Error("oracle.provisionSandbox handler not available");
3053
+ }
3054
+ if (!inputs.entityDid) throw new Error("entityDid is required");
3055
+ if (!inputs.matrixRoomId) throw new Error("matrixRoomId is required");
3056
+ const result = await ctx.services.oracle.provisionSandbox({
3057
+ entityDid: inputs.entityDid,
3058
+ matrixRoomId: inputs.matrixRoomId
3059
+ });
3060
+ return { output: result };
3061
+ }
3062
+ });
3063
+
3064
+ // src/core/lib/actionRegistry/actions/oracleContract.ts
3065
+ registerAction({
3066
+ type: "qi/oracle.contract",
3067
+ can: "oracle/contract",
3068
+ sideEffect: true,
3069
+ defaultRequiresConfirmation: false,
3070
+ outputSchema: [
3071
+ { path: "userOracleRoomId", displayName: "User\u2194Oracle Room ID", type: "string", description: "Matrix room id of the user\u2194oracle DM room" },
3072
+ { path: "userOracleRoomAlias", displayName: "User\u2194Oracle Room Alias", type: "string", description: "Matrix alias of the user\u2194oracle DM room" }
3073
+ ],
3074
+ run: async (inputs, ctx) => {
3075
+ if (!ctx.services.oracle?.contract) {
3076
+ throw new Error("oracle.contract handler not available");
3077
+ }
3078
+ if (!inputs.oracleEntityDid) throw new Error("oracleEntityDid is required (from entity.createOracle output)");
3079
+ const result = await ctx.services.oracle.contract({
3080
+ oracleEntityDid: inputs.oracleEntityDid
3081
+ });
3082
+ return { output: result };
3083
+ }
3084
+ });
3085
+
3086
+ // src/core/lib/actionRegistry/actions/oracleStoreSecrets.ts
3087
+ var SENSITIVE_PLAINTEXT_KEYS = [
3088
+ "SECP_MNEMONIC",
3089
+ "MATRIX_ORACLE_ADMIN_PASSWORD",
3090
+ "MATRIX_RECOVERY_PHRASE",
3091
+ "MATRIX_VALUE_PIN"
3092
+ ];
3093
+ registerAction({
3094
+ type: "qi/oracle.storeSecrets",
3095
+ can: "oracle/storeSecrets",
3096
+ sideEffect: true,
3097
+ defaultRequiresConfirmation: false,
3098
+ outputSchema: [
3099
+ { path: "storedSecrets", displayName: "Stored Secrets", type: "array", description: "List of secret names stored" },
3100
+ { path: "roomId", displayName: "Room ID", type: "string", description: "Matrix room where secrets are stored" }
3101
+ ],
3102
+ run: async (inputs, ctx) => {
3103
+ if (!ctx.services.oracle?.storeSecrets) {
3104
+ throw new Error("oracle.storeSecrets handler not available");
3105
+ }
3106
+ if (!inputs.matrixRoomId) throw new Error("matrixRoomId is required (from oracle.contract output)");
3107
+ if (!inputs.publicKeyMultibase) throw new Error("publicKeyMultibase is required (from entity.createOracle output)");
3108
+ if (!inputs.verificationMethodId) throw new Error("verificationMethodId is required (from entity.createOracle output)");
3109
+ if (!inputs.matrixHomeServerUrl) throw new Error("matrixHomeServerUrl is required (from matrix.register output)");
3110
+ if (!inputs.matrixUsername) throw new Error("matrixUsername is required (from matrix.register output matrixUserId)");
3111
+ if (!inputs.matrixPassword) throw new Error("matrixPassword is required (from matrix.register output)");
3112
+ if (!inputs.mnemonic) throw new Error("mnemonic is required (from wallet.generate output)");
3113
+ if (!inputs.matrixRecoveryPhrase) throw new Error("matrixRecoveryPhrase is required (from matrix.register output)");
3114
+ if (!inputs.pin) throw new Error("pin is required (from form output)");
3115
+ if (!inputs.openRouterApiKeyJwe) {
3116
+ throw new Error("OPEN_ROUTER_API_KEY is required \u2014 enter it in the form before submitting");
3117
+ }
3118
+ const secrets = {
3119
+ SECP_MNEMONIC: inputs.mnemonic,
3120
+ MATRIX_ORACLE_ADMIN_PASSWORD: inputs.matrixPassword,
3121
+ MATRIX_RECOVERY_PHRASE: inputs.matrixRecoveryPhrase,
3122
+ MATRIX_VALUE_PIN: inputs.pin
3123
+ };
3124
+ const preEncryptedSecrets = {
3125
+ OPEN_ROUTER_API_KEY: inputs.openRouterApiKeyJwe
3126
+ };
3127
+ if (inputs.mcpAuthSecrets) {
3128
+ try {
3129
+ const mcpSecrets = typeof inputs.mcpAuthSecrets === "string" ? JSON.parse(inputs.mcpAuthSecrets) : inputs.mcpAuthSecrets;
3130
+ if (mcpSecrets && typeof mcpSecrets === "object") {
3131
+ Object.assign(preEncryptedSecrets, mcpSecrets);
3132
+ }
3133
+ } catch {
3134
+ console.warn("[oracle.storeSecrets] Failed to parse mcpAuthSecrets");
3135
+ }
3136
+ }
3137
+ for (const k of SENSITIVE_PLAINTEXT_KEYS) {
3138
+ if (!secrets[k]) throw new Error(`${k} is empty after assembly \u2014 refusing to call storeSecrets`);
3139
+ }
3140
+ const result = await ctx.services.oracle.storeSecrets({
3141
+ matrixRoomId: inputs.matrixRoomId,
3142
+ publicKeyMultibase: inputs.publicKeyMultibase,
3143
+ verificationMethodId: inputs.verificationMethodId,
3144
+ matrixHomeServerUrl: inputs.matrixHomeServerUrl,
3145
+ matrixUsername: inputs.matrixUsername,
3146
+ matrixPassword: inputs.matrixPassword,
3147
+ secrets,
3148
+ preEncryptedSecrets
3149
+ });
3150
+ return { output: result };
3151
+ }
3152
+ });
3153
+
3154
+ // src/core/lib/actionRegistry/actions/oracleStoreConfig.ts
3155
+ registerAction({
3156
+ type: "qi/oracle.storeConfig",
3157
+ can: "oracle/storeConfig",
3158
+ sideEffect: true,
3159
+ defaultRequiresConfirmation: false,
3160
+ outputSchema: [
3161
+ { path: "configStored", displayName: "Config Stored", type: "boolean", description: "Whether the oracle config was stored successfully" },
3162
+ { path: "roomId", displayName: "Room ID", type: "string", description: "The Matrix room ID where config was stored" }
3163
+ ],
3164
+ run: async (inputs, ctx) => {
3165
+ if (!ctx.services.oracle?.storeConfig) {
3166
+ throw new Error("oracle.storeConfig handler not available");
3167
+ }
3168
+ if (!inputs.matrixRoomId) throw new Error("matrixRoomId is required (from oracle.contract output)");
3169
+ if (!inputs.oracleName) throw new Error("oracleName is required");
3170
+ if (!inputs.entityDid) throw new Error("entityDid is required");
3171
+ const result = await ctx.services.oracle.storeConfig({
3172
+ matrixRoomId: inputs.matrixRoomId,
3173
+ config: {
3174
+ oracleName: inputs.oracleName,
3175
+ orgName: inputs.orgName || "",
3176
+ description: inputs.description || "",
3177
+ location: inputs.location || "",
3178
+ price: inputs.price ?? 0,
3179
+ apiUrl: inputs.apiUrl || "",
3180
+ entityDid: inputs.entityDid,
3181
+ logoUrl: inputs.logoUrl || "",
3182
+ llmModel: inputs.llmModel || "",
3183
+ opening: inputs.opening,
3184
+ communicationStyle: inputs.communicationStyle,
3185
+ capabilities: inputs.capabilities,
3186
+ skills: inputs.skills,
3187
+ mcpServers: inputs.mcpServers,
3188
+ matrixUserId: inputs.matrixUserId || "",
3189
+ matrixAccountRoomId: inputs.matrixAccountRoomId || "",
3190
+ oracleAddress: inputs.oracleAddress || "",
3191
+ oracleDid: inputs.oracleDid || ""
3192
+ }
3193
+ });
3194
+ return { output: result };
3195
+ }
3196
+ });
3197
+
3198
+ // src/core/lib/actionRegistry/actions/oracleStoreSecretsAndConfig.ts
3199
+ var SENSITIVE_PLAINTEXT_KEYS2 = [
3200
+ "SECP_MNEMONIC",
3201
+ "MATRIX_ORACLE_ADMIN_PASSWORD",
3202
+ "MATRIX_RECOVERY_PHRASE",
3203
+ "MATRIX_VALUE_PIN"
3204
+ ];
3205
+ registerAction({
3206
+ type: "qi/oracle.storeSecretsAndConfig",
3207
+ can: "oracle/storeSecretsAndConfig",
3208
+ sideEffect: true,
3209
+ defaultRequiresConfirmation: false,
3210
+ outputSchema: [
3211
+ { path: "storedSecrets", displayName: "Stored Secrets", type: "array", description: "List of secret names stored" },
3212
+ { path: "roomId", displayName: "Room ID", type: "string", description: "Matrix room where data is stored" },
3213
+ { path: "configStored", displayName: "Config Stored", type: "boolean", description: "Whether oracle config was stored" }
3214
+ ],
3215
+ run: async (inputs, ctx) => {
3216
+ if (!ctx.services.oracle?.storeSecrets) throw new Error("oracle.storeSecrets handler not available");
3217
+ if (!ctx.services.oracle?.storeConfig) throw new Error("oracle.storeConfig handler not available");
3218
+ if (!inputs.matrixRoomId) throw new Error("matrixRoomId is required (from oracle.contract output)");
3219
+ if (!inputs.publicKeyMultibase) throw new Error("publicKeyMultibase is required (from entity.createOracle output)");
3220
+ if (!inputs.verificationMethodId) throw new Error("verificationMethodId is required (from entity.createOracle output)");
3221
+ if (!inputs.matrixHomeServerUrl) throw new Error("matrixHomeServerUrl is required (from matrix.register output)");
3222
+ if (!inputs.matrixUsername) throw new Error("matrixUsername is required (from matrix.register output matrixUserId)");
3223
+ if (!inputs.matrixPassword) throw new Error("matrixPassword is required (from matrix.register output)");
3224
+ if (!inputs.mnemonic) throw new Error("mnemonic is required (from wallet.generate output)");
3225
+ if (!inputs.matrixRecoveryPhrase) throw new Error("matrixRecoveryPhrase is required (from matrix.register output)");
3226
+ if (!inputs.pin) throw new Error("pin is required (from form output)");
3227
+ if (!inputs.openRouterApiKeyJwe) {
3228
+ throw new Error("OPEN_ROUTER_API_KEY is required \u2014 enter it in the form before submitting");
3229
+ }
3230
+ const secrets = {
3231
+ SECP_MNEMONIC: inputs.mnemonic,
3232
+ MATRIX_ORACLE_ADMIN_PASSWORD: inputs.matrixPassword,
3233
+ MATRIX_RECOVERY_PHRASE: inputs.matrixRecoveryPhrase,
3234
+ MATRIX_VALUE_PIN: inputs.pin
3235
+ };
3236
+ const preEncryptedSecrets = {
3237
+ OPEN_ROUTER_API_KEY: inputs.openRouterApiKeyJwe
3238
+ };
3239
+ if (inputs.mcpAuthSecrets) {
3240
+ try {
3241
+ const mcpSecrets = typeof inputs.mcpAuthSecrets === "string" ? JSON.parse(inputs.mcpAuthSecrets) : inputs.mcpAuthSecrets;
3242
+ if (mcpSecrets && typeof mcpSecrets === "object") {
3243
+ Object.assign(preEncryptedSecrets, mcpSecrets);
3244
+ }
3245
+ } catch {
3246
+ console.warn("[oracle.storeSecretsAndConfig] Failed to parse mcpAuthSecrets");
3247
+ }
3248
+ }
3249
+ for (const k of SENSITIVE_PLAINTEXT_KEYS2) {
3250
+ if (!secrets[k]) throw new Error(`${k} is empty after assembly \u2014 refusing to call storeSecrets`);
3251
+ }
3252
+ console.log("[oracle.storeSecretsAndConfig] Phase 1: storing secrets");
3253
+ const secretsResult = await ctx.services.oracle.storeSecrets({
3254
+ matrixRoomId: inputs.matrixRoomId,
3255
+ publicKeyMultibase: inputs.publicKeyMultibase,
3256
+ verificationMethodId: inputs.verificationMethodId,
3257
+ matrixHomeServerUrl: inputs.matrixHomeServerUrl,
3258
+ matrixUsername: inputs.matrixUsername,
3259
+ matrixPassword: inputs.matrixPassword,
3260
+ secrets,
3261
+ preEncryptedSecrets
3262
+ });
3263
+ if (!secretsResult.storedSecrets || secretsResult.storedSecrets.length === 0) {
3264
+ throw new Error("storeSecrets returned success without any storedSecrets");
3265
+ }
3266
+ if (!inputs.oracleName) throw new Error("oracleName is required");
3267
+ if (!inputs.entityDid) throw new Error("entityDid is required");
3268
+ console.log("[oracle.storeSecretsAndConfig] Phase 2: storing config");
3269
+ const configResult = await ctx.services.oracle.storeConfig({
3270
+ matrixRoomId: inputs.matrixRoomId,
3271
+ config: {
3272
+ oracleName: inputs.oracleName,
3273
+ orgName: inputs.orgName || "",
3274
+ description: inputs.description || "",
3275
+ location: inputs.location || "",
3276
+ price: inputs.price ?? 0,
3277
+ apiUrl: inputs.apiUrl || "",
3278
+ entityDid: inputs.entityDid,
3279
+ logoUrl: inputs.logoUrl || "",
3280
+ llmModel: inputs.llmModel || "",
3281
+ opening: inputs.opening,
3282
+ communicationStyle: inputs.communicationStyle,
3283
+ capabilities: inputs.capabilities,
3284
+ skills: inputs.skills,
3285
+ mcpServers: inputs.mcpServers,
3286
+ matrixUserId: inputs.matrixUserId || "",
3287
+ matrixAccountRoomId: inputs.matrixAccountRoomId || "",
3288
+ oracleAddress: inputs.oracleAddress || "",
3289
+ oracleDid: inputs.oracleDid || ""
3290
+ }
3291
+ });
3292
+ if (!configResult.configStored) {
3293
+ throw new Error("storeConfig returned success without configStored=true");
3294
+ }
3295
+ console.log("[oracle.storeSecretsAndConfig] Both phases complete");
3296
+ return {
3297
+ output: {
3298
+ storedSecrets: secretsResult.storedSecrets,
3299
+ roomId: secretsResult.roomId,
3300
+ configStored: configResult.configStored
3301
+ }
3302
+ };
3303
+ }
3304
+ });
3305
+
3306
+ // src/core/lib/actionRegistry/actions/oracleConfigureOracle.ts
3307
+ var SENSITIVE_PLAINTEXT_KEYS3 = [
3308
+ "SECP_MNEMONIC",
3309
+ "MATRIX_ORACLE_ADMIN_PASSWORD",
3310
+ "MATRIX_RECOVERY_PHRASE",
3311
+ "MATRIX_VALUE_PIN"
3312
+ ];
3313
+ registerAction({
3314
+ type: "qi/oracle.configureOracle",
3315
+ can: "oracle/configureOracle",
3316
+ sideEffect: true,
3317
+ defaultRequiresConfirmation: false,
3318
+ outputSchema: [
3319
+ { path: "userOracleRoomId", displayName: "User-Oracle Room ID", type: "string", description: "Matrix room id from contract phase" },
3320
+ { path: "userOracleRoomAlias", displayName: "User-Oracle Room Alias", type: "string", description: "Matrix alias from contract phase" },
3321
+ { path: "storedSecrets", displayName: "Stored Secrets", type: "array", description: "List of secret names stored" },
3322
+ { path: "roomId", displayName: "Room ID", type: "string", description: "Matrix room where data is stored" },
3323
+ { path: "configStored", displayName: "Config Stored", type: "boolean", description: "Whether oracle config was stored" },
3324
+ { path: "freshAccessToken", displayName: "Fresh Access Token", type: "string", description: "Fresh Matrix access token from mxLogin during secret storage" },
3325
+ { path: "openRouterApiKeyPlaintext", displayName: "OpenRouter API Key", type: "string", description: "Plaintext OpenRouter API key for deploy" }
3326
+ ],
3327
+ run: async (rawInputs, ctx) => {
3328
+ const form = (() => {
3329
+ const raw = rawInputs.formAnswers;
3330
+ if (typeof raw !== "string" || !raw) return {};
3331
+ try {
3332
+ const parsed = JSON.parse(raw);
3333
+ return parsed && typeof parsed === "object" ? parsed : {};
3334
+ } catch {
3335
+ return {};
3336
+ }
3337
+ })();
3338
+ const inputs = { ...form, ...rawInputs };
3339
+ if (!ctx.services.oracle?.contract) throw new Error("oracle.contract handler not available");
3340
+ if (!ctx.services.oracle?.storeSecrets) throw new Error("oracle.storeSecrets handler not available");
3341
+ if (!ctx.services.oracle?.storeConfig) throw new Error("oracle.storeConfig handler not available");
3342
+ if (!inputs.oracleEntityDid) throw new Error("oracleEntityDid is required (from entity.createOracle output)");
3343
+ if (!inputs.publicKeyMultibase) throw new Error("publicKeyMultibase is required (from entity.createOracle output)");
3344
+ if (!inputs.verificationMethodId) throw new Error("verificationMethodId is required (from entity.createOracle output)");
3345
+ if (!inputs.matrixHomeServerUrl) throw new Error("matrixHomeServerUrl is required (from matrix.register output)");
3346
+ if (!inputs.matrixUsername) throw new Error("matrixUsername is required (from matrix.register output matrixUserId)");
3347
+ if (!inputs.matrixPassword) throw new Error("matrixPassword is required (from matrix.register output)");
3348
+ if (!inputs.mnemonic) throw new Error("mnemonic is required (from wallet.generate output)");
3349
+ if (!inputs.matrixRecoveryPhrase) throw new Error("matrixRecoveryPhrase is required (from matrix.register output)");
3350
+ if (!inputs.pin) throw new Error("pin is required (from form output)");
3351
+ if (!inputs.openRouterApiKeyJwe) {
3352
+ throw new Error("OPEN_ROUTER_API_KEY is required \u2014 enter it in the form before submitting");
3353
+ }
3354
+ if (!inputs.oracleName) throw new Error("oracleName is required");
3355
+ if (!inputs.entityDid) throw new Error("entityDid is required");
3356
+ console.log("[oracle.configureOracle] Phase 1: contracting oracle");
3357
+ const contractResult = await ctx.services.oracle.contract({
3358
+ oracleEntityDid: inputs.oracleEntityDid
3359
+ });
3360
+ if (!contractResult.userOracleRoomId) {
3361
+ throw new Error("contract returned success without userOracleRoomId");
3362
+ }
3363
+ const matrixRoomId = contractResult.userOracleRoomId;
3364
+ const secrets = {
3365
+ SECP_MNEMONIC: inputs.mnemonic,
3366
+ MATRIX_ORACLE_ADMIN_PASSWORD: inputs.matrixPassword,
3367
+ MATRIX_RECOVERY_PHRASE: inputs.matrixRecoveryPhrase,
3368
+ MATRIX_VALUE_PIN: inputs.pin
3369
+ };
3370
+ const preEncryptedSecrets = {
3371
+ OPEN_ROUTER_API_KEY: inputs.openRouterApiKeyJwe
3372
+ };
3373
+ if (inputs.mcpAuthSecrets) {
3374
+ try {
3375
+ const mcpSecrets = typeof inputs.mcpAuthSecrets === "string" ? JSON.parse(inputs.mcpAuthSecrets) : inputs.mcpAuthSecrets;
3376
+ if (mcpSecrets && typeof mcpSecrets === "object") {
3377
+ Object.assign(preEncryptedSecrets, mcpSecrets);
3378
+ }
3379
+ } catch {
3380
+ console.warn("[oracle.configureOracle] Failed to parse mcpAuthSecrets");
3381
+ }
3382
+ }
3383
+ for (const k of SENSITIVE_PLAINTEXT_KEYS3) {
3384
+ if (!secrets[k]) throw new Error(`${k} is empty after assembly \u2014 refusing to call storeSecrets`);
3385
+ }
3386
+ console.log("[oracle.configureOracle] Phase 2: storing secrets");
3387
+ const secretsResult = await ctx.services.oracle.storeSecrets({
3388
+ matrixRoomId,
3389
+ publicKeyMultibase: inputs.publicKeyMultibase,
3390
+ verificationMethodId: inputs.verificationMethodId,
3391
+ matrixHomeServerUrl: inputs.matrixHomeServerUrl,
3392
+ matrixUsername: inputs.matrixUsername,
3393
+ matrixPassword: inputs.matrixPassword,
3394
+ secrets,
3395
+ preEncryptedSecrets
3396
+ });
3397
+ if (!secretsResult.storedSecrets || secretsResult.storedSecrets.length === 0) {
3398
+ throw new Error("storeSecrets returned success without any storedSecrets");
3399
+ }
3400
+ console.log("[oracle.configureOracle] Phase 3: storing config");
3401
+ const configResult = await ctx.services.oracle.storeConfig({
3402
+ matrixRoomId,
3403
+ config: {
3404
+ oracleName: inputs.oracleName,
3405
+ orgName: inputs.orgName || "",
3406
+ description: inputs.description || "",
3407
+ location: inputs.location || "",
3408
+ price: inputs.price ?? 0,
3409
+ apiUrl: inputs.apiUrl || "",
3410
+ entityDid: inputs.entityDid,
3411
+ logoUrl: inputs.logoUrl || "",
3412
+ llmModel: inputs.llmModel || "",
3413
+ opening: inputs.opening,
3414
+ communicationStyle: inputs.communicationStyle,
3415
+ capabilities: inputs.capabilities,
3416
+ skills: inputs.skills,
3417
+ mcpServers: inputs.mcpServers,
3418
+ matrixUserId: inputs.matrixUserId || "",
3419
+ matrixAccountRoomId: inputs.matrixAccountRoomId || "",
3420
+ oracleAddress: inputs.oracleAddress || "",
3421
+ oracleDid: inputs.oracleDid || ""
3422
+ }
3423
+ });
3424
+ if (!configResult.configStored) {
3425
+ throw new Error("storeConfig returned success without configStored=true");
3426
+ }
3427
+ console.log("[oracle.configureOracle] All 3 phases complete");
3428
+ return {
3429
+ output: {
3430
+ userOracleRoomId: contractResult.userOracleRoomId,
3431
+ userOracleRoomAlias: contractResult.userOracleRoomAlias,
3432
+ storedSecrets: secretsResult.storedSecrets,
3433
+ roomId: secretsResult.roomId,
3434
+ configStored: configResult.configStored,
3435
+ freshAccessToken: secretsResult.freshAccessToken || "",
3436
+ openRouterApiKeyPlaintext: inputs.openRouterApiKeyPlaintext || ""
3437
+ }
3438
+ };
3439
+ }
3440
+ });
3441
+
3442
+ // src/core/lib/actionRegistry/actions/oracleDeploySetup.ts
3443
+ registerAction({
3444
+ type: "qi/oracle.deploySetup",
3445
+ can: "oracle/deploySetup",
3446
+ sideEffect: true,
3447
+ defaultRequiresConfirmation: false,
3448
+ outputSchema: [
3449
+ { path: "setupComplete", displayName: "Setup Complete", type: "boolean", description: "Whether the oracle setup completed successfully" },
3450
+ { path: "stdout", displayName: "Build Output", type: "string", description: "Build stdout output" }
3451
+ ],
3452
+ run: async (inputs, ctx) => {
3453
+ if (!ctx.services.oracle?.deploySetup) {
3454
+ throw new Error("oracle.deploySetup handler not available");
3455
+ }
3456
+ if (!inputs.name) throw new Error("name is required (project name from form)");
3457
+ const config = typeof inputs.config === "string" ? JSON.parse(inputs.config) : inputs.config;
3458
+ if (!config || typeof config !== "object") throw new Error("config is required (oracle config object)");
3459
+ if (!inputs.roomId) throw new Error("roomId is required (from oracle contract/configure output)");
3460
+ const result = await ctx.services.oracle.deploySetup({ name: inputs.name, config, roomId: inputs.roomId });
3461
+ return { output: result };
3462
+ }
3463
+ });
3464
+
3465
+ // src/core/lib/actionRegistry/actions/oracleDeployStart.ts
3466
+ registerAction({
3467
+ type: "qi/oracle.deployStart",
3468
+ can: "oracle/deployStart",
3469
+ sideEffect: true,
3470
+ defaultRequiresConfirmation: false,
3471
+ outputSchema: [
3472
+ { path: "processId", displayName: "Process ID", type: "string", description: "Running process identifier" },
3473
+ { path: "status", displayName: "Status", type: "string", description: "Oracle process status" }
3474
+ ],
3475
+ run: async (inputs, ctx) => {
3476
+ if (!ctx.services.oracle?.deployStart) {
3477
+ throw new Error("oracle.deployStart handler not available");
3478
+ }
3479
+ if (!inputs.name) throw new Error("name is required (project name from form)");
3480
+ if (!inputs.entityDid) throw new Error("entityDid is required (from entity.createOracle output)");
3481
+ if (!inputs.roomId) throw new Error("roomId is required (from oracle contract/configure output)");
3482
+ const result = await ctx.services.oracle.deployStart({ name: inputs.name, entityDid: inputs.entityDid, roomId: inputs.roomId });
3483
+ return { output: result };
3484
+ }
3485
+ });
3486
+
3487
+ // src/core/lib/actionRegistry/actions/oracleDeploy.ts
3488
+ registerAction({
3489
+ type: "qi/oracle.deploy",
3490
+ can: "oracle/deploy",
3491
+ sideEffect: true,
3492
+ defaultRequiresConfirmation: false,
3493
+ outputSchema: [
3494
+ { path: "setupComplete", displayName: "Setup Complete", type: "boolean", description: "Whether the oracle setup completed successfully" },
3495
+ { path: "processId", displayName: "Process ID", type: "string", description: "Running process identifier" },
3496
+ { path: "status", displayName: "Status", type: "string", description: "Oracle process status" },
3497
+ { path: "deploymentUrl", displayName: "Deployment URL", type: "string", description: "The URL where the oracle was deployed" },
3498
+ { path: "domainUpdateTxHash", displayName: "Domain Update Tx", type: "string", description: "Transaction hash of the on-chain domain update" }
3499
+ ],
3500
+ run: async (rawInputs, ctx) => {
3501
+ const form = (() => {
3502
+ const raw = rawInputs.formAnswers;
3503
+ if (typeof raw !== "string" || !raw) return {};
3504
+ try {
3505
+ const parsed = JSON.parse(raw);
3506
+ return parsed && typeof parsed === "object" ? parsed : {};
3507
+ } catch {
3508
+ return {};
3509
+ }
3510
+ })();
3511
+ const inputs = {
3512
+ // Rename: form.projectName → name for deploy handler
3513
+ name: form.projectName,
3514
+ ...form,
3515
+ ...rawInputs
3516
+ };
3517
+ if (!ctx.services.oracle?.deploySetup) {
3518
+ throw new Error("oracle.deploySetup handler not available");
3519
+ }
3520
+ if (!ctx.services.oracle?.deployStart) {
3521
+ throw new Error("oracle.deployStart handler not available");
3522
+ }
3523
+ if (!inputs.name) throw new Error("name is required (project name from form)");
3524
+ if (!inputs.entityDid) throw new Error("entityDid is required (from entity.createOracle output)");
3525
+ if (!inputs.roomId) throw new Error("roomId is required (from oracle.configureOracle output)");
3526
+ const config = {
3527
+ oracleName: inputs.oracleName,
3528
+ orgName: inputs.orgName,
3529
+ description: inputs.description,
3530
+ location: inputs.location,
3531
+ price: inputs.price,
3532
+ apiUrl: inputs.apiUrl,
3533
+ logoUrl: inputs.logoUrl,
3534
+ llmModel: inputs.llmModel,
3535
+ opening: inputs.opening,
3536
+ communicationStyle: inputs.communicationStyle,
3537
+ capabilities: inputs.capabilities,
3538
+ skills: inputs.skills,
3539
+ mcpServers: inputs.mcpServers,
3540
+ entityDid: inputs.entityDid
3541
+ };
3542
+ const secrets = {
3543
+ mnemonic: inputs.mnemonic,
3544
+ matrixPassword: inputs.matrixPassword,
3545
+ matrixRecoveryPhrase: inputs.matrixRecoveryPhrase,
3546
+ pin: inputs.pin,
3547
+ matrixUsername: inputs.matrixUsername,
3548
+ matrixAccountRoomId: inputs.matrixAccountRoomId,
3549
+ freshAccessToken: inputs.freshAccessToken,
3550
+ openRouterApiKey: inputs.openRouterApiKey
3551
+ };
3552
+ const setupResult = await ctx.services.oracle.deploySetup({ name: inputs.name, config, roomId: inputs.roomId, secrets });
3553
+ if (!setupResult.setupComplete) {
3554
+ throw new Error(`Deploy setup failed: ${setupResult.stderr || "setupComplete was not true"}`);
3555
+ }
3556
+ const startResult = await ctx.services.oracle.deployStart({ name: inputs.name, entityDid: inputs.entityDid, roomId: inputs.roomId, secrets });
3557
+ if (!startResult.processId && startResult.status !== "running") {
3558
+ throw new Error("Deploy start failed: no processId returned and status is not running");
3559
+ }
3560
+ let deploymentUrl;
3561
+ let domainUpdateTxHash;
3562
+ if (startResult.url) {
3563
+ if (!ctx.services.oracle?.updateOracleDomain) {
3564
+ console.warn("[oracle.deploy] updateOracleDomain handler not available, skipping domain update");
3565
+ } else {
3566
+ const domainResult = await ctx.services.oracle.updateOracleDomain({
3567
+ entityDid: inputs.entityDid,
3568
+ newApiUrl: startResult.url
3569
+ });
3570
+ deploymentUrl = startResult.url;
3571
+ domainUpdateTxHash = domainResult.transactionHash;
3572
+ }
3573
+ }
3574
+ return {
3575
+ output: {
3576
+ setupComplete: setupResult.setupComplete,
3577
+ processId: startResult.processId,
3578
+ status: startResult.status,
3579
+ deploymentUrl,
3580
+ domainUpdateTxHash
3581
+ }
3582
+ };
3583
+ }
3584
+ });
3585
+
2705
3586
  // src/core/lib/actionRegistry/actions/bid/bid.diff.ts
2706
3587
  registerDiffResolver("bid", {
2707
3588
  resolver: async (inputs, _ctx) => {
@@ -2984,6 +3865,40 @@ registerDiffResolver("evaluateClaim", {
2984
3865
  }
2985
3866
  });
2986
3867
 
3868
+ // src/core/lib/actionRegistry/actions/walletFund.diff.ts
3869
+ registerDiffResolver("qi/wallet.fund", {
3870
+ resolver: async (inputs, _ctx) => {
3871
+ const address = String(inputs.address || "").trim();
3872
+ const amount = String(inputs.amount || "250000").trim();
3873
+ const network = String(inputs.network || "devnet").trim();
3874
+ const ixoAmount = (Number(amount) / 1e6).toFixed(6);
3875
+ return [
3876
+ {
3877
+ key: "recipient",
3878
+ label: "Recipient",
3879
+ before: "N/A",
3880
+ after: address || "Pending wallet generation",
3881
+ changeType: address ? "replace" : "unchanged"
3882
+ },
3883
+ {
3884
+ key: "amount",
3885
+ label: "Amount",
3886
+ before: "0 IXO",
3887
+ after: `${ixoAmount} IXO (${amount} uixo)`,
3888
+ changeType: "replace",
3889
+ severity: "info"
3890
+ },
3891
+ {
3892
+ key: "network",
3893
+ label: "Network",
3894
+ before: network,
3895
+ after: network,
3896
+ changeType: "unchanged"
3897
+ }
3898
+ ];
3899
+ }
3900
+ });
3901
+
2987
3902
  // src/core/services/ucanService.ts
2988
3903
  import {
2989
3904
  createDelegation as ucanCreateDelegation,
@@ -5487,4 +6402,4 @@ export {
5487
6402
  readFlow,
5488
6403
  setupFlowFromBaseUcan
5489
6404
  };
5490
- //# sourceMappingURL=chunk-YA5P7BXL.mjs.map
6405
+ //# sourceMappingURL=chunk-75MWYZJ2.mjs.map