@ddd-qc/agent-directory 4.165.5 → 5.0.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/agent_directory.zvm.d.ts +24 -24
- package/dist/agent_directory.zvm.js +41 -41
- package/dist/agent_directory.zvm.js.map +1 -1
- package/dist/bindings/agent_directory.fn.d.ts +7 -0
- package/dist/bindings/agent_directory.fn.js +17 -0
- package/dist/bindings/agent_directory.fn.js.map +1 -0
- package/dist/bindings/agent_directory.proxy.d.ts +10 -9
- package/dist/bindings/agent_directory.proxy.js +13 -11
- package/dist/bindings/agent_directory.proxy.js.map +1 -1
- package/dist/bindings/{agent_directory.d.ts → agent_directory.types.d.ts} +1 -1
- package/dist/bindings/{agent_directory.js → agent_directory.types.js} +3 -3
- package/dist/bindings/agent_directory.types.js.map +1 -0
- package/dist/elements/agent-directory-list.d.ts +20 -20
- package/dist/elements/agent-directory-list.js +49 -49
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/package.json +6 -7
- package/dist/ZomeViewModel.d.ts +0 -22
- package/dist/ZomeViewModel.js +0 -49
- package/dist/ZomeViewModel.js.map +0 -1
- package/dist/agent_directory.bridge.d.ts +0 -9
- package/dist/agent_directory.bridge.js +0 -14
- package/dist/agent_directory.bridge.js.map +0 -1
- package/dist/agent_directory.dvm.d.ts +0 -18
- package/dist/agent_directory.dvm.js +0 -18
- package/dist/agent_directory.dvm.js.map +0 -1
- package/dist/agent_directory.proxy.d.ts +0 -9
- package/dist/agent_directory.proxy.js +0 -11
- package/dist/agent_directory.proxy.js.map +0 -1
- package/dist/agent_directory.vm.d.ts +0 -29
- package/dist/agent_directory.vm.js +0 -43
- package/dist/agent_directory.vm.js.map +0 -1
- package/dist/agent_directory.zome.d.ts +0 -13
- package/dist/agent_directory.zome.js +0 -15
- package/dist/agent_directory.zome.js.map +0 -1
- package/dist/bindings/agent_directory.js.map +0 -1
@@ -1,24 +1,24 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import { AgentDirectoryProxy } from "./bindings/agent_directory.proxy";
|
4
|
-
/** */
|
5
|
-
export interface AgentDirectoryPerspective {
|
6
|
-
agents: AgentPubKeyB64[];
|
7
|
-
}
|
8
|
-
/**
|
9
|
-
*
|
10
|
-
*/
|
11
|
-
export declare class AgentDirectoryZvm extends ZomeViewModel {
|
12
|
-
static readonly ZOME_PROXY: typeof AgentDirectoryProxy;
|
13
|
-
get zomeProxy(): AgentDirectoryProxy;
|
14
|
-
/** -- Fields -- */
|
15
|
-
private _agents;
|
16
|
-
/** -- Methods -- */
|
17
|
-
get perspective(): AgentDirectoryPerspective;
|
18
|
-
/** */
|
19
|
-
protected hasChanged(): boolean;
|
20
|
-
/** */
|
21
|
-
probeAll(): Promise<void>;
|
22
|
-
/** */
|
23
|
-
probeRegisteredAgents(): Promise<void>;
|
24
|
-
}
|
1
|
+
import { ZomeViewModel } from "@ddd-qc/lit-happ";
|
2
|
+
import { AgentPubKeyB64 } from "@holochain/client";
|
3
|
+
import { AgentDirectoryProxy } from "./bindings/agent_directory.proxy";
|
4
|
+
/** */
|
5
|
+
export interface AgentDirectoryPerspective {
|
6
|
+
agents: AgentPubKeyB64[];
|
7
|
+
}
|
8
|
+
/**
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
export declare class AgentDirectoryZvm extends ZomeViewModel {
|
12
|
+
static readonly ZOME_PROXY: typeof AgentDirectoryProxy;
|
13
|
+
get zomeProxy(): AgentDirectoryProxy;
|
14
|
+
/** -- Fields -- */
|
15
|
+
private _agents;
|
16
|
+
/** -- Methods -- */
|
17
|
+
get perspective(): AgentDirectoryPerspective;
|
18
|
+
/** */
|
19
|
+
protected hasChanged(): boolean;
|
20
|
+
/** */
|
21
|
+
probeAll(): Promise<void>;
|
22
|
+
/** */
|
23
|
+
probeRegisteredAgents(): Promise<void>;
|
24
|
+
}
|
@@ -1,42 +1,42 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import { AgentDirectoryProxy } from "./bindings/agent_directory.proxy";
|
4
|
-
/**
|
5
|
-
*
|
6
|
-
*/
|
7
|
-
export class AgentDirectoryZvm extends ZomeViewModel {
|
8
|
-
constructor() {
|
9
|
-
super(...arguments);
|
10
|
-
/** -- Fields -- */
|
11
|
-
this._agents = [];
|
12
|
-
}
|
13
|
-
get zomeProxy() {
|
14
|
-
return this._zomeProxy;
|
15
|
-
}
|
16
|
-
/** -- Methods -- */
|
17
|
-
/* */
|
18
|
-
get perspective() {
|
19
|
-
return { agents: this._agents };
|
20
|
-
}
|
21
|
-
/** */
|
22
|
-
hasChanged() {
|
23
|
-
if (!this._previousPerspective)
|
24
|
-
return true;
|
25
|
-
let hasChanged = JSON.stringify(this.perspective.agents) !== JSON.stringify(this._previousPerspective.agents);
|
26
|
-
return hasChanged;
|
27
|
-
}
|
28
|
-
/** */
|
29
|
-
async probeAll() {
|
30
|
-
await this.probeRegisteredAgents();
|
31
|
-
}
|
32
|
-
/** */
|
33
|
-
async probeRegisteredAgents() {
|
34
|
-
let agents = await this.zomeProxy.getRegisteredAgents();
|
35
|
-
this._agents = agents.map((agentKey) =>
|
36
|
-
// Debug add a random string to the perspective
|
37
|
-
// this._agents.push(String.fromCharCode("A".charCodeAt(0) + Math.floor(Math.random() * 26)))
|
38
|
-
this.notifySubscribers();
|
39
|
-
}
|
40
|
-
}
|
41
|
-
AgentDirectoryZvm.ZOME_PROXY = AgentDirectoryProxy;
|
1
|
+
import { ZomeViewModel } from "@ddd-qc/lit-happ";
|
2
|
+
import { encodeHashToBase64 } from "@holochain/client";
|
3
|
+
import { AgentDirectoryProxy } from "./bindings/agent_directory.proxy";
|
4
|
+
/**
|
5
|
+
*
|
6
|
+
*/
|
7
|
+
export class AgentDirectoryZvm extends ZomeViewModel {
|
8
|
+
constructor() {
|
9
|
+
super(...arguments);
|
10
|
+
/** -- Fields -- */
|
11
|
+
this._agents = [];
|
12
|
+
}
|
13
|
+
get zomeProxy() {
|
14
|
+
return this._zomeProxy;
|
15
|
+
}
|
16
|
+
/** -- Methods -- */
|
17
|
+
/* */
|
18
|
+
get perspective() {
|
19
|
+
return { agents: this._agents };
|
20
|
+
}
|
21
|
+
/** */
|
22
|
+
hasChanged() {
|
23
|
+
if (!this._previousPerspective)
|
24
|
+
return true;
|
25
|
+
let hasChanged = JSON.stringify(this.perspective.agents) !== JSON.stringify(this._previousPerspective.agents);
|
26
|
+
return hasChanged;
|
27
|
+
}
|
28
|
+
/** */
|
29
|
+
async probeAll() {
|
30
|
+
await this.probeRegisteredAgents();
|
31
|
+
}
|
32
|
+
/** */
|
33
|
+
async probeRegisteredAgents() {
|
34
|
+
let agents = await this.zomeProxy.getRegisteredAgents();
|
35
|
+
this._agents = agents.map((agentKey) => encodeHashToBase64(agentKey));
|
36
|
+
// Debug add a random string to the perspective
|
37
|
+
// this._agents.push(String.fromCharCode("A".charCodeAt(0) + Math.floor(Math.random() * 26)))
|
38
|
+
this.notifySubscribers();
|
39
|
+
}
|
40
|
+
}
|
41
|
+
AgentDirectoryZvm.ZOME_PROXY = AgentDirectoryProxy;
|
42
42
|
//# sourceMappingURL=agent_directory.zvm.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"agent_directory.zvm.js","sourceRoot":"","sources":["../src/agent_directory.zvm.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"agent_directory.zvm.js","sourceRoot":"","sources":["../src/agent_directory.zvm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAkB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,kCAAkC,CAAC;AASrE;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,aAAa;IAApD;;QASE,mBAAmB;QAEX,YAAO,GAAqB,EAAE,CAAC;IAkCzC,CAAC;IAzCC,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAiC,CAAC;IAChD,CAAC;IAQD,oBAAoB;IAEpB,KAAK;IACL,IAAI,WAAW;QACb,OAAO,EAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAC,CAAA;IAC/B,CAAC;IAGD,MAAM;IACI,UAAU;QAClB,IAAI,CAAC,IAAI,CAAC,oBAAoB;YAAE,OAAO,IAAI,CAAC;QAC5C,IAAI,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAA;QAC7G,OAAO,UAAU,CAAA;IACnB,CAAC;IAGD,MAAM;IACN,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,CAAC,qBAAqB,EAAE,CAAA;IACpC,CAAC;IAGD,MAAM;IACN,KAAK,CAAC,qBAAqB;QACzB,IAAI,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,mBAAmB,EAAE,CAAC;QACxD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;QACtE,+CAA+C;QAC/C,6FAA6F;QAC7F,IAAI,CAAC,iBAAiB,EAAE,CAAA;IAC1B,CAAC;;AAzCe,4BAAU,GAAG,mBAAmB,CAAC","sourcesContent":["import {ZomeViewModel} from \"@ddd-qc/lit-happ\";\nimport { AgentPubKeyB64, encodeHashToBase64 } from \"@holochain/client\";\nimport {AgentDirectoryProxy} from \"./bindings/agent_directory.proxy\";\n\n\n/** */\nexport interface AgentDirectoryPerspective {\n agents: AgentPubKeyB64[],\n}\n\n\n/**\n *\n */\nexport class AgentDirectoryZvm extends ZomeViewModel {\n\n static readonly ZOME_PROXY = AgentDirectoryProxy;\n\n get zomeProxy(): AgentDirectoryProxy {\n return this._zomeProxy as AgentDirectoryProxy;\n }\n\n\n /** -- Fields -- */\n\n private _agents: AgentPubKeyB64[] = [];\n\n\n /** -- Methods -- */\n\n /* */\n get perspective(): AgentDirectoryPerspective {\n return {agents: this._agents}\n }\n\n\n /** */\n protected hasChanged(): boolean {\n if (!this._previousPerspective) return true;\n let hasChanged = JSON.stringify(this.perspective.agents) !== JSON.stringify(this._previousPerspective.agents)\n return hasChanged\n }\n\n\n /** */\n async probeAll(): Promise<void> {\n await this.probeRegisteredAgents()\n }\n\n\n /** */\n async probeRegisteredAgents() {\n let agents = await this.zomeProxy.getRegisteredAgents();\n this._agents = agents.map((agentKey) => encodeHashToBase64(agentKey));\n // Debug add a random string to the perspective\n // this._agents.push(String.fromCharCode(\"A\".charCodeAt(0) + Math.floor(Math.random() * 26)))\n this.notifySubscribers()\n }\n\n}"]}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { ZomeName, FunctionName } from '@holochain/client';
|
2
|
+
/** Array of all zome function names in "agentDirectory" */
|
3
|
+
export declare const agentDirectoryFunctionNames: FunctionName[];
|
4
|
+
/** Generate tuple array of function names with given zomeName */
|
5
|
+
export declare function generateAgentDirectoryZomeFunctionsArray(zomeName: ZomeName): [ZomeName, FunctionName][];
|
6
|
+
/** Tuple array of all zome function names with default zome name "agent_directory" */
|
7
|
+
export declare const agentDirectoryZomeFunctions: [ZomeName, FunctionName][];
|
@@ -0,0 +1,17 @@
|
|
1
|
+
/* This file is generated by zits. Do not edit manually */
|
2
|
+
/** Array of all zome function names in "agentDirectory" */
|
3
|
+
export const agentDirectoryFunctionNames = [
|
4
|
+
"entry_defs",
|
5
|
+
"get_registered_agents",
|
6
|
+
];
|
7
|
+
/** Generate tuple array of function names with given zomeName */
|
8
|
+
export function generateAgentDirectoryZomeFunctionsArray(zomeName) {
|
9
|
+
let fns = [];
|
10
|
+
for (const fn of agentDirectoryFunctionNames) {
|
11
|
+
fns.push([zomeName, fn]);
|
12
|
+
}
|
13
|
+
return fns;
|
14
|
+
}
|
15
|
+
/** Tuple array of all zome function names with default zome name "agent_directory" */
|
16
|
+
export const agentDirectoryZomeFunctions = generateAgentDirectoryZomeFunctionsArray("agent_directory");
|
17
|
+
//# sourceMappingURL=agent_directory.fn.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"agent_directory.fn.js","sourceRoot":"","sources":["../../src/bindings/agent_directory.fn.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAK1D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,2BAA2B,GAAmB;IAC1D,YAAY;IACZ,uBAAuB;CAEvB,CAAC;AAGF,iEAAiE;AACjE,MAAM,UAAU,wCAAwC,CAAC,QAAkB;IACxE,IAAI,GAAG,GAA+B,EAAE,CAAC;IACzC,KAAK,MAAM,EAAE,IAAI,2BAA2B,EAAE;QAC3C,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;KAC3B;IACD,OAAO,GAAG,CAAC;AACd,CAAC;AAGD,sFAAsF;AACtF,MAAM,CAAC,MAAM,2BAA2B,GAA+B,wCAAwC,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {ZomeName, FunctionName} from '@holochain/client';\n\n\n/** Array of all zome function names in \"agentDirectory\" */\nexport const agentDirectoryFunctionNames: FunctionName[] = [\n\t\"entry_defs\",\n\t\"get_registered_agents\",\n\n];\n\n\n/** Generate tuple array of function names with given zomeName */\nexport function generateAgentDirectoryZomeFunctionsArray(zomeName: ZomeName): [ZomeName, FunctionName][] {\n let fns: [ZomeName, FunctionName][] = [];\n for (const fn of agentDirectoryFunctionNames) {\n fns.push([zomeName, fn]);\n }\n return fns;\n}\n\n\n/** Tuple array of all zome function names with default zome name \"agent_directory\" */\nexport const agentDirectoryZomeFunctions: [ZomeName, FunctionName][] = generateAgentDirectoryZomeFunctionsArray(\"agent_directory\");\n"]}
|
@@ -1,9 +1,10 @@
|
|
1
|
-
import { AgentPubKey } from '@holochain/client';
|
2
|
-
import { ZomeProxy } from '@ddd-qc/lit-happ';
|
3
|
-
/**
|
4
|
-
*
|
5
|
-
*/
|
6
|
-
export declare class AgentDirectoryProxy extends ZomeProxy {
|
7
|
-
static readonly DEFAULT_ZOME_NAME = "agent_directory";
|
8
|
-
|
9
|
-
|
1
|
+
import { AgentPubKey } from '@holochain/client';
|
2
|
+
import { ZomeProxy } from '@ddd-qc/lit-happ';
|
3
|
+
/**
|
4
|
+
*
|
5
|
+
*/
|
6
|
+
export declare class AgentDirectoryProxy extends ZomeProxy {
|
7
|
+
static readonly DEFAULT_ZOME_NAME = "agent_directory";
|
8
|
+
static readonly FN_NAMES: string[];
|
9
|
+
getRegisteredAgents(): Promise<AgentPubKey[]>;
|
10
|
+
}
|
@@ -1,12 +1,14 @@
|
|
1
|
-
/* This file is generated by zits. Do not edit manually */
|
2
|
-
import { ZomeProxy } from '@ddd-qc/lit-happ';
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
}
|
11
|
-
|
1
|
+
/* This file is generated by zits. Do not edit manually */
|
2
|
+
import { ZomeProxy } from '@ddd-qc/lit-happ';
|
3
|
+
import { agentDirectoryFunctionNames } from './agent_directory.fn';
|
4
|
+
/**
|
5
|
+
*
|
6
|
+
*/
|
7
|
+
export class AgentDirectoryProxy extends ZomeProxy {
|
8
|
+
async getRegisteredAgents() {
|
9
|
+
return this.call('get_registered_agents', null);
|
10
|
+
}
|
11
|
+
}
|
12
|
+
AgentDirectoryProxy.DEFAULT_ZOME_NAME = "agent_directory";
|
13
|
+
AgentDirectoryProxy.FN_NAMES = agentDirectoryFunctionNames;
|
12
14
|
//# sourceMappingURL=agent_directory.proxy.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"agent_directory.proxy.js","sourceRoot":"","sources":["../../src/bindings/agent_directory.proxy.ts"],"names":[],"mappings":"AAAA,0DAA0D;
|
1
|
+
{"version":3,"file":"agent_directory.proxy.js","sourceRoot":"","sources":["../../src/bindings/agent_directory.proxy.ts"],"names":[],"mappings":"AAAA,0DAA0D;AA0H1D,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,2BAA2B,EAAC,MAAM,sBAAsB,CAAC;AAEjE;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,SAAS;IAIhD,KAAK,CAAC,mBAAmB;QACvB,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;;AALe,qCAAiB,GAAG,iBAAiB,CAAA;AACrC,4BAAQ,GAAG,2BAA2B,CAAA","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {} from './agent_directory.types';\nimport {\n/** Types */\nHoloHash,\nAgentPubKey,\nDnaHash,\nWasmHash,\nEntryHash,\nActionHash,\nAnyDhtHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nHoloHashed,\nNetworkInfo,\nFetchQueueInfo,\n/** Action */\nSignedActionHashed,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** Capabilities */\nCapSecret,\nCapClaim,\nZomeCallCapGrant,\nCapAccess,\nCapGrant,\n/** CounterSigning */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** DhtOps */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** Entry */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** Record */\nRecord,\nRecordEntry,\n/** admin types */\nInstalledAppInfoStatus,\nStemCell,\nCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\nimport {\n/** Common */\nDictionary,\nDhtOpHashB64,\nDhtOpHash,\n/** DnaFile */\nDnaFile,\nDnaDef,\nZomes,\nWasmCode,\n/** entry-details */\nEntryDetails,\nRecordDetails,\nDetails,\nDetailsType,\nEntryDhtStatus,\n/** Validation */\nValidationStatus,\nValidationReceipt,\n } from '@holochain-open-dev/core-types';\n\nimport {ZomeProxy} from '@ddd-qc/lit-happ';\nimport {agentDirectoryFunctionNames} from './agent_directory.fn';\n\n/**\n *\n */\nexport class AgentDirectoryProxy extends ZomeProxy {\n static readonly DEFAULT_ZOME_NAME = \"agent_directory\"\n static readonly FN_NAMES = agentDirectoryFunctionNames\n \n async getRegisteredAgents(): Promise<AgentPubKey[]> {\n return this.call('get_registered_agents', null);\n }\n\n\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
export {};
|
1
|
+
export {};
|
@@ -1,3 +1,3 @@
|
|
1
|
-
/* This file is generated by zits. Do not edit manually */
|
2
|
-
export {};
|
3
|
-
//# sourceMappingURL=agent_directory.js.map
|
1
|
+
/* This file is generated by zits. Do not edit manually */
|
2
|
+
export {};
|
3
|
+
//# sourceMappingURL=agent_directory.types.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"agent_directory.types.js","sourceRoot":"","sources":["../../src/bindings/agent_directory.types.ts"],"names":[],"mappings":"AAAA,0DAA0D","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {\n/** Types */\nHoloHash,\nAgentPubKey,\nDnaHash,\nWasmHash,\nEntryHash,\nActionHash,\nAnyDhtHash,\nKitsuneAgent,\nKitsuneSpace,\nHoloHashB64,\nAgentPubKeyB64,\nDnaHashB64,\nWasmHashB64,\nEntryHashB64,\nActionHashB64,\nAnyDhtHashB64,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleName,\nInstalledCell,\nTimestamp,\nHoloHashed,\nNetworkInfo,\nFetchQueueInfo,\n/** Action */\nSignedActionHashed,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** Capabilities */\nCapSecret,\nCapClaim,\nZomeCallCapGrant,\nCapAccess,\nCapGrant,\n/** CounterSigning */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** DhtOps */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** Entry */\nEntryVisibility,\nAppEntryDef,\nEntryType,\nEntryContent,\nEntry,\n/** Record */\nRecord,\nRecordEntry,\n/** admin types */\nInstalledAppInfoStatus,\nStemCell,\nCell,\nCellType,\nCellInfo,\nAppInfo,\nMembraneProof,\nFunctionName,\nZomeName,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioning,\nDnaVersionSpec,\nDnaVersionFlexible,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\nimport {\n/** Common */\nDictionary,\nDhtOpHashB64,\nDhtOpHash,\n/** DnaFile */\nDnaFile,\nDnaDef,\nZomes,\nWasmCode,\n/** entry-details */\nEntryDetails,\nRecordDetails,\nDetails,\nDetailsType,\nEntryDhtStatus,\n/** Validation */\nValidationStatus,\nValidationReceipt,\n } from '@holochain-open-dev/core-types';\n"]}
|
@@ -1,20 +1,20 @@
|
|
1
|
-
import { ZomeElement } from "@ddd-qc/lit-happ";
|
2
|
-
import { AgentDirectoryPerspective, AgentDirectoryZvm } from "../agent_directory.zvm";
|
3
|
-
/**
|
4
|
-
* @element agent-directory-list
|
5
|
-
*/
|
6
|
-
export declare class AgentDirectoryList extends ZomeElement<AgentDirectoryPerspective, AgentDirectoryZvm> {
|
7
|
-
/** Ctor */
|
8
|
-
constructor();
|
9
|
-
/** -- Fields -- */
|
10
|
-
private _initialized;
|
11
|
-
/** -- Methods -- */
|
12
|
-
/** After first call to render() */
|
13
|
-
firstUpdated(): Promise<void>;
|
14
|
-
/** After each call to render() */
|
15
|
-
updated(changedProperties: any): Promise<void>;
|
16
|
-
/** */
|
17
|
-
refresh(_e?: any): Promise<void>;
|
18
|
-
/** */
|
19
|
-
render(): import("lit-html").TemplateResult<1>;
|
20
|
-
}
|
1
|
+
import { ZomeElement } from "@ddd-qc/lit-happ";
|
2
|
+
import { AgentDirectoryPerspective, AgentDirectoryZvm } from "../agent_directory.zvm";
|
3
|
+
/**
|
4
|
+
* @element agent-directory-list
|
5
|
+
*/
|
6
|
+
export declare class AgentDirectoryList extends ZomeElement<AgentDirectoryPerspective, AgentDirectoryZvm> {
|
7
|
+
/** Ctor */
|
8
|
+
constructor();
|
9
|
+
/** -- Fields -- */
|
10
|
+
private _initialized;
|
11
|
+
/** -- Methods -- */
|
12
|
+
/** After first call to render() */
|
13
|
+
firstUpdated(): Promise<void>;
|
14
|
+
/** After each call to render() */
|
15
|
+
updated(changedProperties: any): Promise<void>;
|
16
|
+
/** */
|
17
|
+
refresh(_e?: any): Promise<void>;
|
18
|
+
/** */
|
19
|
+
render(): import("lit-html").TemplateResult<1>;
|
20
|
+
}
|
@@ -1,54 +1,54 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { html } from "lit";
|
3
|
-
import { state } from "lit/decorators.js";
|
4
|
-
import { ZomeElement } from "@ddd-qc/lit-happ";
|
5
|
-
import { AgentDirectoryZvm } from "../agent_directory.zvm";
|
6
|
-
/**
|
7
|
-
* @element agent-directory-list
|
8
|
-
*/
|
9
|
-
export class AgentDirectoryList extends ZomeElement {
|
10
|
-
/** Ctor */
|
11
|
-
constructor() {
|
12
|
-
super(AgentDirectoryZvm.DEFAULT_ZOME_NAME);
|
13
|
-
/** -- Fields -- */
|
14
|
-
this._initialized = false;
|
15
|
-
}
|
16
|
-
/** -- Methods -- */
|
17
|
-
/** After first call to render() */
|
18
|
-
async firstUpdated() {
|
19
|
-
//this._viewModel.subscribe(this, 'perspective');
|
20
|
-
await this.refresh();
|
21
|
-
this._initialized = true;
|
22
|
-
}
|
23
|
-
/** After each call to render() */
|
24
|
-
async updated(changedProperties) {
|
25
|
-
// n/a
|
26
|
-
}
|
27
|
-
/** */
|
28
|
-
async refresh(_e) {
|
29
|
-
//console.log("refresh(): Pulling data from DHT")
|
30
|
-
await this._zvm.probeAll();
|
31
|
-
}
|
32
|
-
/** */
|
33
|
-
render() {
|
34
|
-
console.log("agent-directory-list render() START");
|
35
|
-
if (!this._initialized) {
|
36
|
-
return html `<span>Loading...</span>`;
|
37
|
-
}
|
38
|
-
/* Agents */
|
39
|
-
const agentLi = Object.entries(this.perspective.agents).map(([_index, agentIdB64]) => {
|
40
|
-
//console.log("" + index + ". " + agentIdB64)
|
41
|
-
return html `<li value="${agentIdB64}">${agentIdB64}</li>`;
|
42
|
-
});
|
43
|
-
/** render all */
|
1
|
+
import { __decorate } from "tslib";
|
2
|
+
import { html } from "lit";
|
3
|
+
import { state } from "lit/decorators.js";
|
4
|
+
import { ZomeElement } from "@ddd-qc/lit-happ";
|
5
|
+
import { AgentDirectoryZvm } from "../agent_directory.zvm";
|
6
|
+
/**
|
7
|
+
* @element agent-directory-list
|
8
|
+
*/
|
9
|
+
export class AgentDirectoryList extends ZomeElement {
|
10
|
+
/** Ctor */
|
11
|
+
constructor() {
|
12
|
+
super(AgentDirectoryZvm.DEFAULT_ZOME_NAME);
|
13
|
+
/** -- Fields -- */
|
14
|
+
this._initialized = false;
|
15
|
+
}
|
16
|
+
/** -- Methods -- */
|
17
|
+
/** After first call to render() */
|
18
|
+
async firstUpdated() {
|
19
|
+
//this._viewModel.subscribe(this, 'perspective');
|
20
|
+
await this.refresh();
|
21
|
+
this._initialized = true;
|
22
|
+
}
|
23
|
+
/** After each call to render() */
|
24
|
+
async updated(changedProperties) {
|
25
|
+
// n/a
|
26
|
+
}
|
27
|
+
/** */
|
28
|
+
async refresh(_e) {
|
29
|
+
//console.log("refresh(): Pulling data from DHT")
|
30
|
+
await this._zvm.probeAll();
|
31
|
+
}
|
32
|
+
/** */
|
33
|
+
render() {
|
34
|
+
console.log("agent-directory-list render() START");
|
35
|
+
if (!this._initialized) {
|
36
|
+
return html `<span>Loading...</span>`;
|
37
|
+
}
|
38
|
+
/* Agents */
|
39
|
+
const agentLi = Object.entries(this.perspective.agents).map(([_index, agentIdB64]) => {
|
40
|
+
//console.log("" + index + ". " + agentIdB64)
|
41
|
+
return html `<li value="${agentIdB64}">${agentIdB64}</li>`;
|
42
|
+
});
|
43
|
+
/** render all */
|
44
44
|
return html `
|
45
45
|
<ul>
|
46
46
|
${agentLi}
|
47
47
|
</ul>
|
48
|
-
`;
|
49
|
-
}
|
50
|
-
}
|
51
|
-
__decorate([
|
52
|
-
state()
|
53
|
-
], AgentDirectoryList.prototype, "_initialized", void 0);
|
48
|
+
`;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
__decorate([
|
52
|
+
state()
|
53
|
+
], AgentDirectoryList.prototype, "_initialized", void 0);
|
54
54
|
//# sourceMappingURL=agent-directory-list.js.map
|
package/dist/index.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
export * from './agent_directory.zvm';
|
2
|
-
export * from './bindings/agent_directory.proxy';
|
3
|
-
export * from './elements/agent-directory-list';
|
1
|
+
export * from './agent_directory.zvm';
|
2
|
+
export * from './bindings/agent_directory.proxy';
|
3
|
+
export * from './elements/agent-directory-list';
|
package/dist/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export * from './agent_directory.zvm';
|
2
|
-
export * from './bindings/agent_directory.proxy';
|
3
|
-
export * from './elements/agent-directory-list';
|
1
|
+
export * from './agent_directory.zvm';
|
2
|
+
export * from './bindings/agent_directory.proxy';
|
3
|
+
export * from './elements/agent-directory-list';
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ddd-qc/agent-directory",
|
3
|
-
"version": "
|
3
|
+
"version": "5.0.0",
|
4
4
|
"license" : "CAL-1.0",
|
5
5
|
"keywords": ["holochain", "zome"],
|
6
6
|
"main": "./dist/index.js",
|
@@ -25,12 +25,11 @@
|
|
25
25
|
"typescript": "4.3.5"
|
26
26
|
},
|
27
27
|
"dependencies": {
|
28
|
-
"@ddd-qc/lit-happ": "0.
|
29
|
-
"@ddd-qc/cell-proxy": "0.
|
30
|
-
"@holochain/client": "^0.
|
31
|
-
"@holochain-open-dev/core-types": "^0.
|
32
|
-
"
|
33
|
-
"lit": "^2.2.0"
|
28
|
+
"@ddd-qc/lit-happ": "0.10.0",
|
29
|
+
"@ddd-qc/cell-proxy": "0.10.0",
|
30
|
+
"@holochain/client": "^0.11.8",
|
31
|
+
"@holochain-open-dev/core-types": "^0.6.1",
|
32
|
+
"lit": "^2.3.0"
|
34
33
|
},
|
35
34
|
"type": "module",
|
36
35
|
"publishConfig": {
|
package/dist/ZomeViewModel.d.ts
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Represents the ViewModel of a zome.
|
3
|
-
* It is an Observable meant to be a singleton passed around with a LitContext.
|
4
|
-
* It queries a cell's zome to get the agent's perspective (by callind a Zome Bridge).
|
5
|
-
* LitElement hosts can subscribe to it in order to get updated when the perspective changes.
|
6
|
-
* Hosts can also trigger probing in order to get an updated perspective.
|
7
|
-
* It is expected from child classes to implement the ZomeViewModelInterface.
|
8
|
-
*/
|
9
|
-
export declare class ZomeViewModel<T extends {}> {
|
10
|
-
/** Dummy implementation ZomeViewModelInterface */
|
11
|
-
get perspective(): T;
|
12
|
-
protected hasChanged(): boolean;
|
13
|
-
probeDht(): Promise<void>;
|
14
|
-
protected _previousPerspective?: any;
|
15
|
-
protected _hosts: [any, PropertyKey][];
|
16
|
-
/** */
|
17
|
-
subscribe(host: any, propName: PropertyKey): void;
|
18
|
-
/** */
|
19
|
-
unsubscribe(candidat: any): void;
|
20
|
-
/** */
|
21
|
-
protected notify(): void;
|
22
|
-
}
|
package/dist/ZomeViewModel.js
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
// export interface ZomeViewModelInterface<T extends {}> {
|
2
|
-
// hasChanged(): boolean;
|
3
|
-
// get perspective(): T | {};
|
4
|
-
// probeDht(): Promise<void>;
|
5
|
-
// }
|
6
|
-
/**
|
7
|
-
* Represents the ViewModel of a zome.
|
8
|
-
* It is an Observable meant to be a singleton passed around with a LitContext.
|
9
|
-
* It queries a cell's zome to get the agent's perspective (by callind a Zome Bridge).
|
10
|
-
* LitElement hosts can subscribe to it in order to get updated when the perspective changes.
|
11
|
-
* Hosts can also trigger probing in order to get an updated perspective.
|
12
|
-
* It is expected from child classes to implement the ZomeViewModelInterface.
|
13
|
-
*/
|
14
|
-
export class ZomeViewModel {
|
15
|
-
constructor() {
|
16
|
-
this._hosts = [];
|
17
|
-
}
|
18
|
-
/** Dummy implementation ZomeViewModelInterface */
|
19
|
-
get perspective() { return {}; }
|
20
|
-
hasChanged() { return true; }
|
21
|
-
async probeDht() { }
|
22
|
-
/** */
|
23
|
-
subscribe(host, propName) {
|
24
|
-
host[propName] = this.perspective;
|
25
|
-
this._hosts.push([host, propName]);
|
26
|
-
}
|
27
|
-
/** */
|
28
|
-
unsubscribe(candidat) {
|
29
|
-
let index = 0;
|
30
|
-
for (const [host, _propName] of this._hosts) {
|
31
|
-
if (host === candidat)
|
32
|
-
break;
|
33
|
-
index += 1;
|
34
|
-
}
|
35
|
-
if (index > -1) {
|
36
|
-
this._hosts.splice(index, 1);
|
37
|
-
}
|
38
|
-
}
|
39
|
-
/** */
|
40
|
-
notify() {
|
41
|
-
if (!this.hasChanged())
|
42
|
-
return;
|
43
|
-
for (const [host, propName] of this._hosts) {
|
44
|
-
host[propName] = this.perspective;
|
45
|
-
}
|
46
|
-
this._previousPerspective = this.perspective;
|
47
|
-
}
|
48
|
-
}
|
49
|
-
//# sourceMappingURL=ZomeViewModel.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ZomeViewModel.js","sourceRoot":"","sources":["../src/ZomeViewModel.ts"],"names":[],"mappings":"AAGA,0DAA0D;AAC1D,6BAA6B;AAC7B,iCAAiC;AACjC,iCAAiC;AACjC,IAAI;AAGJ;;;;;;;GAOG;AACH,MAAM,OAAO,aAAa;IAA1B;QAQc,WAAM,GAAyB,EAAE,CAAC;IA+BhD,CAAC;IArCG,kDAAkD;IAClD,IAAI,WAAW,KAAQ,OAAO,EAAO,CAAA,CAAC,CAAC;IAC7B,UAAU,KAAc,OAAO,IAAI,CAAA,CAAC,CAAC;IAC/C,KAAK,CAAC,QAAQ,KAAmB,CAAC;IAMlC,MAAM;IACN,SAAS,CAAC,IAAS,EAAE,QAAqB;QACtC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;QAClC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;IACtC,CAAC;IAGD,MAAM;IACN,WAAW,CAAC,QAAa;QACrB,IAAI,KAAK,GAAI,CAAC,CAAC;QACf,KAAK,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE;YACzC,IAAI,IAAI,KAAK,QAAQ;gBAAE,MAAM;YAC7B,KAAK,IAAI,CAAC,CAAC;SACd;QACD,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;YACZ,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;SAChC;IACL,CAAC;IAGD,MAAM;IACI,MAAM;QACZ,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAAE,OAAO;QAC/B,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE;YACxC,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;SACrC;QACD,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,WAAW,CAAA;IAChD,CAAC;CACJ","sourcesContent":["\r\n\r\n\r\n// export interface ZomeViewModelInterface<T extends {}> {\r\n// hasChanged(): boolean;\r\n// get perspective(): T | {};\r\n// probeDht(): Promise<void>;\r\n// }\r\n\r\n\r\n/**\r\n * Represents the ViewModel of a zome.\r\n * It is an Observable meant to be a singleton passed around with a LitContext.\r\n * It queries a cell's zome to get the agent's perspective (by callind a Zome Bridge).\r\n * LitElement hosts can subscribe to it in order to get updated when the perspective changes.\r\n * Hosts can also trigger probing in order to get an updated perspective.\r\n * It is expected from child classes to implement the ZomeViewModelInterface.\r\n */\r\nexport class ZomeViewModel<T extends {}> /*implements ZomeViewModelInterface<T>*/ {\r\n\r\n /** Dummy implementation ZomeViewModelInterface */\r\n get perspective(): T { return {} as T }\r\n protected hasChanged(): boolean { return true }\r\n async probeDht(): Promise<void> {}\r\n\r\n protected _previousPerspective?: any;\r\n protected _hosts: [any, PropertyKey][] = [];\r\n\r\n\r\n /** */\r\n subscribe(host: any, propName: PropertyKey) {\r\n host[propName] = this.perspective;\r\n this._hosts.push([host, propName])\r\n }\r\n\r\n\r\n /** */\r\n unsubscribe(candidat: any) {\r\n let index = 0;\r\n for (const [host, _propName] of this._hosts) {\r\n if (host === candidat) break;\r\n index += 1;\r\n }\r\n if (index > -1) {\r\n this._hosts.splice(index, 1);\r\n }\r\n }\r\n\r\n\r\n /** */\r\n protected notify() {\r\n if (!this.hasChanged()) return;\r\n for (const [host, propName] of this._hosts) {\r\n host[propName] = this.perspective;\r\n }\r\n this._previousPerspective = this.perspective\r\n }\r\n}"]}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { ZomeBridge } from "@ddd-qc/dna-client";
|
2
|
-
/**
|
3
|
-
*
|
4
|
-
*/
|
5
|
-
export class AgentDirectoryBridge extends ZomeBridge {
|
6
|
-
constructor() {
|
7
|
-
super(...arguments);
|
8
|
-
this.zomeName = 'agent_directory';
|
9
|
-
}
|
10
|
-
async getAllAgents() {
|
11
|
-
return this.call('get_registered_agents', null);
|
12
|
-
}
|
13
|
-
}
|
14
|
-
//# sourceMappingURL=agent_directory.bridge.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"agent_directory.bridge.js","sourceRoot":"","sources":["../src/agent_directory.bridge.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAG9C;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,UAAU;IAApD;;QACE,aAAQ,GAAG,iBAAiB,CAAC;IAK/B,CAAC;IAHC,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;CACF","sourcesContent":["import {AgentPubKey} from \"@holochain/client\";\nimport {ZomeBridge} from \"@ddd-qc/dna-client\";\n\n\n/**\n *\n */\nexport class AgentDirectoryBridge extends ZomeBridge {\n zomeName = 'agent_directory';\n\n async getAllAgents(): Promise<AgentPubKey[]> {\n return this.call('get_registered_agents', null);\n }\n}\n"]}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { DnaViewModel } from "@ddd-qc/dna-client";
|
2
|
-
import { AgentDirectoryZvm } from "./agent_directory.zvm";
|
3
|
-
import { AppSignalCb } from "@holochain/client";
|
4
|
-
/**
|
5
|
-
* DnaViewModel fo the agent_directory DNA holding just this zome
|
6
|
-
*/
|
7
|
-
export declare class AgentDirectoryDvm extends DnaViewModel {
|
8
|
-
/** -- DnaViewModel Interface -- */
|
9
|
-
static readonly DEFAULT_ROLE_ID = "agent_directory";
|
10
|
-
static readonly ZVM_DEFS: (typeof AgentDirectoryZvm)[];
|
11
|
-
readonly signalHandler?: AppSignalCb;
|
12
|
-
/** */
|
13
|
-
get zvm(): AgentDirectoryZvm;
|
14
|
-
/** -- ViewModel Interface -- */
|
15
|
-
/** */
|
16
|
-
protected hasChanged(): boolean;
|
17
|
-
get perspective(): unknown;
|
18
|
-
}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { DnaViewModel } from "@ddd-qc/dna-client";
|
2
|
-
import { AgentDirectoryZvm } from "./agent_directory.zvm";
|
3
|
-
/**
|
4
|
-
* DnaViewModel fo the agent_directory DNA holding just this zome
|
5
|
-
*/
|
6
|
-
export class AgentDirectoryDvm extends DnaViewModel {
|
7
|
-
/** */
|
8
|
-
get zvm() { return this.getZomeViewModel(AgentDirectoryZvm.DEFAULT_ZOME_NAME); }
|
9
|
-
;
|
10
|
-
/** -- ViewModel Interface -- */
|
11
|
-
/** */
|
12
|
-
hasChanged() { return true; }
|
13
|
-
get perspective() { return; }
|
14
|
-
}
|
15
|
-
/** -- DnaViewModel Interface -- */
|
16
|
-
AgentDirectoryDvm.DEFAULT_ROLE_ID = "agent_directory";
|
17
|
-
AgentDirectoryDvm.ZVM_DEFS = [AgentDirectoryZvm];
|
18
|
-
//# sourceMappingURL=agent_directory.dvm.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"agent_directory.dvm.js","sourceRoot":"","sources":["../src/agent_directory.dvm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAIxD;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,YAAY;IAM/C,MAAM;IACN,IAAI,GAAG,KAAwB,OAAO,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,iBAAiB,CAAsB,CAAA,CAAA,CAAC;IAAA,CAAC;IAEvH,gCAAgC;IAEhC,MAAM;IAEI,UAAU,KAAa,OAAO,IAAI,CAAA,CAAA,CAAC;IAE7C,IAAI,WAAW,KAAa,OAAM,CAAA,CAAC;;AAdnC,mCAAmC;AACnB,iCAAe,GAAG,iBAAiB,CAAC;AACpC,0BAAQ,GAAG,CAAC,iBAAiB,CAAC,CAAA","sourcesContent":["import {DnaViewModel} from \"@ddd-qc/dna-client\";\r\nimport {AgentDirectoryZvm} from \"./agent_directory.zvm\";\r\nimport {AppSignalCb} from \"@holochain/client\";\r\n\r\n\r\n/**\r\n * DnaViewModel fo the agent_directory DNA holding just this zome\r\n */\r\nexport class AgentDirectoryDvm extends DnaViewModel {\r\n /** -- DnaViewModel Interface -- */\r\n static readonly DEFAULT_ROLE_ID = \"agent_directory\";\r\n static readonly ZVM_DEFS = [AgentDirectoryZvm]\r\n readonly signalHandler?: AppSignalCb;\r\n\r\n /** */\r\n get zvm(): AgentDirectoryZvm { return this.getZomeViewModel(AgentDirectoryZvm.DEFAULT_ZOME_NAME) as AgentDirectoryZvm};\r\n\r\n /** -- ViewModel Interface -- */\r\n\r\n /** */\r\n\r\n protected hasChanged(): boolean {return true}\r\n\r\n get perspective(): unknown {return}\r\n\r\n}"]}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { AgentPubKey } from "@holochain/client";
|
2
|
-
import { ZomeProxy } from "@ddd-qc/lit-happ";
|
3
|
-
/**
|
4
|
-
*
|
5
|
-
*/
|
6
|
-
export declare class AgentDirectoryProxy extends ZomeProxy {
|
7
|
-
static readonly DEFAULT_ZOME_NAME = "agent_directory";
|
8
|
-
getAllAgents(): Promise<AgentPubKey[]>;
|
9
|
-
}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { ZomeProxy } from "@ddd-qc/lit-happ";
|
2
|
-
/**
|
3
|
-
*
|
4
|
-
*/
|
5
|
-
export class AgentDirectoryProxy extends ZomeProxy {
|
6
|
-
async getAllAgents() {
|
7
|
-
return this.call('get_registered_agents', null);
|
8
|
-
}
|
9
|
-
}
|
10
|
-
AgentDirectoryProxy.DEFAULT_ZOME_NAME = 'agent_directory';
|
11
|
-
//# sourceMappingURL=agent_directory.proxy.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"agent_directory.proxy.js","sourceRoot":"","sources":["../src/agent_directory.proxy.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAG3C;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,SAAS;IAGhD,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,IAAI,CAAC,CAAC;IAClD,CAAC;;AAJe,qCAAiB,GAAG,iBAAiB,CAAC","sourcesContent":["import {AgentPubKey} from \"@holochain/client\";\nimport {ZomeProxy} from \"@ddd-qc/lit-happ\";\n\n\n/**\n *\n */\nexport class AgentDirectoryProxy extends ZomeProxy {\n static readonly DEFAULT_ZOME_NAME = 'agent_directory';\n\n async getAllAgents(): Promise<AgentPubKey[]> {\n return this.call('get_registered_agents', null);\n }\n}\n"]}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import { AgentPubKeyB64 } from '@holochain-open-dev/core-types';
|
2
|
-
import { AgentDirectoryBridge } from "./agent_directory.bridge";
|
3
|
-
import { DnaClient, ZomeViewModel } from "@ddd-qc/dna-client";
|
4
|
-
/** */
|
5
|
-
export interface AgentDirectoryPerspective {
|
6
|
-
agents: AgentPubKeyB64[];
|
7
|
-
}
|
8
|
-
/**
|
9
|
-
*
|
10
|
-
*/
|
11
|
-
export declare class AgentDirectoryViewModel extends ZomeViewModel<AgentDirectoryPerspective, AgentDirectoryBridge> {
|
12
|
-
protected dnaClient: DnaClient;
|
13
|
-
/** Ctor */
|
14
|
-
constructor(dnaClient: DnaClient);
|
15
|
-
static context: {
|
16
|
-
__context__: AgentDirectoryViewModel;
|
17
|
-
};
|
18
|
-
getContext(): any;
|
19
|
-
/** -- Fields -- */
|
20
|
-
private _agents;
|
21
|
-
/** -- Methods -- */
|
22
|
-
get perspective(): AgentDirectoryPerspective;
|
23
|
-
/** */
|
24
|
-
protected hasChanged(): boolean;
|
25
|
-
/** */
|
26
|
-
probeDht(): Promise<void>;
|
27
|
-
/** */
|
28
|
-
probeRegisteredAgents(): Promise<void>;
|
29
|
-
}
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import { serializeHash } from "@holochain-open-dev/utils";
|
2
|
-
import { AgentDirectoryBridge } from "./agent_directory.bridge";
|
3
|
-
import { ZomeViewModel } from "@ddd-qc/dna-client";
|
4
|
-
import { createContext } from "@lit-labs/context";
|
5
|
-
/**
|
6
|
-
*
|
7
|
-
*/
|
8
|
-
export class AgentDirectoryViewModel extends ZomeViewModel {
|
9
|
-
/** Ctor */
|
10
|
-
constructor(dnaClient) {
|
11
|
-
super(new AgentDirectoryBridge(dnaClient));
|
12
|
-
this.dnaClient = dnaClient;
|
13
|
-
/** -- Fields -- */
|
14
|
-
this._agents = [];
|
15
|
-
}
|
16
|
-
getContext() { return AgentDirectoryViewModel.context; }
|
17
|
-
/** -- Methods -- */
|
18
|
-
/* */
|
19
|
-
get perspective() {
|
20
|
-
return { agents: this._agents };
|
21
|
-
}
|
22
|
-
/** */
|
23
|
-
hasChanged() {
|
24
|
-
if (!this._previousPerspective)
|
25
|
-
return true;
|
26
|
-
let hasChanged = JSON.stringify(this.perspective.agents) !== JSON.stringify(this._previousPerspective.agents);
|
27
|
-
return hasChanged;
|
28
|
-
}
|
29
|
-
/** */
|
30
|
-
async probeDht() {
|
31
|
-
await this.probeRegisteredAgents();
|
32
|
-
}
|
33
|
-
/** */
|
34
|
-
async probeRegisteredAgents() {
|
35
|
-
let agents = await this._bridge.getAllAgents();
|
36
|
-
this._agents = agents.map((agentKey) => serializeHash(agentKey));
|
37
|
-
// Debug add a random string to the perspective
|
38
|
-
// this._agents.push(String.fromCharCode("A".charCodeAt(0) + Math.floor(Math.random() * 26)))
|
39
|
-
this.notify();
|
40
|
-
}
|
41
|
-
}
|
42
|
-
AgentDirectoryViewModel.context = createContext('AgentDirectory');
|
43
|
-
//# sourceMappingURL=agent_directory.vm.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"agent_directory.vm.js","sourceRoot":"","sources":["../src/agent_directory.vm.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAY,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAShD;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,aAA8D;IACzG,WAAW;IACX,YAAsB,SAAoB;QACxC,KAAK,CAAC,IAAI,oBAAoB,CAAC,SAAS,CAAC,CAAC,CAAC;QADvB,cAAS,GAAT,SAAS,CAAW;QAO1C,mBAAmB;QAEX,YAAO,GAAqB,EAAE,CAAC;IAPvC,CAAC;IAGD,UAAU,KAAQ,OAAO,uBAAuB,CAAC,OAAO,CAAA,CAAA,CAAC;IAOzD,oBAAoB;IAEpB,KAAK;IACL,IAAI,WAAW;QACb,OAAO,EAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAC,CAAA;IAC/B,CAAC;IAGD,MAAM;IACI,UAAU;QAClB,IAAI,CAAC,IAAI,CAAC,oBAAoB;YAAE,OAAO,IAAI,CAAC;QAC5C,IAAI,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAA;QAC7G,OAAO,UAAU,CAAA;IACnB,CAAC;IAGD,MAAM;IACN,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,CAAC,qBAAqB,EAAE,CAAA;IACpC,CAAC;IAGD,MAAM;IACN,KAAK,CAAC,qBAAqB;QACzB,IAAI,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;QACjE,+CAA+C;QAC/C,6FAA6F;QAC7F,IAAI,CAAC,MAAM,EAAE,CAAA;IACf,CAAC;;AArCM,+BAAO,GAAG,aAAa,CAA0B,gBAAgB,CAAC,CAAC","sourcesContent":["import {AgentPubKeyB64} from '@holochain-open-dev/core-types';\nimport {serializeHash} from \"@holochain-open-dev/utils\";\n\nimport {AgentDirectoryBridge} from \"./agent_directory.bridge\";\nimport {DnaClient, ZomeViewModel} from \"@ddd-qc/dna-client\";\nimport {createContext} from \"@lit-labs/context\";\n\n\n/** */\nexport interface AgentDirectoryPerspective {\n agents: AgentPubKeyB64[],\n}\n\n\n/**\n *\n */\nexport class AgentDirectoryViewModel extends ZomeViewModel<AgentDirectoryPerspective, AgentDirectoryBridge> {\n /** Ctor */\n constructor(protected dnaClient: DnaClient) {\n super(new AgentDirectoryBridge(dnaClient));\n }\n\n static context = createContext<AgentDirectoryViewModel>('AgentDirectory');\n getContext():any {return AgentDirectoryViewModel.context}\n\n /** -- Fields -- */\n\n private _agents: AgentPubKeyB64[] = [];\n\n\n /** -- Methods -- */\n\n /* */\n get perspective(): AgentDirectoryPerspective {\n return {agents: this._agents}\n }\n\n\n /** */\n protected hasChanged(): boolean {\n if (!this._previousPerspective) return true;\n let hasChanged = JSON.stringify(this.perspective.agents) !== JSON.stringify(this._previousPerspective.agents)\n return hasChanged\n }\n\n\n /** */\n async probeDht(): Promise<void> {\n await this.probeRegisteredAgents()\n }\n\n\n /** */\n async probeRegisteredAgents() {\n let agents = await this._bridge.getAllAgents();\n this._agents = agents.map((agentKey) => serializeHash(agentKey));\n // Debug add a random string to the perspective\n // this._agents.push(String.fromCharCode(\"A\".charCodeAt(0) + Math.floor(Math.random() * 26)))\n this.notify()\n }\n\n}\n"]}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { AgentPubKey } from "@holochain/client";
|
2
|
-
import { DnaClient } from "@ddd-qc/lit-happ";
|
3
|
-
/**
|
4
|
-
*
|
5
|
-
*/
|
6
|
-
export declare class AgentDirectoryBridge {
|
7
|
-
dnaClient: DnaClient;
|
8
|
-
/** Ctor */
|
9
|
-
constructor(dnaClient: DnaClient);
|
10
|
-
private _zomeName;
|
11
|
-
/** Zome API */
|
12
|
-
getAllAgents(): Promise<AgentPubKey[]>;
|
13
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
*
|
3
|
-
*/
|
4
|
-
export class AgentDirectoryBridge {
|
5
|
-
/** Ctor */
|
6
|
-
constructor(dnaClient) {
|
7
|
-
this.dnaClient = dnaClient;
|
8
|
-
this._zomeName = 'agent_directory';
|
9
|
-
}
|
10
|
-
/** Zome API */
|
11
|
-
async getAllAgents() {
|
12
|
-
return this.dnaClient.callZome(this._zomeName, 'get_registered_agents', null);
|
13
|
-
}
|
14
|
-
}
|
15
|
-
//# sourceMappingURL=agent_directory.zome.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"agent_directory.zome.js","sourceRoot":"","sources":["../src/agent_directory.zome.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAC/B,WAAW;IACX,YAAmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;QAE/B,cAAS,GAAG,iBAAiB,CAAC;IAFG,CAAC;IAI1C,eAAe;IAEf,KAAK,CAAC,YAAY;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAG,uBAAuB,EAAE,IAAI,CAAC,CAAC;IACjF,CAAC;CACF","sourcesContent":["import {AgentPubKey} from \"@holochain/client\";\nimport {DnaClient} from \"@ddd-qc/dna-client\";\n\n\n/**\n *\n */\nexport class AgentDirectoryBridge {\n /** Ctor */\n constructor(public dnaClient: DnaClient){}\n\n private _zomeName = 'agent_directory';\n\n /** Zome API */\n\n async getAllAgents(): Promise<AgentPubKey[]> {\n return this.dnaClient.callZome(this._zomeName, 'get_registered_agents', null);\n }\n}\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"agent_directory.js","sourceRoot":"","sources":["../../src/bindings/agent_directory.ts"],"names":[],"mappings":"AAAA,0DAA0D","sourcesContent":["/* This file is generated by zits. Do not edit manually */\n\nimport {\n/** Types */\nHoloHash,\nAgentPubKey,\nDnaHash,\nWasmHash,\nEntryHash,\nActionHash,\nAnyDhtHash,\nKitsuneAgent,\nKitsuneSpace,\nInstalledAppId,\nSignature,\nCellId,\nDnaProperties,\nRoleId,\nInstalledCell,\nTimestamp,\nHoloHashed,\n/** Action */\nSignedActionHashed,\nActionHashed,\nActionType,\nAction,\nNewEntryAction,\nDna,\nAgentValidationPkg,\nInitZomesComplete,\nCreateLink,\nDeleteLink,\nOpenChain,\nCloseChain,\nUpdate,\nDelete,\nCreate,\n/** Capabilities */\nCapSecret,\nCapClaim,\nZomeCallCapGrant,\nCapAccess,\nCapGrant,\n/** CounterSigning */\n//CounterSigningSessionData,\n//PreflightRequest,\n//CounterSigningSessionTimes,\n//ActionBase,\n//CounterSigningAgents,\n//PreflightBytes,\n//Role,\n//CountersigningAgentState,\n/** DhtOps */\nDhtOpType,\nDhtOp,\ngetDhtOpType,\ngetDhtOpAction,\ngetDhtOpEntry,\ngetDhtOpSignature,\n/** Entry */\nEntryVisibility,\nAppEntryType,\nEntryType,\nEntryContent,\nEntry,\n/** Record */\nRecord,\nRecordEntry,\n/** admin types */\nZomeName,\nMembraneProof,\nZomeDefinition,\nIntegrityZome,\nCoordinatorZome,\nDnaDefinition,\nResourceBytes,\nResourceMap,\nCellProvisioning,\nHoloHashB64,\nDnaVersionSpec,\nDnaVersionFlexible,\nNetworkSeed,\nZomeLocation,\n } from '@holochain/client';\n\nimport {\n// Common\nDictionary,\nEntryHashB64,\nActionHashB64,\nDhtOpHashB64,\nDnaHashB64,\nAgentPubKeyB64,\nAnyDhtHashB64,\nDhtOpHash,\n// DnaFile\nDnaFile,\nDnaDef,\nZomes,\nWasmCode,\n// entry-details\nEntryDetails,\nRecordDetails,\nDetails,\nDetailsType,\nEntryDhtStatus,\n// Validation\nValidationStatus,\nValidationReceipt,\n } from '@holochain-open-dev/core-types';\n"]}
|