@astrasyncai/verification-gateway 5.9.0 → 5.11.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.
- package/dist/adapters/express.js +19 -1
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +19 -1
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.js +19 -1
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +19 -1
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.js +19 -1
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +19 -1
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.js +19 -1
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +19 -1
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +540 -10
- package/dist/bin/astrasync-codex-hook.js +540 -10
- package/dist/bin/astrasync-guard.js +629 -65
- package/dist/bin/astrasync.js +673 -66
- package/dist/browser/background.js +19 -1
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +19 -1
- package/dist/browser/background.mjs.map +1 -1
- package/dist/cli/index.d.mts +8 -8
- package/dist/cli/index.d.ts +8 -8
- package/dist/cli/index.js +22 -64
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +22 -64
- package/dist/cli/index.mjs.map +1 -1
- package/dist/codex/index.d.mts +5 -0
- package/dist/codex/index.d.ts +5 -0
- package/dist/codex/index.js +556 -18
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +558 -20
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.d.mts +9 -2
- package/dist/cursor/extension.d.ts +9 -2
- package/dist/cursor/extension.js +522 -5
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +524 -5
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.js +1 -1
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +1 -1
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.js +20 -2
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +20 -2
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/enrolment-store-8DyaIOLe.d.mts +26 -0
- package/dist/enrolment-store-8DyaIOLe.d.ts +26 -0
- package/dist/gateway/gateway.js +19 -1
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +19 -1
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/index.d.mts +100 -3
- package/dist/index.d.ts +100 -3
- package/dist/index.js +3289 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3287 -18
- package/dist/index.mjs.map +1 -1
- package/dist/registration/index.js +1 -1
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +1 -1
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +1 -1
- package/dist/transport/index.mjs.map +1 -1
- package/dist/verify.js +19 -1
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +19 -1
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.d.mts
CHANGED
|
@@ -97,9 +97,14 @@ declare function inferFromGitignore(content: string): string[];
|
|
|
97
97
|
* 1. Validate existing setup and check for prior upgrade
|
|
98
98
|
* 2. Open browser for KYD registration
|
|
99
99
|
* 3. Validate API key before proceeding
|
|
100
|
-
* 4.
|
|
101
|
-
* 5.
|
|
102
|
-
*
|
|
100
|
+
* 4. Link the ASTRA- agent this guard acts as (registered in the dashboard)
|
|
101
|
+
* 5. Choose mode (online or hybrid) and switch gateway
|
|
102
|
+
*
|
|
103
|
+
* 5.11.0: the old step 4 POSTed the local policy to
|
|
104
|
+
* /api/v1/agents/policies/upload — a route the platform never had, so every
|
|
105
|
+
* upgrade failed there. A developer's local policy no longer becomes cloud
|
|
106
|
+
* policy (organisation policy is central — see fleet mode); the agent's own
|
|
107
|
+
* PDLSS is declared when it is registered.
|
|
103
108
|
*
|
|
104
109
|
* Also supports event-triggered upgrade prompts when counterparties
|
|
105
110
|
* reject unverified agents.
|
|
@@ -175,11 +180,6 @@ declare class UpgradeFlow {
|
|
|
175
180
|
* Validate the API key by calling the platform.
|
|
176
181
|
*/
|
|
177
182
|
private validateApiKey;
|
|
178
|
-
/**
|
|
179
|
-
* Upload local policy to the AstraSync cloud.
|
|
180
|
-
* YAML -> cloud PDLSS boundary, 1:1 mapping, no lossy transformation.
|
|
181
|
-
*/
|
|
182
|
-
private uploadPolicy;
|
|
183
183
|
/**
|
|
184
184
|
* Write the config file for the chosen mode.
|
|
185
185
|
*/
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -97,9 +97,14 @@ declare function inferFromGitignore(content: string): string[];
|
|
|
97
97
|
* 1. Validate existing setup and check for prior upgrade
|
|
98
98
|
* 2. Open browser for KYD registration
|
|
99
99
|
* 3. Validate API key before proceeding
|
|
100
|
-
* 4.
|
|
101
|
-
* 5.
|
|
102
|
-
*
|
|
100
|
+
* 4. Link the ASTRA- agent this guard acts as (registered in the dashboard)
|
|
101
|
+
* 5. Choose mode (online or hybrid) and switch gateway
|
|
102
|
+
*
|
|
103
|
+
* 5.11.0: the old step 4 POSTed the local policy to
|
|
104
|
+
* /api/v1/agents/policies/upload — a route the platform never had, so every
|
|
105
|
+
* upgrade failed there. A developer's local policy no longer becomes cloud
|
|
106
|
+
* policy (organisation policy is central — see fleet mode); the agent's own
|
|
107
|
+
* PDLSS is declared when it is registered.
|
|
103
108
|
*
|
|
104
109
|
* Also supports event-triggered upgrade prompts when counterparties
|
|
105
110
|
* reject unverified agents.
|
|
@@ -175,11 +180,6 @@ declare class UpgradeFlow {
|
|
|
175
180
|
* Validate the API key by calling the platform.
|
|
176
181
|
*/
|
|
177
182
|
private validateApiKey;
|
|
178
|
-
/**
|
|
179
|
-
* Upload local policy to the AstraSync cloud.
|
|
180
|
-
* YAML -> cloud PDLSS boundary, 1:1 mapping, no lossy transformation.
|
|
181
|
-
*/
|
|
182
|
-
private uploadPolicy;
|
|
183
183
|
/**
|
|
184
184
|
* Write the config file for the chosen mode.
|
|
185
185
|
*/
|
package/dist/cli/index.js
CHANGED
|
@@ -3734,7 +3734,7 @@ function inferFromGitignore(content) {
|
|
|
3734
3734
|
}
|
|
3735
3735
|
|
|
3736
3736
|
// src/version.ts
|
|
3737
|
-
var SDK_VERSION = "5.
|
|
3737
|
+
var SDK_VERSION = "5.11.0";
|
|
3738
3738
|
|
|
3739
3739
|
// src/http.ts
|
|
3740
3740
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -3814,27 +3814,23 @@ var UpgradeFlow = class {
|
|
|
3814
3814
|
*/
|
|
3815
3815
|
async continueUpgrade(apiKey, kydId) {
|
|
3816
3816
|
const { print, prompt } = this.callbacks;
|
|
3817
|
-
print("\n[3/5]
|
|
3818
|
-
print(
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
]
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
return uploadResult;
|
|
3835
|
-
}
|
|
3836
|
-
print(" Policy uploaded. Same rules, now with trust scoring and audit.");
|
|
3837
|
-
print(` Agent registered: ${uploadResult.agentId}`);
|
|
3817
|
+
print("\n[3/5] Link your agent");
|
|
3818
|
+
print(
|
|
3819
|
+
` Local policy ${this.config.policyPath} stays on this machine (${this.config.policy.purposes.length} purpose rules).`
|
|
3820
|
+
);
|
|
3821
|
+
print(" Register the agent in the AstraSync dashboard (or with `astrasync register`) and");
|
|
3822
|
+
print(" paste its ASTRA- id so synced decisions are attributed to it.\n");
|
|
3823
|
+
const agentInput = (await prompt(" Agent ASTRA- id (Enter to skip): ")).trim();
|
|
3824
|
+
let agentId;
|
|
3825
|
+
if (agentInput) {
|
|
3826
|
+
if (!/^ASTRA-[A-Za-z0-9_-]+$/.test(agentInput)) {
|
|
3827
|
+
return { success: false, error: `Not an ASTRA- agent id: ${agentInput}` };
|
|
3828
|
+
}
|
|
3829
|
+
agentId = agentInput;
|
|
3830
|
+
print(` Agent: ${agentId}`);
|
|
3831
|
+
} else {
|
|
3832
|
+
print(" No agent linked \u2014 decisions sync under your API key only.");
|
|
3833
|
+
}
|
|
3838
3834
|
if (kydId) {
|
|
3839
3835
|
print(` Developer: ${kydId}`);
|
|
3840
3836
|
}
|
|
@@ -3845,23 +3841,23 @@ var UpgradeFlow = class {
|
|
|
3845
3841
|
const mode = modeInput.trim().toLowerCase() === "online" ? "online" : "hybrid";
|
|
3846
3842
|
print(`
|
|
3847
3843
|
[5/5] Activating ${mode} verification`);
|
|
3848
|
-
await this.writeLocalConfig(apiKey,
|
|
3844
|
+
await this.writeLocalConfig(apiKey, agentId, mode, kydId);
|
|
3849
3845
|
print(` Config written to ${this.configDir}/config`);
|
|
3850
3846
|
print(` Mode: ${mode}`);
|
|
3851
3847
|
print(" Done!\n");
|
|
3852
|
-
print(` Your agent (${
|
|
3848
|
+
if (agentId) print(` Your agent (${agentId}) is verified on the AstraSync network.`);
|
|
3853
3849
|
if (mode === "hybrid") {
|
|
3854
3850
|
print(" Local evaluation active for speed. Cloud sync for audit and trust scoring.");
|
|
3855
3851
|
} else {
|
|
3856
3852
|
print(" Trust scoring, audit trails, and blockchain recording are active.");
|
|
3857
3853
|
}
|
|
3858
3854
|
print(`
|
|
3859
|
-
Dashboard: ${this.platformUrl}/agents
|
|
3855
|
+
Dashboard: ${this.platformUrl}/agents${agentId ? `/${agentId}` : ""}
|
|
3860
3856
|
`);
|
|
3861
3857
|
return {
|
|
3862
3858
|
success: true,
|
|
3863
3859
|
apiKey,
|
|
3864
|
-
agentId
|
|
3860
|
+
agentId,
|
|
3865
3861
|
kydId,
|
|
3866
3862
|
mode
|
|
3867
3863
|
};
|
|
@@ -3914,44 +3910,6 @@ var UpgradeFlow = class {
|
|
|
3914
3910
|
return { valid: true, error: `Could not reach platform (proceeding anyway)` };
|
|
3915
3911
|
}
|
|
3916
3912
|
}
|
|
3917
|
-
/**
|
|
3918
|
-
* Upload local policy to the AstraSync cloud.
|
|
3919
|
-
* YAML -> cloud PDLSS boundary, 1:1 mapping, no lossy transformation.
|
|
3920
|
-
*/
|
|
3921
|
-
async uploadPolicy(apiKey) {
|
|
3922
|
-
const policyYaml = toYaml(this.config.policy);
|
|
3923
|
-
try {
|
|
3924
|
-
const response = await sdkFetch(`${this.platformUrl}/api/v1/agents/policies/upload`, {
|
|
3925
|
-
method: "POST",
|
|
3926
|
-
headers: {
|
|
3927
|
-
"Content-Type": "application/json",
|
|
3928
|
-
Authorization: `Bearer ${apiKey}`
|
|
3929
|
-
},
|
|
3930
|
-
body: JSON.stringify({
|
|
3931
|
-
policy: policyYaml,
|
|
3932
|
-
policyObject: this.config.policy,
|
|
3933
|
-
format: "yaml",
|
|
3934
|
-
source: "local-guard-upgrade",
|
|
3935
|
-
name: this.config.policy.name
|
|
3936
|
-
})
|
|
3937
|
-
});
|
|
3938
|
-
if (!response.ok) {
|
|
3939
|
-
const body = await response.text();
|
|
3940
|
-
return { success: false, error: `Upload failed (${response.status}): ${body}` };
|
|
3941
|
-
}
|
|
3942
|
-
const data = await response.json();
|
|
3943
|
-
return {
|
|
3944
|
-
success: true,
|
|
3945
|
-
agentId: data.agentId || "ASTRA-PENDING",
|
|
3946
|
-
kydId: data.kydId
|
|
3947
|
-
};
|
|
3948
|
-
} catch (err) {
|
|
3949
|
-
return {
|
|
3950
|
-
success: false,
|
|
3951
|
-
error: `Network error: ${err instanceof Error ? err.message : String(err)}`
|
|
3952
|
-
};
|
|
3953
|
-
}
|
|
3954
|
-
}
|
|
3955
3913
|
/**
|
|
3956
3914
|
* Write the config file for the chosen mode.
|
|
3957
3915
|
*/
|